执行及取消执行;
This commit is contained in:
@@ -97,6 +97,18 @@ public interface WmsServiceFeign {
|
||||
@PostMapping(value = "/stockInOrderApi/omsInOrderAdd")
|
||||
public void omsInOrderAdd(@RequestBody StockInOrder stockInOrder);
|
||||
|
||||
@ApiOperation("oms取消下发单保存")
|
||||
@PostMapping(value = "/stockOutOrderApi/cancelExecutionOrder")
|
||||
public void cancelExecutionOrder(@RequestBody StockOutOrder stockOutOrder);
|
||||
|
||||
@ApiOperation("oms取消下发单自动分配")
|
||||
@PostMapping(value = "/stockOutOrderApi/omsAutoAssign")
|
||||
public void omsAutoAssign(@RequestBody StockOutOrderDTO stockOutOrderDTO);
|
||||
|
||||
@ApiOperation("oms出库执行")
|
||||
@PostMapping(value = "/stockOutOrderApi/execution")
|
||||
public AjaxResult execution(@RequestBody com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO);
|
||||
|
||||
/**
|
||||
* oms下发单明细保存
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,486 @@
|
||||
package com.mhd.system.api.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库单对象 stock_out_order
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-28
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class StockOutOrderDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("出库单id")
|
||||
private Long outOrderId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("通知单号")
|
||||
@Excel(name = "通知单号")
|
||||
private String noticeNumber;
|
||||
|
||||
@ApiModelProperty("出库单号")
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer auditStatus;
|
||||
|
||||
@ApiModelProperty("出库单审核备注")
|
||||
@Excel(name = "出库单审核备注")
|
||||
private String auditRemark;
|
||||
|
||||
@ApiModelProperty("出库单审核人")
|
||||
@Excel(name = "出库单审核人")
|
||||
private Long auditBy;
|
||||
|
||||
@ApiModelProperty("出库单审核人姓名")
|
||||
@Excel(name = "出库单审核人姓名")
|
||||
private String auditByName;
|
||||
|
||||
@ApiModelProperty("出库单审核时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "出库单审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date auditTime;
|
||||
|
||||
@ApiModelProperty("仓库id")
|
||||
@Excel(name = "仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String shipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("出库单类型编码")
|
||||
@Excel(name = "出库单类型编码")
|
||||
private String orderTypeCode;
|
||||
|
||||
@ApiModelProperty("出库单类型名称")
|
||||
@Excel(name = "出库单类型名称")
|
||||
private String orderTypeName;
|
||||
|
||||
@ApiModelProperty("客户id")
|
||||
@Excel(name = "客户id")
|
||||
private Long customerId;
|
||||
|
||||
@ApiModelProperty("客户编码")
|
||||
@Excel(name = "客户编码")
|
||||
private String customerCode;
|
||||
|
||||
@ApiModelProperty("客户名称")
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
@ApiModelProperty("预计出货时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expectTime;
|
||||
|
||||
@ApiModelProperty("供应链订单号")
|
||||
@Excel(name = "供应链订单号")
|
||||
private String supplyChainNumber;
|
||||
|
||||
@ApiModelProperty("优先级别编码")
|
||||
@Excel(name = "优先级别编码")
|
||||
private String priorityLevelCode;
|
||||
|
||||
@ApiModelProperty("优先级别名称")
|
||||
@Excel(name = "优先级别名称")
|
||||
private String priorityLevelName;
|
||||
|
||||
@ApiModelProperty("是否直接出库: 1-是 2-否")
|
||||
@Excel(name = "是否直接出库: 1-是 2-否")
|
||||
private Integer directWarehouse;
|
||||
|
||||
@ApiModelProperty("是否复核: 1-是 2-否")
|
||||
@Excel(name = "是否复核: 1-是 2-否")
|
||||
private Integer review;
|
||||
|
||||
@ApiModelProperty("附件url")
|
||||
@Excel(name = "附件url")
|
||||
private String annexUrl;
|
||||
|
||||
@ApiModelProperty("物料种数")
|
||||
@Excel(name = "物料种数")
|
||||
private Integer materialQuantity;
|
||||
|
||||
@ApiModelProperty("计划数量")
|
||||
@Excel(name = "计划数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ApiModelProperty("净重 单位:千克")
|
||||
@Excel(name = "净重 单位:千克")
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
@ApiModelProperty("体积 单位:立方米")
|
||||
@Excel(name = "体积 单位:立方米")
|
||||
private BigDecimal volumeLimit;
|
||||
|
||||
@ApiModelProperty("分配数量")
|
||||
@Excel(name = "分配数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
|
||||
@ApiModelProperty("已生成拣货单数量")
|
||||
@Excel(name = "已生成拣货单分配数量")
|
||||
private BigDecimal alreadyAllocationQuantity;
|
||||
|
||||
@ApiModelProperty("拣货数量")
|
||||
@Excel(name = "拣货数量")
|
||||
private BigDecimal pickingQuantity;
|
||||
|
||||
@ApiModelProperty("复核数量")
|
||||
@Excel(name = "复核数量")
|
||||
private BigDecimal checkQuantity;
|
||||
|
||||
@ApiModelProperty("是否取消订单: 1-是 2-否")
|
||||
@Excel(name = "是否取消订单: 1-是 2-否")
|
||||
private Integer cancelOrder;
|
||||
|
||||
@ApiModelProperty("取消订单备注")
|
||||
@Excel(name = "取消订单备注")
|
||||
private String cancelRemark;
|
||||
|
||||
@ApiModelProperty("取消订单人")
|
||||
@Excel(name = "取消订单人")
|
||||
private Long cancelBy;
|
||||
|
||||
@ApiModelProperty("取消订单人姓名")
|
||||
@Excel(name = "取消订单人姓名")
|
||||
private String cancelByName;
|
||||
|
||||
@ApiModelProperty("取消订单时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cancelTime;
|
||||
|
||||
@ApiModelProperty("是否关闭订单: 1-是 2-否")
|
||||
@Excel(name = "是否关闭订单: 1-是 2-否")
|
||||
private Integer closeOrder;
|
||||
|
||||
@ApiModelProperty("关闭订单备注")
|
||||
@Excel(name = "关闭订单备注")
|
||||
private String closeRemark;
|
||||
|
||||
@ApiModelProperty("关闭订单人")
|
||||
@Excel(name = "关闭订单人")
|
||||
private Long closeBy;
|
||||
|
||||
@ApiModelProperty("关闭订单人姓名")
|
||||
@Excel(name = "关闭订单人姓名")
|
||||
private String closeByName;
|
||||
|
||||
@ApiModelProperty("关闭订单时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date closeTime;
|
||||
|
||||
@ApiModelProperty("复核状态: 1-未复核 2-复核中 3-已复核")
|
||||
@Excel(name = "复核状态: 1-未复核 2-复核中 3-已复核")
|
||||
private Integer checkStatus;
|
||||
|
||||
@ApiModelProperty("复核任务是否下发: 1-是 2-否")
|
||||
@Excel(name = "复核任务是否下发: 1-是 2-否")
|
||||
private Integer checkTaskDistribution;
|
||||
|
||||
@ApiModelProperty("复核任务下发时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "复核任务下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkTaskDistributionTime;
|
||||
|
||||
@ApiModelProperty("复核作业人用户ID")
|
||||
@Excel(name = "复核作业人用户ID")
|
||||
@JsonAlias({"checkOperatorId", "operatorId"})
|
||||
private Long checkOperatorsBy;
|
||||
|
||||
@ApiModelProperty("复核作业人姓名")
|
||||
@Excel(name = "复核作业人姓名")
|
||||
private String checkOperatorsName;
|
||||
|
||||
@ApiModelProperty("调度单号")
|
||||
@Excel(name = "调度单号")
|
||||
private String mobilizeCode;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("出库单id集合")
|
||||
private List<Long> outOrderIds;
|
||||
|
||||
// @ApiModelProperty("物料明细")
|
||||
// private List<OutMaterialDetailDTO> materialDetailList;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料审核数量")
|
||||
@Excel(name = "物料审核数量")
|
||||
private BigDecimal actualQuantity;
|
||||
|
||||
@ApiModelProperty("波次类型编码")
|
||||
private String waveOrderTypeCode;
|
||||
|
||||
@ApiModelProperty("大于复核状态: 1-未复核 2-复核中 3-已复核")
|
||||
private Integer gtCheckStatus;
|
||||
|
||||
@ApiModelProperty("小于复核状态: 1-未复核 2-复核中 3-已复核")
|
||||
private Integer ltCheckStatus;
|
||||
|
||||
@ApiModelProperty("PDA复核查询tab: 1-列表(待复核) 2-历史记录(已复核)")
|
||||
private Integer tabType;
|
||||
|
||||
@ApiModelProperty("to")
|
||||
@Excel(name = "to")
|
||||
private String to;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@ApiModelProperty("车型及车牌")
|
||||
@Excel(name = "车型及车牌")
|
||||
private String vehicleModelPlate;
|
||||
|
||||
@ApiModelProperty("委托编号")
|
||||
@Excel(name = "委托编号")
|
||||
private String entrustNo;
|
||||
|
||||
@ApiModelProperty("Tel")
|
||||
@Excel(name = "Tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("司机签名")
|
||||
@Excel(name = "司机签名")
|
||||
private String driverSign;
|
||||
|
||||
@ApiModelProperty("Fax")
|
||||
@Excel(name = "Fax")
|
||||
private String fax;
|
||||
|
||||
@ApiModelProperty("申报地关区")
|
||||
@Excel(name = "申报地关区")
|
||||
private String declareCustoms;
|
||||
|
||||
@ApiModelProperty("生产商")
|
||||
@Excel(name = "生产商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("报关员姓名及联系方式")
|
||||
@Excel(name = "报关员姓名及联系方式")
|
||||
private String customsDeclarerInfo;
|
||||
|
||||
@ApiModelProperty("送货地址")
|
||||
@Excel(name = "送货地址")
|
||||
private String deliveryAddr;
|
||||
|
||||
@ApiModelProperty("进出境关别")
|
||||
@Excel(name = "进出境关别")
|
||||
private String entryExitCustoms;
|
||||
|
||||
@ApiModelProperty("起运/运抵国(地区)")
|
||||
@Excel(name = "起运/运抵国(地区)")
|
||||
private String departureArrivalCountry;
|
||||
|
||||
@ApiModelProperty("承运商")
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("柜号")
|
||||
@Excel(name = "柜号")
|
||||
private String containerNo;
|
||||
|
||||
@ApiModelProperty("柜")
|
||||
@Excel(name = "柜")
|
||||
private String containerNoName;
|
||||
|
||||
@ApiModelProperty("出仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date outboundDate;
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date completeTime;
|
||||
@ApiModelProperty("orderDate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "orderDate", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderDate;
|
||||
|
||||
@ApiModelProperty("运输方式")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportModeCode;
|
||||
@ApiModelProperty("运输方式")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportModeName;
|
||||
@ApiModelProperty("监管方式")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionModeCode;
|
||||
@ApiModelProperty("监管方式")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionModeName;
|
||||
@ApiModelProperty("海关是否查验货物")
|
||||
@Excel(name = "海关是否查验货物")
|
||||
private String customsInspectionFlag;
|
||||
@ApiModelProperty("是否需要报关")
|
||||
@Excel(name = "是否需要报关")
|
||||
private String needDeclareFlag;
|
||||
@ApiModelProperty("是否需要运输")
|
||||
@Excel(name = "是否需要运输")
|
||||
private String needTransportFlag;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty(name = "审核时间查询条件开始日期")
|
||||
private String auditTimeStart;
|
||||
|
||||
@ApiModelProperty(name = "审核时间查询条件结束日期")
|
||||
private String auditTimeEnd;
|
||||
|
||||
@ApiModelProperty("出库明细-物料名称(商品名称),模糊匹配,与前端参数 materialName 一致")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("出库明细-物料编码,模糊匹配,与前端参数 materialCode 一致")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("出库交接图片,PDA出库交接时上传的照片,多张图片以逗号隔开")
|
||||
private String pictureApp;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String businessOrderNo;
|
||||
|
||||
@ApiModelProperty("业务类型")
|
||||
@Excel(name = "业务类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty("制单人")
|
||||
@Excel(name = "制单人")
|
||||
private String documentCreator;
|
||||
|
||||
@ApiModelProperty("制单人名称")
|
||||
@Excel(name = "制单人名称")
|
||||
private String documentCreatorName;
|
||||
|
||||
@ApiModelProperty("制单日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date documentDate;
|
||||
@ApiModelProperty("承运商名称")
|
||||
@Excel(name = "承运商名称")
|
||||
private String carrierName;
|
||||
@ApiModelProperty("计费信息")
|
||||
private String billingJson;
|
||||
@ApiModelProperty("结算币种")
|
||||
private String settlementCurrency;
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
@ApiModelProperty("业务员名称")
|
||||
private String salesmanName;
|
||||
// @ApiModelProperty("费用")
|
||||
// List<ReceiptOrderAccount> receiptOrderAccountList;
|
||||
@ApiModelProperty("退货数量")
|
||||
@Excel(name = "退货数量")
|
||||
private BigDecimal returnQuantity;
|
||||
/**
|
||||
* 提货单打印所选模版(与图5单选项文案一致即可)。可传副标题如「谷丰--营销部」,或整段「提货单--谷丰--营销部」;不传则标题为「提货单」
|
||||
*/
|
||||
@ApiModelProperty("提货单打印模版名/弹窗选项全文;后端生成 printTitle(-- 会规范为 ——)")
|
||||
private String noticePrintTemplateName;
|
||||
@ApiModelProperty("车次")
|
||||
@Excel(name = "车次")
|
||||
private Integer trainNo;
|
||||
@ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("推送时间")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty("推送人姓名")
|
||||
private String pushByName;
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTimeTo;
|
||||
|
||||
@ApiModelProperty(value = "推送时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTimeFrom;
|
||||
|
||||
@ApiModelProperty(value = "推送时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTimeTo;
|
||||
}
|
||||
+4
@@ -41,6 +41,10 @@ public interface ExecutionStockInOrderMapper extends BaseMapper<ExecutionStockIn
|
||||
|
||||
public String getUserNcCode(@Param("id") Long id);
|
||||
|
||||
public void delWOrder(@Param("inOrderNumber") String inOrderNumber);
|
||||
|
||||
public void delWOrderDetail(@Param("inOrderNumber") String inOrderNumber);
|
||||
|
||||
|
||||
List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO);
|
||||
List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDO);
|
||||
|
||||
+5
@@ -306,6 +306,11 @@ public class ExecutionStockInOrderApplicationService {
|
||||
return b;
|
||||
}
|
||||
|
||||
public Boolean cancelAuditState(ExecutionStockInOrderDO stockInOrderDO){
|
||||
Boolean b = stockInOrderDomainService.cancelAuditState(stockInOrderDO);
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 下发入库单
|
||||
* @author ZhouGY
|
||||
|
||||
+33
@@ -429,6 +429,39 @@ public class ExecutionStockInOrderDomainService {
|
||||
.in(ExecutionStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean cancelAuditState(ExecutionStockInOrderDO stockInOrderDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Integer issueStatus = stockInOrderDO.getIssueStatus();
|
||||
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||
? loginUser.getUserPo().getUserName()
|
||||
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||
|
||||
//逻辑删除w入库单信息
|
||||
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||
if (inOrderIds == null || inOrderIds.isEmpty()) {
|
||||
for (Long inOrderId : inOrderIds) {
|
||||
ExecutionStockInOrder executionStockInOrder = reservationStockInOrderMapper.selectById(inOrderId);
|
||||
if (executionStockInOrder != null) {
|
||||
String inOrderNumber = executionStockInOrder.getInOrderNumber();
|
||||
reservationStockInOrderMapper.delWOrder(inOrderNumber);
|
||||
reservationStockInOrderMapper.delWOrderDetail(inOrderNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stockInOrderService.update(null, new UpdateWrapper<ExecutionStockInOrder>().lambda()
|
||||
.set(ExecutionStockInOrder::getIssueId, null)
|
||||
.set(ExecutionStockInOrder::getIssueName, null)
|
||||
.set(ExecutionStockInOrder::getIssueTime, null)
|
||||
.set(ExecutionStockInOrder::getUpdateBy, loginUser.getUserid())
|
||||
.set(ExecutionStockInOrder::getUpdateByName, userRealName)
|
||||
.set(ExecutionStockInOrder::getUpdateTime, new Date())
|
||||
.set(ExecutionStockInOrder::getIssueStatus, issueStatus)
|
||||
.in(ExecutionStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 审核入库单
|
||||
* @author ZhouGY
|
||||
|
||||
+6
@@ -5,6 +5,7 @@ import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutM
|
||||
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.po.ExecutionStockOutOrderPO;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -31,4 +32,9 @@ public interface ExecutionStockOutOrderMapper extends BaseMapper<ExecutionStockO
|
||||
* 出库单提货单打印-明细
|
||||
*/
|
||||
List<ExecutionOutMaterialDetailPO> queryOutStockNoticePrintDetail(ExecutionStockOutOrderDO stockOutOrderDO);
|
||||
|
||||
public void delWOrder(@Param("outOrderNumber") String outOrderNumber);
|
||||
|
||||
public void delWOrderDetail(@Param("outOrderNumber") String outOrderNumber);
|
||||
|
||||
}
|
||||
+4
@@ -826,6 +826,10 @@ public class ExecutionStockOutOrderApplicationService {
|
||||
return stockOutOrderDomainService.auditState(stockOutOrderDO);
|
||||
}
|
||||
|
||||
public Boolean cancelAuditState(ExecutionStockOutOrderDO stockOutOrderDO){
|
||||
return stockOutOrderDomainService.auditState(stockOutOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 下发入库单
|
||||
* @author ZhouGY
|
||||
|
||||
+40
@@ -27,6 +27,7 @@ import com.mhd.oms.domain.executionStockInOrder.repository.mapper.ExecutionStock
|
||||
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.facade.IExecutionStockOutOrderService;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.mapper.ExecutionStockOutOrderMapper;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.po.ExecutionStockOutOrderPO;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO;
|
||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
|
||||
@@ -68,6 +69,8 @@ public class ExecutionStockOutOrderDomainService {
|
||||
@Autowired
|
||||
private ExecutionStockInOrderMapper reservationStockInOrderMapper;
|
||||
@Autowired
|
||||
private ExecutionStockOutOrderMapper executionStockOutOrderMapper;
|
||||
@Autowired
|
||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||
@Autowired
|
||||
private ExecuteOrderMapper executeOrderMapper;
|
||||
@@ -296,6 +299,38 @@ public class ExecutionStockOutOrderDomainService {
|
||||
.in(ExecutionStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean cancelAuditState(ExecutionStockOutOrderDO stockOutOrderDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Integer issueStatus = stockOutOrderDO.getIssueStatus();
|
||||
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||
? loginUser.getUserPo().getUserName()
|
||||
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||
|
||||
List<Long> outOrderIds = stockOutOrderDO.getOutOrderIds();
|
||||
if (outOrderIds != null && outOrderIds.size() > 0) {
|
||||
for (Long outOrderId : outOrderIds) {
|
||||
ExecutionStockOutOrder executionStockOutOrder = stockOutOrderService.getById(outOrderId);
|
||||
String outOrderNumber = executionStockOutOrder.getOutOrderNumber();
|
||||
StockOutOrder stockOutOrder = new StockOutOrder();
|
||||
stockOutOrder.setOutOrderNumber(outOrderNumber);
|
||||
wmsServiceFeign.cancelExecutionOrder(stockOutOrder);
|
||||
//还原oms库存及调整记录
|
||||
}
|
||||
}
|
||||
|
||||
return stockOutOrderService.update(null, new UpdateWrapper<ExecutionStockOutOrder>().lambda()
|
||||
.set(ExecutionStockOutOrder::getIssueId, null)
|
||||
.set(ExecutionStockOutOrder::getIssueName, userRealName)
|
||||
.set(ExecutionStockOutOrder::getIssueTime, new Date())
|
||||
.set(ExecutionStockOutOrder::getUpdateBy, loginUser.getUserid())
|
||||
.set(ExecutionStockOutOrder::getUpdateByName, userRealName)
|
||||
.set(ExecutionStockOutOrder::getUpdateTime, new Date())
|
||||
.set(ExecutionStockOutOrder::getIssueStatus, issueStatus)
|
||||
.in(ExecutionStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 审核出库单
|
||||
* @author ZhouGY
|
||||
@@ -348,6 +383,11 @@ public class ExecutionStockOutOrderDomainService {
|
||||
outMaterialDetailList.add(outMaterialDetail);
|
||||
}
|
||||
wmsServiceFeign.omsOutOrderAddDetail(outMaterialDetailList);
|
||||
|
||||
String outOrderNumber = byId.getOutOrderNumber();
|
||||
com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO = new com.mhd.system.api.domain.StockOutOrderDTO();
|
||||
stockOutOrderDTO.setOutOrderNumber(outOrderNumber);
|
||||
wmsServiceFeign.execution(stockOutOrderDTO);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
+9
@@ -40,6 +40,15 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
|
||||
|
||||
public String getUserNcCode(@Param("id") Long id);
|
||||
|
||||
public Long getTopOrgId(@Param("id") Long id);
|
||||
|
||||
public String getOrgName(@Param("id") Long id);
|
||||
|
||||
public Long getOrgId(@Param("id") Long id);
|
||||
|
||||
public String getWarehouseCode(@Param("id") Long id);
|
||||
|
||||
public String getWarehouseName(@Param("id") Long id);
|
||||
|
||||
List<ReservationStockInOrderPO> queryNoticePrint(ReservationStockInOrderDO stockInOrderDO);
|
||||
List<ReservationInMaterialDetailPO> queryNoticePrintDetail(ReservationStockInOrderDO stockInOrderDO);
|
||||
|
||||
+93
-12
@@ -13,6 +13,10 @@ import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
||||
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||
import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
|
||||
@@ -29,6 +33,8 @@ import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReservationStock
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO;
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder;
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService;
|
||||
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
|
||||
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.*;
|
||||
@@ -43,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -61,6 +68,10 @@ public class ReservationStockInOrderDomainService {
|
||||
@Autowired
|
||||
private IReservationInMaterialDetailService materialDetailService;
|
||||
@Autowired
|
||||
private IExecutionStockInOrderService executionStockInOrderService;
|
||||
@Autowired
|
||||
private IExecutionInMaterialDetailService executionInMaterialDetailService;
|
||||
@Autowired
|
||||
private IReservationStockOutOrderService stockOutOrderService;
|
||||
// @Autowired
|
||||
// private ReservationStockReceiptOrderDomainService stockReceiptOrderDomainService;
|
||||
@@ -455,27 +466,97 @@ public class ReservationStockInOrderDomainService {
|
||||
.in(ReservationStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
|
||||
|
||||
//todo下发推送到wms
|
||||
// List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||
// for (Long inOrderId : inOrderIds) {
|
||||
// ReservationStockInOrder byId = stockInOrderService.getById(inOrderId);
|
||||
// StockInOrder stockInOrder = new StockInOrder();
|
||||
// BeanUtils.copyProperties(byId, stockInOrder,"inOrderId");
|
||||
// stockInOrder.setOmsStockInOrderId(String.valueOf(byId.getInOrderId()));
|
||||
// wmsServiceFeign.omsInOrderAdd(stockInOrder);
|
||||
// String inOrderNumber = stockInOrder.getInOrderNumber();
|
||||
// List<ReservationInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReservationInMaterialDetail>().lambda().eq(ReservationInMaterialDetail::getInOrderNumber, inOrderNumber));
|
||||
// List<InMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
// for (ReservationInMaterialDetail reservationInMaterialDetail : materialDetailList) {
|
||||
// InMaterialDetail inMaterialDetail = new InMaterialDetail();
|
||||
// BeanUtils.copyProperties(reservationInMaterialDetail, inMaterialDetail,"materialDetailId");
|
||||
// inMaterialDetail.setOmsInMaterialDetail(String.valueOf(reservationInMaterialDetail.getMaterialDetailId()));
|
||||
// inMaterialDetailList.add(inMaterialDetail);
|
||||
// }
|
||||
// wmsServiceFeign.omsInOrderAddDetail(inMaterialDetailList);
|
||||
// }
|
||||
//todo下发推送到入库业务单
|
||||
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||
for (Long inOrderId : inOrderIds) {
|
||||
// Long inOrderId = stockInOrderDO.getInOrderId();
|
||||
ReservationStockInOrder byId = stockInOrderService.getById(inOrderId);
|
||||
StockInOrder stockInOrder = new StockInOrder();
|
||||
BeanUtils.copyProperties(byId, stockInOrder,"inOrderId");
|
||||
stockInOrder.setOmsStockInOrderId(String.valueOf(byId.getInOrderId()));
|
||||
wmsServiceFeign.omsInOrderAdd(stockInOrder);
|
||||
String inOrderNumber = stockInOrder.getInOrderNumber();
|
||||
String inOrderNumber = byId.getInOrderNumber();
|
||||
List<ReservationInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReservationInMaterialDetail>().lambda().eq(ReservationInMaterialDetail::getInOrderNumber, inOrderNumber));
|
||||
List<InMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
for (ReservationInMaterialDetail reservationInMaterialDetail : materialDetailList) {
|
||||
InMaterialDetail inMaterialDetail = new InMaterialDetail();
|
||||
BeanUtils.copyProperties(reservationInMaterialDetail, inMaterialDetail,"materialDetailId");
|
||||
inMaterialDetail.setOmsInMaterialDetail(String.valueOf(reservationInMaterialDetail.getMaterialDetailId()));
|
||||
inMaterialDetailList.add(inMaterialDetail);
|
||||
|
||||
// 按照 warehouseId 分组
|
||||
Map<Long, List<ReservationInMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||
.collect(Collectors.groupingBy(ReservationInMaterialDetail::getWarehouseId));
|
||||
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||
Long orgId = reservationStockInOrderMapper.getOrgId(warehouseId);
|
||||
String orgName = reservationStockInOrderMapper.getOrgName(warehouseId);
|
||||
String warehouseCode = reservationStockInOrderMapper.getWarehouseCode(warehouseId);
|
||||
String warehouseName = reservationStockInOrderMapper.getWarehouseName(warehouseId);
|
||||
|
||||
ExecutionStockInOrder reservationStockInOrder = new ExecutionStockInOrder();
|
||||
BeanUtils.copyProperties(byId, reservationStockInOrder,"inOrderId","issueStatus","issueTime","issueId","issueName","reservationAuditId","reservationAuditName","reservationAuditTime");
|
||||
reservationStockInOrder.setIssueStatus(0);
|
||||
reservationStockInOrder.setOrderTypeCode("pu_tong_ru_ku");
|
||||
reservationStockInOrder.setOrderTypeName("普通入库");
|
||||
reservationStockInOrder.setReservationOrderSource("客户预约");
|
||||
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||
reservationStockInOrder.setOrganizationId(orgId);
|
||||
reservationStockInOrder.setOrganizationName(orgName);
|
||||
reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
|
||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
for (ReservationInMaterialDetail reserveInMaterialDetail : details) {
|
||||
ExecutionInMaterialDetail reservationInMaterialDetail = new ExecutionInMaterialDetail();
|
||||
BeanUtils.copyProperties(reserveInMaterialDetail, reservationInMaterialDetail,"materialDetailId");
|
||||
reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getQuantity());
|
||||
reservationInMaterialDetail.setOrganizationId(orgId);
|
||||
reservationInMaterialDetail.setOrganizationName(orgName);
|
||||
reservationInMaterialDetail.setTopOrganizationId(topOrgId);
|
||||
reservationInMaterialDetail.setWarehouseCode(warehouseCode);
|
||||
reservationInMaterialDetail.setWarehouseName(warehouseName);
|
||||
// String lot = generateDateSerialNumber();
|
||||
// lot = lot+"-"+index;
|
||||
// index++;
|
||||
// reservationInMaterialDetail.setLotNo(lot);
|
||||
inMaterialDetailList.add(reservationInMaterialDetail);
|
||||
}
|
||||
wmsServiceFeign.omsInOrderAddDetail(inMaterialDetailList);
|
||||
BigDecimal quantity = details.stream().map(ReservationInMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
reservationStockInOrder.setQuantity(quantity);
|
||||
executionStockInOrderService.save(reservationStockInOrder);
|
||||
executionInMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return update;
|
||||
}
|
||||
|
||||
public String generateDateSerialNumber() {
|
||||
// 1. 获取当前时间,格式化为:yyMMdd (2位年+2位月+2位日)
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
|
||||
String datePart = sdf.format(new Date());
|
||||
|
||||
// 2. 生成 000~999 的 3 位随机数(不足补零)
|
||||
Random random = new Random();
|
||||
int randomNum = random.nextInt(1000); // 0~999
|
||||
String randomPart = String.format("%03d", randomNum); // 自动补前导零
|
||||
|
||||
// 3. 拼接结果
|
||||
return datePart + randomPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 入库单返回结果
|
||||
* @author ZhouGY
|
||||
|
||||
+11
-1
@@ -120,13 +120,23 @@ public class ExecutionStockInOrderApi extends BaseController {
|
||||
/**
|
||||
* 下发入库单
|
||||
*/
|
||||
@ApiOperation("下发入库单")
|
||||
@ApiOperation("执行入库单")
|
||||
@PostMapping(value = "/issueOrder")
|
||||
public AjaxResult issueOrder(@RequestBody ExecutionStockInOrderDTO stockInOrderDTO) {
|
||||
ExecutionStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
|
||||
return AjaxResult.success(stockInOrderApplicationService.issueOrder(stockInOrderDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核入库单
|
||||
*/
|
||||
@ApiOperation("取消执行入库单")
|
||||
@PostMapping(value = "/cancelAuditState")
|
||||
public AjaxResult cancelAuditState(@RequestBody ExecutionStockInOrderDTO stockInOrderDTO) {
|
||||
ExecutionStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
|
||||
return AjaxResult.success(stockInOrderApplicationService.cancelAuditState(stockInOrderDO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wms回传出入库结果
|
||||
|
||||
+10
@@ -148,6 +148,16 @@ public class ExecutionStockOutOrderApi extends BaseController {
|
||||
return AjaxResult.success(stockOutOrderApplicationService.issueOrder(stockOutOrderDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核出库单
|
||||
*/
|
||||
@ApiOperation("审核出库单")
|
||||
@PostMapping(value = "/cancelAuditState")
|
||||
public AjaxResult cancelAuditState(@RequestBody ExecutionStockOutOrderDTO stockOutOrderDTO) {
|
||||
ExecutionStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
|
||||
return AjaxResult.success(stockOutOrderApplicationService.auditState(stockOutOrderDO));
|
||||
}
|
||||
|
||||
@ApiOperation("关闭出库单")
|
||||
@PostMapping("/close")
|
||||
public AjaxResult close(@RequestBody ExecutionStockOutOrderDTO stockOutOrderDTO)
|
||||
|
||||
+8
@@ -629,4 +629,12 @@
|
||||
and organization_name = #{organizationName}
|
||||
and interface_type = #{interfaceType} limit 1
|
||||
</select>
|
||||
|
||||
<update id="delWOrder">
|
||||
update "NGWL_TEST_WMS".stock_in_order set DEL_FLAG = 2 where DEL_FLAG = 1 and in_order_number = #{inOrderNumber}
|
||||
</update>
|
||||
|
||||
<update id="delWOrderDetail">
|
||||
update "NGWL_TEST_WMS".IN_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and in_order_number = #{inOrderNumber}
|
||||
</update>
|
||||
</mapper>
|
||||
+8
@@ -466,4 +466,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="boxPalletNo" column="box_pallet_no"/>
|
||||
</resultMap>
|
||||
|
||||
<update id="delWOrder">
|
||||
update "NGWL_TEST_WMS".stock_out_order set DEL_FLAG = 2 where DEL_FLAG = 1 and out_order_number = #{outOrderNumber}
|
||||
</update>
|
||||
|
||||
<update id="delWOrderDetail">
|
||||
update "NGWL_TEST_WMS".out_material_detail set DEL_FLAG = 2 where DEL_FLAG = 1 and out_order_number = #{outOrderNumber}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
+17
@@ -538,6 +538,23 @@
|
||||
select CUSTOMER_NC_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getOrgId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
select ORGANIZATION_ID from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||
</select>
|
||||
<select id="getOrgName" parameterType="java.lang.Long" resultType="java.lang.String">
|
||||
select ORGANIZATION_NAME from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||
</select>
|
||||
<select id="getTopOrgId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
select TOP_ORGANIZATION_ID from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||
</select>
|
||||
<select id="getWarehouseName" parameterType="java.lang.Long" resultType="java.lang.String">
|
||||
select WAREHOUSE_NAME from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||
</select>
|
||||
<select id="getWarehouseCode" parameterType="java.lang.Long" resultType="java.lang.String">
|
||||
select WAREHOUSE_CODE from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 入仓通知单打印-表头查询 -->
|
||||
<select id="queryNoticePrint" resultMap="StockInOrderResult">
|
||||
SELECT
|
||||
|
||||
+88
@@ -842,6 +842,14 @@ public class StockOutOrderApplicationService {
|
||||
return stockOutOrderDomainService.auditState(stockOutOrderDO);
|
||||
}
|
||||
|
||||
public Boolean execution(String outOrderNumber){
|
||||
//Boolean execution = stockOutOrderDomainService.execution(outOrderNumber);
|
||||
StockOutOrderDO stockOutOrderDO = new StockOutOrderDO();
|
||||
stockOutOrderDO.setOutOrderNumber(outOrderNumber);
|
||||
Boolean b = omsAutoAssign(stockOutOrderDO);
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 手动分配
|
||||
* @author ZhouGY
|
||||
@@ -934,6 +942,82 @@ public class StockOutOrderApplicationService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public Boolean omsAutoAssign(StockOutOrderDO stockOutOrderDO){
|
||||
List<String> outOrderNumbers = stockOutOrderDO.getOutOrderNumbers();
|
||||
if (outOrderNumbers == null || outOrderNumbers.isEmpty()){
|
||||
throw new ServiceException("出库单ID不能为空");
|
||||
}
|
||||
Boolean result = true;
|
||||
for (String outOrderNumber : outOrderNumbers){
|
||||
StockOutOrderDO stockOutOrderD = new StockOutOrderDO();
|
||||
StockOutOrder stockOutOrderDb = stockOutOrderService.getOne(new QueryWrapper<StockOutOrder>().lambda()
|
||||
.eq(StockOutOrder::getOutOrderNumber, outOrderNumber)
|
||||
.eq(StockOutOrder::getDelFlag, 1), false);
|
||||
if (stockOutOrderDb == null){
|
||||
throw new ServiceException("出库单不存在");
|
||||
}
|
||||
BeanUtils.copyProperties(stockOutOrderDb, stockOutOrderD);
|
||||
List<OutMaterialDetail> outMaterialDetailList = outMaterialDetailService.list(new QueryWrapper<OutMaterialDetail>().lambda()
|
||||
.eq(OutMaterialDetail::getOutOrderNumber, stockOutOrderDb.getOutOrderNumber()));
|
||||
List<OutMaterialDetailDO> materialDetailList = cn.hutool.core.bean.BeanUtil.copyToList(outMaterialDetailList, OutMaterialDetailDO.class);
|
||||
List<OutMaterialDetailDO> materialDetailList2 = new ArrayList<>();
|
||||
for (OutMaterialDetailDO detail : materialDetailList) {
|
||||
String batchRefNo = detail.getBatchRefNo();
|
||||
String sheetRefNo = detail.getSheetRefNo();
|
||||
String boxPalletNo = detail.getBoxPalletNo();
|
||||
Long materialBaseInfoId = detail.getMaterialBaseInfoId();
|
||||
Long warehouseId = detail.getWarehouseId();
|
||||
List<MaterialInventory> materialInventories = materialInventoryMapper.selectList(new QueryWrapper<MaterialInventory>().lambda()
|
||||
.eq(MaterialInventory::getBatchRefNo, batchRefNo)
|
||||
.eq(MaterialInventory::getSheetRefNo, sheetRefNo)
|
||||
.eq(MaterialInventory::getBoxPalletNo, boxPalletNo)
|
||||
.eq(MaterialInventory::getWarehouseId, warehouseId)
|
||||
.eq(MaterialInventory::getMaterialBaseInfoId, materialBaseInfoId));
|
||||
if (materialInventories == null || materialInventories.isEmpty()) {
|
||||
throw new ServiceException("库存不存在:" + batchRefNo + " " + sheetRefNo + " " + boxPalletNo);
|
||||
}
|
||||
|
||||
BigDecimal remainingQuantity = detail.getQuantity(); // 计划数量
|
||||
for (MaterialInventory materialInventory : materialInventories) {
|
||||
if (remainingQuantity.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
break;
|
||||
}
|
||||
// 当前物料的可用库存
|
||||
BigDecimal availableStock = materialInventory.getAllocationQuantity();
|
||||
// 如果当前物料没有库存,跳过
|
||||
if (availableStock == null || availableStock.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
continue;
|
||||
}
|
||||
// 计算本次能扣减的数量:取 剩余计划 和 当前库存 的较小值
|
||||
BigDecimal deductQuantity = remainingQuantity.compareTo(availableStock) <= 0
|
||||
? remainingQuantity // 剩余计划 <= 库存,扣剩余计划
|
||||
: availableStock; // 剩余计划 > 库存,扣全部库存
|
||||
|
||||
detail.setMaterialInventoryId(materialInventory.getMaterialInventoryId());
|
||||
detail.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
detail.setStorageLocationName(materialInventory.getStorageLocationName());
|
||||
detail.setStorageLocationCode(materialInventory.getStorageLocationCode());
|
||||
detail.setStorageSectionId(materialInventory.getStorageSectionId());
|
||||
detail.setStorageName(materialInventory.getStorageName());
|
||||
detail.setStorageCode(materialInventory.getStorageCode());
|
||||
detail.setInventoryQuantity(materialInventory.getInventoryQuantity());
|
||||
detail.setAllocationQuantity(deductQuantity);
|
||||
materialDetailList2.add(detail);
|
||||
// 更新剩余计划数量
|
||||
remainingQuantity = remainingQuantity.subtract(deductQuantity);
|
||||
}
|
||||
}
|
||||
stockOutOrderD.setMaterialDetailList(materialDetailList2);
|
||||
StockOutOrderDO assembleStockOutOrderDO = assembleParamByOutOrder(stockOutOrderD);
|
||||
Boolean assignResult = stockOutOrderDomainService.autoAssign(assembleStockOutOrderDO);
|
||||
if (!assignResult) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*public Boolean autoAssign(StockOutOrderDO stockOutOrderDO){
|
||||
StockOutOrderDO assembleStockOutOrderDO = assembleParamByOutOrder(stockOutOrderDO);
|
||||
return stockOutOrderDomainService.autoAssign(assembleStockOutOrderDO);
|
||||
@@ -1487,6 +1571,10 @@ public class StockOutOrderApplicationService {
|
||||
stockOutOrderDomainService.omsOrderAdd(stockOutOrder);
|
||||
}
|
||||
|
||||
public void cancelExecutionOrder(StockOutOrder stockOutOrder){
|
||||
stockOutOrderDomainService.cancelExecutionOrder(stockOutOrder);
|
||||
}
|
||||
|
||||
public void omsOrderAddDetail(List<OutMaterialDetail> outMaterialDetails){
|
||||
stockOutOrderDomainService.omsOrderAddDetail(outMaterialDetails);
|
||||
}
|
||||
|
||||
+3
@@ -261,6 +261,9 @@ public class StockOutOrderDO extends BaseVOEntity {
|
||||
@ApiModelProperty("出库单id集合")
|
||||
private List<Long> outOrderIds;
|
||||
|
||||
@ApiModelProperty("出库单number集合")
|
||||
private List<String> outOrderNumbers;
|
||||
|
||||
@ApiModelProperty("物料明细")
|
||||
private List<OutMaterialDetailDO> materialDetailList;
|
||||
|
||||
|
||||
+63
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -26,6 +27,8 @@ import com.mhd.wms.domain.handoverTaskOrder.repository.facade.IHandoverTaskOrder
|
||||
import com.mhd.wms.domain.handoverTaskOrder.repository.todo.HandoverTaskOrderDO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.inventoryAdjustmentRecord.entity.InventoryAdjustmentRecord;
|
||||
import com.mhd.wms.domain.inventoryAdjustmentRecord.repository.facade.IInventoryAdjustmentRecordService;
|
||||
import com.mhd.wms.domain.inventoryStandingDetail.repository.facade.IInventoryStandingDetailService;
|
||||
import com.mhd.wms.domain.inventoryStandingDetail.repository.todo.InventoryStandingDetailDO;
|
||||
import com.mhd.wms.domain.materialBarCode.repository.facade.IMaterialBarCodeService;
|
||||
@@ -34,6 +37,7 @@ import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.wms.domain.materialInventory.entity.MaterialInventory;
|
||||
import com.mhd.wms.domain.materialInventory.repository.facade.IMaterialInventoryService;
|
||||
import com.mhd.wms.domain.materialInventory.repository.mapper.MaterialInventoryMapper;
|
||||
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryPO;
|
||||
@@ -137,6 +141,8 @@ public class StockOutOrderDomainService {
|
||||
@Autowired
|
||||
private MaterialInventoryMapper materialInventoryMapper;
|
||||
@Autowired
|
||||
private IInventoryAdjustmentRecordService inventoryAdjustmentRecordService;
|
||||
@Autowired
|
||||
private IPickingMaterialDetailService pickingMaterialDetailService;
|
||||
|
||||
/**
|
||||
@@ -594,6 +600,23 @@ public class StockOutOrderDomainService {
|
||||
.in(StockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean execution(String outOrderNumber) {
|
||||
StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper<StockOutOrder>().lambda()
|
||||
.eq(StockOutOrder::getOutOrderNumber, outOrderNumber)
|
||||
.eq(StockOutOrder::getDelFlag, 1));
|
||||
if (stockOutOrder == null) {
|
||||
throw new ServiceException("出库单不存在");
|
||||
}
|
||||
StockOutOrderDO stockOutOrderDO = new StockOutOrderDO();
|
||||
Long outOrderId = stockOutOrder.getOutOrderId();
|
||||
List<Long> outOrderIds = Collections.singletonList(outOrderId);
|
||||
stockOutOrderDO.setOutOrderIds(outOrderIds);
|
||||
auditState(stockOutOrderDO);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 生成拣货单
|
||||
@@ -1727,6 +1750,46 @@ public class StockOutOrderDomainService {
|
||||
stockOutOrderService.save(stockOutOrder);
|
||||
}
|
||||
|
||||
public void cancelExecutionOrder(StockOutOrder stockOutOrder) {
|
||||
String outOrderNumber = stockOutOrder.getOutOrderNumber();
|
||||
StockOutOrder stockOutOrderDB = stockOutOrderService.getOne(new LambdaQueryWrapper<StockOutOrder>()
|
||||
.eq(StockOutOrder::getOutOrderNumber, outOrderNumber)
|
||||
.eq(StockOutOrder::getDelFlag, 1));
|
||||
if (stockOutOrderDB == null) {
|
||||
throw new ServiceException("出库单不存在");
|
||||
}
|
||||
List<OutMaterialDetail> materialDetails = outMaterialDetailService.list(new LambdaQueryWrapper<OutMaterialDetail>()
|
||||
.eq(OutMaterialDetail::getOutOrderNumber, outOrderNumber)
|
||||
.eq(OutMaterialDetail::getDelFlag, 1));
|
||||
if (CollectionUtils.isEmpty(materialDetails)) {
|
||||
throw new ServiceException("出库单明细不存在");
|
||||
}
|
||||
for (OutMaterialDetail materialDetail : materialDetails) {
|
||||
//还原库存
|
||||
BigDecimal allocationQuantity = materialDetail.getAllocationQuantity();
|
||||
Long materialInventoryId = materialDetail.getMaterialInventoryId();
|
||||
MaterialInventory materialInventory = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventory == null) {
|
||||
throw new ServiceException("库存信息不存在");
|
||||
}
|
||||
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().add(allocationQuantity));
|
||||
materialInventory.setFreezeQuantity(materialInventory.getFreezeQuantity().subtract(allocationQuantity));
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
//逻辑删除库存调整记录
|
||||
Long uniqueId = materialDetail.getUniqueId();
|
||||
String relateNo = outOrderNumber+"#"+uniqueId;
|
||||
inventoryAdjustmentRecordService.update(new InventoryAdjustmentRecord(), new LambdaUpdateWrapper<InventoryAdjustmentRecord>()
|
||||
.set(InventoryAdjustmentRecord::getDelFlag, 2)
|
||||
.eq(InventoryAdjustmentRecord::getRelateNo, relateNo));
|
||||
//逻辑删除出库单明细
|
||||
materialDetail.setDelFlag(2);
|
||||
outMaterialDetailService.updateById(materialDetail);
|
||||
}
|
||||
//逻辑删除出库单
|
||||
stockOutOrder.setDelFlag(2);
|
||||
stockOutOrderService.updateById(stockOutOrder);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void omsOrderAddDetail(List<OutMaterialDetail> outMaterialDetails) {
|
||||
if (CollectionUtils.isEmpty(outMaterialDetails)) {
|
||||
|
||||
+27
@@ -217,6 +217,16 @@ public class StockOutOrderApi extends BaseController {
|
||||
return AjaxResult.success(stockOutOrderApplicationService.auditState(stockOutOrderDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核出库单
|
||||
*/
|
||||
@ApiOperation("oms执行")
|
||||
@PostMapping(value = "/execution")
|
||||
public AjaxResult execution(@RequestBody com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO) {
|
||||
String outOrderNumber = stockOutOrderDTO.getOutOrderNumber();
|
||||
return AjaxResult.success(stockOutOrderApplicationService.execution(outOrderNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动分配
|
||||
*/
|
||||
@@ -242,6 +252,17 @@ public class StockOutOrderApi extends BaseController {
|
||||
return toAjax(stockOutOrderApplicationService.autoAssign(stockOutOrderDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动分配
|
||||
*/
|
||||
@ApiOperation("oms执行单下发自动分配")
|
||||
@PostMapping("/omsAutoAssign")
|
||||
public AjaxResult omsAutoAssign(@RequestBody StockOutOrderDTO stockOutOrderDTO) {
|
||||
StockOutOrderDO stockOutOrderDO = new StockOutOrderDO();
|
||||
BeanUtils.copyProperties(stockOutOrderDTO, stockOutOrderDO);
|
||||
return toAjax(stockOutOrderApplicationService.omsAutoAssign(stockOutOrderDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消分配
|
||||
*/
|
||||
@@ -422,6 +443,12 @@ public class StockOutOrderApi extends BaseController {
|
||||
stockOutOrderApplicationService.omsOrderAddDetail(outMaterialDetails);
|
||||
}
|
||||
|
||||
@ApiOperation("oms下发单保存")
|
||||
@PostMapping(value = "/cancelExecutionOrder")
|
||||
public void omsCancelExecutionOrder(@RequestBody StockOutOrder stockOutOrder) {
|
||||
stockOutOrderApplicationService.cancelExecutionOrder(stockOutOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* oms下发单配送明细保存
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user