Browse Source

opt: 代码整理,出窑口校验,入窑口校验,布料信息,对接记录筛选功能

master
李永德 1 year ago
parent
commit
0a31f770ca
  1. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java
  2. 168
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java
  3. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java
  4. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java
  5. 22
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ClothRequest.java
  6. 48
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  7. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java
  8. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java
  9. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java
  10. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java
  11. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml
  12. 35
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SpreaderDto.java
  13. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  14. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java
  15. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java
  16. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java
  17. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml
  18. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java
  19. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  20. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java
  21. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java
  22. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  23. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java
  24. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java
  25. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml
  26. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  27. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  28. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java
  29. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java
  30. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java
  31. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java
  32. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java
  33. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java
  34. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java
  35. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java
  36. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java
  37. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml
  38. 24
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java
  39. 21
      lms/nladmin-ui/src/views/wms/ext/record/index.vue
  40. 9
      lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoCallMaterials.java

@ -12,9 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
import java.util.function.Consumer;
/**
* @Author: lyd
@ -51,7 +49,8 @@ public class AutoCallMaterials {
}
try {
// 记录数据
requestMaterialRecordService.recordData(workorder);
PdmBdRequestMaterialRecord requestMaterialRecord = requestMaterialRecordService.recordData(workorder);
log.info("记录自动要料信息:{}", requestMaterialRecord);
} catch (Exception e) {
log.error("插入LMS数据库失败,{}", e.getMessage());
log.error("插入LMS数据库失败数据:{}", workorder);
@ -61,6 +60,7 @@ public class AutoCallMaterials {
try {
// 下发混碾
wmsToMmsService.addRequestMaterial(workorder);
log.info("自动下发混碾: {}", workorder);
} catch (Exception e) {
log.error("下发混碾失败,{}", e.getMessage());
log.error("下发混碾失败数据:{}", workorder);

168
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/autotask/AutoIssueWorkOrder.java

@ -38,112 +38,90 @@ public class AutoIssueWorkOrder {
private WmsToAcsService wmsToAcsService;
@Autowired
private ISysNoticeService noticeService;
@Autowired
private RedissonClient redissonClient;
@SneakyThrows
public void run() {
RLock lock = redissonClient.getLock(this.getClass().getName());
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
// 获取每台设备的第一条工单
List<PdmBdWorkorder> workorderList = workorderService.getNotIssueOrder();
// 查找该设备未生产的工单去下发
workorderList.forEach(s -> {
// 判断是否有工单
List<PdmBdWorkorder> lists = workorderService.getTheDayProducedWorkOrderByDevice(s.getPoint_code());
if (lists.size() > 0) {
return;
}
// 已生产就退出
if (s.getWorkorder_status().equals(WorkOrderStatusEnum.PRODUCING.getCode())
|| s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) {
return;
}
AcsWorkOrderVo acsWorkOrderVo = workorderService.toAcsWorkOrderById(s.getWorkorder_id());
// 获取一个下发
List<AcsWorkOrderVo> list = new CopyOnWriteArrayList<>();
list.add(acsWorkOrderVo);
AcsResponse resultForAcs;
try {
resultForAcs = wmsToAcsService.order(list);
log.info("自动下发工单:{}", list);
} catch (Exception e) {
log.error("工单下发异常:" + e.getMessage());
// 通知
noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: "
+ acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
return;
}
if (resultForAcs.getCode() != HttpStatus.HTTP_OK) {
// 不成功
noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(),
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
// 修改工单数据
PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code());
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
workorderService.updateById(pdmBdWorkorder);
});
// 获取每台设备的第一条工单
List<PdmBdWorkorder> workorderList = workorderService.getNotIssueOrder();
// 查找该设备未生产的工单去下发
workorderList.forEach(s -> {
// 判断是否有工单
List<PdmBdWorkorder> lists = workorderService.getTheDayProducedWorkOrderByDevice(s.getPoint_code());
if (lists.size() > 0) {
return;
}
// 已生产就退出
if (s.getWorkorder_status().equals(WorkOrderStatusEnum.PRODUCING.getCode())
|| s.getWorkorder_code().equals(WorkOrderStatusEnum.ISSUED.getCode())) {
return;
}
AcsWorkOrderVo acsWorkOrderVo = workorderService.toAcsWorkOrderById(s.getWorkorder_id());
// 获取一个下发
List<AcsWorkOrderVo> list = new ArrayList<>();
list.add(acsWorkOrderVo);
AcsResponse resultForAcs;
try {
resultForAcs = wmsToAcsService.order(list);
log.info("自动下发工单:{}", list);
} catch (Exception e) {
log.error("工单下发异常:" + e.getMessage());
// 通知
noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: "
+ acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
return;
}
} finally {
if (tryLock) {
lock.unlock();
if (resultForAcs.getCode() != HttpStatus.HTTP_OK) {
// 不成功
noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(),
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
}
// 修改工单数据
PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code());
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
workorderService.updateById(pdmBdWorkorder);
});
}
@SneakyThrows
public void run_backup() {
RLock lock = redissonClient.getLock(this.getClass().getName());
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
// todo: 获取每台设备的第一条工单
// 获取所有设备号
List<String> deviceCodes = workorderService.getTheDayUnProducedDevice();
// 查找该设备未生产的工单去下发
deviceCodes.forEach(s -> {
// 判断是否有工单
List<PdmBdWorkorder> lists = workorderService.getTheDayProducedWorkOrderByDevice(s);
if (lists.size() > 0) return;
List<AcsWorkOrderVo> acsWorkOrderVoList = workorderService.getAcsWorkOrderVos(s);
if (acsWorkOrderVoList.size() == 0) return;
AcsWorkOrderVo acsWorkOrderVo = acsWorkOrderVoList.get(0);
// 获取一个下发
List<AcsWorkOrderVo> list = new CopyOnWriteArrayList<>();
list.add(acsWorkOrderVo);
AcsResponse resultForAcs;
try {
resultForAcs = wmsToAcsService.order(list);
} catch (Exception e) {
log.error("工单下发异常:" + e.getMessage());
// 通知
noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: "
+ acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
return;
}
if (resultForAcs.getCode() != HttpStatus.HTTP_OK) {
// 不成功
noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(),
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
// 修改工单数据
PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code());
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
workorderService.updateById(pdmBdWorkorder);
});
// todo: 获取每台设备的第一条工单
// 获取所有设备号
List<String> deviceCodes = workorderService.getTheDayUnProducedDevice();
// 查找该设备未生产的工单去下发
deviceCodes.forEach(s -> {
// 判断是否有工单
List<PdmBdWorkorder> lists = workorderService.getTheDayProducedWorkOrderByDevice(s);
if (lists.size() > 0) return;
List<AcsWorkOrderVo> acsWorkOrderVoList = workorderService.getAcsWorkOrderVos(s);
if (acsWorkOrderVoList.size() == 0) return;
AcsWorkOrderVo acsWorkOrderVo = acsWorkOrderVoList.get(0);
// 获取一个下发
List<AcsWorkOrderVo> list = new CopyOnWriteArrayList<>();
list.add(acsWorkOrderVo);
AcsResponse resultForAcs;
try {
resultForAcs = wmsToAcsService.order(list);
} catch (Exception e) {
log.error("工单下发异常:" + e.getMessage());
// 通知
noticeService.createNotice("工单下发失败: " + e.getMessage(), "工单下发失败: "
+ acsWorkOrderVo.getWorkorder_code(), NoticeTypeEnum.EXCEPTION.getCode());
return;
}
} finally {
if (tryLock) {
lock.unlock();
if (resultForAcs.getCode() != HttpStatus.HTTP_OK) {
// 不成功
noticeService.createNotice(resultForAcs.getMessage(), "工单下发失败: " + acsWorkOrderVo.getWorkorder_code(),
NoticeTypeEnum.EXCEPTION.getCode());
return;
}
}
// 修改工单数据
PdmBdWorkorder pdmBdWorkorder = workorderService.getByCode(acsWorkOrderVo.getWorkorder_code());
pdmBdWorkorder.setWorkorder_status(WorkOrderStatusEnum.ISSUED.getCode());
TaskUtils.setWorkOrderUpdateByAcs(pdmBdWorkorder);
workorderService.updateById(pdmBdWorkorder);
});
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java

@ -57,5 +57,5 @@ public interface AcsToWmsService {
/** 实时修改点位状态 */
BaseResponse realTimeSetPoint(JSONObject param);
/** 布料记录 - 上传MES */
// BaseResponse applyOneGrab(JSONObject param);
BaseResponse applyOneCloth(JSONObject param);
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java

