|
|
|
@ -5,11 +5,17 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.shkj.common.annotation.Log; |
|
|
|
import com.shkj.common.annotation.Log; |
|
|
|
import com.shkj.common.annotation.RepeatSubmit; |
|
|
|
import com.shkj.common.annotation.RepeatSubmit; |
|
|
|
|
|
|
|
import com.shkj.common.core.domain.Result; |
|
|
|
import com.shkj.common.enums.BusinessType; |
|
|
|
import com.shkj.common.enums.BusinessType; |
|
|
|
import com.shkj.common.utils.DateUtils; |
|
|
|
import com.shkj.common.utils.DateUtils; |
|
|
|
import com.shkj.wcs.service.IBusinDataTaskService; |
|
|
|
import com.shkj.wcs.service.IBusinDataTaskService; |
|
|
|
import com.shkj.wcs.third.workbinWcs.dto.WcsCreateTaskBody; |
|
|
|
import com.shkj.wcs.third.rcs.RCSUtil; |
|
|
|
import com.shkj.wcs.third.workbinWcs.dto.WcsCreateTaskDto; |
|
|
|
import com.shkj.wcs.third.rcs.dto.RcsCreateTaskDto; |
|
|
|
|
|
|
|
import com.shkj.wcs.third.rcs.dto.RcsIdList; |
|
|
|
|
|
|
|
import com.shkj.wcs.third.rcs.enums.RCSOperation; |
|
|
|
|
|
|
|
import com.shkj.wcs.third.rcs.enums.RCSTaskTypeEnum; |
|
|
|
|
|
|
|
import com.shkj.wcs.third.workbinWcs.WCSUtil; |
|
|
|
|
|
|
|
import com.shkj.wcs.third.workbinWcs.dto.*; |
|
|
|
import com.shkj.wcs.vo.WcsResponseVo; |
|
|
|
import com.shkj.wcs.vo.WcsResponseVo; |
|
|
|
import com.shkj.wcs.domain.BusinDataTask; |
|
|
|
import com.shkj.wcs.domain.BusinDataTask; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
@ -19,6 +25,7 @@ import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
@ -32,6 +39,12 @@ public class WcsTaskController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IBusinDataTaskService iBusinDataTaskService; |
|
|
|
private IBusinDataTaskService iBusinDataTaskService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private RCSUtil rcsUtil; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private WCSUtil wcsUtil; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* wz-wcs任务下发 |
|
|
|
* wz-wcs任务下发 |
|
|
|
@ -66,10 +79,34 @@ public class WcsTaskController { |
|
|
|
businDataTask.setFromSide(fromBinCode); |
|
|
|
businDataTask.setFromSide(fromBinCode); |
|
|
|
businDataTask.setToSide(toBinCode); |
|
|
|
businDataTask.setToSide(toBinCode); |
|
|
|
businDataTask.setCreateTime(DateUtils.getNowDate()); |
|
|
|
businDataTask.setCreateTime(DateUtils.getNowDate()); |
|
|
|
|
|
|
|
if (!priority.isEmpty()){ |
|
|
|
businDataTask.setPriority(priority); |
|
|
|
businDataTask.setPriority(priority); |
|
|
|
|
|
|
|
} |
|
|
|
boolean save = iBusinDataTaskService.save(businDataTask); |
|
|
|
boolean save = iBusinDataTaskService.save(businDataTask); |
|
|
|
if (save) { |
|
|
|
if (save) { |
|
|
|
//调用下游接口下任务
|
|
|
|
//调用下游接口下任务
|
|
|
|
|
|
|
|
log.info("任务储存成功!"); |
|
|
|
|
|
|
|
RcsCreateTaskDto rcsCreateTaskDto = new RcsCreateTaskDto(); |
|
|
|
|
|
|
|
rcsCreateTaskDto.setTaskType(RCSTaskTypeEnum.PF_LMR_COMMON.getValue()); |
|
|
|
|
|
|
|
rcsCreateTaskDto.setRobotTaskCode(businDataTask.getTaskCode()); |
|
|
|
|
|
|
|
if(!businDataTask.getPriority().isEmpty()){ |
|
|
|
|
|
|
|
rcsCreateTaskDto.setInitPriority(Integer.parseInt(businDataTask.getPriority())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<RcsIdList> rcsIdLists =new ArrayList<>(); |
|
|
|
|
|
|
|
for (int i = 1;i<=2;i++){ |
|
|
|
|
|
|
|
RcsIdList rcsIdList =new RcsIdList(); |
|
|
|
|
|
|
|
if(i==1){ |
|
|
|
|
|
|
|
rcsIdList.setType("ZONE"); |
|
|
|
|
|
|
|
rcsIdList.setCode(businDataTask.getFromSide()); |
|
|
|
|
|
|
|
rcsIdList.setOperation(RCSOperation.OT_COLLECT.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
rcsIdList.setType("ZONE"); |
|
|
|
|
|
|
|
rcsIdList.setCode(businDataTask.getToSide()); |
|
|
|
|
|
|
|
rcsIdList.setOperation(RCSOperation.OT_DELIVERY.getValue()); |
|
|
|
|
|
|
|
rcsIdLists.add(rcsIdList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Result result = rcsUtil.rcsCreateTask(rcsCreateTaskDto);
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (dataChange.equals("2")) { |
|
|
|
} else if (dataChange.equals("2")) { |
|
|
|
@ -89,23 +126,59 @@ public class WcsTaskController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "查询库区状态", businessType = BusinessType.UPDATE) |
|
|
|
@Log(title = "查询是否存在出库任务测试接口", businessType = BusinessType.UPDATE) |
|
|
|
@PostMapping("/toWzWcs/queryAreaStatus") |
|
|
|
@PostMapping("/toWzWcs/queryTaskStatus") |
|
|
|
@RepeatSubmit |
|
|
|
@RepeatSubmit |
|
|
|
public WcsResponseVo queryAreaStatus(WcsCreateTaskDto dto) { |
|
|
|
public WcsResponseVo queryTaskStatus(WCSQueryTaskStatusBody body) { |
|
|
|
if (dto != null) { |
|
|
|
WcsResponseVo vo = wcsUtil.queryTaskStatus(body); |
|
|
|
String businessType = dto.getHeader().getBusinessType(); |
|
|
|
return vo; |
|
|
|
if(businessType.equals("queryAreaStatus")){ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "查询每个库区状态测试接口", businessType = BusinessType.UPDATE) |
|
|
|
|
|
|
|
@PostMapping("/toKjWcs/queryAreaStatus") |
|
|
|
|
|
|
|
@RepeatSubmit |
|
|
|
|
|
|
|
public WcsResponseVo queryAreaStatus(WCSQueryAreaStatusDto dto) { |
|
|
|
|
|
|
|
//调用plc接口 暂时不用
|
|
|
|
|
|
|
|
WCSQueryAreaStatusDto wcsQueryAreaStatusDto = new WCSQueryAreaStatusDto(); |
|
|
|
|
|
|
|
List<WCSQueryAreaStatusBody> areaStatusBodyList = new ArrayList<>(); |
|
|
|
|
|
|
|
String[] areaCodes = {"SC-A2", "SC-B2", "SC-C2", "SC-D2"}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int[] statusValues = {0, 1, 1, 1}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) { |
|
|
|
|
|
|
|
WCSQueryAreaStatusBody queryAreaStatusBody = new WCSQueryAreaStatusBody(); |
|
|
|
|
|
|
|
queryAreaStatusBody.setAreaInLocation(areaCodes[i]); |
|
|
|
|
|
|
|
queryAreaStatusBody.setStatus(statusValues[i]); |
|
|
|
|
|
|
|
areaStatusBodyList.add(queryAreaStatusBody); |
|
|
|
} |
|
|
|
} |
|
|
|
List<WcsCreateTaskBody> body = dto.getBody(); |
|
|
|
|
|
|
|
if (!body.isEmpty()) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wcsQueryAreaStatusDto.setBody(areaStatusBodyList); |
|
|
|
|
|
|
|
return WcsResponseVo.success(wcsQueryAreaStatusDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "任务状态上报测试接口", businessType = BusinessType.UPDATE) |
|
|
|
|
|
|
|
@PostMapping("/toWzWcs/uploadWCSTaskStatus") |
|
|
|
|
|
|
|
@RepeatSubmit |
|
|
|
|
|
|
|
public WcsResponseVo uploadWCSTaskStatus(UploadWCSTaskStatusDto dto) { |
|
|
|
|
|
|
|
//调用plc接口 暂时不用
|
|
|
|
|
|
|
|
WcsResponseVo vo = wcsUtil.uploadWCSTaskStatus(dto); |
|
|
|
|
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
return WcsResponseVo.success(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "扫码处入库申请", businessType = BusinessType.UPDATE) |
|
|
|
|
|
|
|
@PostMapping("/toWzWcs/wcsIncomingTaskRequest") |
|
|
|
|
|
|
|
@RepeatSubmit |
|
|
|
|
|
|
|
public WcsResponseVo wcsIncomingTaskRequest(WcsIncomingTaskRequestDto dto) { |
|
|
|
|
|
|
|
//调用plc接口 暂时不用
|
|
|
|
|
|
|
|
WcsResponseVo vo = wcsUtil.wcsIncomingTaskRequest(dto); |
|
|
|
|
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|