现场调度修改

This commit is contained in:
liuhanqing
2026-03-05 15:08:32 +08:00
parent 38f10b676d
commit 1ad5a15b6f
20 changed files with 100 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
package com.ruoyi.api.controller;
import cn.hutool.json.JSONUtil;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.api.service.IToErpService;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -30,7 +31,7 @@ public class ToErpApiController {
public AjaxResult receiveDeliveryNotice(@RequestBody DeliveryNoticeVo deliveryNoticeVo) {
AjaxResult ajaxResult = toErpService.receiveDeliveryNotice(deliveryNoticeVo);
requestLogService.insertRequestLog(requestLogService.getRequestLog(deliveryNoticeVo.toString(), "接收入出库通知单", ajaxResult));
requestLogService.insertRequestLog(requestLogService.getRequestLog(JSONUtil.toJsonStr(deliveryNoticeVo), "接收入出库通知单", ajaxResult));
return ajaxResult;
@@ -40,7 +41,7 @@ public class ToErpApiController {
/**
* 回传其他入库单
*/
// @Scheduled(fixedDelay = 1500)
@Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackInDeliveryNotice")
@ResponseBody
public void callbackInDeliveryNotice() {
@@ -50,7 +51,7 @@ public class ToErpApiController {
/**
* 回传其他出库单
*/
// @Scheduled(fixedDelay = 1500)
@Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackOutDeliveryNotice")
@ResponseBody
public void callbackDeliveryOutNotice() {
@@ -59,7 +60,7 @@ public class ToErpApiController {
/**
* 移库回调接口
*/
// @Scheduled(fixedDelay = 1500)
@Scheduled(fixedDelay = 1500)
@RequestMapping("/moveCargoSpace")
@ResponseBody
public void moveCargoSpace(){

View File

@@ -309,6 +309,7 @@ public class ToErpServiceImpl implements IToErpService {
d.setSpare3(item.getTopMaterial());
d.setSpare4(deliveryNoticeVo.getProjectNo());
// d.setSpare6(item.getLineNo());
d.setSpare8(deliveryNoticeVo.getOutType());
d.setRemark(item.getRemark());
@@ -475,13 +476,14 @@ public class ToErpServiceImpl implements IToErpService {
String[] splitArea = detail.getSpare9().split(",");
String[] splitLocation = detail.getSpare8().split(",");
String[] splitQuantity = detail.getQuantityX().split(",");
String[] lotNo = detail.getLotNo().split(",");
ArrayList<LocationDetail> locationDetails = new ArrayList<>();
for(int i=0;i<splitArea.length;i++) {
LocationDetail locationDetail = new LocationDetail();
locationDetail.setLocationNo(splitLocation[i]);
locationDetail.setQuantity(splitQuantity[i]);
locationDetail.setAreaNo(splitArea[i]);
locationDetail.setLotNo(detail.getLotNo());
locationDetail.setLotNo(lotNo[i]);
locationDetails.add(locationDetail);
}
item.setLocations(locationDetails);
@@ -550,8 +552,8 @@ public class ToErpServiceImpl implements IToErpService {
List<BasStock> basStockList = entry.getValue();
DeliveryNoticeVo deliveryNoticeVo = new DeliveryNoticeVo();
deliveryNoticeVo.setBillNo(basStockList.get(0).getStockinId());
deliveryNoticeVo.setNoteBillNo(basStockList.get(0).getStockinId());
deliveryNoticeVo.setBillDate(basStockList.get(0).getSpare8());
//deliveryNoticeVo.setNoteBillNo(basStockList.get(0).getStockinId());
deliveryNoticeVo.setBillDate(DateUtil.formatDateTime(new Date()));
deliveryNoticeVo.setWarehouseId(basStockList.get(0).getWarehouseId());
deliveryNoticeVo.setProjectNo(basStockList.get(0).getSpare4());
deliveryNoticeVo.setBillType("9");
@@ -559,7 +561,7 @@ public class ToErpServiceImpl implements IToErpService {
for (BasStock basStock1 : basStockList) {
DeliveryNoticeItemVo item = new DeliveryNoticeItemVo();
item.setLineNo(basStock1.getStockinDetailId());
item.setNotelineNo(basStock1.getStockinDetailId());
//item.setNotelineNo(basStock1.getStockinDetailId());
item.setInventoryCode(basStock1.getProductId());
item.setInventoryName(basStock1.getProductName());
item.setSpecModel(basStock1.getPower());
@@ -570,7 +572,7 @@ public class ToErpServiceImpl implements IToErpService {
item.setTopMaterial(basStock1.getSpare3());
item.setLotNo(basStock1.getLotNo());
item.setAreaBefore(moveMsg.getOldSpace());
item.setLocationBefore(moveMsg.getTrayCode());
//item.setLocationBefore(moveMsg.getTrayCode());
item.setArea(moveMsg.getNewSpace());
item.setLocation(moveMsg.getTrayCode());
deliveryNoticeItemVos.add(item);

View File

@@ -33,7 +33,7 @@ public class ToWcsServiceImpl implements IToWcsService {
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_OUT_MYDO_JOB = "http://192.168.188.236:8081/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_IN_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveInMydoJob";
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
public static final String OUT_MYDOJOB_MS = "http://localhost:8081/wcs2Wms/api/outMydojobMakesure";
@@ -48,10 +48,6 @@ public class ToWcsServiceImpl implements IToWcsService {
//查询所有未推送的料箱出库作业
MydoJob mydoJobParam = new MydoJob();
mydoJobParam.setStatus("1");
List<String> list = new ArrayList<>();
list.add("21");
list.add("26");
mydoJobParam.setInOutIds(list);
mydoJobParam.setInOut("2");
List<MydoJob> outMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
for (MydoJob outMydoJob : outMydoJobs) {

View File

@@ -196,8 +196,14 @@ public class ToWmsServiceImpl implements IToWmsService {
return AjaxResult.error("任务不存在");
}
MydoJob outJob = outMydoJobs.get(0);
outJob.setExecutionPhase("2");
mydoJobService.updateMydoJob(outJob);
if ("30".equals(outJob.getInOrOut())){
//移库作业
mydoJobService.ykCompleted(outJob);
}else {
//出库作业
outJob.setExecutionPhase("2");
mydoJobService.updateMydoJob(outJob);
}
break;
default:

View File

@@ -229,7 +229,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
checkStockinMapper.autoAllot(map);
builder.append("行明细:" + checkStockinDetail.getStockCheckDetailId() + ",分配结果:" + map.get("v_resultmsg") + "<br />");
}
iToWcsService.pushOutMydoJob();
//iToWcsService.pushOutMydoJob();
return AjaxResult.success(builder.toString());

View File

@@ -83,4 +83,6 @@ public interface MydoJobMapper
MydoJob selectInJobByTrayCode(@Param("trayCode") String trayCode);
void allotInJobSpace(HashMap<String, Object> map);
void ykCompleted(HashMap<String, Object> map);
}

View File

@@ -109,4 +109,6 @@ public interface IMydoJobService
MydoJob selectMydoJobByEntranceId(MydoJob mydoJob);
List<MydoJob> getInJobBySerial(String serial);
void ykCompleted(MydoJob outJob);
}

View File

@@ -506,7 +506,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
msg = map.get("v_resultmsg").toString();
builder.append("托盘:" + basStock.getTrayCode() + ",分配结果:" + msg + "<br/>");
}
iToWcsService.pushOutMydoJob();
//iToWcsService.pushOutMydoJob();
if (!StrUtil.isEmpty(builder)) {
return AjaxResult.warn(builder.toString());
}
@@ -527,4 +527,16 @@ public class MydoJobServiceImpl implements IMydoJobService {
public List<MydoJob> getInJobBySerial(String trayCode) {
return mydoJobMapper.getInJobBySerial(trayCode);
}
@Override
public void ykCompleted(MydoJob outJob) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_job_id", outJob.getJobId());
mydoJobMapper.ykCompleted(map);
if (!"10".equals(map.get("v_result").toString())) {
log.error("移库任务处理异常 异常代码{}", map.get("v_result"));
}else{
log.info("移库任务处理成功 jobId:[{}] trayCode:[{}]", outJob.getJobId(), outJob.getTrayCode());
}
}
}

View File

@@ -122,8 +122,8 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtil.post(url, param);
String resStr = HttpUtil.post(url, param);
requestLog.setResponseBody(resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -133,7 +133,6 @@ public class RequestLogServiceImpl implements IRequestLogService
if (codeObj == null || !codeObj.toString().equals("200")) {
throw new RuntimeException("请求失败,状态码: " + (codeObj != null ? codeObj.toString() : "null"));
}
requestLog.setResponseBody(resStr);
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
@@ -173,4 +172,9 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
return requestLog;
}
public static void main(String[] args) {
String aa = "{\"code\":\"200,\"success\":true,\"msg\":\"请求成功\"}";
System.out.println(JSONUtil.isJsonObj(aa));
}
}

View File

@@ -180,10 +180,12 @@ public class OutStockoutServiceImpl implements IOutStockoutService
for (OutStockoutDetail detail : outStockoutDetails) {
if (detail.getAllotQuantity().compareTo(detail.getQuantity()) < 0){
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
map.put("v_result", null);
map.put("v_resultmsg", null);
outStockoutMapper.autoAllot(map);
toWcsService.pushOutMydoJob();
//toWcsService.pushOutMydoJob();
if (!"10".equals(map.get("v_result"))){
stringBuilder.append(",").append(detail.getStockoutDetailId()+map.get("v_resultString"));
stringBuilder.append(",").append(detail.getStockoutDetailId()+map.get("v_resultmsg"));
}
}else{
stringBuilder.append(",").append(detail.getStockoutDetailId()+"单据已分配完成");
@@ -209,7 +211,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
map.put("v_stockout_detail_id", stockoutDetailId);
map.put("v_stock_id", stock);
outStockoutMapper.manualAllot(map);
toWcsService.pushOutMydoJob();
//toWcsService.pushOutMydoJob();
if (!"10".equals(map.get("v_result"))){
stringBuilder.append(",").append(stockoutDetailId+map.get("v_resultString"));
}

View File

@@ -48,7 +48,7 @@ public class OutStockoutDetail extends BaseEntity
/** 计划数量(箱) */
@Excel(name = "计划数量", readConverterExp = "箱=")
private BigDecimal quantityX;
private String quantityX;
/** 计划数量(件) */
@Excel(name = "计划数量", readConverterExp = "件=")
@@ -407,12 +407,12 @@ public class OutStockoutDetail extends BaseEntity
return quantity;
}
public void setQuantityX(BigDecimal quantityX)
public void setQuantityX(String quantityX)
{
this.quantityX = quantityX;
}
public BigDecimal getQuantityX()
public String getQuantityX()
{
return quantityX;
}