|
|
|
@ -1,10 +1,13 @@
|
|
|
|
package com.zhehekeji.web.controller;
|
|
|
|
package com.zhehekeji.web.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
|
|
import com.zhehekeji.web.entity.CheckLog;
|
|
|
|
import com.zhehekeji.web.entity.RfidLog;
|
|
|
|
import com.zhehekeji.web.entity.RfidLog;
|
|
|
|
import com.zhehekeji.web.entity.Videocc;
|
|
|
|
import com.zhehekeji.web.entity.Videocc;
|
|
|
|
import com.zhehekeji.web.entity.VideoccResponse;
|
|
|
|
import com.zhehekeji.web.entity.VideoccResponse;
|
|
|
|
|
|
|
|
import com.zhehekeji.web.mapper.CheckLogMapper;
|
|
|
|
import com.zhehekeji.web.mapper.RFIDMapper;
|
|
|
|
import com.zhehekeji.web.mapper.RFIDMapper;
|
|
|
|
|
|
|
|
import com.zhehekeji.web.service.CheckLogService;
|
|
|
|
import com.zhehekeji.web.service.interfaces.RfidLogService;
|
|
|
|
import com.zhehekeji.web.service.interfaces.RfidLogService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -22,6 +25,8 @@ import java.util.*;
|
|
|
|
public class VideoccController {
|
|
|
|
public class VideoccController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private RfidLogService rfidLogService;
|
|
|
|
private RfidLogService rfidLogService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private CheckLogMapper checkLogMapper;
|
|
|
|
@PostMapping("/xiddata")
|
|
|
|
@PostMapping("/xiddata")
|
|
|
|
@ApiOperation(value = "库存信息")
|
|
|
|
@ApiOperation(value = "库存信息")
|
|
|
|
public VideoccResponse xiddata(@RequestBody Videocc videocc ){
|
|
|
|
public VideoccResponse xiddata(@RequestBody Videocc videocc ){
|
|
|
|
@ -38,20 +43,26 @@ public class VideoccController {
|
|
|
|
VideoccResponse videoccResponse = new VideoccResponse();
|
|
|
|
VideoccResponse videoccResponse = new VideoccResponse();
|
|
|
|
videoccResponse.setMsg("失败");
|
|
|
|
videoccResponse.setMsg("失败");
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
|
|
|
|
CheckLog checkLog = checkLogMapper.selectOne(new QueryWrapper<CheckLog>().eq("check_Num",videocc.getJobNum()).orderByDesc("create_time"));
|
|
|
|
RfidLog rfidLog = rfidLogService.getOne(new QueryWrapper<RfidLog>().eq("task_id",videocc.getJobNum()).orderByDesc("create_time"));
|
|
|
|
RfidLog rfidLog = rfidLogService.getOne(new QueryWrapper<RfidLog>().eq("task_id",videocc.getJobNum()).orderByDesc("create_time"));
|
|
|
|
if(rfidLog!=null){
|
|
|
|
if(rfidLog!=null){
|
|
|
|
Set<String> codes = rfidLog.getRfidTrayCode().split(",").length>0?new HashSet<>(Arrays.asList(rfidLog.getRfidTrayCode().split(","))):new HashSet<>();
|
|
|
|
Set<String> codes = rfidLog.getRfidTrayCode().split(",").length>0?new HashSet<>(Arrays.asList(rfidLog.getRfidTrayCode().split(","))):new HashSet<>();
|
|
|
|
if(codes.containsAll(list)){
|
|
|
|
if(codes.containsAll(list)){
|
|
|
|
|
|
|
|
checkLog.setStatus(2);
|
|
|
|
videoccResponse.setMsg("成功");
|
|
|
|
videoccResponse.setMsg("成功");
|
|
|
|
videoccResponse.setIsSuccess(1);
|
|
|
|
videoccResponse.setIsSuccess(1);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkLog.setStatus(1);
|
|
|
|
videoccResponse.setMsg("扫码错误,请检查货物");
|
|
|
|
videoccResponse.setMsg("扫码错误,请检查货物");
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
checkLogMapper.updateById(checkLog);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
videoccResponse.setMsg("rfid扫码未完成,请稍后重试");
|
|
|
|
videoccResponse.setMsg("rfid扫码未完成,请稍后重试");
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
videoccResponse.setIsSuccess(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return videoccResponse;
|
|
|
|
return videoccResponse;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|