Merge branch '滁州-烟草' of https://gitlab.hzleaper.com:81/duoji/backend-duoji-monitor into 滁州-烟草

滁州-烟草
LAPTOP-S9HJSOEB\昊天 2 years ago
commit b61b09eeaf

@ -25,7 +25,7 @@ public class Encryptor {
public static void main(String[] args) public static void main(String[] args)
{ {
String noEncrypt = "BFEBFBFF000A0671AK7211183"; String noEncrypt = "BFEBFBFF000306F2WD-WXD2A136C7UD";
String encrypt = Encryptor.encryptStr(noEncrypt); String encrypt = Encryptor.encryptStr(noEncrypt);
System.out.println(encrypt); System.out.println(encrypt);
} }

@ -31,6 +31,8 @@ public class ConfigProperties {
private String userUrl; private String userUrl;
private String picIpPort;
private KSEC ksec; private KSEC ksec;
private LightSource lightSource; private LightSource lightSource;

@ -4,8 +4,8 @@ import com.github.pagehelper.PageInfo;
import com.zhehekeji.common.util.ValidatorUtil; import com.zhehekeji.common.util.ValidatorUtil;
import com.zhehekeji.core.pojo.Result; import com.zhehekeji.core.pojo.Result;
import com.zhehekeji.web.entity.CheckLog; import com.zhehekeji.web.entity.CheckLog;
import com.zhehekeji.web.entity.StockLog; import com.zhehekeji.web.pojo.CheckLogOne;
import com.zhehekeji.web.pojo.LocReq; import com.zhehekeji.web.pojo.Obg;
import com.zhehekeji.web.pojo.stock.CheckLogSearch; import com.zhehekeji.web.pojo.stock.CheckLogSearch;
import com.zhehekeji.web.pojo.stock.StockLogSearch; import com.zhehekeji.web.pojo.stock.StockLogSearch;
import com.zhehekeji.web.service.CheckLogService; import com.zhehekeji.web.service.CheckLogService;
@ -37,11 +37,10 @@ public class CheckLogController {
return Result.success(checkLogService.list(checkLogSearch)); return Result.success(checkLogService.list(checkLogSearch));
} }
@ApiOperation("盘点历史")
@PostMapping("/getOne")
public Map<String,String> getOne(@RequestBody Result<List<LocReq>> checkLogSearch){
return null; @ApiOperation("盘点信息")
@PostMapping("getOne")
public Obg<CheckLogOne> getOne(@RequestBody Obg<CheckLogSearch> checkLogSearch){
return checkLogService.getOne(checkLogSearch);
} }
} }

@ -0,0 +1,13 @@
package com.zhehekeji.web.pojo;
import lombok.Data;
@Data
public class CheckLogOne {
private String flag;
private String from_tagid;
private String loc;
private String to_tagid;
private String jobnum;
private String picture_routesid;
}

@ -0,0 +1,11 @@
package com.zhehekeji.web.pojo;
import com.zhehekeji.web.pojo.stock.CheckLogSearch;
import lombok.Data;
import java.util.List;
@Data
public class Obg <T> {
private List<T> data;
}