@ -21,6 +21,7 @@ public class ApplyTaskResponse extends BaseResponse {
private String label_message;
// 特殊业务-无具体含义:目前是是否满足码满规定托盘数
private int is_satisfy;
private String mudBatch;
public static ApplyTaskResponse responseOk(String requestNo) {
ApplyTaskResponse response = new ApplyTaskResponse();

22
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ClothRequest.java

@ -0,0 +1,22 @@
package org.nl.wms.ext.acs.service.dto.to.wms;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
@Data
public class ClothRequest extends BaseRequest {
/**
* 泥料批次
*/
private String slip;
/**
* 设定重量
*/
private String set_weight;
/**
* 称量重量
*/
private String weight;
}

48
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -25,6 +25,7 @@ import org.nl.wms.ext.acs.service.dto.to.wms.*;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.nl.wms.ext.mes.service.dto.CusterDo;
import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto;
import org.nl.wms.ext.mes.service.dto.SpreaderDto;
import org.nl.wms.ext.mms.service.WmsToMmsService;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService;
@ -314,7 +315,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return ApplyTaskResponse.responseOk(requestNo, "任务创建成功", handling);
}
// todo: 特殊处理
// mark: 特殊处理
protected int specialHandling(String regionCode, JSONObject param) {
int torus = 0; // 无业务:0,分拣剩余0托:1
if (regionCode.equals("FJ")) { // 判断是否够码满
@ -362,7 +363,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
/**
* 任务申请强制满托入缓存 todo: 暂时=分拣剩料回库
* 任务申请强制满托入缓存 mark: 暂时=分拣剩料回库
*
* @param param: ApplyTaskRequest的json形式
* @return
@ -570,7 +571,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
workorderService.updateById(bdWorkorder);
log.info("工单完成: {}", bdWorkorder);
try {
// todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
// mark: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
wmsToMesService.reportPressUnusedMaterial(bdWorkorder);
} catch (Exception e) {
log.info("调用mes异常:{}", e.getMessage());
@ -613,7 +614,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 扫码成功申请 - 判断是否静置完成
* todo: 需要返回泥料重量
* mark: 需要返回泥料重量
*/
@Override
public ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest) {
@ -683,6 +684,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
taskResponse.setIs_standing_finish(GeneralDefinition.YES);
taskResponse.setMessage("静置完成");
taskResponse.setWeight(one.getMaterial_weight().toString());
taskResponse.setMudBatch(one.getPcsn());
// 泥料数据删除
List<PdmBdRequestMaterialRecord> list = requestMaterialRecordService.list(new LambdaQueryWrapper<PdmBdRequestMaterialRecord>()
.eq(PdmBdRequestMaterialRecord::getDevice_code, productionTask.getPoint_code())
@ -716,16 +718,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("载具编码不能为空");
}
baseRequest.setVehicle_code(TaskUtils.defaultVehicleCode(baseRequest.getVehicle_code()));
if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) {
baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY);
}
baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY);
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code());
// 入窑记录时间
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(),
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isNotEmpty(groupInfo.getInto_kiln_time())) {
// 如果已经记录就跳过
return ApplyTaskResponse.responseOk(baseRequest.getRequestNo());
if (ObjectUtil.isEmpty(groupInfo)) {
throw new BadRequestException("入窑失败:载具["+baseRequest.getVehicle_code()+"]组盘信息不存在!");
}
groupInfo.setInto_kiln_time(DateUtil.now());
if (ObjectUtil.isNotEmpty(basePoint)) {
@ -772,7 +771,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(deviceProductionTask)) {
throw new BadRequestException("压机" + deviceCode + "暂无生产的工单");
}
// todo: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中
// mark: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中
try {
wmsToMmsService.addRequestMaterial(deviceProductionTask);
} catch (Exception e) {
@ -951,4 +950,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
return BaseResponse.responseOk(actionRequest.getRequestNo());
}
@Override
public BaseResponse applyOneCloth(JSONObject param) {
// mark: 上传mes数据
ClothRequest actionRequest = param.toJavaObject(ClothRequest.class);
// 获取工单
PdmBdWorkorder productionTask = workorderService.getDeviceDockingProductionTask(actionRequest.getDevice_code());
MdBaseMaterial mdBaseMaterial = materialService.getById(productionTask.getMaterial_id());
SpreaderDto spreaderDto = new SpreaderDto();
spreaderDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
spreaderDto.setTIM(DateUtil.now());
BigDecimal bigDecimalValue = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getWeight())
? "0" : actionRequest.getWeight());
spreaderDto.setACT_WEIGHT(bigDecimalValue);
BigDecimal bigDecimal = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getSet_weight())
? "0" : actionRequest.getSet_weight());
spreaderDto.setTHEO_WEIGHT(bigDecimal);
spreaderDto.setMATERIAL_ID(mdBaseMaterial.getMaterial_id());
spreaderDto.setMATERIAL_NAME(mdBaseMaterial.getMaterial_name());
spreaderDto.setMATERIAL_SPEC(mdBaseMaterial.getMaterial_spec());
spreaderDto.setMATERIAL_MODEL(mdBaseMaterial.getMaterial_model());
spreaderDto.setFPROBATCH(actionRequest.getSlip());
spreaderDto.setCREATE_TM(DateUtil.now());
spreaderDto.setOP_FLAG(GeneralDefinition.NO);
wmsToMesService.reportSpreaderInfoToMes(spreaderDto);
return BaseResponse.responseOk(actionRequest.getRequestNo());
}
}

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java

