|
|
|
|
@ -6,6 +6,7 @@ import com.zhehekeji.web.mapper.CheckLogMapper;
|
|
|
|
|
import com.zhehekeji.web.mapper.RFIDMapper;
|
|
|
|
|
import com.zhehekeji.web.mapper.StreetMapper;
|
|
|
|
|
import com.zhehekeji.web.service.CheckLogService;
|
|
|
|
|
import com.zhehekeji.web.service.PlcService;
|
|
|
|
|
import com.zhehekeji.web.service.interfaces.RfidLogService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
@ -27,10 +28,12 @@ public class VideoccController {
|
|
|
|
|
private CheckLogMapper checkLogMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private StreetMapper streetMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
PlcService plcService;
|
|
|
|
|
@PostMapping("/xiddata")
|
|
|
|
|
@ApiOperation(value = "库存信息")
|
|
|
|
|
public VideoccResponse xiddata(@RequestBody Videocc videocc ){
|
|
|
|
|
|
|
|
|
|
public VideoccResponse xiddata1(@RequestBody Videocc videocc ){
|
|
|
|
|
String orderNum = videocc.getLoc().substring(0,3)+ "_"+videocc.getJobNum();
|
|
|
|
|
Set<String> list = new HashSet<>();
|
|
|
|
|
if(videocc.getDetails()!=null && videocc.getDetails().size()>0){
|
|
|
|
|
for(String detail:videocc.getDetails().keySet()){
|
|
|
|
|
@ -38,33 +41,14 @@ public class VideoccController {
|
|
|
|
|
list.addAll(videocc.getDetails().get(detail));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
plcService.wmsTrayCodeMapByTask.put(orderNum,list);
|
|
|
|
|
VideoccResponse videoccResponse = new VideoccResponse();
|
|
|
|
|
videoccResponse.setMsg("失败");
|
|
|
|
|
videoccResponse.setIsSuccess(0);RfidLog rfidLog = rfidLogService.getOne(new QueryWrapper<RfidLog>().eq("task_id",videocc.getJobNum()).orderByDesc("create_time"));
|
|
|
|
|
|
|
|
|
|
Street street = streetMapper.selectById(rfidLog.getStreet_id());
|
|
|
|
|
|
|
|
|
|
CheckLog checkLog = checkLogMapper.selectOne(new QueryWrapper<CheckLog>().eq("check_Num",street.getPlcId()+"_"+videocc.getJobNum()).orderByDesc("create_time"));
|
|
|
|
|
|
|
|
|
|
if(rfidLog!=null){
|
|
|
|
|
Set<String> codes = rfidLog.getRfidTrayCode().split(",").length>0?new HashSet<>(Arrays.asList(rfidLog.getRfidTrayCode().split(","))):new HashSet<>();
|
|
|
|
|
if(codes.containsAll(list)){
|
|
|
|
|
checkLog.setStatus(2);
|
|
|
|
|
videoccResponse.setMsg("成功");
|
|
|
|
|
videoccResponse.setIsSuccess(1);
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
checkLog.setStatus(1);
|
|
|
|
|
videoccResponse.setMsg("扫码错误,请检查货物");
|
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
|
}
|
|
|
|
|
checkLogMapper.updateById(checkLog);
|
|
|
|
|
}else {
|
|
|
|
|
videoccResponse.setMsg("rfid扫码未完成,请稍后重试");
|
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
|
}
|
|
|
|
|
videoccResponse.setMsg("成功");
|
|
|
|
|
videoccResponse.setIsSuccess(1);
|
|
|
|
|
|
|
|
|
|
return videoccResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|