diff --git a/lms/nladmin-system/doc/wms.xls b/lms/nladmin-system/doc/wms.xls index 99dc07d..9f3fd9e 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/common/exception/handler/GlobalExceptionHandler.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/exception/handler/GlobalExceptionHandler.java index 9e3bbc5..e1a0029 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/exception/handler/GlobalExceptionHandler.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/exception/handler/GlobalExceptionHandler.java @@ -21,6 +21,9 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.exception.EntityExistException; import org.nl.common.exception.EntityNotFoundException; import org.nl.common.utils.ThrowableUtil; +import org.nl.system.service.notice.ISysNoticeService; +import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -39,6 +42,17 @@ import static org.springframework.http.HttpStatus.NOT_FOUND; @RestControllerAdvice public class GlobalExceptionHandler { + @Autowired + private ISysNoticeService noticeService; + + @ExceptionHandler(NullPointerException.class) + public ResponseEntity handleNullPointerException(NullPointerException ex) { + // 在这里处理空指针异常 + noticeService.createNotice("异常信息:" + ex.getMessage(), "空指针异常发", + NoticeTypeEnum.EXCEPTION.getCode()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("空指针异常发生了"); + } + /** * 处理所有不可知的异常 */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/FeedBackSplitPalletStationRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/FeedBackSplitPalletStationRequest.java new file mode 100644 index 0000000..0be5f70 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/FeedBackSplitPalletStationRequest.java @@ -0,0 +1,48 @@ +package org.nl.wms.ext.acs.service.dto.to.wms; + +import lombok.Data; +import org.nl.wms.ext.acs.service.dto.to.BaseRequest; + +/** + * @Author: lyd + * @Description: 分拣反馈记录木托盘与钢托盘的绑定 + * @Date: 2023/7/31 + */ +@Data +public class FeedBackSplitPalletStationRequest extends BaseRequest { + + /** + * 取货点位 + */ + private String get_station; + + /** + * 放货点位 + */ + private String put_station; + + + /** + * 取货点位载具号 + */ + private String get_station_vehicle_code; + + + /** + * 放货点位载具号 + */ + private String put_station_vehicle_code; + + /** + * 取货点当前数量 + */ + private String get_station_qty; + + /** + * 放货点当前数量 + */ + private String put_station_qty; + + +} + 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 f1c77e0..dbdf01a 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 @@ -18,6 +18,7 @@ import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.ext.acs.service.dto.*; import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest; +import org.nl.wms.ext.acs.service.dto.to.wms.FeedBackSplitPalletStationRequest; import org.nl.wms.ext.acs.service.dto.to.wms.FeedBackTaskStatusRequest; import org.nl.wms.ext.acs.service.dto.to.wms.GetPalletizeRequest; import org.nl.wms.ext.acs.service.dto.to.BaseResponse; @@ -30,6 +31,8 @@ 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.vehiclebiding.service.IPdmBdVehicleBindingService; +import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; @@ -96,6 +99,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private RedissonClient redissonClient; @Autowired private IPdmBdMaterialResidueService materialResidueService; + @Autowired + private IPdmBdVehicleBindingService vehicleBindingService; @Override public BaseResponse acsApply(JSONObject param) { @@ -311,6 +316,38 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return requestNo; } + /** 分拣 - 记录钢托与木托的绑定 */ + public BaseResponse recordVehicleBiding(JSONObject param) { + FeedBackSplitPalletStationRequest request = param.toJavaObject(FeedBackSplitPalletStationRequest.class); + String getStation = request.getGet_station(); // 取货点 + String putStation = request.getPut_station(); // 放货点 + // 查找当前点位中的信息,如果acs没有提供,就获取点位上的数据,如果点位没有,则数据失效 + SchBasePoint pickupPoint = pointService.getById(getStation); + SchBasePoint putPoint = pointService.getById(putStation); + if (request.getGet_station_vehicle_code() == null) { + request.setGet_station_vehicle_code(pickupPoint.getVehicle_code()); + } + if (request.getPut_station_vehicle_code() == null) { + request.setPut_station_vehicle_code(putPoint.getVehicle_code()); + } + // 获取工单 + PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(pickupPoint.getParent_point_code()); + // 插入数据 + 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.setTarget_vehicle_code(request.getPut_station_vehicle_code()); + vehicleBinding.setTarget_vehicle_type(putPoint.getVehicle_type()); + vehicleBinding.setTarget_qty(request.getPut_station_qty()); + if (productionTask != null) { + vehicleBinding.setOrder_code(productionTask.getWorkorder_code()); + } + vehicleBindingService.create(vehicleBinding); + return BaseResponse.responseOk(request.getRequestNo()); + + } + /** 反馈压机残留重量*/ public BaseResponse applyFeedbackWeight(JSONObject param) { ApplyTaskRequest applyTaskRequest = param.toJavaObject(ApplyTaskRequest.class); @@ -351,34 +388,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { /** 人工排产确认 */ public BaseResponse orderVerify(JSONObject param) { // 执行中 String requestNo = param.getString("requestNo"); - String workorderId = param.getString("workorder_id"); - if (workorderId == null) { + String workorderCode = param.getString("order_code"); + if (workorderCode == null) { return BaseResponse.responseError(requestNo, "工单标识不能为空!"); } - PdmBdWorkorder bdWorkorder = workorderService.getById(workorderId); + PdmBdWorkorder bdWorkorder = workorderService.getByCode(workorderCode); if (bdWorkorder == null) { return BaseResponse.responseError(requestNo, "物料信息为空!"); } bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode()); bdWorkorder.setRealproducestart_date(DateUtil.now()); - workorderService.update(bdWorkorder); + TaskUtils.setWorkOrderUpdateByAcs(bdWorkorder); + workorderService.updateById(bdWorkorder); return BaseResponse.responseOk(requestNo); } /** 工单完成 */ public BaseResponse orderFinish(JSONObject param) { // 完成 String requestNo = param.getString("requestNo"); - String workorderId = param.getString("workorder_id"); - if (workorderId == null) { + String workorderCode = param.getString("order_code"); + if (workorderCode == null) { return BaseResponse.responseError(requestNo, "工单标识不能为空!"); } - PdmBdWorkorder bdWorkorder = workorderService.getById(workorderId); + PdmBdWorkorder bdWorkorder = workorderService.getByCode(workorderCode); if (bdWorkorder == null) { return BaseResponse.responseError(requestNo, "物料信息为空!"); } bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode()); bdWorkorder.setRealproduceend_date(DateUtil.now()); - workorderService.update(bdWorkorder); + TaskUtils.setWorkOrderUpdateByAcs(bdWorkorder); + workorderService.updateById(bdWorkorder); return BaseResponse.responseOk(requestNo); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/controller/PdmBdVehicleBindingController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/controller/PdmBdVehicleBindingController.java new file mode 100644 index 0000000..faefb0e --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/controller/PdmBdVehicleBindingController.java @@ -0,0 +1,66 @@ +package org.nl.wms.pdm.vehiclebiding.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.vehiclebiding.service.IPdmBdVehicleBindingService; +import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; +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-31 +**/ +@Slf4j +@RestController +@Api(tags = "分拣载具关联记录管理") +@RequestMapping("/api/pdmBdVehicleBinding") +public class PdmBdVehicleBindingController { + + @Autowired + private IPdmBdVehicleBindingService pdmBdVehicleBindingService; + + @GetMapping + @Log("查询分拣载具关联记录") + @ApiOperation("查询分拣载具关联记录") + //@SaCheckPermission("@el.check('pdmBdVehicleBinding:list')") + public ResponseEntity query(@RequestParam Map whereJson, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(pdmBdVehicleBindingService.queryAll(whereJson,page)),HttpStatus.OK); + } + + @PostMapping + @Log("新增分拣载具关联记录") + @ApiOperation("新增分拣载具关联记录") + //@SaCheckPermission("@el.check('pdmBdVehicleBinding:add')") + public ResponseEntity create(@Validated @RequestBody PdmBdVehicleBinding entity){ + pdmBdVehicleBindingService.create(entity); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改分拣载具关联记录") + @ApiOperation("修改分拣载具关联记录") + //@SaCheckPermission("@el.check('pdmBdVehicleBinding:edit')") + public ResponseEntity update(@Validated @RequestBody PdmBdVehicleBinding entity){ + pdmBdVehicleBindingService.update(entity); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除分拣载具关联记录") + @ApiOperation("删除分拣载具关联记录") + //@SaCheckPermission("@el.check('pdmBdVehicleBinding:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Set ids) { + pdmBdVehicleBindingService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/IPdmBdVehicleBindingService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/IPdmBdVehicleBindingService.java new file mode 100644 index 0000000..5b93bf1 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/IPdmBdVehicleBindingService.java @@ -0,0 +1,43 @@ +package org.nl.wms.pdm.vehiclebiding.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.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; + +import java.util.Map; +import java.util.Set; + +/** +* @description 服务接口 +* @author lyd +* @date 2023-07-31 +**/ +public interface IPdmBdVehicleBindingService extends IService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param pageable 分页参数 + * @return IPage + */ + IPage queryAll(Map whereJson, PageQuery pageable); + + /** + * 创建 + * @param entity / + */ + void create(PdmBdVehicleBinding entity); + + /** + * 编辑 + * @param entity / + */ + void update(PdmBdVehicleBinding entity); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Set ids); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/PdmBdVehicleBinding.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/PdmBdVehicleBinding.java new file mode 100644 index 0000000..d95462d --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/PdmBdVehicleBinding.java @@ -0,0 +1,58 @@ +package org.nl.wms.pdm.vehiclebiding.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-31 +**/ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("pdm_bd_vehicle_binding") +public class PdmBdVehicleBinding implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "associate_id", type = IdType.NONE) + @ApiModelProperty(value = "对应标识") + private String associate_id; + + @ApiModelProperty(value = "源载具编码") + private String origin_vehicle_code; + + @ApiModelProperty(value = "源载具类型") + private String origin_vehicle_type; + + @ApiModelProperty(value = "目标载具编码") + private String target_vehicle_code; + + @ApiModelProperty(value = "目标载具类型") + private String target_vehicle_type; + + @ApiModelProperty(value = "源当前物料数量") + private String origin_qty; + + @ApiModelProperty(value = "目标当前物料数量") + private String target_qty; + + @ApiModelProperty(value = "取货点") + private String get_station; + + @ApiModelProperty(value = "放货点") + private String put_station; + + @ApiModelProperty(value = "工单号") + private String order_code; + + @ApiModelProperty(value = "记录时间") + private String record_time; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.java new file mode 100644 index 0000000..b3d37a9 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.java @@ -0,0 +1,12 @@ +package org.nl.wms.pdm.vehiclebiding.service.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; + +/** +* @author lyd +* @date 2023-07-31 +**/ +public interface PdmBdVehicleBindingMapper extends BaseMapper { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.xml new file mode 100644 index 0000000..bc73a08 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dao/mapper/PdmBdVehicleBindingMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingDto.java new file mode 100644 index 0000000..a0808ab --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingDto.java @@ -0,0 +1,46 @@ +package org.nl.wms.pdm.vehiclebiding.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @description / +* @author lyd +* @date 2023-07-31 +**/ +@Data +public class PdmBdVehicleBindingDto implements Serializable { + + /** 对应标识 */ + private String associate_id; + + /** 源载具编码 */ + private String origin_vehicle_code; + + /** 源载具类型 */ + private String origin_vehicle_type; + + /** 目标载具编码 */ + private String target_vehicle_code; + + /** 目标载具类型 */ + private String target_vehicle_type; + + /** 源当前物料数量 */ + private String origin_qty; + + /** 目标当前物料数量 */ + private String target_qty; + + /** 取货点 */ + private String get_station; + + /** 放货点 */ + private String put_station; + + /** 工单号 */ + private String order_code; + + /** 记录时间 */ + private String record_time; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingQuery.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingQuery.java new file mode 100644 index 0000000..e2b5584 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/dto/PdmBdVehicleBindingQuery.java @@ -0,0 +1,12 @@ +package org.nl.wms.pdm.vehiclebiding.service.dto; + +import org.nl.common.domain.query.BaseQuery; +import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; + +/** +* @author lyd +* @date 2023-07-31 +**/ +public class PdmBdVehicleBindingQuery extends BaseQuery { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/impl/PdmBdVehicleBindingServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/impl/PdmBdVehicleBindingServiceImpl.java new file mode 100644 index 0000000..a615e5f --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/vehiclebiding/service/impl/PdmBdVehicleBindingServiceImpl.java @@ -0,0 +1,67 @@ +package org.nl.wms.pdm.vehiclebiding.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +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.pdm.vehiclebiding.service.IPdmBdVehicleBindingService; +import org.nl.wms.pdm.vehiclebiding.service.dao.mapper.PdmBdVehicleBindingMapper; +import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding; +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-31 +**/ +@Slf4j +@Service +public class PdmBdVehicleBindingServiceImpl extends ServiceImpl implements IPdmBdVehicleBindingService { + + @Autowired + private PdmBdVehicleBindingMapper pdmBdVehicleBindingMapper; + + @Override + public IPage queryAll(Map whereJson, PageQuery page){ + LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); + IPage pages = new Page<>(page.getPage() + 1, page.getSize()); + pdmBdVehicleBindingMapper.selectPage(pages, lam); + return pages; + } + + @Override + public void create(PdmBdVehicleBinding entity) { + String now = DateUtil.now(); + entity.setAssociate_id(IdUtil.getSnowflake(1, 1).nextIdStr()); + entity.setRecord_time(now); + pdmBdVehicleBindingMapper.insert(entity); + } + + @Override + public void update(PdmBdVehicleBinding entity) { + PdmBdVehicleBinding dto = pdmBdVehicleBindingMapper.selectById(entity.getAssociate_id()); + if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!"); + String now = DateUtil.now(); + entity.setRecord_time(now); + + pdmBdVehicleBindingMapper.updateById(entity); + } + + @Override + public void deleteAll(Set ids) { + // 真删除 + pdmBdVehicleBindingMapper.deleteBatchIds(ids); + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/controller/ReportController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/controller/ReportController.java index 4fd8098..64f993f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/controller/ReportController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/controller/ReportController.java @@ -36,4 +36,12 @@ public class ReportController { // return new ResponseEntity<>(TableDataInfo.build(reportService.mudTransfer(json,page)), HttpStatus.OK); return null; } + + @PostMapping("/inventoryAlert") + @Log("库存物料提示记录表") + @ApiOperation("库存物料提示记录表") + public ResponseEntity inventoryAlert(JSONObject json, PageQuery page){ +// return new ResponseEntity<>(TableDataInfo.build(reportService.inventoryAlert(json,page)), HttpStatus.OK); + return null; + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java index e86f792..b11ed3c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java @@ -210,7 +210,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl= Integer.parseInt(TaskStatus.FINISHED.getCode())) { throw new BadRequestException("任务已完成或已取消!"); } 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 4d34732..d76e795 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 @@ -124,7 +124,7 @@ public class HNMLTask extends AbstractTask { task.setRemark(""); task.setVehicle_type(GeneralDefinition.MATERIAL_CUP); // 告知acs去左边右边 - String deviceCode = point.getDevice_code(); + String deviceCode = point.getParent_point_code(); int number = Integer.parseInt(deviceCode.replaceAll("[^0-9]", "")); // 1左边2右边 number = (number % 2) == 0 ? 2 : (number % 2); @@ -136,7 +136,7 @@ public class HNMLTask extends AbstractTask { pointService.updateById(point); //下发 - this.renotifyAcs(task); +// this.renotifyAcs(task); } } @@ -152,15 +152,13 @@ public class HNMLTask extends AbstractTask { // *: 混碾无工单 String materialCode = requestParam.getString("material_code"); // 混碾编码 Assert.notNull(materialCode, "物料编码不能为空!"); - MdBaseMaterial baseMaterialObj = materialService.findByCode(materialCode); - Assert.notNull(baseMaterialObj, "物料: " + materialCode + "未找到!"); // 根据工单物料标识寻找点位 - List points = hnMapper.findPointForHNMLAndWorkOrder(nextRegionStr, baseMaterialObj.getMaterial_id()); + List points = hnMapper.findPointForHNMLAndWorkOrder(nextRegionStr, materialCode); return ObjectUtil.isNotEmpty(points) ? points.get(0) : null; } @Override - public void forceFinish(String task_code) { + public void forceFinish(String task_code) { // 人工完成任务 SchBaseTask taskObj = taskService.getByCode(task_code); if (ObjectUtil.isEmpty(taskObj)) { throw new BadRequestException("该任务不存在"); @@ -169,12 +167,13 @@ public class HNMLTask extends AbstractTask { } @Override - public void cancel(String task_code) { + public void cancel(String task_code) { // 人工取消任务 SchBaseTask taskObj = taskService.getByCode(task_code); if (ObjectUtil.isEmpty(taskObj)) { throw new BadRequestException("该任务不存在"); } this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC); + // todo: 通知acs取消任务 } public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { @@ -211,6 +210,10 @@ public class HNMLTask extends AbstractTask { // 找到父点位 SchBasePoint serviceOne = pointService.getOne(new LambdaQueryWrapper() .eq(SchBasePoint::getPoint_code, parentPointCode)); + // 父点位(设备)需要切换成非空状态 + PointUtils.setUpdateByType(serviceOne, taskFinishedType); + serviceOne.setPoint_status(PointStatusEnum.FULL_POINT.getCode()); + pointService.updateById(serviceOne); // 找压机工单 PdmBdWorkorder one = workorderService.getOne(new LambdaQueryWrapper() .eq(serviceOne != null, PdmBdWorkorder::getPoint_code, serviceOne.getPoint_code()) @@ -270,7 +273,7 @@ public class HNMLTask extends AbstractTask { String vehicleType = param.getString("vehicle_type"); // 泥料物料对应不出物料标识 String materialCode = param.getString("material_code"); // 泥料编码 - String mixTimes = param.getString("bag_number"); // 碾次 + String mixTimes = param.getString("mix_times"); // 碾次 // 载具类型默认料盅 if (vehicleType == null) { vehicleType = GeneralDefinition.MATERIAL_CUP; @@ -292,6 +295,7 @@ public class HNMLTask extends AbstractTask { // 要把数据存到组盘表 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); groupEntity.setCreate_name(GeneralDefinition.ACS_NAME); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.java index 149d8b3..d0e4f78 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.java @@ -13,5 +13,5 @@ import java.util.List; */ public interface HNMapper extends BaseMapper { List findPointForHNML(List regionCode, String materialId); - List findPointForHNMLAndWorkOrder(List regionCode, String materialId); + List findPointForHNMLAndWorkOrder(List regionCode, String materialCode); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.xml index 3376f3e..374e787 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/mapper/HNMapper.xml @@ -33,7 +33,7 @@ AND p.parent_point_code LIKE CONCAT('%', (SELECT p2.point_code FROM sch_base_point p2 WHERE p2.point_code IN ( - SELECT w.point_code FROM pdm_bd_workorder w WHERE w.material_id = #{materialId} AND w.workorder_status = '3' + SELECT w.point_code FROM pdm_bd_workorder w WHERE w.raw_material_code = #{materialCode} AND w.workorder_status = '3' ) AND p2.point_status = '1' ORDER BY p2.update_time LIMIT 1), '%') 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 d85a7d7..c20e0c0 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 @@ -159,10 +159,10 @@ public class YZQKTask extends AbstractTask { PointUtils.setUpdateByType(startPointObj, taskFinishedType); PointUtils.clearPoint(startPointObj); endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode()); - endPointObj.setVehicle_type("2"); + endPointObj.setVehicle_type(GeneralDefinition.STEEL_TRAY); endPointObj.setVehicle_qty(1); PointUtils.setUpdateByType(endPointObj, taskFinishedType); - pointService.update(endPointObj); + pointService.updateById(endPointObj); } // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); diff --git a/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/index.vue b/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/index.vue new file mode 100644 index 0000000..7cf04f9 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/index.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/pdmBdVehicleBinding.js b/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/pdmBdVehicleBinding.js new file mode 100644 index 0000000..2bff8e8 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/vehiclebiding/pdmBdVehicleBinding.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/pdmBdVehicleBinding', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/pdmBdVehicleBinding/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/pdmBdVehicleBinding', + method: 'put', + data + }) +} + +export default { add, edit, del }