diff --git a/lms/nladmin-system/doc/wms.xls b/lms/nladmin-system/doc/wms.xls index d3e88f6..99dc07d 100644 Binary files a/lms/nladmin-system/doc/wms.xls and b/lms/nladmin-system/doc/wms.xls differ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/SignalData.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/SignalData.java index 0b3b05c..86c0776 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/SignalData.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/SignalData.java @@ -14,5 +14,11 @@ public class SignalData { private String value; // 1 + public static SignalData buildSignalData(String code, String value) { + SignalData signalData = new SignalData(); + signalData.setCode(code); + signalData.setValue(value); + return signalData; + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseRequest.java index 7d96008..ee50697 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseRequest.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseRequest.java @@ -1,5 +1,7 @@ package org.nl.wms.ext.acs.service.dto.to; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import lombok.Data; import java.util.HashMap; @@ -47,4 +49,11 @@ public class BaseRequest { */ private Map parameters = new HashMap(); + public static BaseRequest createRequest() { + BaseRequest baseRequest = new BaseRequest(); + 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 beeb436..41d0937 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 @@ -27,6 +27,7 @@ import org.nl.wms.ext.acs.service.dto.to.acs.GetPalletizeResponse; import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.pdm.record.service.IPdmBdRequestMaterialRecordService; import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord; +import org.nl.wms.pdm.residue.service.IPdmBdMaterialResidueService; import org.nl.wms.pdm.track.service.IPdmBdProductionProcessTrackingService; import org.nl.wms.pdm.track.service.dao.PdmBdProductionProcessTracking; import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; @@ -93,6 +94,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private IPdmBdProductionProcessTrackingService processTrackingService; @Autowired private RedissonClient redissonClient; + @Autowired + private IPdmBdMaterialResidueService materialResidueService; @Override public BaseResponse acsApply(JSONObject param) { @@ -308,6 +311,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return requestNo; } + /** 反馈压机残留重量*/ + public BaseResponse applyFeedbackWeight(JSONObject param) { + ApplyTaskRequest applyTaskRequest = param.toJavaObject(ApplyTaskRequest.class); + materialResidueService.addByApplyTaskRequest(applyTaskRequest); + return BaseResponse.responseOk(applyTaskRequest.getRequestNo()); + } + /** 申请贴标 */ public BaseResponse applyLabelling(JSONObject param) { // 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期##成型工单号(mes提供压制工单) @@ -350,6 +360,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return BaseResponse.responseError(requestNo, "物料信息为空!"); } bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode()); + bdWorkorder.setRealproducestart_date(DateUtil.now()); workorderService.update(bdWorkorder); return BaseResponse.responseOk(requestNo); } @@ -366,6 +377,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return BaseResponse.responseError(requestNo, "物料信息为空!"); } bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode()); + bdWorkorder.setRealproduceend_date(DateUtil.now()); workorderService.update(bdWorkorder); return BaseResponse.responseOk(requestNo); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/controller/PdmBdMaterialResidueController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/controller/PdmBdMaterialResidueController.java new file mode 100644 index 0000000..3df312a --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/controller/PdmBdMaterialResidueController.java @@ -0,0 +1,66 @@ +package org.nl.wms.pdm.residue.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.base.TableDataInfo; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.logging.annotation.Log; +import org.nl.wms.pdm.residue.service.IPdmBdMaterialResidueService; +import org.nl.wms.pdm.residue.service.dao.PdmBdMaterialResidue; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; +import java.util.Set; +/** +* @author lyd +* @date 2023-07-28 +**/ +@Slf4j +@RestController +@Api(tags = "压机泥料剩余记录管理") +@RequestMapping("/api/pdmBdMaterialResidue") +public class PdmBdMaterialResidueController { + + @Autowired + private IPdmBdMaterialResidueService pdmBdMaterialResidueService; + + @GetMapping + @Log("查询压机泥料剩余记录") + @ApiOperation("查询压机泥料剩余记录") + //@SaCheckPermission("@el.check('pdmBdMaterialResidue:list')") + public ResponseEntity query(@RequestParam Map whereJson, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(pdmBdMaterialResidueService.queryAll(whereJson,page)),HttpStatus.OK); + } + + @PostMapping + @Log("新增压机泥料剩余记录") + @ApiOperation("新增压机泥料剩余记录") + //@SaCheckPermission("@el.check('pdmBdMaterialResidue:add')") + public ResponseEntity create(@Validated @RequestBody PdmBdMaterialResidue entity){ + pdmBdMaterialResidueService.create(entity); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改压机泥料剩余记录") + @ApiOperation("修改压机泥料剩余记录") + //@SaCheckPermission("@el.check('pdmBdMaterialResidue:edit')") + public ResponseEntity update(@Validated @RequestBody PdmBdMaterialResidue entity){ + pdmBdMaterialResidueService.update(entity); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除压机泥料剩余记录") + @ApiOperation("删除压机泥料剩余记录") + //@SaCheckPermission("@el.check('pdmBdMaterialResidue:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Set ids) { + pdmBdMaterialResidueService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/IPdmBdMaterialResidueService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/IPdmBdMaterialResidueService.java new file mode 100644 index 0000000..dfec403 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/IPdmBdMaterialResidueService.java @@ -0,0 +1,49 @@ +package org.nl.wms.pdm.residue.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.nl.common.domain.query.PageQuery; +import com.baomidou.mybatisplus.extension.service.IService; +import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest; +import org.nl.wms.pdm.residue.service.dao.PdmBdMaterialResidue; + +import java.util.Map; +import java.util.Set; + +/** +* @description 服务接口 +* @author lyd +* @date 2023-07-28 +**/ +public interface IPdmBdMaterialResidueService extends IService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param pageable 分页参数 + * @return IPage + */ + IPage queryAll(Map whereJson, PageQuery pageable); + + /** + * 创建 + * @param entity / + */ + void create(PdmBdMaterialResidue entity); + + /** + * 编辑 + * @param entity / + */ + void update(PdmBdMaterialResidue entity); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Set ids); + + /** + * 添加数据 + */ + void addByApplyTaskRequest(ApplyTaskRequest applyTaskRequest); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/PdmBdMaterialResidue.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/PdmBdMaterialResidue.java new file mode 100644 index 0000000..980ddbc --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/PdmBdMaterialResidue.java @@ -0,0 +1,46 @@ +package org.nl.wms.pdm.residue.service.dao; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** +* @description / +* @author lyd +* @date 2023-07-28 +**/ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("pdm_bd_material_residue") +public class PdmBdMaterialResidue implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "record_id", type = IdType.NONE) + @ApiModelProperty(value = "记录标识") + private String record_id; + + @ApiModelProperty(value = "泥料编码") + private String raw_material_code; + + @ApiModelProperty(value = "设备编码") + private String device_code; + + @ApiModelProperty(value = "泥料编码") + private String weight; + + @ApiModelProperty(value = "工单号") + private String workorder_code; + + @ApiModelProperty(value = "物料id") + private String material_id; + + @ApiModelProperty(value = "记录时间") + private String record_time; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.java new file mode 100644 index 0000000..da60465 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.java @@ -0,0 +1,12 @@ +package org.nl.wms.pdm.residue.service.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.pdm.residue.service.dao.PdmBdMaterialResidue; + +/** +* @author lyd +* @date 2023-07-28 +**/ +public interface PdmBdMaterialResidueMapper extends BaseMapper { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.xml new file mode 100644 index 0000000..2110a28 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dao/mapper/PdmBdMaterialResidueMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueDto.java new file mode 100644 index 0000000..dd40ff7 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueDto.java @@ -0,0 +1,34 @@ +package org.nl.wms.pdm.residue.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @description / +* @author lyd +* @date 2023-07-28 +**/ +@Data +public class PdmBdMaterialResidueDto implements Serializable { + + /** 记录标识 */ + private String record_id; + + /** 泥料编码 */ + private String raw_material_code; + + /** 设备编码 */ + private String device_code; + + /** 泥料编码 */ + private String weight; + + /** 工单号 */ + private String workorder_code; + + /** 物料id */ + private String material_id; + + /** 记录时间 */ + private String record_time; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueQuery.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueQuery.java new file mode 100644 index 0000000..90fff91 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/dto/PdmBdMaterialResidueQuery.java @@ -0,0 +1,12 @@ +package org.nl.wms.pdm.residue.service.dto; + +import org.nl.common.domain.query.BaseQuery; +import org.nl.wms.pdm.residue.service.dao.PdmBdMaterialResidue; + +/** +* @author lyd +* @date 2023-07-28 +**/ +public class PdmBdMaterialResidueQuery extends BaseQuery { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/impl/PdmBdMaterialResidueServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/impl/PdmBdMaterialResidueServiceImpl.java new file mode 100644 index 0000000..0b25678 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/residue/service/impl/PdmBdMaterialResidueServiceImpl.java @@ -0,0 +1,90 @@ +package org.nl.wms.pdm.residue.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.exception.BadRequestException; +import org.nl.common.utils.SecurityUtils; +import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest; +import org.nl.wms.pdm.residue.service.IPdmBdMaterialResidueService; +import org.nl.wms.pdm.residue.service.dao.mapper.PdmBdMaterialResidueMapper; +import org.nl.wms.pdm.residue.service.dao.PdmBdMaterialResidue; +import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; +import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; +import java.util.Set; + +/** +* @description 服务实现 +* @author lyd +* @date 2023-07-28 +**/ +@Slf4j +@Service +public class PdmBdMaterialResidueServiceImpl extends ServiceImpl implements IPdmBdMaterialResidueService { + + @Autowired + private PdmBdMaterialResidueMapper pdmBdMaterialResidueMapper; + @Autowired + private IPdmBdWorkorderService workorderService; + + @Override + public IPage queryAll(Map whereJson, PageQuery page){ + LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); + IPage pages = new Page<>(page.getPage() + 1, page.getSize()); + pdmBdMaterialResidueMapper.selectPage(pages, lam); + return pages; + } + + @Override + public void create(PdmBdMaterialResidue entity) { + entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr()); + entity.setRecord_time(DateUtil.now()); + pdmBdMaterialResidueMapper.insert(entity); + } + + @Override + public void update(PdmBdMaterialResidue entity) { + PdmBdMaterialResidue dto = pdmBdMaterialResidueMapper.selectById(entity.getRecord_id()); + if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!"); + String now = DateUtil.now(); + entity.setRecord_time(now); + + pdmBdMaterialResidueMapper.updateById(entity); + } + + @Override + public void deleteAll(Set ids) { + // 真删除 + pdmBdMaterialResidueMapper.deleteBatchIds(ids); + } + + @Override + public void addByApplyTaskRequest(ApplyTaskRequest applyTaskRequest) { + // 查找工单 + PdmBdWorkorder code = workorderService.getByCode(applyTaskRequest.getOrder_code()); + PdmBdMaterialResidue materialResidue = new PdmBdMaterialResidue(); + materialResidue.setRecord_id(IdUtil.getSnowflake(1,1).nextIdStr()); + if (ObjectUtil.isNotEmpty(code)) { + materialResidue.setMaterial_id(code.getMaterial_id()); + } + materialResidue.setWorkorder_code(applyTaskRequest.getOrder_code()); + materialResidue.setDevice_code(applyTaskRequest.getDevice_code()); + materialResidue.setRaw_material_code(applyTaskRequest.getMaterial_code()); + materialResidue.setWeight(applyTaskRequest.getWeight()); + materialResidue.setRecord_time(DateUtil.now()); + pdmBdMaterialResidueMapper.insert(materialResidue); + + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java index 9ca5064..b4d71f6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/IPdmBdWorkorderService.java @@ -47,4 +47,6 @@ public interface IPdmBdWorkorderService extends IService { * @return */ PdmBdWorkorder getDeviceProductionTask(String deviceCode); + + PdmBdWorkorder getByCode(String orderCode); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java index 00ff6e2..3d1bbff 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java @@ -16,6 +16,7 @@ import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.workorder.service.dao.mapper.PdmBdWorkorderMapper; import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery; +import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -65,11 +66,9 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl lam = new QueryWrapper().lambda(); + lam.eq(PdmBdWorkorder::getWorkorder_code, orderCode); + return pdmBdWorkorderMapper.selectOne(lam); + } + } 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 66fdca8..22e724e 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 @@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.CodeUtil; import org.nl.system.service.notice.ISysNoticeService; +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; @@ -28,6 +31,7 @@ import org.nl.wms.util.TaskUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -120,7 +124,13 @@ public class FJQKTask extends AbstractTask { SchBasePoint endPointObj = fjMapper.findPointForFJQK(startRegionStr, new JSONObject() .fluentPut("vehicleType", vehicleType).fluentPut("pointType", GeneralDefinition.DEVICE_POINT)); // todo: 请求ACS释放一个木托盘 -// AcsUtil.notifyAcs("", ) +// SignalData signalData = SignalData.buildSignalData("to_command", "1"); +// List signalList = new ArrayList<>(); +// signalList.add(signalData); +// PutActionRequest putActionRequest = (PutActionRequest) BaseRequest.createRequest(); +// putActionRequest.setDevice_code(endPointObj.getDevice_code()); +// putActionRequest.setList(signalList); +// AcsUtil.notifyAcs("", putActionRequest); // 这个点的父点位为起点 return ObjectUtil.isNotEmpty(endPointObj) ? endPointObj : null; } 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 b310d5e..9c89193 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 @@ -2,6 +2,7 @@ package org.nl.wms.sch.task_manage.task.tasks.yz; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -301,6 +303,13 @@ public class YZSLTask extends AbstractTask { processTracking.setProcess_location(endPoint); processTracking.setRecord_time(DateUtil.now()); processTrackingService.create(processTracking); + // 工单统计实际数量 + Integer materialQty = vehiclematerialgroup.getMaterial_qty(); + PdmBdWorkorder bdWorkorder = workorderService.getByCode(vehiclematerialgroup.getWorkorder_code()); + BigDecimal realQty = bdWorkorder.getReal_qty(); + bdWorkorder.setReal_qty(NumberUtil.add(realQty, materialQty)); + TaskUtils.setWorkOrderUpdateByType(bdWorkorder, taskFinishedType); + workorderService.updateById(bdWorkorder); } // 起点清空 PointUtils.setUpdateByType(startPointObj, taskFinishedType); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java index 70c5017..5090034 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; +import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.dao.SchBaseTask; @@ -63,6 +64,26 @@ public class TaskUtils { setGroupUpdateByPC(groupEntity); } } + public static void setWorkOrderUpdateByAcs(PdmBdWorkorder pdmBdWorkorder) { + pdmBdWorkorder.setUpdate_id(GeneralDefinition.ACS_ID); + pdmBdWorkorder.setUpdate_name(GeneralDefinition.ACS_NAME); + pdmBdWorkorder.setUpdate_time(DateUtil.now()); + } + + public static void setWorkOrderUpdateByPC(PdmBdWorkorder pdmBdWorkorder) { + pdmBdWorkorder.setUpdate_id(SecurityUtils.getCurrentUserId()); + pdmBdWorkorder.setUpdate_name(SecurityUtils.getCurrentNickName()); + pdmBdWorkorder.setUpdate_time(DateUtil.now()); + } + + // 根据类型去判断谁修改的 + public static void setWorkOrderUpdateByType(PdmBdWorkorder groupEntity, TaskFinishedTypeEnum taskFinishedType) { + if (taskFinishedType.equals(TaskFinishedTypeEnum.AUTO_ACS)) { + setWorkOrderUpdateByAcs(groupEntity); + } else { + setWorkOrderUpdateByPC(groupEntity); + } + } public static void setUpdateAuto(SchBaseTask taskObj) { diff --git a/lms/nladmin-ui/src/views/wms/pdm/residue/index.vue b/lms/nladmin-ui/src/views/wms/pdm/residue/index.vue new file mode 100644 index 0000000..c22a6c7 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/residue/index.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/pdm/residue/pdmBdMaterialResidue.js b/lms/nladmin-ui/src/views/wms/pdm/residue/pdmBdMaterialResidue.js new file mode 100644 index 0000000..f9fba98 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/residue/pdmBdMaterialResidue.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/pdmBdMaterialResidue', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/pdmBdMaterialResidue/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/pdmBdMaterialResidue', + method: 'put', + data + }) +} + +export default { add, edit, del }