@ -3,14 +3,10 @@ package org.nl.wms.ext.mes.autotask;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* @Author: lyd
* @Description: 自动同步物料
@ -22,20 +18,8 @@ import java.util.concurrent.TimeUnit;
public class AutoSynMaterialInfo {
@Autowired
private WmsToMesService wmsToMesService;
@Autowired
private RedissonClient redissonClient;
@SneakyThrows
public void run() {
RLock lock = redissonClient.getLock(this.getClass().getName());
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
wmsToMesService.synchronizeMaterialInfo();
}
} finally {
if (tryLock) {
lock.unlock();
}
}
wmsToMesService.synchronizeMaterialInfo();
}
}

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynWorkOrderInfo.java

@ -23,21 +23,8 @@ public class AutoSynWorkOrderInfo {
@Autowired
private WmsToMesService wmsToMesService;
@Autowired
private RedissonClient redissonClient;
@SneakyThrows
public void run() {
RLock lock = redissonClient.getLock(this.getClass().getName());
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
wmsToMesService.synchronizeWorkOrderInfo();
}
} finally {
if (tryLock) {
lock.unlock();
}
}
wmsToMesService.synchronizeWorkOrderInfo();
}
}

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java

@ -134,4 +134,10 @@ public interface WmsToMesService {
int getTotal(String materialId);
CusterDo getCusterByName(String custerName);
/**
* 上报布料机数据
* @param spreaderDto
*/
void reportSpreaderInfoToMes(SpreaderDto spreaderDto);
}

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java

