main
parent
0258b6f73b
commit
164280ef33
@ -0,0 +1,44 @@
|
||||
package com.nmgs.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nmgs.entity.Res;
|
||||
import com.nmgs.service.DriverAwayService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 8:33
|
||||
* @description:
|
||||
*/
|
||||
@RestController
|
||||
public class DriverAwayController {
|
||||
|
||||
@Resource
|
||||
private DriverAwayService driverAwayService;
|
||||
|
||||
@PostMapping("/getDriverAwayPage")
|
||||
public IPage getDriverAwayPage(@RequestBody Map<String,Object> map) {
|
||||
return driverAwayService.getDriverAwayPage(map);
|
||||
}
|
||||
@PostMapping("/matchDriveAway")
|
||||
public int matchDriveAway(@RequestBody Map<String,Object> map) {
|
||||
return driverAwayService.matchDriveAway(map);
|
||||
}
|
||||
@PostMapping("/deleteDriveAway")
|
||||
public int deleteDriveAway(@RequestBody Map<String,Object> map) {
|
||||
return driverAwayService.deleteDriveAway(map);
|
||||
}
|
||||
|
||||
@PostMapping("/saveDriverAway")
|
||||
public Res saveDriverAway(@RequestBody Map<String,Object> map) {
|
||||
int count = driverAwayService.saveDriverAway(map);
|
||||
return Res.success(count);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月06日 15:41
|
||||
* @description: 就近驶离高速车辆
|
||||
*/
|
||||
@Data
|
||||
@TableName("DRIVEAWAY_TABLE")
|
||||
public class DriveAwayTable {
|
||||
@TableField("SUBCOMNO")
|
||||
private Integer SUBCOMNO;
|
||||
@TableField("STANO")
|
||||
private Integer STANO;
|
||||
@TableField("CARNO")
|
||||
private String CARNO;
|
||||
@TableField("DT")
|
||||
private Date DT;
|
||||
@TableField("OSUBCOMNO")
|
||||
private Integer OSUBCOMNO;
|
||||
@TableField("OSTANO")
|
||||
private Integer OSTANO;
|
||||
@TableField("ROSTANO")
|
||||
private Integer ROSTANO;
|
||||
@TableField("ODT")
|
||||
private Date ODT;
|
||||
@TableField("FLAG")
|
||||
private Integer FLAG;
|
||||
@TableField("ADDDT")
|
||||
private Date ADDDT;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月06日 15:41
|
||||
* @description: 车道计重设备状态
|
||||
*/
|
||||
@Data
|
||||
@TableName("LANE_WEIGHT_STATUS")
|
||||
public class LaneWeightStatus {
|
||||
@TableField("ROADNO")
|
||||
private Integer ROADNO;
|
||||
@TableField("STANO")
|
||||
private Integer STANO;
|
||||
@TableField("PORTNO")
|
||||
private Integer PORTNO;
|
||||
@TableField("PORTTYPE")
|
||||
private Integer PORTTYPE;
|
||||
@TableField("DT")
|
||||
private Date DT;
|
||||
@TableField("WEIGHTSTATUS")
|
||||
private String WEIGHTSTATUS;
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年11月08日 14:33
|
||||
* @description:
|
||||
*/
|
||||
@TableName("NAME_TABLE")
|
||||
@Data
|
||||
public class NameTable2 {
|
||||
@TableField("STANO")
|
||||
private Integer stano ;
|
||||
@TableField("SUBCOMNO")
|
||||
private Integer subcomno ;
|
||||
@TableField("STATYPE")
|
||||
private Integer statype ;
|
||||
@TableField("ROADNO")
|
||||
private Integer roadno ;
|
||||
@TableField("STANAME")
|
||||
private String staname ;
|
||||
@TableField("GBSTATIONID")
|
||||
private String gbstationid ;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年11月08日 14:33
|
||||
* @description:
|
||||
*/
|
||||
@TableName("NAME_TABLE")
|
||||
@Data
|
||||
public class NameTable3 {
|
||||
@TableField("STANO")
|
||||
private Integer stano ;
|
||||
@TableField("SUBCOMNO")
|
||||
private Integer subcomno ;
|
||||
@TableField("STATYPE")
|
||||
private Integer statype ;
|
||||
@TableField("ROADNO")
|
||||
private Integer roadno ;
|
||||
@TableField("STANAME")
|
||||
private String staname ;
|
||||
@TableField("GBSTATIONID")
|
||||
private String gbstationid ;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 9:21
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@TableName("SUBCOMPANY_TABLE")
|
||||
public class SubCompany2 {
|
||||
@TableField("SUBCOMNO")
|
||||
private Integer subcomno;
|
||||
@TableField("SUBCOMNAME")
|
||||
private String subcomname;
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.nmgs.entity.DriveAwayTable;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月06日 15:46
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface DriveAwayTableMapper extends MPJBaseMapper<DriveAwayTable> {
|
||||
List<String> selectInPort( String sqlWhere);
|
||||
|
||||
List<Map<String, Object>> selectOutPort(String sqlWhereOut);
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.DriveAwayTableMapper">
|
||||
|
||||
|
||||
<select id="selectInPort" resultType="java.lang.String">
|
||||
|
||||
select PASSID
|
||||
from IN_PORT ${sqlWhere}
|
||||
order by DT desc
|
||||
|
||||
</select>
|
||||
<select id="selectOutPort" resultType="java.util.Map">
|
||||
select STANO, DT
|
||||
from OUT_PORT ${sqlWhereOut}
|
||||
order by DT desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,19 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.entity.LaneWeightStatus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 12:35
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface LaneWeightStatusMapper extends BaseMapper<LaneWeightStatus> {
|
||||
IPage<Map> selectMyMapsPage(Page<LaneWeightStatus> page, String sqlWhere);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nmgs.mapper.LaneWeightStatusMapper">
|
||||
|
||||
|
||||
<select id="selectMyMapsPage" resultType="java.util.Map">
|
||||
SELECT t.* FROM(select ROADNO,STANO,PORTNO,PORTTYPE,DT,WEIGHTSTATUS,
|
||||
(select SUBCOMNAME from SUBCOMPANY_TABLE WHERE SUBCOMNO=(SELECT SUBCOMNO FROM NAME_TABLE WHERE STANO=L.STANO)) SUBCOMNAME,
|
||||
(select STANAME FROM NAME_TABLE WHERE STANO=L.STANO) STANAME,
|
||||
(select text from porttypegb_text where value=(select GBTYPE from setup_table where roadno=L.roadno and stano=L.stano and portno=L.portno)) PORTTYPETEXT,
|
||||
(case WEIGHTSTATUS when '0' then '正常' else '故障' end) WEIGHTSTATUSTEXT,
|
||||
ROW_NUMBER() OVER(ORDER BY WEIGHTSTATUS desc, ROADNO,STANO,PORTNO) rn, COUNT(*) OVER() TOTALCOUNT
|
||||
from LANE_WEIGHT_STATUS L ${sqlWhere}) t
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,17 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nmgs.entity.NameTable;
|
||||
import com.nmgs.entity.NameTable2;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年11月08日 14:37
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface NameTableMapper2 extends BaseMapper<NameTable2> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nmgs.entity.NameTable3;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年11月08日 14:37
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface NameTableMapper3 extends BaseMapper<NameTable3> {
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.nmgs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nmgs.entity.SubCompany;
|
||||
import com.nmgs.entity.SubCompany2;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年08月29日 14:32
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubCompanyMapper2 extends BaseMapper<SubCompany2> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 8:34
|
||||
* @description:
|
||||
*/
|
||||
public interface DriverAwayService {
|
||||
/**
|
||||
* 新增就近驶离高速车辆
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int 新增行数
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 8:37
|
||||
*/
|
||||
int saveDriverAway(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 根据查询条件分页查询就近驶离高速车辆信息
|
||||
*
|
||||
* @param map 查询参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 9:13
|
||||
*/
|
||||
IPage getDriverAwayPage(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 根据参数条件删除数据
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 9:50
|
||||
*/
|
||||
int deleteDriveAway(Map<String, Object> map);
|
||||
/**
|
||||
* 根据参数条件匹配实际出口数据
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int
|
||||
* @author shuguang
|
||||
* @date 2024-03-08 9:50
|
||||
*/
|
||||
int matchDriveAway(Map<String, Object> map);
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nmgs.service.DeviceStatusService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月05日 12:39
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
public class DeviceStatusServiceImpl implements DeviceStatusService {
|
||||
/**
|
||||
* 根据条件分页查询车道计重设备状态
|
||||
*
|
||||
* @param map 条件
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage
|
||||
* @author shuguang
|
||||
* @date 2024-03-05 12:41
|
||||
*/
|
||||
@Override
|
||||
public IPage getPage(Map<String, Object> map) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,292 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.nmgs.config.Constant;
|
||||
import com.nmgs.entity.DriveAwayTable;
|
||||
import com.nmgs.entity.NameTable;
|
||||
import com.nmgs.entity.NameTable2;
|
||||
import com.nmgs.entity.NameTable3;
|
||||
import com.nmgs.entity.PlateColor;
|
||||
import com.nmgs.entity.PlateColor2;
|
||||
import com.nmgs.entity.SubCompany;
|
||||
import com.nmgs.entity.SubCompany2;
|
||||
import com.nmgs.entity.WeightCheck;
|
||||
import com.nmgs.enumeration.MessageEnum;
|
||||
import com.nmgs.exception.PPException;
|
||||
import com.nmgs.mapper.DriveAwayTableMapper;
|
||||
import com.nmgs.service.DriverAwayService;
|
||||
import com.nmgs.util.DateTimeUtil;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import com.nmgs.util.UuidUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 8:35
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DriverAwayServiceImpl implements DriverAwayService {
|
||||
|
||||
@Resource
|
||||
private DriveAwayTableMapper driveAwayTableMapper;
|
||||
/**
|
||||
* 新增就近驶离高速车辆
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int 新增行数
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 8:37
|
||||
*/
|
||||
@Override
|
||||
public int saveDriverAway(Map<String, Object> map) {
|
||||
String uuid = UuidUtil.getUuid();
|
||||
String dbType = PropertiesUtil.getValue("DBType");
|
||||
log.info("[uuid:{}]-开始根据参数{}新增就近驶离高速车辆", uuid, map);
|
||||
int subcomno = (int) map.get("SUBCOMNO");
|
||||
int stano = (int) map.get("STANO");
|
||||
String carno = ((String) map.get("CARNO")).trim();
|
||||
String dtStr = (String) map.get("DT");
|
||||
int osubcomno = (int) map.get("OSUBCOMNO");
|
||||
int ostano = (int) map.get("OSTANO");
|
||||
int count;
|
||||
QueryWrapper<DriveAwayTable> wrapper = new QueryWrapper<>();
|
||||
wrapper
|
||||
.eq("SUBCOMNO",subcomno)
|
||||
.eq("STANO",stano)
|
||||
.eq("CARNO",carno);
|
||||
if (Constant.STR_TWO.equals(dbType)) {
|
||||
wrapper.apply("DT = TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')", dtStr);
|
||||
}else {
|
||||
wrapper.eq("DT",dtStr);
|
||||
}
|
||||
|
||||
boolean exists = driveAwayTableMapper.exists(wrapper);
|
||||
if (!exists) {
|
||||
DriveAwayTable t = new DriveAwayTable();
|
||||
t.setSUBCOMNO(subcomno);
|
||||
t.setSTANO(stano);
|
||||
t.setCARNO(carno);
|
||||
t.setDT(DateTimeUtil.getFormatDate(dtStr, Constant.YYYY_MM_DD_HH_MM_SS));
|
||||
t.setOSUBCOMNO(osubcomno);
|
||||
t.setOSTANO(ostano);
|
||||
t.setADDDT(new Date());
|
||||
t.setFLAG(0);
|
||||
count = driveAwayTableMapper.insert(t);
|
||||
log.info("[uuid:{}]-新增{}条就近驶离高速车辆信息成功", uuid, count);
|
||||
}else {
|
||||
log.info("[uuid:{}]-新增就近驶离高速车辆信息失败,主键冲突", uuid);
|
||||
throw new PPException(MessageEnum.主键冲突入库失败.getCode(), MessageEnum.主键冲突入库失败.getMessage());
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据查询条件分页查询就近驶离高速车辆信息
|
||||
*
|
||||
* @param map 查询参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 9:13
|
||||
*/
|
||||
@Override
|
||||
public IPage getDriverAwayPage(Map<String, Object> map) {
|
||||
String uuid = UuidUtil.getUuid();
|
||||
String dbType = PropertiesUtil.getValue("DBType");
|
||||
log.info("[uuid:{}]-开始根据参数{}分页查询-就近驶离高速车辆信息", uuid, map);
|
||||
int pageNum = (int) map.get("pageNum");
|
||||
int pageSize = (int) map.get("pageSize");
|
||||
IPage<Map> mapIPage = new Page<>();
|
||||
|
||||
|
||||
try {
|
||||
Page<DriveAwayTable> page = new Page<>(pageNum, pageSize);
|
||||
MPJLambdaWrapper<Map> mpjLambdaWrapper = new MPJLambdaWrapper();
|
||||
mpjLambdaWrapper
|
||||
.selectAll(DriveAwayTable.class)
|
||||
.selectAs(SubCompany::getSubcomname,"SUBCOMNAME")
|
||||
.leftJoin(SubCompany.class, SubCompany::getSubcomno, DriveAwayTable::getSUBCOMNO)
|
||||
.selectAs(NameTable::getStaname, "STANAME")
|
||||
.leftJoin(NameTable.class, NameTable::getStano, DriveAwayTable::getSTANO)
|
||||
.selectAs(SubCompany2::getSubcomname,"OSUBCOMNAME")
|
||||
.leftJoin(SubCompany2.class, SubCompany2::getSubcomno, DriveAwayTable::getOSUBCOMNO)
|
||||
.selectAs(NameTable2::getStaname, "OSTANAME")
|
||||
.leftJoin(NameTable2.class, NameTable2::getStano, DriveAwayTable::getOSTANO)
|
||||
.selectAs(NameTable3::getStaname, "ROSTANAE")
|
||||
.leftJoin(NameTable3.class, NameTable3::getStano, DriveAwayTable::getROSTANO)
|
||||
|
||||
.orderByDesc(DriveAwayTable::getADDDT);
|
||||
if (ObjectUtils.isNotEmpty(map.get("SUBCOMNO"))) {
|
||||
mpjLambdaWrapper.eq(DriveAwayTable::getSUBCOMNO, map.get("SUBCOMNO"));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("STANO"))) {
|
||||
mpjLambdaWrapper.eq(DriveAwayTable::getSTANO, map.get("STANO"));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("CARNO"))) {
|
||||
mpjLambdaWrapper.like(DriveAwayTable::getCARNO, map.get("CARNO").toString().toUpperCase().trim());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("DT"))) {
|
||||
String dtStr = (String) map.get("DT");
|
||||
if (Constant.STR_TWO.equals(dbType)) {
|
||||
mpjLambdaWrapper
|
||||
.apply("DT >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')", dtStr)
|
||||
|
||||
;
|
||||
}else {
|
||||
mpjLambdaWrapper
|
||||
.ge(DriveAwayTable::getDT, dtStr)
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("OSUBCOMNO"))) {
|
||||
mpjLambdaWrapper.eq(DriveAwayTable::getOSUBCOMNO, map.get("OSUBCOMNO"));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("OSTANO"))) {
|
||||
mpjLambdaWrapper.eq(DriveAwayTable::getOSTANO, map.get("OSTANO"));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("MATCHSTATUS"))) {
|
||||
//0-指定出口站和实际出口站不相同 1-指定出口站和实际出口站相同
|
||||
String matchStatus=map.get("MATCHSTATUS").toString();
|
||||
if(Constant.STR_ZERO.equals(matchStatus)){
|
||||
mpjLambdaWrapper
|
||||
.apply("ROSTANO IS NOT NULL AND ROSTANO != OSTANO");
|
||||
}else {
|
||||
mpjLambdaWrapper
|
||||
.apply("ROSTANO IS NOT NULL AND ROSTANO = OSTANO");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mapIPage = driveAwayTableMapper.selectJoinPage(page, Map.class, mpjLambdaWrapper);
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("[uuid:{}]-查询-就近驶离高速车辆信息失败,报错为:{}", uuid, e.getMessage(), e);
|
||||
}
|
||||
return mapIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数条件删除数据
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 9:50
|
||||
*/
|
||||
@Override
|
||||
public int deleteDriveAway(Map<String, Object> map) {
|
||||
String uuid = UuidUtil.getUuid();
|
||||
String dbType = PropertiesUtil.getValue("DBType");
|
||||
log.info("[uuid:{}]-开始根据参数{}删除-就近驶离高速车辆信息", uuid, map);
|
||||
int subcomno = (int) map.get("SUBCOMNO");
|
||||
int stano = (int) map.get("STANO");
|
||||
String carno = ((String) map.get("CARNO")).trim();
|
||||
String dtStr = (String) map.get("DT");
|
||||
QueryWrapper<DriveAwayTable> wrapper = new QueryWrapper<>();
|
||||
wrapper
|
||||
.eq("SUBCOMNO",subcomno)
|
||||
.eq("STANO",stano)
|
||||
.eq("CARNO",carno);
|
||||
if (Constant.STR_TWO.equals(dbType)) {
|
||||
wrapper.apply("DT = TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')", dtStr);
|
||||
}else {
|
||||
wrapper.eq("DT",dtStr);
|
||||
}
|
||||
int count = driveAwayTableMapper.delete(wrapper);
|
||||
log.info("[uuid:{}]-根据参数{}删除-就近驶离高速车辆信息成功,删除条数{}", uuid, map,count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数条件匹配实际出口数据
|
||||
*
|
||||
* @param map 参数
|
||||
* @return int
|
||||
* @author shuguang
|
||||
* @date 2024-03-08 9:50
|
||||
*/
|
||||
@Override
|
||||
public int matchDriveAway(Map<String, Object> map) {
|
||||
String uuid = UuidUtil.getUuid();
|
||||
log.info("[uuid:{}]-开始根据参数{}根据参数条件匹配实际出口数据", uuid, map);
|
||||
int count = 0;
|
||||
String dbType = PropertiesUtil.getValue("DBType");
|
||||
try {
|
||||
int subcomno = (int) map.get("SUBCOMNO");
|
||||
int stano = (int) map.get("STANO");
|
||||
String carno = ((String) map.get("CARNO")).trim();
|
||||
String dtStr = (String) map.get("DT");
|
||||
Date formatDate = DateTimeUtil.getFormatDate(dtStr, Constant.YYYY_MM_DD_HH_MM_SS);
|
||||
Date date0 = DateTimeUtil.addDateHours(formatDate, -1);
|
||||
Date date1 = DateTimeUtil.addDateHours(formatDate, 1);
|
||||
Date date12 = DateTimeUtil.addDateHours(formatDate, 12);
|
||||
String dateStr0 = DateTimeUtil.getFormateString(date0, Constant.YYYY_MM_DD_HH_MM_SS);
|
||||
String dateStr1 = DateTimeUtil.getFormateString(date1, Constant.YYYY_MM_DD_HH_MM_SS);
|
||||
String dateStr12 = DateTimeUtil.getFormateString(date12, Constant.YYYY_MM_DD_HH_MM_SS);
|
||||
//查找就近驶离高速车辆出口站
|
||||
log.info("[uuid:{}]-开始查找就近驶离高速车辆出口站", uuid);
|
||||
String sqlWhere="where STANO=" +stano+
|
||||
" and ACARNO='" +carno+
|
||||
"' and DT>=to_date('" +dateStr0+
|
||||
"','yyyy-mm-dd hh24:mi:ss')" +
|
||||
" and DT>=to_date('" +dateStr1+
|
||||
"','yyyy-mm-dd hh24:mi:ss')";
|
||||
List<String> passIdList = driveAwayTableMapper.selectInPort(sqlWhere);
|
||||
log.info("[uuid:{}]-查询入口passid信息为{}", uuid,passIdList);
|
||||
if(passIdList != null && passIdList.size() > 0){
|
||||
//根据passID查询实际出口信息
|
||||
String passId=passIdList.get(0);
|
||||
String sqlWhereOut="where PASSID='" +passId+
|
||||
"' and ACARNO='" +carno+
|
||||
"' and DT>=to_date('" +dateStr0+
|
||||
"','yyyy-mm-dd hh24:mi:ss')" +
|
||||
" and DT>=to_date('" +dateStr12+
|
||||
"','yyyy-mm-dd hh24:mi:ss')";
|
||||
|
||||
List<Map<String,Object>> outPortList = driveAwayTableMapper.selectOutPort(sqlWhereOut);
|
||||
log.info("[uuid:{}]-查询根据入口passid={}查询实际出口站信息为{}", uuid,passId,outPortList);
|
||||
if(outPortList != null && outPortList.size() > 0){
|
||||
String stanoOut = outPortList.get(0).get("STANO").toString();
|
||||
String dtOut = outPortList.get(0).get("DT").toString();
|
||||
UpdateWrapper<DriveAwayTable> update = new UpdateWrapper<>();
|
||||
update
|
||||
.eq("SUBCOMNO",subcomno)
|
||||
.eq("STANO",stano)
|
||||
.eq("CARNO",carno)
|
||||
;
|
||||
if (Constant.STR_TWO.equals(dbType)) {
|
||||
update.apply("DT = TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')", dtStr);
|
||||
}else {
|
||||
update.eq("DT",dtStr);
|
||||
}
|
||||
update.set("ROSTANO", stanoOut)
|
||||
.set("ODT", "TO_DATE('"+dtOut+"','yyyy-MM-dd HH24:mi:ss')");
|
||||
|
||||
count=driveAwayTableMapper.update(null,update);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("[uuid:{}]-查询-入口大件车治超数据失败,报错为:{}", uuid, e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.nmgs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nmgs.config.Constant;
|
||||
import com.nmgs.entity.DriveAwayTable;
|
||||
import com.nmgs.entity.LaneWeightStatus;
|
||||
import com.nmgs.mapper.LaneWeightStatusMapper;
|
||||
import com.nmgs.service.LaneWeightStatusService;
|
||||
import com.nmgs.util.UuidUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年03月07日 16:07
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LaneWeightStatusServiceImpl implements LaneWeightStatusService {
|
||||
@Resource
|
||||
private LaneWeightStatusMapper laneWeightStatusMapper;
|
||||
/**
|
||||
* 根据参数条件查询车道计重设备状态信息
|
||||
*
|
||||
* @param map 参数条件
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage
|
||||
* @author shuguang
|
||||
* @date 2024-03-07 16:09
|
||||
*/
|
||||
@Override
|
||||
public IPage getDeviceStatusPage(Map<String, Object> map) {
|
||||
String uuid = UuidUtil.getUuid();
|
||||
log.info("[uuid:{}]-开始根据参数{}分页查询-车道计重设备状态信息", uuid, map);
|
||||
int pageNum = (int) map.get("pageNum");
|
||||
int pageSize = (int) map.get("pageSize");
|
||||
IPage<Map> mapIPage = new Page<>();
|
||||
Page<LaneWeightStatus> page = new Page<>(pageNum, pageSize);
|
||||
String whereSql = " Where 1 = 1 ";
|
||||
|
||||
|
||||
try {
|
||||
if (ObjectUtils.isNotEmpty(map.get("SUBCOMNO"))) {
|
||||
whereSql += " AND STANO IN ( SELECT STANO FROM NAME_TABLE WHERE STATYPE=1 AND SUBCOMNO="+map.get("SUBCOMNO") +")";
|
||||
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("STANO"))) {
|
||||
whereSql += " AND STANO="+map.get("STANO");
|
||||
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("PORTNO"))) {
|
||||
whereSql += " AND PORTNO="+map.get("PORTNO").toString().trim();
|
||||
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(map.get("WEIGHTSTATUS"))) {
|
||||
whereSql += " AND WEIGHTSTATUS='"+map.get("WEIGHTSTATUS")+"'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
mapIPage=laneWeightStatusMapper.selectMyMapsPage(page,whereSql);
|
||||
} catch (Exception e) {
|
||||
log.error("[uuid:{}]-查询车道计重设备状态信息失败,报错为:{}", uuid, e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
return mapIPage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<!--<html lang="en" class="dark">-->
|
||||
<html lang="en" class="light">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
|
||||
<title></title>
|
||||
<script type="module" crossorigin src="./assets/index.259bdd29.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.4eed0f89.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="loading">
|
||||
<div class="loading-wrap">
|
||||
<div class="loading-dots">
|
||||
<span class="dot dot-spin">
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="loading-title">
|
||||
超限检测管理...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,4 +1,4 @@
|
||||
序号 日期 版本号 说明
|
||||
1 2024年03月04日 1.0.0 初始版本号
|
||||
1 2024年03月04日 1.0.0 超限检测管理初始版本号
|
||||
|
||||
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Created-By: IntelliJ IDEA
|
||||
Built-By: shuguang
|
||||
Build-Jdk: version 1.8.0_121
|
||||
Implementation-Title: OverLimitDetection
|
||||
Implementation-Version: 0.0.1-SNAPSHOT
|
||||
Implementation-Vendor-Id: com.nmgs
|
||||
Main-Class: ${start-class}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
序号 日期 版本号 说明
|
||||
1 2024年03月04日 1.0.0 初始版本号
|
||||
1 2024年03月04日 1.0.0 超限检测管理初始版本号
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
序号 日期 版本号 说明
|
||||
1 2024年03月04日 1.0.0 初始版本号
|
||||
1 2024年03月04日 1.0.0 超限检测管理初始版本号
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<!--<html lang="en" class="dark">-->
|
||||
<html lang="en" class="light">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
|
||||
<title></title>
|
||||
<script type="module" crossorigin src="./assets/index.259bdd29.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.4eed0f89.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="loading">
|
||||
<div class="loading-wrap">
|
||||
<div class="loading-dots">
|
||||
<span class="dot dot-spin">
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="loading-title">
|
||||
超限检测管理...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue