diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java index 2856250..0028e78 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java @@ -75,9 +75,9 @@ public interface ISysNoticeService extends IService { /** * 写入信息 - * @param msg - * @param title - * @param type + * @param msg: 数据信息 + * @param title: 唯一 + * @param type: 类型 */ void createNotice(String msg, String title, String type); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index 99a3814..be9d474 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service; import com.alibaba.fastjson.JSONArray; import org.nl.wms.ext.acs.service.dto.ResultForAcs; +import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto; import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo; @@ -29,4 +30,11 @@ public interface WmsToAcsService { * @return */ ResultForAcs getVehicleForLaminatingMachine(List list); + + /** + * 获取设备状态 + * @param list + * @return + */ + ResultForAcs getDeviceStatusByCode(List list); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java index 2ae8554..35bff22 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java @@ -16,6 +16,7 @@ public class ApplyTaskResponse extends BaseResponse { * 是否优先包装 */ private String is_package; + private String mix_number; public static ApplyTaskResponse responseOk(String requestNo) { ApplyTaskResponse response = new ApplyTaskResponse(); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/DeviceInfoDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/DeviceInfoDto.java new file mode 100644 index 0000000..02af60d --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/DeviceInfoDto.java @@ -0,0 +1,13 @@ +package org.nl.wms.ext.acs.service.dto.to.acs; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/8/4 + */ +@Data +public class DeviceInfoDto { + private String device_code; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java index 1fa8b43..d926880 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java @@ -1,5 +1,7 @@ package org.nl.wms.ext.acs.service.dto.to.acs; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import lombok.Data; import org.nl.wms.ext.acs.service.dto.to.BaseRequest; import org.nl.wms.ext.acs.service.dto.SignalData; @@ -25,4 +27,11 @@ public class PutActionRequest extends BaseRequest { */ private List list; + public static PutActionRequest createRequest() { + PutActionRequest baseRequest = new PutActionRequest(); + baseRequest.setRequestNo(IdUtil.simpleUUID()); + baseRequest.setRequestDate(DateUtil.now()); + return baseRequest; + } + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index ed48c42..d7cf95a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -108,6 +108,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public BaseResponse acsApply(JSONObject param) { String requestNo = param.getString("requestNo"); + String requestMethodName = param.getString("request_medthod_name"); BaseResponse result = BaseResponse.build(requestNo); try { String requestMethodCode = param.getString("request_medthod_code"); // 获取请求方法名 @@ -125,11 +126,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result.setMessage(message); result.setRequestNo(requestNo); // 消息通知 - noticeService.createNotice("异常信息:" + message, "acsApply: " + requestNo, + noticeService.createNotice("异常信息:" + message, "acsApply: " + param.getString("request_medthod_code"), NoticeTypeEnum.EXCEPTION.getCode()); } // acs对接记录 - interactRecordService.saveRecord(param.getString("request_medthod_name"), param, result, GeneralDefinition.ACS_LMS); + interactRecordService.saveRecord(requestMethodName, param, result, GeneralDefinition.ACS_LMS); return result; } @@ -314,6 +315,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } /** 强制去包装位(半托) 记录不包装 --- 业务不需要*/ + @Deprecated public String forceNoPackage(JSONObject param) { String requestNo = param.getString("requestNo"); return requestNo; @@ -347,10 +349,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { PdmBdVehicleBinding vehicleBinding = new PdmBdVehicleBinding(); vehicleBinding.setOrigin_vehicle_code(request.getGet_station_vehicle_code()); vehicleBinding.setOrigin_vehicle_type(pickupPoint.getVehicle_type()); - vehicleBinding.setOrigin_qty(request.getGet_station_qty()); + vehicleBinding.setOrigin_qty(request.getGet_station_qty()); // 当前码垛位的数量 vehicleBinding.setTarget_vehicle_code(request.getPut_station_vehicle_code()); vehicleBinding.setTarget_vehicle_type(putPoint.getVehicle_type()); - vehicleBinding.setTarget_qty(request.getPut_station_qty()); + vehicleBinding.setTarget_qty(request.getPut_station_qty()); // 当前拆垛位的数量 if (productionTask != null) { vehicleBinding.setOrder_code(productionTask.getWorkorder_code()); } @@ -368,7 +370,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { /** 申请贴标 */ public BaseResponse applyLabelling(JSONObject param) { - // 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期##成型工单号(mes提供压制工单) + // 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期## todo: 成型工单号(未添加) String requestNo = param.getString("requestNo"); ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class); if (baseRequest.getVehicle_code() == null) { @@ -435,6 +437,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { /** 扫码成功申请 - 判断是否静置完成 */ public ApplyTaskResponse barcodeSuccessApply(JSONObject param) { ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class); + ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(baseRequest.getRequestNo()); String deviceCode = baseRequest.getDevice_code(); SchBasePoint basePoint = pointService.getById(deviceCode); // 获取点位实体 switch (basePoint.getRegion_code()) { @@ -443,7 +446,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { case GeneralDefinition.GZY: // 如果是入窑口就是记录数据 return this.recordKilnTime(baseRequest); // 直接返回 default: - return (ApplyTaskResponse) ApplyTaskResponse.responseError(baseRequest.getRequestNo(),"参数错误"); + taskResponse.setMessage("参数错误!"); + taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); + return taskResponse; } } @@ -454,29 +459,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(requestNo); SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code()); if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) { - return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "载具编码不能为空!"); + taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); + taskResponse.setMessage("载具编码不能为空!"); + return taskResponse; } if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) { - baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY); + baseRequest.setVehicle_type(GeneralDefinition.MATERIAL_CUP); } // 静置完成要把组盘改成以解绑 SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(), baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); if (ObjectUtil.isEmpty(one)) { // 返回400,物料不存在 - return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "物料不存在!"); + taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); + taskResponse.setMessage("组盘不存在或已静置完成!"); + return taskResponse; } String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码 // 获取当前工单 PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(yjDeviceCode); // 校验物料是否正确 if (ObjectUtil.isEmpty(productionTask)) { - return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, - "压机" + yjDeviceCode + "工单不存在!"); + taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); + taskResponse.setMessage("压机" + yjDeviceCode + "工单不存在!"); + return taskResponse; } String rawMaterialCode = productionTask.getRaw_material_code(); - if (!rawMaterialCode.equals(baseRequest.getMaterial_code())) { - return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "物料不一样!"); + if (!rawMaterialCode.equals(one.getRedundance_material_code())) { + taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST); + taskResponse.setMessage("物料不一样!"); + return taskResponse; } // 判断是否静置完成 @@ -490,6 +502,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); TaskUtils.setGroupUpdateByAcs(one); vehiclematerialgroupService.updateById(one); + taskResponse.setMix_number(one.getMix_times()); taskResponse.setIs_standing_finish(GeneralDefinition.YES); taskResponse.setMessage("静置完成"); return taskResponse; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index 58d37ce..788c946 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.http.HttpStatus; import lombok.extern.slf4j.Slf4j; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.acs.service.dto.ResultForAcs; +import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto; import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo; @@ -31,15 +32,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String api = "api/wms/order"; List list = new CopyOnWriteArrayList<>(); list.add(workorder); - ResultForAcs resultForAcs = ResultForAcs.requestOk(); - try { - resultForAcs = AcsUtil.notifyAcs(api, list); - } catch (Exception e) { - log.error(api + ": {}", e.getMessage()); - resultForAcs.setTimestamp(DateUtil.now()); - resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST); - resultForAcs.setMessage(e.getMessage()); - } + ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list); // 记录日志 interactRecordService.saveRecord("下发工单", workorder, resultForAcs, GeneralDefinition.LMS_ACS); return resultForAcs; @@ -48,17 +41,18 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public ResultForAcs getVehicleForLaminatingMachine(List list) { String api = "api/wms/order"; // todo: 地址未确认 - ResultForAcs resultForAcs = ResultForAcs.requestOk(); - try { - resultForAcs = AcsUtil.notifyAcs(api, list); - } catch (Exception e) { - log.error(api + ": {}", e.getMessage()); - resultForAcs.setTimestamp(DateUtil.now()); - resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST); - resultForAcs.setMessage(e.getMessage()); - } + ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list); // 记录日志 interactRecordService.saveRecord("下发信号传送空木托盘", list, resultForAcs, GeneralDefinition.LMS_ACS); return resultForAcs; } + + @Override + public ResultForAcs getDeviceStatusByCode(List list) { + String api = "api/wms/order"; // todo: 地址未确认 + ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list); + // 记录日志 + interactRecordService.saveRecord("获取设备状态", list, resultForAcs, GeneralDefinition.LMS_ACS); + return resultForAcs; + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java index 4f89a4f..885ba31 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.wms.ext.record.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpStatus; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -23,6 +24,7 @@ import org.springframework.stereotype.Service; import java.util.Date; import java.util.Map; import java.util.Set; +import java.util.function.Consumer; /** * @description 服务实现 @@ -38,7 +40,17 @@ public class SysInteractRecordServiceImpl extends ServiceImpl 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; LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); + lam.eq(interactDirection!=null, SysInteractRecord::getDirection, interactDirection) + .and(blurry != null, s -> s.like(SysInteractRecord::getInteract_name, blurry) + .or() + .like(SysInteractRecord::getMessage, blurry) + .or() + .like(SysInteractRecord::getRequest_param, blurry) + .or() + .like(SysInteractRecord::getResponse_param, blurry)); lam.orderByDesc(SysInteractRecord::getRecord_time); IPage pages = new Page<>(page.getPage() + 1, page.getSize()); sysInteractRecordMapper.selectPage(pages, lam); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java index 0d730b0..efcbe14 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -35,7 +35,6 @@ public class PdaController { @PostMapping("/deviceCheck/verify") @Log("设备点检") @ApiOperation("设备点检") - @SaIgnore public ResponseEntity deviceCheck(@Validated @RequestBody DasDeviceCheckRecord entity){ return new ResponseEntity<>(deviceCheckRecordService.create(entity), HttpStatus.OK); } @@ -43,7 +42,6 @@ public class PdaController { @PostMapping("/deviceCheck/deviceInfo") @Log("设备下拉框数据") @ApiOperation("设备下拉框数据") - @SaIgnore public ResponseEntity deviceInfo(){ return new ResponseEntity<>(pdaService.getDeviceInfo(), HttpStatus.OK); } @@ -51,7 +49,6 @@ public class PdaController { @PostMapping("/deviceCheck/deviceStatus") @Log("设备状态下拉框数据") @ApiOperation("设备状态下拉框数据") - @SaIgnore public ResponseEntity deviceStatus(){ return new ResponseEntity<>(pdaService.getDeviceStatus(), HttpStatus.OK); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml index 8e2f782..a53620f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml @@ -36,6 +36,7 @@ w.point_code AS device_code, w.plan_qty, m.half_material_code AS material_code, + 0 AS to_material_code, 0 AS a, 0 AS b, 0 AS h, diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java index 065a08a..b057da2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java @@ -12,6 +12,7 @@ public class AcsWorkOrderVo { private String workorder_code; private String device_code; private String material_code; + private String to_material_code; private String plan_qty; private String a; private String b; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java index 3944171..e3904b3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java @@ -15,7 +15,7 @@ import java.util.Map; /** * @Author: lyd - * @Description: + * @Description: 报表实现类 * @Date: 2023/7/21 */ @Slf4j diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java index 133025d..8a1c6f3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java @@ -111,6 +111,13 @@ public abstract class AbstractTask { resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST); resultForAcs.setMessage(e.getMessage()); } + // 如果下发完毕,就修改状态 + if (resultForAcs.getStatus() == 200) { + for (SchBaseTask schBaseTask : taskList) { + schBaseTask.setTask_status(TaskStatus.ISSUED.getCode()); + } + taskService.updateBatchById(taskList); + } // 记录日志 interactRecordService.saveRecord("下发任务", list, resultForAcs, GeneralDefinition.LMS_ACS); return resultForAcs; @@ -132,6 +139,16 @@ public abstract class AbstractTask { public void schedule() { this.autoCreate(); this.create(); + // 下发 + this.getAllFinishTask(); + } + + public void getAllFinishTask() { + List list = taskService.list(new LambdaQueryWrapper() + .eq(SchBaseTask::getTask_status, TaskStatus.CREATED.getCode())); + if (ObjectUtil.isEmpty(list)) return; + // 下发 + this.renotifyAcs(list); } public void updateTaskStatus(String task_code, TaskStatus status) { @@ -216,7 +233,7 @@ public abstract class AbstractTask { taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction()); Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn, - "该点位申请的任务未完成数已超过上限,无法申请任务"); + apply_point_code + "该点位申请的任务未完成数已超过上限,无法申请任务"); // 获取对接位点位对象 SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper() .eq(SchBasePoint::getPoint_code, apply_point_code)); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java index c472d52..4469ea7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java @@ -34,13 +34,13 @@ public class AcsUtil { //判断是否连接ACS系统 Param isConnectAcs = sysParamService.findByCode(GeneralDefinition.IS_CONNECT_ACS); if (ObjectUtil.isEmpty(isConnectAcs)) { - throw new BadRequestException("参数表中:" + GeneralDefinition.IS_CONNECT_ACS + "不存在"); + return ResultForAcs.requestRefuse("参数表中:" + GeneralDefinition.IS_CONNECT_ACS + "不存在"); } String isConnect = isConnectAcs.getValue(); //ACS地址:127.0.0.1:8010 Param acsUrlObj = sysParamService.findByCode(GeneralDefinition.ACS_URL); if (ObjectUtil.isEmpty(acsUrlObj)) { - throw new BadRequestException("参数表中:" + GeneralDefinition.ACS_URL + "不存在"); + return ResultForAcs.requestRefuse("参数表中:" + GeneralDefinition.ACS_URL + "不存在"); } String acsUrl = acsUrlObj.getValue(); JSONObject result; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/auto/HLYZTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/auto/HLYZTask.java deleted file mode 100644 index 827c727..0000000 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/auto/HLYZTask.java +++ /dev/null @@ -1,108 +0,0 @@ -//package org.nl.wms.sch.task_manage.task.tasks.auto; -// -//import cn.hutool.core.util.ObjectUtil; -//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -//import org.nl.common.exception.BadRequestException; -//import org.nl.system.service.param.ISysParamService; -//import org.nl.system.service.param.dao.Param; -//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.service.ISchBaseTaskconfigService; -//import org.nl.wms.sch.task.service.dao.SchBaseTask; -//import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; -//import org.nl.wms.sch.task_manage.AbstractTask; -//import org.nl.wms.sch.task_manage.GeneralDefinition; -//import org.nl.wms.sch.task_manage.task.TaskType; -//import org.nl.wms.sch.task_manage.task.core.TaskStatus; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.stereotype.Component; -// -//import java.util.Arrays; -//import java.util.List; -//import java.util.stream.Collectors; -// -///** -// * @Author: lyd -// * @Description: 混料压制物料输送任务 -// * @Date: 2023/7/27 -// */ -//@Component -//@TaskType("HLYZTask") -//public class HLYZTask extends AbstractTask { -// private static String TASK_CONFIG_CODE = "HLYZTask"; -// @Autowired -// private ISchBasePointService pointService; -// @Autowired -// private ISchBaseTaskService taskService; -// @Autowired -// private ISchBaseTaskconfigService taskConfigService; -// @Autowired -// private ISysParamService paramService; -// @Override -// protected void create() throws BadRequestException { -// -// } -// -// @Override -// protected void autoCreate() { -// // 自动创建任务 -//// Param autoKilnCall = paramService.findByCode(GeneralDefinition.AUTO_KILN_CALL); -//// if (autoKilnCall.getValue().equals(GeneralDefinition.NO)) { -//// return; -//// } -// // 判断当前点位有没有任务执行 -// List unFinishTasksByTaskConfig = taskService.findUnFinishTasksByTaskConfig(TASK_CONFIG_CODE); -// if (unFinishTasksByTaskConfig.size() > 0) { -// // 有任务在执行就不创建 -// return; -// } -// // 获取任务配置 -// SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() -// .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); -// // 创建任务 -// SchBaseTask task = new SchBaseTask(); // 任务实体 -// // 2、创建申请任务 -// task.setConfig_code(TASK_CONFIG_CODE); -// task.setCreate_mode(GeneralDefinition.AUTO_CREATION); -// task.setTask_status(TaskStatus.APPLY.getCode()); -// task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码 -// // 设置起/终点 -// this.setTaskPoint(taskConfig, task, "***"); -// // 找起点 -// List nextRegionStr = Arrays -// .stream(taskConfig.getNext_region_str().split(",")) -// .collect(Collectors.toList()); -// SchBasePoint point = findNextPoint(nextRegionStr); -// if (ObjectUtil.isEmpty(point)) { -// task.setRemark("未找到所需点位!"); -// taskService.create(task); -// // 消息通知 -// return; -// } -// // 设置终点并修改创建成功状态 -// task.setPoint_code2(point.getPoint_code()); -// task.setRemark(""); -// task.setTask_status(TaskStatus.CREATED.getCode()); -// taskService.create(task); -// point.setIng_task_code(task.getTask_code()); -// pointService.update(point); -// //下发 -//// this.renotifyAcs(task); -// } -// -// @Override -// protected void updateStatus(String task_code, TaskStatus status) { -// -// } -// -// @Override -// public void forceFinish(String task_code) { -// -// } -// -// @Override -// public void cancel(String task_code) { -// -// } -//} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java index 6347f33..0ca0c78 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java @@ -80,7 +80,7 @@ public class CTQKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java index 16d2a2c..64c9e98 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java @@ -81,7 +81,7 @@ public class DTSKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java index fe76b93..03e4ad6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java @@ -124,40 +124,35 @@ public class FJMKTask extends AbstractTask { pointService.updateById(basePoint); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } @Override public String setGroupPlate(JSONObject param) { + // 载具编码从点位中获取 // 组盘,返回组盘标识,设置待绑定,搬运结束就设置已绑定 - String vehicleCode = param.getString("vehicle_code"); - if (vehicleCode == null) { - throw new BadRequestException("载具编码不能为空"); - } - String vehicleType = param.getString("vehicle_type"); - String workorderCode = param.getString("workorder_code"); JSONObject stackParameters = param.getJSONObject("palletize"); - if (vehicleType == null) { - vehicleType = GeneralDefinition.STEEL_TRAY; - } String deviceCode = param.getString("device_code"); + String isFull = param.getString("is_full"); + if (isFull == null) { + isFull = GeneralDefinition.YES; + } // 砖块数量 Integer qty = param.getInteger("qty"); SchBasePoint basePoint = pointService.getById(deviceCode); - PdmBdWorkorder workorderObject = ObjectUtil.isNotEmpty(workorderCode) - ? workorderService.getOne(new LambdaQueryWrapper() - .eq(PdmBdWorkorder::getWorkorder_code, workorderCode)) - : null; + PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code()); + String vehicleCode = basePoint.getVehicle_code(); + String vehicleType = basePoint.getVehicle_type(); // 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入 + SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); + groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType, GroupBindMaterialStatusEnum.BOUND.getValue(), workorderObject.getMaterial_id()); if (groupObject != null) { - return groupObject.getGroup_id(); + groupEntity = groupObject; } // 要把数据存到组盘表 - SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); - groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderObject) ? workorderObject.getMaterial_id() : ""); @@ -183,9 +178,8 @@ public class FJMKTask extends AbstractTask { groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 groupEntity.setIs_delete(false); + groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES) ? true : false); vehiclematerialgroupService.save(groupEntity); - // 将所有当前位置的砖块设置组盘标识 -// baseBrickInfoService.setGroupByCurrentAllBrick(deviceCode, groupEntity.getGroup_id()); // 返回组盘id记录任务中 return groupEntity.getGroup_id(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java index 2265f35..ccabf15 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java @@ -104,7 +104,7 @@ public class FJQKTask extends AbstractTask { pointService.updateById(basePoint); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java index cbe3076..50aa426 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java @@ -99,7 +99,7 @@ public class FJQLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } @@ -119,7 +119,7 @@ public class FJQLTask extends AbstractTask { : null; Assert.notNull(workOrder, "工单不能为空!"); // 从所选区域中,选择满料位、无锁、可用的点位 - List points = fjMapper.findPointForFJQL(startRegionStr, workOrder.getRaw_material_code()); + List points = fjMapper.findPointForFJQL(startRegionStr, workOrder.getMaterial_id()); return ObjectUtil.isNotEmpty(points) ? points.get(0) : null; } @@ -177,7 +177,7 @@ public class FJQLTask extends AbstractTask { PointUtils.setUpdateByType(startPointObj, taskFinishedType); PointUtils.clearPoint(startPointObj); SchBaseVehiclematerialgroup vehicleMaterialGroupObj = - vehiclematerialgroupService.getById(taskObj.getGroup_id()); + vehiclematerialgroupService.getById(taskObj.getGroup_id()); // 等到变成空盘才能解除 // vehicleMaterialGroupObj.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); vehicleMaterialGroupObj.setPoint_code(endPointObj.getPoint_code()); // 当前位置 @@ -196,7 +196,7 @@ public class FJQLTask extends AbstractTask { // 终点设置对应的参数 endPointObj.setVehicle_code(startPointObj.getVehicle_code()); endPointObj.setVehicle_type(startPointObj.getVehicle_type()); - endPointObj.setPoint_status(PointStatusEnum.FULL_POINT.getCode()); + endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode()); PointUtils.setUpdateByType(endPointObj, taskFinishedType); pointService.updateById(endPointObj); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java index 527e5f8..1a570b0 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java @@ -85,7 +85,7 @@ public class FJRKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java index 95cccce..bd31555 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java @@ -86,7 +86,7 @@ public class FJSKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java index af843a8..baa5560 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java @@ -56,7 +56,7 @@ public class FJSLTask extends AbstractTask { private ISysNoticeService noticeService; @Override protected void create() throws BadRequestException { -// 获取任务 + // 获取任务 List tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); // 配置信息 SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() @@ -89,7 +89,7 @@ public class FJSLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java index 55d93ce..8e606c6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java @@ -136,7 +136,7 @@ public class HNMLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); +// this.renotifyAcs(task); } } @@ -234,7 +234,7 @@ public class HNMLTask extends AbstractTask { } } // 更新组盘数据 - groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); TaskUtils.setGroupUpdateByType(groupEntity, taskFinishedType); vehiclematerialgroupService.updateById(groupEntity); // 起点清空 - 由ACS请求修改 @@ -273,7 +273,7 @@ public class HNMLTask extends AbstractTask { String vehicleType = param.getString("vehicle_type"); // 泥料物料对应不出物料标识 String materialCode = param.getString("material_code"); // 泥料编码 - String mixTimes = param.getString("grinding_number"); // 碾次 + String mixTimes = param.getString("mix_number"); // 碾次 // 载具类型默认料盅 if (vehicleType == null) { vehicleType = GeneralDefinition.MATERIAL_CUP; @@ -286,15 +286,16 @@ public class HNMLTask extends AbstractTask { if (vehicleCode == null) { throw new BadRequestException("载具编码不能为空"); } + SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); + groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); // 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入 + // 找到不直接返回,用那条数据进行修改 SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType, GroupBindMaterialStatusEnum.BOUND.getValue()); if (groupObject != null) { - return groupObject.getGroup_id(); + groupEntity = groupObject; } // 要把数据存到组盘表 - SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); - groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); groupEntity.setMaterial_id("-"); groupEntity.setRedundance_material_code(materialCode); groupEntity.setCreate_id(GeneralDefinition.ACS_ID); @@ -314,7 +315,7 @@ public class HNMLTask extends AbstractTask { groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 待绑定 groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 groupEntity.setIs_delete(false); - vehiclematerialgroupService.save(groupEntity); + vehiclematerialgroupService.saveOrUpdate(groupEntity); return groupEntity.getGroup_id(); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java index b2c1fc5..c9da883 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java @@ -94,7 +94,7 @@ public class CYZCTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java index 37c674c..34e2016 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java @@ -19,6 +19,7 @@ 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.TaskType; import org.nl.wms.sch.task_manage.task.core.TaskStatus; +import org.nl.wms.sch.task_manage.task.tasks.yz.mapper.YZMapper; import org.nl.wms.util.PointUtils; import org.nl.wms.util.TaskUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +48,8 @@ public class GZYQLTask extends AbstractTask { @Autowired private ISysNoticeService noticeService; + @Autowired + private YZMapper yzMapper; @Override protected void create() throws BadRequestException { // 获取任务 @@ -82,12 +85,23 @@ public class GZYQLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } + /** + * 找到有货最多的那层搬运到入窑口 + * @param startRegionStr + * @param jsonObject + * @return + */ private SchBasePoint findStartPoint(List startRegionStr, JSONObject jsonObject) { // 无需工单 + // 判断是使用desc还是asc + int countUp = yzMapper.countConveyorLine(startRegionStr.get(0), GeneralDefinition.UPPER_CONVEYOR_LINE, + PointStatusEnum.EMPTY_VEHICLE.getCode()); + int countLower = yzMapper.countConveyorLine(startRegionStr.get(0), GeneralDefinition.LOWER_CONVEYOR_LINE, + PointStatusEnum.EMPTY_VEHICLE.getCode()); // 默认认为缓存线有东西 LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); lam.in(SchBasePoint::getRegion_code, startRegionStr) @@ -96,7 +110,8 @@ public class GZYQLTask extends AbstractTask { .or() .eq(SchBasePoint::getIng_task_code, "")) .eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_VEHICLE.getCode()) - .eq(SchBasePoint::getIs_used, true); + .eq(SchBasePoint::getIs_used, true) + .orderBy(true, countUp > countLower, SchBasePoint::getPoint_code);; List schBasePoints = pointService.list(lam); return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java index 454f681..37c4305 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java @@ -83,7 +83,7 @@ public class YZQKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java index 0c749ad..33ae01a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java @@ -88,7 +88,7 @@ public class YZSKTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java index b79a450..9f9c0f2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java @@ -106,7 +106,7 @@ public class YZSLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); + //this.renotifyAcs(task); } } @@ -198,7 +198,6 @@ public class YZSLTask extends AbstractTask { throw new BadRequestException("载具编码不能为空"); } String vehicleType = param.getString("vehicle_type"); - String workorderCode = param.getString("workorder_code"); JSONObject stackParameters = param.getJSONObject("palletize"); if (vehicleType == null) { vehicleType = GeneralDefinition.STEEL_TRAY; @@ -211,10 +210,7 @@ public class YZSLTask extends AbstractTask { // 砖块数量 Integer qty = param.getInteger("qty"); SchBasePoint basePoint = pointService.getById(deviceCode); - PdmBdWorkorder workorderObject = ObjectUtil.isNotEmpty(workorderCode) - ? workorderService.getOne(new LambdaQueryWrapper() - .eq(PdmBdWorkorder::getWorkorder_code, workorderCode)) - : null; + PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code()); // 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入 SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType, GroupBindMaterialStatusEnum.WAIT_BIND.getValue(), workorderObject.getMaterial_id()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java index 3eaadb8..c01429a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java @@ -44,7 +44,7 @@ public class CommonUtils { // 请求ACS释放一个木托盘 public static List requestAcsReleaseVehicle(HashMap map, String deviceCode) { List list = new CopyOnWriteArrayList<>(); - PutActionRequest putActionRequest = (PutActionRequest) BaseRequest.createRequest(); + PutActionRequest putActionRequest = PutActionRequest.createRequest(); putActionRequest.setDevice_code(deviceCode); List signalList = new CopyOnWriteArrayList<>(); for (Map.Entry entry : map.entrySet()) { diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/XmlFormatter.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/XmlFormatter.java new file mode 100644 index 0000000..8f35f59 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/XmlFormatter.java @@ -0,0 +1,100 @@ +package org.nl.wms.util; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * @Author: lyd + * @Description: 将xml字符串存入xml文件中 + * @Date: 2023/8/7 + */ +public class XmlFormatter { + public static void main(String[] args) { + String xmlString = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n"; + + // 格式化XML字符串 + String formattedXmlString = formatXmlString(xmlString); + + // 将格式化后的XML字符串存储到文件中 + String fileName = "xx.xml"; + saveXmlToFile(fileName, formattedXmlString); + } + + public static String formatXmlString(String xmlString) { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document document = builder.parse(new InputSource(new java.io.StringReader(xmlString))); + + // 格式化XML + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + DOMSource source = new DOMSource(document); + + java.io.StringWriter sw = new java.io.StringWriter(); + StreamResult result = new StreamResult(sw); + transformer.transform(source, result); + + return sw.toString(); + } catch (ParserConfigurationException | IOException | SAXException | TransformerException e) { + e.printStackTrace(); + } + return xmlString; + } + + public static void saveXmlToFile(String fileName, String xmlString) { + try { + File file = new File(fileName); + FileWriter writer = new FileWriter(file); + writer.write(xmlString); + writer.flush(); + writer.close(); + System.out.println("XML file saved successfully."); + } catch (IOException e) { + e.printStackTrace(); + } + } +} + diff --git a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java index 776a0c2..266e1d7 100644 --- a/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java +++ b/lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java @@ -58,4 +58,18 @@ public class test { // return g; // } + @Test + void test03() { + try { + for (int i = 0; i < 5; i++) { + System.out.println(i); + if (i==3) { + throw new RuntimeException("1"); + } + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + } diff --git a/lms/nladmin-ui/src/views/wms/das/inKiln/index.vue b/lms/nladmin-ui/src/views/wms/das/inKiln/index.vue index 7157856..083ee86 100644 --- a/lms/nladmin-ui/src/views/wms/das/inKiln/index.vue +++ b/lms/nladmin-ui/src/views/wms/das/inKiln/index.vue @@ -13,14 +13,6 @@ - - - @@ -40,7 +32,7 @@ export default { mixins: [presenter(), header(), crud()], cruds() { return CRUD({ - title: '入窑记录报表', + title: '窑内记录报表', url: 'api/report/inKilnReport', optShow: { add: false, diff --git a/lms/nladmin-ui/src/views/wms/das/inspection/index.vue b/lms/nladmin-ui/src/views/wms/das/inspection/index.vue index 083a5bd..5ba1d0d 100644 --- a/lms/nladmin-ui/src/views/wms/das/inspection/index.vue +++ b/lms/nladmin-ui/src/views/wms/das/inspection/index.vue @@ -40,14 +40,6 @@ - - - diff --git a/lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue b/lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue index e597214..a7cc2de 100644 --- a/lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue +++ b/lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue @@ -14,14 +14,6 @@ - - - diff --git a/lms/nladmin-ui/src/views/wms/das/outKiln/index.vue b/lms/nladmin-ui/src/views/wms/das/outKiln/index.vue index ebc2c41..2f9da86 100644 --- a/lms/nladmin-ui/src/views/wms/das/outKiln/index.vue +++ b/lms/nladmin-ui/src/views/wms/das/outKiln/index.vue @@ -14,14 +14,6 @@ - - - diff --git a/lms/nladmin-ui/src/views/wms/ext/record/index.vue b/lms/nladmin-ui/src/views/wms/ext/record/index.vue index eb2cdbc..3a0ebd1 100644 --- a/lms/nladmin-ui/src/views/wms/ext/record/index.vue +++ b/lms/nladmin-ui/src/views/wms/ext/record/index.vue @@ -2,6 +2,36 @@
+
+ + + + + + + + + + + + +