@ -66,7 +66,6 @@ public interface MesRequestMapper {
CusterDo getCusterByNo(String custerNo);
@DS("oracle")
List<MesOrderInfo> selectPageMesOrder(String materialId, int currentPage, int currentSize);
/**
* 获取当前物料的订单总数
* @param materialId
@ -76,4 +75,6 @@ public interface MesRequestMapper {
int getOrderTotalByMaterial(String materialId);
@DS("oracle")
CusterDo getCusterByName(String custerName);
@DS("oracle")
void reportSpreaderInfoToMes(SpreaderDto spreaderDto);
}

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml

@ -90,6 +90,12 @@
, #{GROUP_BIND_MATERIAL_STATUS}, #{MOVE_WAY}, #{REMARK}, #{UPDATE_TIME}, #{OUT_KILN_TIME}, #{INTO_KILN_TIME}
, #{CREATE_TM}, #{OP_FLAG})
</insert>
<insert id="reportSpreaderInfoToMes" parameterType="org.nl.wms.ext.mes.service.dto.SpreaderDto">
INSERT INTO "LMSTELCOM"."RECEIVE_MUDLAYOUT_RECORD"(MSGID, TIM, ACT_WEIGHT, THEO_WEIGHT, MATERIAL_ID, MATERIAL_NAME
, MATERIAL_SPEC, MATERIAL_MODEL, FPROBATCH, CREATE_TM, OP_FLAG)
VALUES (#{MSGID}, #{TIM}, #{ACT_WEIGHT}, #{THEO_WEIGHT}, #{MATERIAL_ID}, #{MATERIAL_NAME}, #{MATERIAL_SPEC}
, #{MATERIAL_MODEL}, #{FPROBATCH}, #{CREATE_TM}, #{OP_FLAG})
</insert>
<update id="updateWorkOrderRead" parameterType="java.util.List">
UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS"
SET OP_FLAG = '1'

35
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SpreaderDto.java

@ -0,0 +1,35 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author: lyd
* @Description: 布料机信息DO
* @Date: 2023/11/16
* 唯一ID
* 时间
* 称量重量
* 设定重量
* 当前生产产品编码
* 当前生产产品名称
* 当前生产砖型
* 当前生产型号
* 配料批次号
*/
@Data
public class SpreaderDto {
private String MSGID;
private String TIM;
private BigDecimal ACT_WEIGHT;
private BigDecimal THEO_WEIGHT;
private String MATERIAL_ID;
private String MATERIAL_NAME;
private String MATERIAL_SPEC;
private String MATERIAL_MODEL;
private String FPROBATCH;
private String CREATE_TM;
private String OP_FLAG;
private String OP_TM;
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java

@ -64,7 +64,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
} catch (Exception e) {
log.error("上报mes消耗泥料记录的数据:{}", mudObject);
log.error("上报mes消耗泥料记录失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(),
NoticeTypeEnum.EXCEPTION.getCode());
}
@ -198,7 +197,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
log.error("半成品入库-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("半成品入库返给MES的数据:{}", semiProductionInfoInDto);
log.error("半成品入库插入mes数据库失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("半成品入库插入mes数据库失败", "半成品入库"
+ semiProductionInfoInDto.getMSGID(), NoticeTypeEnum.EXCEPTION.getCode());
}
@ -242,7 +240,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
log.error("半成品出库-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("半成品出库返给MES的数据:{}", semiProductionInfoOutDto);
log.error("半成品出库插入mes数据库失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("半成品出库插入mes数据库失败", "半成品出库" + semiProductionInfoOutDto.getMSGID(),
NoticeTypeEnum.EXCEPTION.getCode());
}
@ -284,7 +281,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
log.error("入窑-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("入窑返给MES的数据:{}", gdyMaterialInDto);
log.error("入窑插入mes数据库失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("入窑插入mes数据库失败", "入窑" + gdyMaterialInDto.getMSGID(),
NoticeTypeEnum.EXCEPTION.getCode());
}
@ -326,7 +322,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
log.error("出窑-获取MES给的工单数据:{}", mesWorkOrderDto);
log.error("出窑返给MES的数据:{}", gdyMaterialOutDto);
log.error("出窑插入mes数据库失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("出窑插入mes数据库失败", "出窑" + gdyMaterialOutDto.getMSGID(),
NoticeTypeEnum.EXCEPTION.getCode());
}
@ -380,7 +375,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
log.error("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number);
log.error("插入mes机口判废数据库的数据:{}", mesUnusedDto);
log.error("插入机口判废失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("机口判废插入mes数据库失败", "机口判废" + mesUnusedDto.getMSGID(),
NoticeTypeEnum.EXCEPTION.getCode());
}
@ -402,7 +396,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
} catch (Exception e) {
log.error("插入压机检测数据:{}", mesQSPressMonitorData);
log.error("插入压机检测失败:{}", e.getMessage());
// todo:发送通知
noticeService.createNotice("压机检测插入mes数据库失败", "压机检测"
+ mesQSPressMonitorData.getBRICK_ID(), NoticeTypeEnum.EXCEPTION.getCode());
}
@ -443,6 +436,11 @@ public class WmsToMesServiceImpl implements WmsToMesService {
return mesRequestMapper.getCusterByName(custerName);
}
@Override
public void reportSpreaderInfoToMes(SpreaderDto spreaderDto) {
mesRequestMapper.reportSpreaderInfoToMes(spreaderDto);
}
/**
* 转换
*

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java

@ -63,4 +63,10 @@ public class SysInteractRecordController {
sysInteractRecordService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
//@SaCheckPermission("@el.check('sysInteractRecord:del')")
@GetMapping("/getAllName")
public ResponseEntity<Object> getAllName() {
return new ResponseEntity<>(sysInteractRecordService.getAllInteractName(), HttpStatus.OK);
}
}

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java

@ -11,6 +11,7 @@ import org.nl.wms.ext.record.service.dao.SysInteractRecord;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -77,4 +78,9 @@ public interface ISysInteractRecordService extends IService<SysInteractRecord> {
* @param maxRowsToDelete 最大删除数
*/
void deleteByRows(Param maxRowsToKeep, Param maxRowsToDelete);
/**
* 获取所有标题
*/
List<String> getAllInteractName();
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java

