| | |
| | | if (StringUtils.isBlank(code)) { |
| | | return R.error("编码不能为空!!"); |
| | | } |
| | | return R.ok(mobileService.getDeltByCode(code)); |
| | | return mobileService.getDeltByCode(code); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.enums;
|
| | |
|
| | | public enum TaskStsType {
|
| | |
|
| | | GENERATE_IN(1L, "创建入库任务"),
|
| | | WCS_EXECUTE_IN(2L, "RCS任务已下发"),
|
| | | WCS_CONTAINER_RECEIVE(3L, "RCS容器到达"),
|
| | |
|
| | | WCS_CONVEYOR_START(4L, "RCS容器流动任务已下发"),
|
| | |
|
| | | WCS_TOTE_LOAD(5L, "RCS取箱完成"),
|
| | |
|
| | | WCS_TOTE_UNLOAD(6L, "RCS放箱完成"),
|
| | |
|
| | | WCS_PUTAWAY_SUCESS(7L, "RCS任务完成"),
|
| | |
|
| | | // WCS_PUTAWAY_FAILED(11L, "任务失败"),
|
| | | //
|
| | | // WCS_PUTAWAY_CANCEL(12L, "任务取消"),
|
| | | //
|
| | | // WCS_PUTAWAY_SUSPEND(13L, "入库任务挂起"),
|
| | |
|
| | | COMPLETE_IN(99L, "入库完成"),
|
| | |
|
| | | UPDATED_IN(100L, "库存更新完成"),
|
| | |
|
| | | GENERATE_OUT(101L, "创建出库任务"),
|
| | |
|
| | | WCS_EXECUTE_OUT(102L, "RCS出库任务已下发"),
|
| | |
|
| | | WCS_EXECUTE_OUT_TOTE_LOAD(103L, "RCS取箱完成"),
|
| | |
|
| | | WCS_EXECUTE_OUT_TOTE_UNLOAD(104L, "RCS放箱完成"),
|
| | |
|
| | | WCS_EXECUTE_OUT_TASK_DONE(105L, "RCS任务完成"),
|
| | |
|
| | | WCS_EXECUTE_OUT_ARRIVED(106L, "RCS容器已到达"),
|
| | |
|
| | | WCS_EXECUTE_OUT_CONVEYOR(107L, "RCS容器流动任务已下发"),
|
| | |
|
| | | GENERATE_WAVE_SEED(197L, "等待容器到达"),
|
| | | WAVE_SEED(198L, "播种中"),
|
| | |
|
| | | COMPLETE_OUT(199L, "出库完成"),
|
| | | UPDATED_OUT(200L, "库存更新完成"),
|
| | | ;
|
| | |
|
| | | public Long id;
|
| | | public String desc;
|
| | |
|
| | | TaskStsType(Long id, String desc) {
|
| | | this.id = id;
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title TaskType |
| | | * @description |
| | | * @create 2025/3/29 17:02 |
| | | */ |
| | | public enum TaskType { |
| | | TASK_TYPE_EMPITY_IN(10L, "空板入库"), |
| | | TASK_TYPE_LOC_MOVE(11L, "库格移载"), |
| | | TASK_TYPE_PICK_IN(53L, "拣料再入库"), |
| | | TASK_TYPE_MERGE_IN(54L, "并板再入库"), |
| | | TASK_TYPE_CHECK_IN(57L, "盘点再入库"), |
| | | TASK_TYPE_OUT(101L, "出库"), |
| | | TASK_TYPE_PICK_AGAIN_IN(103L, "拣料入库"), |
| | | TASK_TYPE_MERGE_OUT(104L, "并板出库"), |
| | | TASK_TYPE_CHECK_OUT(107L, "盘点出库"), |
| | | TASK_TYPE_EMPITY_OUT(110L, "空板出库"), |
| | | ; |
| | | public Long type; |
| | | public String desc; |
| | | |
| | | TaskType(Long type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public WaitPakin unBind(WaitPakinParam param) { |
| | | |
| | | return waitPakinService.unBind(param); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | @PostMapping("/waitPakin/page") |
| | |
| | | @PostMapping("/waitPakin/save") |
| | | public R save(@RequestBody WaitPakin waitPakin) { |
| | | waitPakin.setCreateBy(getLoginUserId()); |
| | | waitPakin.setCreateTime(new Date()); |
| | | waitPakin.setUpdateBy(getLoginUserId()); |
| | | waitPakin.setUpdateTime(new Date()); |
| | | if (Objects.isNull(waitPakin.getBarcode()) || StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | return R.error("拖盘码不能为空!!"); |
| | | } |
| | | List<WaitPakin> list = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!list.isEmpty()) { |
| | | return R.error("拖盘已组拖!!"); |
| | | } |
| | | if (!waitPakinService.save(waitPakin)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("生成任务列表") |
| | | @PostMapping("/waitPakin/merge") |
| | | public R generateTask(@RequestBody List<WaitPakin> waitPakin) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return taskService.generateTasks(waitPakin); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private Long matnrId; |
| | | |
| | | private Double qty; |
| | | private Double receiptQty; |
| | | |
| | | } |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_task") |
| | | public class Task implements Serializable { |
| | | |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.manager.entity.Task; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | R generateTasks(List<WaitPakin> waitPakin); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.server.api.entity.enums.TaskStsType; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import com.vincent.rsf.server.manager.entity.Task; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinItemService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 生成任务列表 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 15:59 |
| | | */ |
| | | @Override |
| | | public R generateTasks(List<WaitPakin> waitPakin) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | /**获取组拖*/ |
| | | List<Long> ids = waitPakin.stream().map(WaitPakin::getId).collect(Collectors.toList()); |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().in(WaitPakin::getId, ids)); |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("组拖信息不存在!!"); |
| | | } |
| | | /**获取组拖明细**/ |
| | | List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, ids)); |
| | | if (waitPakinItems.isEmpty()) { |
| | | throw new CoolException("数据错误:组拖明细不存在"); |
| | | } |
| | | Task task = new Task(); |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_TASK_CODE, null); |
| | | task.setTaskCode(ruleCode).setTaskStatus(TaskStsType.GENERATE_IN.id.shortValue()); |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | @Service("waitPakinService") |
| | | public class WaitPakinServiceImpl extends ServiceImpl<WaitPakinMapper, WaitPakin> implements WaitPakinService { |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | |
| | | /** |
| | | * 单据组拖 |
| | | * @param waitPakin |
| | | * @author Ryan |
| | | * @description 组拖 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:42 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | |
| | | double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getQty).sum(); |
| | | double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | |
| | | WaitPakin pakin = new WaitPakin(); |
| | | |
| | |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | Double v = item.getWorkQty() + waitPakinItem.getQty(); |
| | | Double v = item.getWorkQty() + waitPakinItem.getReceiptQty(); |
| | | pakinItem.setWorkQty(v) |
| | | .setAnfme(waitPakinItem.getQty()) |
| | | .setAnfme(waitPakinItem.getReceiptQty()) |
| | | .setTrackCode(waitPakinItem.getTrackCode()); |
| | | /**更新单据执行中库存*/ |
| | | if (v.compareTo(item.getAnfme()) > 0) {throw new CoolException("执行中数量大于收货数量!!");} |
| | |
| | | return pakin; |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 组拖解绑 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:42 |
| | | */ |
| | | @Override |
| | | public WaitPakin unBind(WaitPakinParam param) { |
| | | String barcode = param.getBarcode(); |
| | |
| | | List<Long> list = paramItems.stream().map(PakinItem::getMatnrId).collect(Collectors.toList()); |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakins.getId()) |
| | | .eq(WaitPakinItem::getMatnrId, list)); |
| | | .in(WaitPakinItem::getMatnrId, list)); |
| | | if (pakinItems.isEmpty()) { |
| | | throw new CoolException("数据错误:组拖明细不存在!!"); |
| | | } |
| | | if (!waitPakinItemService.removeByIds(pakinItems)) { |
| | | List<Long> ids = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toList()); |
| | | if (!waitPakinItemService.removeByIds(ids)) { |
| | | throw new CoolException("组拖明细解绑失败!!"); |
| | | } |
| | | return waitPakins; |
| | |
| | | * 组拖编码生成规则 |
| | | */ |
| | | public final static String SYS_WAIT_PAKIN_CODE = "sys_wait_pakin_code"; |
| | | |
| | | /** |
| | | * 任务编码生成规则 |
| | | */ |
| | | public final static String SYS_TASK_CODE = "sys_task_code"; |
| | | } |
| | |
| | | # global-config:
|
| | | # field-strategy: 0
|
| | | configuration:
|
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | map-underscore-to-camel-case: true
|
| | | cache-enabled: true
|
| | | call-setters-on-nulls: true
|