Browse Source

mes接口优化

master
psh 10 months ago
parent
commit
a161979507
  1. 20
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/webservice/WebServiceClient.java
  2. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java
  3. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java
  5. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java
  6. 74
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java
  7. 35
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java
  8. 6
      lms/nladmin-ui/src/views/wms/sch/group/index.vue
  9. 4
      lms/nladmin-ui/src/views/wms/sch/material/index.vue
  10. 2
      lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue

20
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/webservice/WebServiceClient.java

@ -0,0 +1,20 @@
package org.nl.wms.mes.webservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.soap.client.core.SoapActionCallback;
import org.springframework.stereotype.Service;
@Service
public class WebServiceClient {
public void callWebService(Object request,String url) {
String soapAction = "";
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
// 发送 SOAP 请求并获取响应
Object response = webServiceTemplate.marshalSendAndReceive(url, request, new SoapActionCallback(soapAction));
// 处理响应
System.out.println("Response: " + response);
// 其他处理: 转对象、转字符串等操作
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java

@ -53,7 +53,7 @@ public class SchBaseVehiclematerialgroup implements Serializable {
@ApiModelProperty(value = "批次")
private String pcsn;
@ApiModelProperty(value = "入库时间")
@ApiModelProperty(value = "回温开始时间")
private String instorage_time;
@ApiModelProperty(value = "回温时间(小时)")

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java

@ -39,7 +39,7 @@ public class SchBaseVehiclematerialgroupDto implements Serializable {
/** 批次 */
private String pcsn;
/** 入库时间 */
/** 回温开始时间 */
private String instorage_time;
/** 回温时间(小时) */

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java

@ -189,7 +189,7 @@ public class KJRKTask extends AbstractTask {
groupEntity.setPoint_code(startPoint);
groupEntity.setPoint_name(startPointObj.getPoint_name());
groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
groupEntity.setInstorage_time(DateUtil.now());
// groupEntity.setInstorage_time(DateUtil.now());
groupEntity.setTask_code(taskObj.getTask_code());
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java

@ -189,7 +189,7 @@ public class SSXBKJTask extends AbstractTask {
groupEntity.setPoint_code(startPoint);
groupEntity.setPoint_name(startPointObj.getPoint_name());
groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
groupEntity.setInstorage_time(DateUtil.now());
// groupEntity.setInstorage_time(DateUtil.now());
groupEntity.setTask_code(taskObj.getTask_code());
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。

74
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java

@ -10,10 +10,15 @@ import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf;
import org.nl.wms.ext.service.WmsToAcsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.mes.domain.QPMES062Request;
import org.nl.wms.mes.domain.QPMES065Request;
import org.nl.wms.mes.webservice.WebServiceClient;
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
@ -65,7 +70,10 @@ public class YCLCKTask extends AbstractTask {
@Autowired
private PointMapper pointMapper;
@Autowired
private WmsToAcsService wmsToAcsService;
private WebServiceClient webServiceClient;
@Autowired
private MaterialMapper materialMapper;
@Override
// @Transactional(rollbackFor = Exception.class)
@ -76,7 +84,17 @@ public class YCLCKTask extends AbstractTask {
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
SchBasePoint point = findNextPoint(task);
JSONObject jsonObject = JSONObject.parseObject(task.getExt_group_data());
String region;
if ("0".equals(jsonObject.getString("mode"))) {
region = "HW";
} else if ("1".equals(jsonObject.getString("mode"))) {
region = "HWK";
} else {
log.error("任务:" + task.getTask_code() + "回温mode:" + jsonObject.getString("mode") + "模式不正确!");
continue;
}
SchBasePoint point = findNextPoint(task, region);
if (ObjectUtil.isEmpty(point)) {
task.setRemark("未找到所需点位!");
taskService.update(task);
@ -88,7 +106,7 @@ public class YCLCKTask extends AbstractTask {
task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
task.setVehicle_code(schBasePoint.getVehicle_code());
task.setVehicle_code2(schBasePoint.getVehicle_code2());
@ -106,22 +124,18 @@ public class YCLCKTask extends AbstractTask {
}
/**
* todo 待确认怎么区分普通回温和快速回温
* todo 设置回温时间
*
* @return
*/
private SchBasePoint findNextPoint(SchBaseTask task) {
String regionCode = "HW";
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"0");
private SchBasePoint findNextPoint(SchBaseTask task, String regionCode) {
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) {
//已锁定直接返回
if(task.getTask_code().equals(schBasePoint.getIng_task_code())){
if (task.getTask_code().equals(schBasePoint.getIng_task_code())) {
return schBasePoint;
}
if (schBasePoint.getIs_used()
&& schBasePoint.getVehicle_qty() ==0) {
log.info("原材料出库任务找到当前符合条件的缓存区位置{}",schBasePoint.getPoint_code());
&& schBasePoint.getVehicle_qty() == 0) {
log.info("原材料出库任务找到当前符合条件的缓存区位置{}", schBasePoint.getPoint_code());
return schBasePoint;
}
}
@ -129,7 +143,7 @@ public class YCLCKTask extends AbstractTask {
}
/**
* todo 任务完成设置完成时间为开始固化时间
* 任务完成设置完成时间为开始固化时间
*/
@Override
// @Transactional(rollbackFor = Exception.class)
@ -152,8 +166,8 @@ public class YCLCKTask extends AbstractTask {
taskObj.setRemark("执行中");
}
if (status.equals(TaskStatus.FINISHED)) { // 完成
String vehicleCode=taskObj.getVehicle_code();
String vehicleCode2= taskObj.getVehicle_code2();
String vehicleCode = taskObj.getVehicle_code();
String vehicleCode2 = taskObj.getVehicle_code2();
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>()
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode)
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status,
@ -166,6 +180,7 @@ public class YCLCKTask extends AbstractTask {
one.setPoint_name(endPointObj.getPoint_name());
one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code());
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
one.setInstorage_time(DateUtil.now());
one.setUpdate_id(GeneralDefinition.ACS_ID);
one.setUpdate_name(GeneralDefinition.ACS_NAME);
one.setUpdate_time(DateUtil.now());
@ -183,6 +198,7 @@ public class YCLCKTask extends AbstractTask {
one.setPoint_name(endPointObj.getPoint_name());
one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code());
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
one.setInstorage_time(DateUtil.now());
one.setUpdate_id(GeneralDefinition.ACS_ID);
one.setUpdate_name(GeneralDefinition.ACS_NAME);
one.setUpdate_time(DateUtil.now());
@ -206,9 +222,29 @@ public class YCLCKTask extends AbstractTask {
taskObj.setGroup_id(one.getGroup_id());
taskObj.setRemark("任务完成");
try {
//todo 出库成功后上报mes
}catch (Exception e){
log.error("原材料出库上报MES失败{}",e.getMessage(),e);
//todo 待确认具体传值
List<Material> materialList = materialMapper.selectList(new LambdaQueryWrapper<Material>()
.eq(Material::getPalletSN, taskObj.getVehicle_code2())
.eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue()));
if (ObjectUtil.isNotEmpty(materialList)) {
PdmBdWorkorder pdmBdWorkorder=workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
.eq(PdmBdWorkorder::getMaterial_code, materialList.get(0).getProductName()));
String url = "http://11.111.11.111:9556/xxx/ws/powerAlarmWs";
QPMES065Request qpmes065Request = new QPMES065Request();
qpmes065Request.setDEST_SYSTEM("1");
qpmes065Request.setINTF_ID("1");
qpmes065Request.setSRC_MSGID("1");
qpmes065Request.setSRC_SYSTEM("1");
qpmes065Request.setMoname(pdmBdWorkorder.getWorkorder_code());
qpmes065Request.setLotSN(materialList.get(0).getPalletSN());
qpmes065Request.setQty(String.valueOf(one.getMaterial_qty()));
qpmes065Request.setSiteName(materialList.get(0).getLocationCode());
webServiceClient.callWebService(qpmes065Request, url);
} else {
log.error("当前子托盘:" + taskObj.getVehicle_code2() + "不存在未解绑的物料信息,请确认!");
}
} catch (Exception e) {
log.error("原材料出库上报MES失败{}", e.getMessage(), e);
}
}
if (status.equals(TaskStatus.CANCELED)) { // 取消
@ -239,7 +275,7 @@ public class YCLCKTask extends AbstractTask {
}
@Override
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) {
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) {
//该场景无需重算等待点
}
}

35
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java

@ -9,10 +9,14 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.mes.domain.QPMES062Request;
import org.nl.wms.mes.webservice.WebServiceClient;
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
@ -66,7 +70,9 @@ public class YCLRKTask extends AbstractTask {
@Autowired
private PointMapper pointMapper;
@Autowired
private AcsToWmsService acsToWmsService;
private WebServiceClient webServiceClient;
@Autowired
private MaterialMapper materialMapper;
@Override
// @Transactional(rollbackFor = Exception.class)
@ -186,7 +192,30 @@ public class YCLRKTask extends AbstractTask {
taskObj.setGroup_id(groupEntity.getGroup_id());
taskObj.setRemark("任务完成");
try {
//todo 入库成功后上报mes
//todo 待确认具体传值
LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Material::getPalletSN,taskObj.getVehicle_code2());
wrapper.eq(Material::getGroup_bind_material_status,GroupBindMaterialStatusEnum.BOUND.getValue());
List<Material> materialList= materialMapper.selectList(wrapper);
if(ObjectUtil.isNotEmpty(materialList)) {
String url = "http://11.111.11.111:9556/xxx/ws/powerAlarmWs";
QPMES062Request qpmes062Request = new QPMES062Request();
qpmes062Request.setDEST_SYSTEM("1");
qpmes062Request.setINTF_ID("1");
qpmes062Request.setSRC_MSGID("1");
qpmes062Request.setSRC_SYSTEM("1");
qpmes062Request.setSimtOrderNo(materialList.get(0).getSimtOrderNo());
qpmes062Request.setLocationCode(materialList.get(0).getLocationCode());
qpmes062Request.setSimtType(materialList.get(0).getSimtType());
qpmes062Request.setDeliveryNo(materialList.get(0).getDeliveryNo());
qpmes062Request.setWhlCode(materialList.get(0).getWhlCode());
qpmes062Request.setPalletSn(materialList.get(0).getPalletSN());
qpmes062Request.setUserCode(materialList.get(0).getSupplierCode());
qpmes062Request.setUserName(materialList.get(0).getSupplierName());
webServiceClient.callWebService(qpmes062Request, url);
}else{
log.error("当前子托盘:"+taskObj.getVehicle_code2()+"不存在未解绑的物料信息,请确认!");
}
}catch (Exception e){
log.error("原材料入库上报MES失败{}",e.getMessage(),e);
}
@ -225,7 +254,7 @@ public class YCLRKTask extends AbstractTask {
groupEntity.setPoint_code(startPoint);
groupEntity.setPoint_name(startPointObj.getPoint_name());
groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
groupEntity.setInstorage_time(DateUtil.now());
// groupEntity.setInstorage_time(DateUtil.now());
groupEntity.setTask_code(taskObj.getTask_code());
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。

6
lms/nladmin-ui/src/views/wms/sch/group/index.vue

@ -86,7 +86,7 @@
<el-radio label="0">母托盘</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="入库时间">
<el-form-item label="回温开始时间">
<el-date-picker
v-model="form.instorage_time"
type="datetime"
@ -241,8 +241,8 @@
</el-table-column>-->
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
<el-table-column prop="workorder_code" label="工单编码" :min-width="flexWidth('workorder_code',crud.data,'工单编码')" />
<el-table-column prop="instorage_time" label="入库时间" :min-width="flexWidth('instorage_time',crud.data,'入库时间')" />
<el-table-column prop="group_bind_material_status" label="绑定状态" :min-width="flexWidth('group_bind_material_status',crud.data,'入库时间')">
<el-table-column prop="instorage_time" label="回温开始时间" :min-width="flexWidth('instorage_time',crud.data,'入库时间')" />
<el-table-column prop="group_bind_material_status" label="绑定状态" :min-width="flexWidth('group_bind_material_status',crud.data,'回温开始时间')">
<template slot-scope="scope">
{{ dict.label.group_bind_material_status[scope.row.group_bind_material_status] }}
</template>

4
lms/nladmin-ui/src/views/wms/sch/material/index.vue

@ -94,7 +94,7 @@
<el-radio label="0">母托盘</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="入库时间">
<el-form-item label="回温开始时间">
<el-date-picker
v-model="form.instorage_time"
type="datetime"
@ -247,7 +247,7 @@
<el-table-column prop="incomingLength" label="来料长度" :min-width="flexWidth('incomingLength',crud.data,'来料长度')" />
<el-table-column prop="incomingWeight" label="来料重量" :min-width="flexWidth('incomingWeight',crud.data,'来料重量')" />
<el-table-column prop="incomingchipping" label="来料缺陷长度" :min-width="flexWidth('incomingchipping',crud.data,'来料缺陷长度')" />
<el-table-column prop="group_bind_material_status" label="绑定状态" :min-width="flexWidth('group_bind_material_status',crud.data,'入库时间')">
<el-table-column prop="group_bind_material_status" label="绑定状态" :min-width="flexWidth('group_bind_material_status',crud.data,'回温开始时间')">
<template slot-scope="scope">
{{ dict.label.group_bind_material_status[scope.row.group_bind_material_status] }}
</template>

2
lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue

@ -72,7 +72,7 @@
<el-form-item label="设备">
<el-input v-model="groups.point_name" style="width: 200px;" />
</el-form-item>
<el-form-item label="入库时间">
<el-form-item label="回温开始时间">
<el-input v-model="groups.instorage_time" style="width: 200px;" />
</el-form-item>
<el-form-item label="回温时间(小时)">

Loading…
Cancel
Save