@ -3,6 +3,8 @@ package org.nl.wms.ext.record.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.ext.record.service.dao.SysInteractRecord;
import java.util.List;
/**
* @author lyd
* @date 2023-07-19
@ -12,4 +14,6 @@ public interface SysInteractRecordMapper extends BaseMapper<SysInteractRecord> {
void deleteByDay(String day);
void deleteByRows(String maxRowsToKeep, String maxRowsToDelete);
List<String> getAllInteractName();
}

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml

@ -9,4 +9,11 @@
<delete id="deleteByRows">
CALL DeleteRowsIfNeeded(#{maxRowsToKeep}, #{maxRowsToDelete})
</delete>
<select id="getAllInteractName" resultType="java.lang.String">
SELECT
DISTINCT interact_name
FROM
`sys_interact_record`
ORDER BY interact_name
</select>
</mapper>

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java

@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -42,10 +43,15 @@ public class SysInteractRecordServiceImpl extends ServiceImpl<SysInteractRecordM
@Override
public IPage<SysInteractRecord> queryAll(Map whereJson, PageQuery page){
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
String interactDirection = ObjectUtil.isNotEmpty(whereJson.get("interact_direction")) ? whereJson.get("interact_direction").toString() : null;
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry"))
? whereJson.get("blurry").toString() : null;
String interactDirection = ObjectUtil.isNotEmpty(whereJson.get("interact_direction"))
? whereJson.get("interact_direction").toString() : null;
String interactName = ObjectUtil.isNotEmpty(whereJson.get("interact_name"))
? whereJson.get("interact_name").toString() : null;
LambdaQueryWrapper<SysInteractRecord> lam = new LambdaQueryWrapper<>();
lam.eq(interactDirection!=null, SysInteractRecord::getDirection, interactDirection)
.eq(ObjectUtil.isNotEmpty(interactName), SysInteractRecord::getInteract_name, interactName)
.and(blurry != null, s -> s.like(SysInteractRecord::getInteract_name, blurry)
.or()
.like(SysInteractRecord::getMessage, blurry)
@ -155,4 +161,9 @@ public class SysInteractRecordServiceImpl extends ServiceImpl<SysInteractRecordM
sysInteractRecordMapper.deleteByRows(maxRowsToKeep.getValue(), maxRowsToDelete.getValue());
}
@Override
public List<String> getAllInteractName() {
return sysInteractRecordMapper.getAllInteractName();
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -196,6 +196,7 @@ public class PdaServiceImpl implements PdaService {
}
// 开工
bdWorkorder.setOperator(manualSortingDto.getUsername());
bdWorkorder.setRealproducestart_date(DateUtil.now());
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode());
TaskUtils.setWorkOrderUpdateByPC(bdWorkorder);
workorderService.updateById(bdWorkorder);
@ -216,6 +217,7 @@ public class PdaServiceImpl implements PdaService {
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工");
}
TaskUtils.setWorkOrderUpdateByPC(bdWorkorder);
bdWorkorder.setRealproduceend_date(DateUtil.now());
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode());
workorderService.updateById(bdWorkorder);
return PdaResponseVo.pdaResultOk("工单:[" + bdWorkorder.getWorkorder_code() + "]完工成功");

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.java

@ -30,7 +30,7 @@ public interface PdmBdWorkorderMapper extends BaseMapper<PdmBdWorkorder> {
List<PdmBdWorkorder> getTheDayUnProducedWorkOrder();
/**
* todo: 获取当天需要下发的工单
* mark: 获取当天需要下发的工单
* @return
*/
List<PdmBdWorkorder> getTheDayIssueWorkOrderList();

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java

