现场调度修改

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;
}

View File

@@ -6,14 +6,14 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:sqlserver://172.16.4.141:1433;databaseName=FT546-wms;encrypt=true;trustServerCertificate=true;
url: jdbc:sqlserver://192.168.188.236:1433;databaseName=FT546-wms;encrypt=true;trustServerCertificate=true;
username: sa
password: Flrd0914.
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url: jdbc:mariadb://172.16.4.141:3307/mydb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mariadb://172.16.4.12:3307/mydb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Flrd0914.
# 初始连接数

View File

@@ -66,12 +66,12 @@ spring:
devtools:
restart:
# 热部署开关
enabled: true
enabled: false
data:
# redis 配置
redis:
# 地址
host: 172.16.4.141
host: 192.168.188.236
# 端口,默认为6379
port: 6379
# 数据库索引
@@ -133,7 +133,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30
expireTime: 720

View File

@@ -205,6 +205,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where job_id = #{jobId}
</update>
<update id="ykCompleted">
{call proc_yk_complete(
#{v_job_id,jdbcType=VARCHAR,mode=IN},
#{v_result,mode=OUT,jdbcType=INTEGER}
)}
</update>
<delete id="deleteMydoJobByJobId" parameterType="String">
delete from mydo_job where job_id = #{jobId}

View File

@@ -253,9 +253,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select d.stockout_detail_id, d.stockout_guid, d.stockout_id, d.lot_no, d.product_guid, d.product_id, d.quantity, d.quantity_x,
d.quantity_j, d.assign_num, d.assign_num_x, d.assign_num_j, d.allot_quantity, d.allot_quantity_x, d.allot_quantity_j,
d.price, d.remark, d.warehouse_id, d.out_id, d.bukechai_quantity, d.kechai_quantity, d.entryid, d.flat_quantity, d.fid,
d.erp_stockout_id, d.unit, d.spec, d.supplier_id, d.cargo_no, d.create_time, d.print_date,
d.voltage, d.power, d.phase, d.net_weight, d.gross_weight, d.distribution, d.model, d.order_id,
p.product_name
d.erp_stockout_id, d.unit, d.spec,
d.product_name,d.spare1, d.spare2, d.spare3, d.spare4,d.spare5, d.spare6,d.spare7,d.spare8,d.spare9
from out_stockout_detail_finish d left join bas_product p on d.product_id = p.product_id
where stockout_guid = #{stockoutGuid}
</select>

View File

@@ -188,10 +188,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="autoAllot" parameterType="java.util.Map" statementType="CALLABLE">
{
call proc_out_auto_allocation(
call proc_out_auto_allocation_copy1(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)
}
</select>
@@ -202,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_stock_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)
}
</select>

View File

@@ -1,22 +1,22 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" >
<!-- <el-form-item label="格式ID" prop="formatId">-->
<!--&lt;!&ndash; <el-input-->
<!-- v-model="queryParams.formatId"-->
<!-- placeholder="请输入格式ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />&ndash;&gt;-->
<!-- <el-select v-model="queryParams.formatId" placeholder="请选择格式ID">-->
<!-- <el-option-->
<!-- v-for="item in traycodeFormatList"-->
<!-- :key="item.id"-->
<!-- :label="item.remarks"-->
<!-- :value="item.id"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="格式ID" prop="formatId">-->
<!--&lt;!&ndash; <el-input-->
<!-- v-model="queryParams.formatId"-->
<!-- placeholder="请输入格式ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />&ndash;&gt;-->
<!-- <el-select v-model="queryParams.formatId" placeholder="请选择格式ID">-->
<!-- <el-option-->
<!-- v-for="item in traycodeFormatList"-->
<!-- :key="item.id"-->
<!-- :label="item.remarks"-->
<!-- :value="item.id"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="条码" prop="trayCode">
<el-input
v-model="queryParams.trayCode"
@@ -101,16 +101,16 @@
<el-table ref="table" v-loading="loading" :data="traycodeList" @selection-change="handleSelectionChange" max-height="700">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="序号" align="center" prop="id" />-->
<!-- <el-table-column label="格式ID" align="left" prop="formatName" />-->
<!-- <el-table-column label="序号" align="center" prop="id" />-->
<!-- <el-table-column label="格式ID" align="left" prop="formatName" />-->
<el-table-column label="条码" align="center" prop="trayCode" />
<!-- <el-table-column label="Spare Field 1" align="center" prop="spare1" />-->
<!-- <el-table-column label="Spare Field 1" align="center" prop="spare1" />-->
<el-table-column label="是否可用" align="center" prop="spare2" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.spare2"/>
</template>
</el-table-column>
<!-- <el-table-column label="Spare Field 3" align="center" prop="spare3" />-->
<!-- <el-table-column label="Spare Field 3" align="center" prop="spare3" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
<template slot-scope="scope">
<el-button
@@ -161,7 +161,7 @@
</el-select>
</el-form-item>
<el-form-item label="数量" prop="spare1" v-if="form.id == null">
<el-form-item label="数量" prop="spare1" v-if="form.id == null">
<el-input v-model="form.spare1" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="托盘编码" prop="trayCode" v-if="form.id != null" >

View File

@@ -249,7 +249,7 @@ export default {
pageNum: 1,
pageSize: 10,
jobId: null,
status: '1',
status: null,
onLineType: null,
taskNo: null,
supplierId: null,

View File

@@ -240,7 +240,7 @@
class="vue-easy-print">
<vue-qr :text='item.stockinDetailId' :size="150" :margin="10" :align-item="center" :correctLevel="2"></vue-qr>
<div>
<span class="num">{{ item.stockinDetailId }}</span>
<span class="num">{{ item.productId }} {{ item.productName }}</span>
</div>
</div>
</vue-easy-print>
@@ -547,11 +547,6 @@ export default {
font-family: Arial, sans-serif;
}
.vue-qr {
display: block;
margin: 20px auto;
max-width: 100%;
}
@media print {
@page {

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<!-- 主表信息录入 -->
<el-form :model="formData" ref="formRef" size="small" :inline="true" label-width="68px" :rules="rules">
<el-form-item :label="'仓库'" prop="warehouseId" required><!--仓库-->
<!-- <el-form-item :label="'仓库'" prop="warehouseId" required>&lt;!&ndash;仓库&ndash;&gt;
<el-select v-model="formData.warehouseId" :placeholder="'请选择仓库'" clearable>
<el-option
v-for="dict in warehouseOptions"
@@ -11,7 +11,7 @@
:value="dict.warehouseId"
/>
</el-select>
</el-form-item>
</el-form-item>-->
<el-form-item label="项目号" prop="departmentNo">
<el-input v-model="formData.departmentNo" placeholder="请输入项目号"/>
</el-form-item>
@@ -265,9 +265,9 @@ export default {
customerTotal: 0,
// 表单验证规则
rules: {
warehouseId: [
{ required: true, message: '请选择仓库', trigger: "change" }
],
// warehouseId: [
// { required: true, message: '请选择仓库', trigger: "change" }
// ],
customerNo: [
{ required: true, message: '请输入客商编号', trigger: "blur" }
],
@@ -403,10 +403,10 @@ export default {
},
/** 打开选择存货弹窗 */
handleSelectMaterials() {
if (!this.formData.warehouseId) {
/*if (!this.formData.warehouseId) {
this.$modal.msgError('请选择仓库');
return;
}
}*/
if (!this.formData.departmentNo) {
this.$modal.msgError('请输入项目号');
return;