@ -12,6 +12,10 @@ public class CheckLogSearch {
private String lotnum; private String lotnum;
private String loc;
private String date;
private String tagid;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTimestamp; private LocalDateTime startTimestamp;
@ -20,6 +24,8 @@ public class CheckLogSearch {
private Integer streetId; private Integer streetId;
private String streetPlc;
@ApiModelProperty("左右 1左 2右") @ApiModelProperty("左右 1左 2右")
private Integer leftRight; private Integer leftRight;
@ -28,9 +34,27 @@ public class CheckLogSearch {
private Integer row; private Integer row;
private Integer jobnum;
private Integer column; private Integer column;
private Integer pageSize; private Integer pageSize;
private Integer pageNum; private Integer pageNum;
public CheckLogSearch getLocInfo(){
if(this.loc!=null){
this.streetPlc = this.loc.substring(0,3);
this.column = Integer.parseInt(this.loc.substring(4,7));
this.leftRight = Integer.parseInt(this.loc.substring(3,4));
this.row = Integer.parseInt(this.loc.substring(7,10));
}
return this;
}
public static void main(String[] args) {
CheckLogSearch checkLogSearch = new CheckLogSearch();
checkLogSearch.setLoc("0011010003000");
checkLogSearch.getLocInfo();
System.out.println(checkLogSearch);
}
} }

@ -3,14 +3,23 @@ package com.zhehekeji.web.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.zhehekeji.web.config.ConfigProperties;
import com.zhehekeji.web.entity.CheckLog; import com.zhehekeji.web.entity.CheckLog;
import com.zhehekeji.web.entity.Street;
import com.zhehekeji.web.mapper.CheckLogMapper; import com.zhehekeji.web.mapper.CheckLogMapper;
import com.zhehekeji.web.pojo.CheckLogOne;
import com.zhehekeji.web.pojo.Obg;
import com.zhehekeji.web.pojo.stock.CheckLogSearch; import com.zhehekeji.web.pojo.stock.CheckLogSearch;
import com.zhehekeji.web.pojo.street.StreetVO; import com.zhehekeji.web.pojo.street.StreetVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,6 +32,9 @@ public class CheckLogService {
@Resource @Resource
private StreetService streetService; private StreetService streetService;
@Resource
private ConfigProperties configProperties;
public PageInfo<CheckLog> list(CheckLogSearch search){ public PageInfo<CheckLog> list(CheckLogSearch search){
List<StreetVO> list = streetService.list(); List<StreetVO> list = streetService.list();
Map<Integer,String> map = new HashMap<>(); Map<Integer,String> map = new HashMap<>();
@ -59,4 +71,63 @@ public class CheckLogService {
}); });
return new PageInfo<>(stockChecks); return new PageInfo<>(stockChecks);
} }
public Obg<CheckLogOne> getOne(Obg<CheckLogSearch> checkLogSearch) {
Obg<CheckLogOne> obg = new Obg<>();
List<CheckLogOne> checkLogOnes = new ArrayList<>();
for(CheckLogSearch search : checkLogSearch.getData()){
CheckLogOne checkLogOne = new CheckLogOne();
search.getLocInfo();
Street streetVO = streetService.getStreetByPlcId(search.getStreetPlc());
// 定义日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将字符串转换为LocalDate对象
LocalDate specifiedDate = LocalDate.parse(search.getDate(), formatter);
// 获取指定日期的开始时间和结束时间
// 生成当天最早时间
LocalDateTime dateStart = specifiedDate.atStartOfDay();
// 生成当天最晚时间
LocalDateTime dateEnd = specifiedDate.atTime(23, 59, 59);
CheckLog checkLog = checkLogMapper.selectOne(new QueryWrapper<CheckLog>()
.eq(search.getJobnum()!=null,"check_num",search.getStreetPlc()+"_"+search.getJobnum())
.eq(streetVO.getId()!=null,"street_id",streetVO.getId())
.eq(search.getRow()!=null,"`row`",search.getRow())
.eq(search.getColumn()!=null,"`column`",search.getColumn())
.between("create_time", dateStart, dateEnd)
.eq(search.getLeftRight()!=null,"direction",search.getLeftRight())
.orderByDesc("create_time")
.last("limit 1")
);
checkLogOne.setLoc(search.getLoc());
checkLogOne.setFlag("false");
checkLogOne.setFrom_tagid(search.getTagid());
if(checkLog != null){
checkLogOne.setJobnum(checkLog.getCheckNum().split("_")[1]);
//图片
checkLogOne.setPicture_routesid(configProperties.getPicIpPort()+checkLog.getPic());
if(checkLog.getStatus()!= 1){
checkLogOne.setFlag("true");
checkLogOne.setTo_tagid(search.getTagid());
}
}
checkLogOnes.add(checkLogOne);
}
obg.setData(checkLogOnes);
return obg;
}
public static void main(String[] args) {
System.out.println("001_21316");
}
} }

@ -862,7 +862,9 @@ public class PlcService {
stock.setWmsCode(wmsCode); stock.setWmsCode(wmsCode);
stockMapper.updateById(stock); stockMapper.updateById(stock);
} }
// StockCheckRunnable stockCheckRunnable = new StockCheckRunnable(street,plcCmdInfo,cmdCode,stockMapper,path,checkLogMapper,configProperties.getScanCodeMode().getGoods(),wmsCode,wmsTrayCode,trayCode,trayCheck,configProperties,sensorGun);
checkLog(stock);
//StockCheckRunnable stockCheckRunnable = new StockCheckRunnable(street,plcCmdInfo,cmdCode,stockMapper,path,checkLogMapper,configProperties.getScanCodeMode().getGoods(),wmsCode,wmsTrayCode,trayCode,trayCheck,configProperties,sensorGun);
// threadPoolExecutor.execute(stockCheckRunnable); // threadPoolExecutor.execute(stockCheckRunnable);
//还原相机 //还原相机

@ -95,6 +95,8 @@ scanCodeMode:
# 照片 視頻保存多久 # 照片 視頻保存多久
deleteFileDays: 365 deleteFileDays: 365
picIpPort: 127.0.0.1:5555/api/pic
rfid: rfid:
codeType: ISO18000_6C codeType: ISO18000_6C
scanTime: 2 scanTime: 2

Loading…
Cancel
Save