@ -32,6 +32,7 @@ import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
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;
import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum;
@ -41,9 +42,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* @author lyd
@ -70,6 +71,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Autowired
private IMdBaseBrickInfoService baseBrickInfoService;
@Autowired
private ISchBaseTaskService taskService;
@Override
public IPage<PdmBdWorkorder> queryAll(PdmBdWorkorderQuery query, PageQuery page) {
@ -197,7 +200,7 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
// 设置开工人
pdmBdWorkorder.setOperator(ObjectUtil.isNotEmpty(SecurityUtils.getCurrentUser())
? SecurityUtils.getCurrentNickName() : "");
List<AcsWorkOrderVo> list = new CopyOnWriteArrayList<>();
List<AcsWorkOrderVo> list = new ArrayList<>();
// 重装数据回ACS,重新根据id找一遍,省的改动以上代码
AcsWorkOrderVo acsWorkOrderVo = pdmBdWorkorderMapper.toAcsWorkOrderById(pdmBdWorkorder.getWorkorder_id());
list.add(acsWorkOrderVo);
@ -253,8 +256,12 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
@Override
public boolean isEnoughCallEmpty(String deviceCode) {
// 计算搬运中的任务
// hint: 对应当前位置的问题,需要校验的是:包装位置到当前对接位的设备
int count = taskService.getEmptyVehicleCarryingByDevice(deviceCode);
PdmBdWorkorder workorder = this.getDeviceDockingProductionTask(deviceCode);
BigDecimal realQty = workorder.getReal_qty();
BigDecimal bigDecimal = new BigDecimal(count);
BigDecimal realQty = workorder.getReal_qty().add(bigDecimal);
BigDecimal planQty = workorder.getPlan_qty();
// 还可以叫空盘
return realQty.compareTo(planQty) < 0;
@ -314,7 +321,7 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
bdWorkorder.setUnqualified_qty(unqualified_qty);
this.updateById(bdWorkorder);
try {
// todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
// mark: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
wmsToMesService.reportPressUnusedMaterial(bdWorkorder);
} catch (Exception e) {
log.info("调用mes异常:{}", e.getMessage());

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -161,7 +161,8 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
lambda.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode)
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, value)
.eq(SchBaseVehiclematerialgroup::getIs_delete, false)
.notIn(SchBaseVehiclematerialgroup::getVehicle_type, list);
.notIn(SchBaseVehiclematerialgroup::getVehicle_type, list)
.orderByDesc(SchBaseVehiclematerialgroup::getUpdate_time);
List<SchBaseVehiclematerialgroup> selectOne = vehiclematerialgroupMapper.selectList(lambda);
return selectOne.size() > 0 ? selectOne.get(0) : null;
}

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java

@ -102,4 +102,11 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
void operation(Map<String, Object> param);
SchBaseTask getByCode(String taskCode);
/**
* 返回当前设备搬运木控盘的任务数量
* @param deviceCode
* @return
*/
int getEmptyVehicleCarryingByDevice(String deviceCode);
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java

@ -9,4 +9,5 @@ import org.nl.wms.sch.task.service.dao.SchBaseTask;
**/
public interface SchBaseTaskMapper extends BaseMapper<SchBaseTask> {
int getEmptyVehicleCarryingByDevice(String deviceCode);
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml

@ -2,4 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskMapper">
<select id="getEmptyVehicleCarryingByDevice" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
`sch_base_task` t
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code4
LEFT JOIN sch_base_point p2 ON p2.point_code = #{deviceCode}
WHERE t.config_code = 'FJMLTask'
AND t.point_code4 IS NOT NULL
AND t.task_status IN ('1', '2', '3', '4')
AND p1.parent_point_code = p2.parent_point_code
</select>
</mapper>

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -243,4 +243,9 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return this.getOne(lam);
}
@Override
public int getEmptyVehicleCarryingByDevice(String deviceCode) {
return schBaseTaskMapper.getEmptyVehicleCarryingByDevice(deviceCode);
}
}

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

@ -91,7 +91,7 @@ public abstract class AbstractTask {
//1、获取任务
//2、根据任务配置补全任务
//3、下发
List<AcsTaskDto> list = new CopyOnWriteArrayList<>();
List<AcsTaskDto> list = new ArrayList<>();
for (SchBaseTask task : taskList) {
AcsTaskDto taskDto = new AcsTaskDto();
String responseParam = task.getResponse_param();

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoRestorePoint.java

@ -27,5 +27,6 @@ public class AutoRestorePoint {
List<SchBasePoint> pointList = pointService.getAllUnlockAbnormalPoints();
pointList.forEach(point -> point.setIng_task_code(""));
pointService.updateBatchById(pointList);
log.info("自动恢复异常点位:{}", pointList);
}
}

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java

@ -105,11 +105,11 @@ public class CTQKTask extends AbstractTask {
task.setPoint_code1(point.getPoint_code());
task.setRemark("");
task.setVehicle_qty(point.getVehicle_qty());
task.setVehicle_type(GeneralDefinition.STEEL_TRAY);
task.setTask_status(TaskStatus.CREATED.getCode());
taskService.save(task);
// 点位更新
point.setIng_task_code(task.getTask_code());
pointService.update(point);
PointUtils.setUpdateByAcs(point);
pointService.updateById(point);
}
@ -186,7 +186,6 @@ public class CTQKTask extends AbstractTask {
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_FINISH);
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setFinished_type(taskFinishedType.getCode());
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
taskService.updateById(taskObj);

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java

@ -197,7 +197,6 @@ public class DTSKTask extends AbstractTask {
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setFinished_type(taskFinishedType.getCode());
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
taskService.updateById(taskObj);

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

@ -163,7 +163,7 @@ public class FJMKTask extends AbstractTask {
// 设置组盘 - 需要的话由子类自行实现
task.setGroup_id(setGroupPlate(jsonObject));
task.setPoint_code2(packagePoint.getPoint_code());
// 大于等于2就可以码
// 为0就呼叫
if (jsonObject.getInteger("special_param") == 0) {
/** 覆膜机木托盘位 */
SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject);

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java

@ -5,13 +5,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.CodeUtil;
import org.nl.config.MapOf;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.ext.acs.service.dto.SignalData;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest;
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.point.service.ISchBasePointService;
@ -25,11 +20,9 @@ import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
import org.nl.wms.sch.task_manage.task.AcsUtil;
import org.nl.wms.sch.task_manage.task.TaskType;
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.sch.task_manage.task.tasks.fj.mapper.FJMapper;
import org.nl.wms.util.CommonUtils;
import org.nl.wms.util.PointUtils;
import org.nl.wms.util.TaskUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,7 +30,6 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -100,7 +92,7 @@ public class FJQKTask extends AbstractTask {
// 设置起点并修改创建成功状态
task.setPoint_code1(point.getParent_point_code());
task.setTask_status(TaskStatus.CREATED.getCode());
// todo: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2
// mark: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2
task.setRemark("");
task.setGroup_id(point.getGroup_id());
task.setResponse_param(param.toJSONString());
@ -132,7 +124,7 @@ public class FJQKTask extends AbstractTask {
// 判断工单是否够
boolean enoughCallEmpty = workorderService.isEnoughCallEmpty(task.getPoint_code2());
if (!enoughCallEmpty) {
throw new BadRequestException("数量不足,不呼叫空盘");
throw new BadRequestException("所需数量已足够,不呼叫空盘");
}
SchBasePoint point = findStartPoint(startRegionStr, extGroupData);
if (ObjectUtil.isEmpty(point)) {
@ -153,7 +145,7 @@ public class FJQKTask extends AbstractTask {
task.setPoint_code1(point.getParent_point_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setResponse_param(param.toJSONString());
// todo: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2
// mark: 未确认是否放在1还是2,目前规定四点任务空盘的载具编码是2
task.setRemark("");
task.setGroup_id(point.getGroup_id());
taskService.save(task);

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java

@ -119,6 +119,7 @@ public class FJSLTask extends AbstractTask {
task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
task.setVehicle_type(GeneralDefinition.STEEL_TRAY);
TaskUtils.setUpdateByAcs(task);
taskService.save(task);

13
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java

@ -95,9 +95,6 @@ public class CYZCTask extends AbstractTask {
point.setIng_task_code(task.getTask_code());
PointUtils.setUpdateByAcs(point);
pointService.updateById(point);
//下发
//this.renotifyAcs(task);
}
}
@ -138,16 +135,16 @@ public class CYZCTask extends AbstractTask {
public String setGroupPlate(JSONObject param) {
// 查找组盘表信息,不做修改
String vehicleCode = TaskUtils.defaultVehicleCode(param.getString("vehicle_code"));
String vehicleType = param.getString("vehicle_type");
String vehicleType = GeneralDefinition.STEEL_TRAY;
if (ObjectUtil.isEmpty(vehicleCode)) {
throw new BadRequestException("载具号不能为空");
}
if (vehicleCode == null) {
vehicleType = GeneralDefinition.STEEL_TRAY;
}
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getGroupInfo(vehicleCode,
vehicleType, GroupBindMaterialStatusEnum.BOUND.getValue());
return ObjectUtil.isNotEmpty(one) ? one.getGroup_id() : "";
if (ObjectUtil.isEmpty(one)) {
throw new BadRequestException("载具号[" + vehicleCode + "]的组盘信息不存在");
}
return one.getGroup_id();
}
/**

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java

@ -80,6 +80,7 @@ public class GZYQLTask extends AbstractTask {
task.setPoint_code1(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
task.setVehicle_type(GeneralDefinition.STEEL_TRAY);
TaskUtils.setUpdateByAcs(task);
taskService.updateById(task);

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java

@ -216,12 +216,12 @@ public class YZSLTask extends AbstractTask {
taskObj.setRemark("执行中");
TaskUtils.setUpdateByAcs(taskObj);
taskService.updateById(taskObj);
// todo:暂时现在执行中的时候将满托上给mes
// mark:暂时现在执行中的时候将满托上给mes
wmsToMesService.reportProductData(taskObj.getGroup_id());
}
if (status.equals(TaskStatus.FINISHED)) { // 完成
this.finishTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
// todo: 完成后上报给MES
// mark: 完成后上报给MES
wmsToMesService.reportSemiProductionInfoIn(taskObj.getGroup_id());
}
if (status.equals(TaskStatus.CANCELED)) { // 取消

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml

@ -123,7 +123,7 @@ mybatis-plus:
configuration:
map-underscore-to-camel-case: false
jdbc-type-for-null: null
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.nl.config.mybatis.MyStdOutImpl
mapper-locations:
- classpath:org.nl.**.mapper/*.xml
global-config:

24
lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/PointCreate.java

@ -232,4 +232,28 @@ public class PointCreate {
}
pointService.saveBatch(pointList);
}
@Test
void BLJ() {
List<SchBasePoint> pointList = new ArrayList<>();
for (int i = 1; i <= 8; i++) {
String pointName = "布料机0";
String pointCode = "BLJ0";
pointName = pointName + i;
pointCode = pointCode + i;
SchBasePoint point = new SchBasePoint();
point.setPoint_code(pointCode);
point.setPoint_name(pointName);
point.setRegion_code("YZ");
point.setRegion_name("压制区域");
point.setParent_point_code("YJ0" + i);
point.setIs_has_workder(false);
point.setIs_auto(false);
point.setCreate_id("1");
point.setCreate_name("管理员");
point.setCreate_time(DateUtil.now());
pointList.add(point);
}
pointService.saveBatch(pointList);
}
}

21
lms/nladmin-ui/src/views/wms/ext/record/index.vue

@ -19,6 +19,16 @@
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="标题">
<el-select v-model="query.interact_name" placeholder="标题" clearable @change="crud.toQuery()">
<el-option
v-for="item in interact_name_list"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="请求方向">
<el-select v-model="query.interact_direction" placeholder="请求方向" clearable>
<el-option
@ -186,9 +196,13 @@ export default {
data() {
return {
permission: {},
rules: {}
rules: {},
interact_name_list: []
}
},
created() {
this.getNameList()
},
computed: {
formattedRequestParam: {
get() {
@ -223,6 +237,11 @@ export default {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
},
getNameList() {
crudSysInteractRecord.getAllName().then((res)=>{
this.interact_name_list = res
})
}
}
}

9
lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js

@ -23,5 +23,12 @@ export function edit(data) {
data
})
}
export function getAllName(params) {
return request({
url: 'api/sysInteractRecord/getAllName',
method: 'get',
params
})
}
export default { add, edit, del }
export default { add, edit, del, getAllName }

Loading…
Cancel
Save