70 Commits
Author SHA1 Message Date
王奎兴 1c2bb30c44 Merge branch 'dev' into dev_v3.0.5 2026-07-02 19:39:40 +08:00
王奎兴 268c00074f 多仓 2026-07-02 19:38:43 +08:00
赵辉 7f38da20e1 bms修改 2026-07-02 19:29:23 +08:00
王奎兴 176bdbc633 Merge branch 'dev' into dev_user0622
# Conflicts:
#	mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml
2026-07-02 19:09:31 +08:00
王奎兴 c2a4b981e6 Merge branch 'dev' into dev_v3.0.5 2026-07-02 19:07:55 +08:00
王奎兴 ecd5e89172 3.0.5 2026-07-02 18:32:23 +08:00
王奎兴 22ff97e045 3.0.5 2026-07-02 17:44:36 +08:00
王奎兴 afc26a798f 3.0.5 2026-07-02 17:25:09 +08:00
王奎兴 b5914940df 3.0.5 2026-07-02 16:22:49 +08:00
王奎兴 01ec70e3c2 3.0.5 2026-07-02 15:59:58 +08:00
王奎兴 b178e79c8f 3.0.5 2026-07-02 15:04:20 +08:00
王奎兴 0d70cc8b4c 入库业务单编辑报错; 2026-07-02 09:09:43 +08:00
王奎兴 55f089a7d6 入库业务单编辑报错; 2026-07-02 09:03:15 +08:00
王奎兴 b432ab0ac3 入库业务单编辑报错; 2026-07-02 08:56:55 +08:00
王奎兴 08b930e6d4 Merge branch 'dev_v3.0.4' into dev_user0622 2026-07-02 08:35:43 +08:00
赵辉 1ed10bf71b Merge remote-tracking branch 'origin/dev_user0622' into dev_user0622 2026-07-01 21:04:25 +08:00
赵辉 4772395daf 发31 2026-07-01 21:04:08 +08:00
秦鸿展 11fa915e0e 发31 2026-07-01 20:57:18 +08:00
秦鸿展 8c9ef2f083 默认用户是本组织的 2026-07-01 19:34:28 +08:00
王奎兴 193db96e63 v3.0.5 2026-07-01 18:19:03 +08:00
秦鸿展 ec43b3be8a 发30 2026-07-01 18:16:19 +08:00
秦鸿展 9511a38946 一般贸易推送添加字段 2026-07-01 15:28:30 +08:00
秦鸿展 bc962c3131 复核数量检验 2026-07-01 14:20:57 +08:00
王奎兴 4f24096a0c Merge branch 'dev' into dev_user0622 2026-07-01 13:45:20 +08:00
王奎兴 20a7978729 上架报错; 2026-07-01 11:43:32 +08:00
王奎兴 7c18ccf3bb 上架报错; 2026-07-01 11:36:59 +08:00
王奎兴 78c9ab191a 出库拣货单打印 2026-07-01 11:35:22 +08:00
王奎兴 8bec065f69 物料编辑货主查询匹配多组织信息; 2026-07-01 10:14:19 +08:00
王奎兴 d82abe15bf 业务单到执行单不分发组织; 2026-07-01 09:47:23 +08:00
王奎兴 4017c0a60d v3.0.4 2026-06-30 18:06:42 +08:00
秦鸿展 da0dae5f40 发测试包 2026-06-30 14:55:08 +08:00
秦鸿展 8b186907e1 发测试包 2026-06-29 20:05:58 +08:00
王奎兴 183c84cb5b Merge remote-tracking branch 'refs/remotes/origin/dev' into dev_user0622
# Conflicts:
#	mhd-user-center/src/main/resources/bootstrap.yml
2026-06-29 18:24:48 +08:00
王奎兴 9ca77a7d57 出库单执行生成拣货单及取消执行删除拣货单; 2026-06-29 18:04:51 +08:00
王奎兴 40ff9808b8 出库单执行生成拣货单及取消执行删除拣货单; 2026-06-29 18:02:40 +08:00
秦鸿展 4afe929020 APP菜单权限 2026-06-29 17:21:09 +08:00
秦鸿展 d982cc41c3 小程序登录同步YMS用户BUG修改1 2026-06-29 15:47:24 +08:00
秦鸿展 0497d8e96e 小程序登录同步YMS用户BUG修改 2026-06-29 15:32:48 +08:00
秦鸿展 b51bc17838 小程序登录同步YMS用户BUG修改 2026-06-29 15:27:11 +08:00
秦鸿展 2516d86226 小程序新增默认角色信息BUG修改 2026-06-29 15:04:15 +08:00
秦鸿展 287575c622 小程序新增默认角色BUG修改1 2026-06-29 14:55:33 +08:00
秦鸿展 374b26d023 小程序新增默认角色BUG修改 2026-06-29 14:34:38 +08:00
王奎兴 a5489ceb5a 新增修改库存添加组织信息; 2026-06-29 11:07:57 +08:00
王奎兴 de1ef5dec7 预约改造;pda报错; 2026-06-29 10:56:57 +08:00
秦鸿展 8be0813e21 新增角色BUG修改 2026-06-27 19:00:43 +08:00
秦鸿展 dc589fdf3f 新增角色 2026-06-27 18:17:43 +08:00
王奎兴 8f0e71fe2a 预约单改造; 2026-06-27 18:06:31 +08:00
秦鸿展 c6366ef728 司机APP注册是默认用户角色 2026-06-27 17:22:27 +08:00
秦鸿展 2d424847c3 对接微信小程序接口 2026-06-27 14:06:34 +08:00
王奎兴 8893eda62d 执行及取消执行;nc推送客户nc编码查询逻辑修改; 2026-06-26 18:27:24 +08:00
王奎兴 293fedda12 执行及取消执行; 2026-06-26 14:15:33 +08:00
王奎兴 ed4d6111a5 执行及取消执行; 2026-06-26 10:52:57 +08:00
王奎兴 92acdb4f20 货主更新角色变管理员处理; 2026-06-25 14:37:03 +08:00
王奎兴 f933aa9234 货主更新角色变管理员处理; 2026-06-25 14:35:55 +08:00
王奎兴 f704038362 根据组织ids查询仓库; 2026-06-25 11:04:58 +08:00
王奎兴 3e90a8c5c4 货主查询组织; 2026-06-25 10:36:34 +08:00
王奎兴 db198dd2a2 货主查询组织; 2026-06-25 10:28:29 +08:00
王奎兴 a6e727e04a 仓储执行单; 2026-06-24 17:45:44 +08:00
赵辉 ce8e340116 同步委托方修改 2026-06-24 16:07:56 +08:00
王奎兴 42e9f79b10 Merge branch 'dev' into dev_user0622 2026-06-24 13:58:38 +08:00
王奎兴 e966726a0c 加货主是否支持多仓;物料组织模糊查询; 2026-06-24 09:57:20 +08:00
王奎兴 89c3f398b8 加货主是否支持多仓; 2026-06-24 09:48:08 +08:00
王奎兴 84174a6639 Merge remote-tracking branch 'origin/dev' into dev_user0622 2026-06-24 09:39:56 +08:00
赵辉 0ae37ac795 信用修改 2026-06-23 14:39:05 +08:00
赵辉 a14c7776e8 信用修改 2026-06-23 14:00:32 +08:00
赵辉 41fc2d1805 修改字段 2026-06-23 11:30:30 +08:00
赵辉 7ccb06ad79 测试环境 2026-06-23 11:11:11 +08:00
赵辉 21aab4f17e 三方信用修改 2026-06-23 10:27:57 +08:00
赵辉 3224e87814 三方信用修改 2026-06-23 10:14:06 +08:00
赵辉 31247d7faa 委托方增加组织代码,与查询修改 2026-06-23 08:57:06 +08:00
222 changed files with 26318 additions and 1040 deletions
@@ -18,7 +18,7 @@ import java.util.Set;
/**
* bms财务结算系统feign调用接口
*/
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.3:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.32:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface BmsServiceFeign {
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.4:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.33:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface OmsServiceFeign {
@@ -357,6 +357,10 @@ public interface SystemServiceFeign {
@GetMapping("/contractManageApi/getInfoByCustomer")
public AjaxResult getInfoByCustomer(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType);
@ApiOperation("根据结算主体和费用科目获取合同信息")
@GetMapping(value = "/contractManageApi/getInfoByCustomerAndSecondSubjectCode")
public AjaxResult getInfoByCustomerAndSecondSubjectCode(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("firstSubjectCode") String firstSubjectCode,@RequestParam("topOrganizationId") Long topOrganizationId,@RequestParam("organizationId") Long organizationId);
/**
* 根据结算主体获取合同信息
*/
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.102.192.30:8014",configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.102.192.31:8014",configuration = FeignAutoConfiguration.class)
public interface WlhyServiceFeign {
/**
@@ -1,5 +1,6 @@
package com.mhd.system.api;
import cn.hutool.json.JSONUtil;
import com.mhd.common.core.constant.ServiceNameConstants;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
@@ -20,7 +21,7 @@ import java.util.Map;
* @description: TODO
* @date 2024/5/10 8:58
**/
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.102.192.3:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.102.192.32:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface WmsServiceFeign {
/**
@@ -97,6 +98,18 @@ public interface WmsServiceFeign {
@PostMapping(value = "/stockInOrderApi/omsInOrderAdd")
public void omsInOrderAdd(@RequestBody StockInOrder stockInOrder);
@ApiOperation("oms取消下发单保存")
@PostMapping(value = "/stockOutOrderApi/cancelExecutionOrder")
public void omsCancelExecutionOrder(@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下发单明细保存
*/
@@ -121,4 +134,11 @@ public interface WmsServiceFeign {
*/
@GetMapping("/materialBaseInfoApi/getBatchByIds")
public TableDataInfo getBatchByIds(@RequestParam("materialBaseInfoIds") List<Long> materialBaseInfoIds);
/**
* 生成拣货单
*/
@ApiOperation("生成拣货单")
@PostMapping("/stockOutOrderApi/genPickingOrderByOms")
public AjaxResult genPickingOrderByOms(@RequestBody com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO);
}
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.4:8018", configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.33:8018", configuration = FeignAutoConfiguration.class)
public interface YmsServiceFeign {
/**
@@ -84,4 +84,6 @@ public class MaterialInventoryOmsParamDO extends BaseVOEntity {
//过期日期
private Date expiryDate;
private String executioOrderNumber;
}
@@ -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;
}
@@ -284,6 +284,10 @@ public class RemoteSystemFeignFallbackFactory implements FallbackFactory<SystemS
return AjaxResult.error("查询失败");
}
@Override
public AjaxResult getInfoByCustomerAndSecondSubjectCode(String settlementCustomersCode, Integer contractType, String firstSubjectCode, Long topOrganizationId, Long organizationId) {
return null;
}
@Override
public AjaxResult getInfoByCustomer2(String settlementCustomersCode, Integer contractType, Long topOrganizationId) {
return AjaxResult.error("查询失败");
@@ -73,6 +73,21 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
public void omsInOrderAdd(StockInOrder stockInOrder) {
}
@Override
public void omsCancelExecutionOrder(StockOutOrder stockOutOrder) {
}
@Override
public void omsAutoAssign(StockOutOrderDTO stockOutOrderDTO) {
}
@Override
public AjaxResult execution(StockOutOrderDTO stockOutOrderDTO) {
return null;
}
@Override
public void omsInOrderAddDetail(List<InMaterialDetail> inMaterialDetails) {
}
@@ -99,6 +114,11 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
tableDataInfo.setCode(500);
return tableDataInfo;
}
@Override
public AjaxResult genPickingOrderByOms(StockOutOrderDTO stockOutOrderDTO) {
return null;
}
};
}
}
@@ -40,6 +40,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -107,11 +108,14 @@ public class TokenLoginApplicationService {
//租户一级组织ID
SysTenantsPo sysTenantsPo = JSON.parseObject(JSON.toJSONString(topOrganizationIdR.get("data")), SysTenantsPo.class);
Long topOrganizationId = sysTenantsPo.getOrganizationId();
// 获取用户选择的组织ID,未选则使用一级组织ID
Long selectedOrgId = loginDTO.getOrganizationId();
Long organizationId = (selectedOrgId != null) ? selectedOrgId : topOrganizationId;
//获取用户信息,组装dto
UserDTO userDTO = new UserDTO();
userDTO.setUserPhone(userPhone);
userDTO.setTopOrganizationId(topOrganizationId);
userDTO.setOrganizationId(topOrganizationId);
userDTO.setOrganizationId(organizationId);
// 查询用户信息,查询组织下用户是否存在
R<LoginUser> userResult = userServiceFeign.getUserByTopOrganizationUserPhone(userDTO, SecurityConstants.INNER);
if (R.FAIL == userResult.getCode()) {
@@ -153,7 +157,8 @@ public class TokenLoginApplicationService {
}else {
userDTO.setBusinessType(4);
}
userDTO.setOrganizationName(sysTenantsPo.getOrganizationName());
userDTO.setOrganizationName(StringUtils.isNotBlank(loginDTO.getOrganizationName())
? loginDTO.getOrganizationName() : sysTenantsPo.getOrganizationName());
userResult = userServiceFeign.registerAddUser(userDTO, SecurityConstants.INNER);
userInfo = userResult.getData();
} else {
@@ -379,6 +384,10 @@ public class TokenLoginApplicationService {
throw new ServiceException("用户不存在/密码错误");
}
}
// 验证码登录时 userInfo.getUserPo() 可能为null,加保护
if (userInfo == null || userInfo.getUserPo() == null || userInfo.getUserPo().getOrganizationId() == null) {
throw new ServiceException("登录用户组织信息不完整,请联系管理员");
}
R<OrganizationPo> organizationInfo = organizationServiceFeign.getInfoForIdList(userInfo.getUserPo().getOrganizationId());
if (ObjectUtil.isNull(organizationInfo) || ObjectUtil.isNull(organizationInfo.getData())) {
throw new ServiceException("登录用户组织不存在");
@@ -569,4 +578,29 @@ public class TokenLoginApplicationService {
sysPasswordService.validateByWms(userPo, verificationCode, 1);
return userInfo;
}
/**
* 根据域名获取组织信息(免Token,供司机APP注册时选择组织用)
*/
public AjaxResult getOrganizationByPath(String path) {
if (StringUtils.isBlank(path)) {
return AjaxResult.error("域名不能为空");
}
try {
AjaxResult result = organizationServiceFeign.getOrganizationByPath(path);
if (ObjectUtil.isNull(result) || ObjectUtil.isNull(result.get("data"))) {
return AjaxResult.error("未找到对应组织");
}
SysTenantsPo sysTenantsPo = JSON.parseObject(JSON.toJSONString(result.get("data")), SysTenantsPo.class);
Long topOrganizationId = sysTenantsPo.getOrganizationId();
// 返回一级组织ID和名称,前端可据此展示组织选择
Map<String, Object> data = new java.util.HashMap<>();
data.put("organizationId", topOrganizationId);
data.put("organizationName", sysTenantsPo.getOrganizationName());
return AjaxResult.success(data);
} catch (Exception e) {
log.error("获取组织信息失败, path={}", path, e);
return AjaxResult.error("获取组织信息失败:" + e.getMessage());
}
}
}
@@ -34,4 +34,10 @@ public class LoginDTO {
@ApiModelProperty(name = "APP包名")
private String appMark;
@ApiModelProperty(name = "组织ID(司机选择组织,不传默认一级组织)")
private Long organizationId;
@ApiModelProperty(name = "组织名称(司机选择组织时传入)")
private String organizationName;
}
@@ -9,11 +9,13 @@ import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.utils.JwtUtils;
import com.mhd.common.core.utils.StringUtils;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.annotation.RepeatSubmit;
import com.mhd.common.security.auth.AuthUtil;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@@ -75,6 +77,15 @@ public class AppTokenController extends BaseController {
return R.ok();
}
/**
* 根据域名获取组织信息(免Token,供司机APP注册时选择组织用)
*/
@ApiOperation("根据域名获取组织信息")
@GetMapping("/getOrganizationByPath/{path}")
public AjaxResult getOrganizationByPath(@PathVariable("path") String path) {
return tokenLoginApplicationService.getOrganizationByPath(path);
}
/**
* @Description wms 新登录接口
+8 -7
View File
@@ -14,19 +14,20 @@ spring:
discovery:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
username: nacos
password: manhuoda@2023
#线上正式环境
# server-addr: 10.102.192.5:6848
# server-addr: 10.33.0.129:6010
# username: nacos
# password: manhuoda@2023
#线上正式环境
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
config:
# server-addr: 127.0.0.1:8848
# 测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
# server-addr: 10.33.0.129:6010
# 线上测试环境配置 容器名+端口号
# server-addr: 10.102.192.5:6848
#
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
#线上正式环境
@@ -271,4 +271,8 @@ public class UserShipperPo {
@ApiModelProperty("货主code")
private String roleCodeShipper;
@ApiModelProperty(name = "是否校验信用")
private String isCheckCredit;
@ApiModelProperty(name = "组织代码")
private String orgCode;
}
@@ -268,12 +268,25 @@ public class ContractManageApplicationService {
Long organizationId = contractManageDTO.getOrganizationId();
String sunjectCode = contractManageDTO.getSubjectCode();
Long topOrganizationId = contractManageDTO.getTopOrganizationId();
List<ContractManage> UserContractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
.eq(ContractManage::getSettlementCustomersId, settlementCustomersId)
.eq(ContractManage::getDelFlag, 1)
.eq(ContractManage::getOrganizationId, organizationId)
.eq(ContractManage::getTopOrganizationId, topOrganizationId)
.eq(ContractManage::getCommonContractFlag, 2));
ContractManageDO contractManageDO = new ContractManageDO();
contractManageDO.setOrganizationId(organizationId);
contractManageDO.setSettlementCustomersId(settlementCustomersId);
contractManageDO.setTopOrganizationId(topOrganizationId);
contractManageDO.setCommonContractFlag(2);
contractManageDO.setDelFlag(1);
contractManageDO.setFirstSubjectCode(sunjectCode);
List<ContractManagePO> contractManagePOS = contractManageMapper.queryList(contractManageDO);
if (contractManagePOS != null && contractManagePOS.size() > 1) {
throw new RuntimeException("同一费用科目存在多条合同,请检查");
}
List<ContractManage> UserContractManages = new ArrayList<>();
if (contractManagePOS != null) {
for (ContractManagePO po : contractManagePOS) {
ContractManage contractManage = new ContractManage();
BeanUtils.copyProperties(po, contractManage);
UserContractManages.add(contractManage);
}
}
if (UserContractManages != null && UserContractManages.size() > 0) {
//用户合同计费策略
calucateSubjectAndPriceStrategy(UserContractManages, organizationId, topOrganizationId, sunjectCode, result);
@@ -595,7 +608,8 @@ public class ContractManageApplicationService {
通用合同:同一时间段、同一合同类型,只能存在一个
特殊合同:同一结算主体、同一时间段、同一合同类型,只能存在一个
*/
checkContract(contractManageDO);
//20260702取消同一时间段不能有相同合同校验
//checkContract(contractManageDO);
handleData(contractManageDO);
handleDict(contractManageDO);
contractManageDO.setContractNumber(OrderSequence.getOrderCode("HT"));
@@ -603,7 +617,7 @@ public class ContractManageApplicationService {
contractManageDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
contractManageDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
boolean flag = contractManageDomainService.insert(contractManageDO);
handleDetils(contractManageDO);
handleDetils(contractManageDO, true);
return flag;
}
@@ -737,7 +751,7 @@ public class ContractManageApplicationService {
/**
* 处理合同详情
*/
private void handleDetils(ContractManageDO contractManageDO) {
private void handleDetils(ContractManageDO contractManageDO, boolean isInsert) {
//获取当前登录人信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
@@ -813,10 +827,12 @@ public class ContractManageApplicationService {
}
}
if(null != contractManagePO){
if (isInsert) {
// 新增/复制时使用新插入的合同ID
contractManageDetailDO.setContractManageId(contractManageDO.getContractManageId());
} else if(null != contractManagePO){
contractManageDetailDO.setContractManageId(contractManagePO.getContractManageId());
}
//contractManageDetailDO.setContractManageId(contractManageDO.getContractManageId());
contractManageDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
contractManageDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
contractManageDetailDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
@@ -831,9 +847,9 @@ public class ContractManageApplicationService {
@Transactional
public Boolean update(ContractManageDO contractManageDO) {
validateContractType(contractManageDO.getContractType());
checkContract(contractManageDO);
//checkContract(contractManageDO);
handleData(contractManageDO);
handleDetils(contractManageDO);
handleDetils(contractManageDO, false);
handleDict(contractManageDO);
return contractManageDomainService.update(contractManageDO);
}
@@ -935,6 +951,78 @@ public class ContractManageApplicationService {
return resultContract;
}
public ContractManagePO getInfoByCustomerAndSecondSubjectCode(String settlementCustomersCode,Integer contractType, Long topOrganizationId, Long organizationId,String firstSubjectCode) {
/*
首先根据合同类型(仓储、运输、其他),以及结算客户,查询合同信息
如果传了结算主体,则根据结算主体以及当前时间查询有效的特殊合同,如果特殊合同没有,则查询通用合同
*/
//获取当前登录人信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser) && topOrganizationId == null) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
if(contractType==null){
throw new ServiceException("合同类型不能为空");
}
ContractManagePO resultContract = new ContractManagePO();
//查询当前日期在有效期内的合同
ContractManageDO queryParam = new ContractManageDO();
queryParam.setNowDateString(DateUtil.format(new Date(),"yyyy-MM-dd"));
queryParam.setFirstSubjectCode(firstSubjectCode);
queryParam.setOrganizationId(organizationId);
queryParam.setTopOrganizationId(topOrganizationId);
List<ContractManagePO> contractManagePOList = contractManageDomainService.queryList(queryParam);
List<ContractManagePO> contractManagePOs = contractManagePOList.stream()
.filter(item -> item.getSettlementCustomersCode().equals(settlementCustomersCode)
&& Objects.equals(item.getContractType(), contractType))
.collect(Collectors.toList());
if (contractManagePOs != null && contractManagePOs.size() > 1) {
throw new ServiceException("存在多条相同费用科目的合同,请检查");
}
if(contractManagePOList != null && contractManagePOList.size()>0){
if(StringUtils.isNotEmpty(settlementCustomersCode)){
//根据结算对象,及合同的类型 查询对应合同信息
ContractManagePO contractManagePO = contractManagePOList.stream()
.filter(item -> item.getSettlementCustomersCode().equals(settlementCustomersCode) && Objects.equals(item.getContractType(), contractType)).findFirst().orElse(null);
if(null == contractManagePO){
resultContract = findGeneralContract(contractManagePOList, contractType);
}else {
resultContract = contractManagePO;
}
}else {
resultContract = findGeneralContract(contractManagePOList, contractType);
}
if(null == resultContract){
throw new ServiceException("找不到匹配的合同,请重试");
}
//得到合同后,查询合同明细
List<ContractManageDetailPO> contractManageDetailPOList = contractManageDetailDomainService.queryListByManageId(resultContract.getContractManageId());
List<ContractManageDetailPO> contractManageDetailSaveList = new ArrayList<>();
if(contractManageDetailPOList != null && contractManageDetailPOList.size()>0){
//将临时合同中没有,但是通用合同中有的数据过滤出(使用 ObjectUtil.equal 避免 firstSubjectCode/secondSubjectCode 为 null 时 NPE
contractManageDetailSaveList = contractManageDetailPOList.stream().filter(item -> contractManageDetailPOList.stream().noneMatch(item1 -> ObjectUtil.equal(item1.getFirstSubjectCode(), item.getFirstSubjectCode()) && ObjectUtil.equal(item1.getSecondSubjectCode(), item.getSecondSubjectCode()) && item1.getSubjectType()==1)).collect(Collectors.toList());
//首先根据结算科目类型将临时合同过滤出
List<ContractManageDetailPO> tempContractManageDetailPOList = contractManageDetailPOList.stream().filter(item -> item.getSubjectType()==2).collect(Collectors.toList());
//遍历两个集合,将相同费用科目code的数据,进行比较,如果结算科目类型是临时且合同有效期有效,则使用该条数据,将另一条移除
for (ContractManageDetailPO manageDetailPO : tempContractManageDetailPOList) {
for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOList) {
if(ObjectUtil.equal(contractManageDetailPO.getFirstSubjectCode(), manageDetailPO.getFirstSubjectCode()) && ObjectUtil.equal(contractManageDetailPO.getSecondSubjectCode(), manageDetailPO.getSecondSubjectCode())){
//判断如果是临时合同在有效期内,则将该条数据保存到集合contractManageDetailSaveList
DateTime start = DateUtil.parseDate(DateUtil.format(manageDetailPO.getSubjectEffectiveDate(),"yyyy-MM-dd"));
DateTime end = DateUtil.parseDateTime(DateUtil.format(manageDetailPO.getSubjectEffectiveDate(),"yyyy-MM-dd"));
DateTime now = DateUtil.beginOfDay(DateUtil.date());
if (now.isAfterOrEquals(start) && now.isBefore(end)) {
contractManageDetailSaveList.add(manageDetailPO);
}
}
}
}
}
resultContract.setContractManageDetailPOList(contractManageDetailSaveList);
}
return resultContract;
}
/**
* 根据结算主体获取合同信息
* @param settlementCustomersCode 结算主体code
@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.mhd.common.core.utils.StringUtils;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -98,6 +99,13 @@ public class WarehouseApplicationService {
}
}
}
String orgIds = warehouseDO.getOrgIds();
if (StringUtils.isNotEmpty(orgIds)) {
String[] orgIdArray = orgIds.split(",");
List<Long> orgIdList = Arrays.stream(orgIdArray).map(Long::valueOf).collect(Collectors.toList());
warehouseDO.setOrgIdList(orgIdList);
warehouseDO.setOrganizationId(null);
}
return warehouseDomainService.queryList(warehouseDO);
}
@@ -23,7 +23,7 @@ public interface IContractManageService extends IService<ContractManage>
/**
* 新增合同管理
*/
public Boolean insert(ContractManageDO contractManageDO);
public Long insert(ContractManageDO contractManageDO);
/**
* 修改合同管理
@@ -37,10 +37,11 @@ public class ContractManageImpl extends ServiceImpl<ContractManageMapper, Contra
* 新增合同管理
*/
@Override
public Boolean insert(ContractManageDO contractManageDO) {
public Long insert(ContractManageDO contractManageDO) {
ContractManage contractManage = new ContractManage();
BeanUtils.copyProperties(contractManageDO,contractManage);
return this.save(contractManage);
this.save(contractManage);
return contractManage.getContractManageId();
}
/**
@@ -214,4 +214,6 @@ public class ContractManageDO extends BaseVOEntity{
@ApiModelProperty(name = "是否包含运输费用(1-包含,2-包含)")
private Integer transportationCosts;
@ApiModelProperty("一级费用科目code")
private String firstSubjectCode;
}
@@ -60,8 +60,9 @@ public class ContractManageDomainService {
* 新增合同管理
*/
public Boolean insert(ContractManageDO contractManageDO) {
return contractManageService.insert(contractManageDO);
Long contractManageId = contractManageService.insert(contractManageDO);
contractManageDO.setContractManageId(contractManageId);
return true;
}
/**
@@ -148,6 +149,7 @@ public class ContractManageDomainService {
LambdaQueryWrapper<ContractManage> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ContractManage::getOriginalContractNumber,contractNumber);
queryWrapper.eq(ContractManage::getDelFlag,1);
queryWrapper.last("LIMIT 1");
ContractManage contractManage = contractManageService.getOne(queryWrapper);
if(null != contractManage){
BeanUtils.copyProperties(contractManage,contractManagePO);
@@ -68,6 +68,20 @@ public class StorageSectionDomainService {
storageSectionDO.getStorageCode(), storageSectionDO.getStorageName(), null);
//设置仓库
setWarehouseInfo(storageSectionDO);
String storageCode = storageSectionDO.getStorageCode();
String storageName = storageSectionDO.getStorageName();
Long warehouseId = storageSectionDO.getWarehouseId();
List<StorageSection> codelist = storageSectionService.list(new QueryWrapper<StorageSection>().lambda()
.eq(StorageSection::getStorageCode, storageCode)
.eq(StorageSection::getWarehouseId, warehouseId)
.eq(StorageSection::getDelFlag, 1));
List<StorageSection> namelist = storageSectionService.list(new QueryWrapper<StorageSection>().lambda()
.eq(StorageSection::getStorageName, storageName)
.eq(StorageSection::getWarehouseId, warehouseId)
.eq(StorageSection::getDelFlag, 1));
if ((codelist != null && codelist.size() > 0) || (namelist != null && namelist.size() > 0)) {
throw new ServiceException("库区编码或名称已存在");
}
return storageSectionService.insert(storageSectionDO);
}
@@ -86,6 +100,22 @@ public class StorageSectionDomainService {
storageSectionDO.getStorageSectionId());
//设置仓库
setWarehouseInfo(storageSectionDO);
String storageCode = storageSectionDO.getStorageCode();
String storageName = storageSectionDO.getStorageName();
Long warehouseId = storageSectionDO.getWarehouseId();
List<StorageSection> codelist = storageSectionService.list(new QueryWrapper<StorageSection>().lambda()
.eq(StorageSection::getStorageCode, storageCode)
.eq(StorageSection::getWarehouseId, warehouseId)
.ne(StorageSection::getStorageSectionId, storageSectionDO.getStorageSectionId())
.eq(StorageSection::getDelFlag, 1));
List<StorageSection> namelist = storageSectionService.list(new QueryWrapper<StorageSection>().lambda()
.eq(StorageSection::getStorageName, storageName)
.eq(StorageSection::getWarehouseId, warehouseId)
.ne(StorageSection::getStorageSectionId, storageSectionDO.getStorageSectionId())
.eq(StorageSection::getDelFlag, 1));
if ((codelist != null && codelist.size() > 0) || (namelist != null && namelist.size() > 0)) {
throw new ServiceException("库区编码或名称已存在");
}
return storageSectionService.update(storageSectionDO);
}
@@ -127,4 +127,8 @@ public class WarehouseDO extends BaseVOEntity{
private Integer isEnable;
@ApiModelProperty("仓库id 集合")
private List<Long> warehouseIds;
@ApiModelProperty("组织id 集合")
private String orgIds;
@ApiModelProperty("组织id 集合")
private List<Long> orgIdList;
}
@@ -132,4 +132,8 @@ public class WarehouseDTO extends BaseVOEntity{
@ApiModelProperty("是否启用: 1-否 2-是")
@Excel(name = "是否启用: 1-否 2-是")
private Integer isEnable;
@ApiModelProperty("组织id 集合")
private String orgIds;
@ApiModelProperty("组织id 集合")
private List<Long> orgIdList;
}
@@ -160,6 +160,13 @@ public class ContractManageApi extends BaseController{
return AjaxResult.success(contractManageApplicationService.getInfoByCustomer(settlementCustomersCode,contractType,null));
}
@ApiOperation("根据结算主体和费用科目获取合同信息")
@GetMapping(value = "/getInfoByCustomerAndSecondSubjectCode")
public AjaxResult getInfoByCustomerAndSecondSubjectCode(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("firstSubjectCode") String firstSubjectCode,@RequestParam("topOrganizationId") Long topOrganizationId,@RequestParam("organizationId") Long organizationId)
{
return AjaxResult.success(contractManageApplicationService.getInfoByCustomerAndSecondSubjectCode(settlementCustomersCode,contractType,topOrganizationId,organizationId,firstSubjectCode));
}
@ApiOperation("根据结算主体获取合同信息")
@GetMapping(value = "/getInfoByCustomer2")
public AjaxResult getInfoByCustomer2(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("topOrganizationId") Long topOrganizationId)
@@ -6,11 +6,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectContractManagePo">
select
*
from contract_manage
SELECT DISTINCT a.*
FROM CONTRACT_MANAGE a
INNER JOIN CONTRACT_MANAGE_DETAIL b
ON a.CONTRACT_MANAGE_ID = b.CONTRACT_MANAGE_ID
where
del_flag = 1
a.del_flag = 1
</sql>
<sql id="selectContractManagePo1">
@@ -46,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and contract_state = #{contractState}
</if>
<if test="signingUnit != null and signingUnit != ''">
and signing_unit = #{signingUnit}
and asigning_unit = #{signingUnit}
</if>
<if test="settlementCustomers != null and settlementCustomers != ''">
and settlement_customers = #{settlementCustomers}
@@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="theyOperatorPhone != null and theyOperatorPhone != ''">
and they_operator_phone = #{theyOperatorPhone}
</if>
</where>
</sql>
@@ -132,72 +134,75 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="common_where">
<if test="contractManageDO.contractNumber != null and contractManageDO.contractNumber != ''">
and contract_number like concat('%', #{contractManageDO.contractNumber}, '%')
and a.contract_number like concat('%', #{contractManageDO.contractNumber}, '%')
</if>
<if test="contractManageDO.originalContractNumber != null and contractManageDO.originalContractNumber != ''">
and original_contract_number like concat('%', #{contractManageDO.originalContractNumber}, '%')
and a.original_contract_number like concat('%', #{contractManageDO.originalContractNumber}, '%')
</if>
<if test="contractManageDO.commonContractFlag != null">
and common_contract_flag = #{contractManageDO.commonContractFlag}
and a.common_contract_flag = #{contractManageDO.commonContractFlag}
</if>
<if test="contractManageDO.contractType != null">
and contract_type = #{contractManageDO.contractType}
and a.contract_type = #{contractManageDO.contractType}
</if>
<if test="contractManageDO.settlementCustomers != null and contractManageDO.settlementCustomers != '' " >
and settlement_customers like concat('%', #{contractManageDO.settlementCustomers}, '%')
and a.settlement_customers like concat('%', #{contractManageDO.settlementCustomers}, '%')
</if>
<if test="contractManageDO.settlementCustomersCode != null">
and settlement_customers_code = #{contractManageDO.settlementCustomersCode}
and a.settlement_customers_code = #{contractManageDO.settlementCustomersCode}
</if>
<if test="contractManageDO.signingUnit != null and contractManageDO.signingUnit != ''">
and signing_unit like concat('%', #{contractManageDO.signingUnit}, '%')
and a.signing_unit like concat('%', #{contractManageDO.signingUnit}, '%')
</if>
<if test="contractManageDO.contractName != null and contractManageDO.contractName != ''">
and contract_name like concat('%', #{contractManageDO.contractName}, '%')
and a.contract_name like concat('%', #{contractManageDO.contractName}, '%')
</if>
<if test="contractManageDO.contractState != null">
and contract_state = #{contractManageDO.contractState}
and a.contract_state = #{contractManageDO.contractState}
</if>
<if test="contractManageDO.signingDateStart != null and contractManageDO.signingDateStart != ''">
AND date_format(signing_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.signingDateStart}
AND date_format(a.signing_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.signingDateStart}
</if>
<if test="contractManageDO.signingDateEnd != null and contractManageDO.signingDateEnd != ''">
AND date_format(signing_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.signingDateEnd}
AND date_format(a.signing_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.signingDateEnd}
</if>
<if test="contractManageDO.effectiveDateStart != null and contractManageDO.effectiveDateStart != ''">
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateStart}
AND date_format(a.effective_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateStart}
</if>
<if test="contractManageDO.effectiveDateEnd != null and contractManageDO.effectiveDateEnd != ''">
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.effectiveDateEnd}
AND date_format(a.effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.effectiveDateEnd}
</if>
<if test="contractManageDO.expirationDateStart != null and contractManageDO.expirationDateStart != ''">
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.expirationDateStart}
AND date_format(a.expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.expirationDateStart}
</if>
<if test="contractManageDO.expirationDateEnd != null and contractManageDO.expirationDateEnd != ''">
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateEnd}
AND date_format(a.expiration_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateEnd}
</if>
<!-- 时间段重叠判断:只有当已有合同与传入的有效期真正有交集时才算冲突
条件:已有合同开始日期 <= 新合同结束日期 且 已有合同结束日期 >= 新合同开始日期 -->
<if test="contractManageDO.effectiveDateString != null and contractManageDO.effectiveDateString != ''
and contractManageDO.expirationDateString != null and contractManageDO.expirationDateString != ''">
AND (
date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateString}
AND date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateString}
date_format(a.effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.expirationDateString}
AND date_format(a.expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.effectiveDateString}
)
</if>
<if test="contractManageDO.nowDateString != null and contractManageDO.nowDateString != ''">
AND (
date_format(expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.nowDateString}
AND date_format(effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.nowDateString}
date_format(a.expiration_date,'%Y-%m-%d') <![CDATA[>=]]> #{contractManageDO.nowDateString}
AND date_format(a.effective_date,'%Y-%m-%d') <![CDATA[<=]]> #{contractManageDO.nowDateString}
)
</if>
<if test="contractManageDO.organizationId != null">
and organization_id = #{contractManageDO.organizationId}
and a.organization_id = #{contractManageDO.organizationId}
</if>
<if test="contractManageDO.topOrganizationId != null">
and top_organization_id = #{contractManageDO.topOrganizationId}
and a.top_organization_id = #{contractManageDO.topOrganizationId}
</if>
<if test="contractManageDO.firstSubjectCode != null and contractManageDO.firstSubjectCode != ''">
and b.FIRST_SUBJECT_CODE = #{contractManageDO.firstSubjectCode}
</if>
</sql>
@@ -130,6 +130,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="orgIdList != null and orgIdList.size > 0 ">
and organization_id in
<foreach collection="orgIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
<otherwise> and del_flag = 1 </otherwise>
@@ -1860,25 +1860,64 @@ public class UserApplicationService {
userDO.setUserName("用户" + userDO.getUserPhone().substring(userDO.getUserPhone().length() - 4));
}
UserEntity userEntity = userDomainService.addUser(userDO);
//同步网货平台员工信息
wlhyDomainService.addOrEditPlatformUser1(userEntity);
//同步商城用户
userMallDomainService.syncDriverUserInfo(userEntity);
//给用户分配默认普通角色权限
RoleDo roleDo = new RoleDo();
roleDo.setRoleCode(RoleEnum.DRIVER.getCode());
roleDo.setOrganizationId(userEntity.getOrganizationId());
RoleEntity roleEntity = roleDomainService.selectByOrganizationIdAndRoleCode(roleDo);
if (null != roleEntity) {
UserRoleDo userRoleDo = new UserRoleDo();
userRoleDo.setUserId(userEntity.getUserId());
userRoleDo.setRoleId(roleEntity.getRoleId());
//判断是否存在当前登录人
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
userRoleDomainService.addUserRole(userRoleDo,userEntity);
}else {
userRoleDomainService.addUserRole(userRoleDo);
//给小程序注册用户分配默认普通用户角色must本组织没有则找上级
userEntity.setUserPassword("Aa123456"); // 三方同步需要密码
try {
RoleDo mustRoleDo = new RoleDo();
mustRoleDo.setRoleCode(RoleEnum.MUST.getCode());
mustRoleDo.setOrganizationId(userEntity.getOrganizationId());
RoleEntity mustRoleEntity = roleDomainService.selectByOrganizationIdAndRoleCode(mustRoleDo);
// 本组织没有找上级组织
if (null == mustRoleEntity && userEntity.getTopOrganizationId() != null
&& !userEntity.getTopOrganizationId().equals(userEntity.getOrganizationId())) {
mustRoleDo.setOrganizationId(userEntity.getTopOrganizationId());
mustRoleEntity = roleDomainService.selectByOrganizationIdAndRoleCode(mustRoleDo);
}
if (null != mustRoleEntity) {
UserRoleDo mustUserRoleDo = new UserRoleDo();
mustUserRoleDo.setUserId(userEntity.getUserId());
mustUserRoleDo.setRoleId(mustRoleEntity.getRoleId());
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
userRoleDomainService.addUserRole(mustUserRoleDo, userEntity);
} else {
userRoleDomainService.addUserRole(mustUserRoleDo);
}
userDO.setRoleCode(RoleEnum.MUST.getCode());
userDO.setRoleName(mustRoleEntity.getRoleName());
userEntity.setRoleCode(RoleEnum.MUST.getCode());
userEntity.setRoleName(mustRoleEntity.getRoleName());
}
} catch (Exception e) {
log.warn("分配默认角色失败,但不影响用户保存: {}", e.getMessage());
}
//更新user表role_code和role_name用mapper直接更新避免需要loginUser
userMapper.update(null, new LambdaUpdateWrapper<UserEntity>()
.set(UserEntity::getRoleCode, userDO.getRoleCode())
.set(UserEntity::getRoleName, userDO.getRoleName())
.eq(UserEntity::getUserId, userEntity.getUserId()));
//同步三方平台放在角色分配之后确保roleCode已设置
try {
wlhyDomainService.addOrEditPlatformUser1(userEntity);
} catch (Exception e) {
log.warn("同步网货平台员工信息失败,但不影响用户保存: {}", e.getMessage());
}
try {
userMallDomainService.syncDriverUserInfo(userEntity);
} catch (Exception e) {
log.warn("同步商城用户失败,但不影响用户保存: {}", e.getMessage());
}
// 只有组织开启园区排队才同步YMS
Integer isQueue = userMapper.getOrdIsQueue(userEntity.getOrganizationId());
if (isQueue != null && isQueue == 1) {
try {
// 截断avatar URLYMS的avatar列长度有限去掉OSS签名参数
if (userEntity.getAvatar() != null && userEntity.getAvatar().contains("?")) {
userEntity.setAvatar(userEntity.getAvatar().substring(0, userEntity.getAvatar().indexOf("?")));
}
ymsDomainService.addOrEditYmsUser(userEntity);
} catch (Exception e) {
log.warn("同步YMS平台员工信息失败,但不影响用户保存: {}", e.getMessage());
}
}
//2024年3月27日16:40:15 处理用户验证码注册首次登录redis用户数据不更新问题
@@ -1934,6 +1973,23 @@ public class UserApplicationService {
userDO.setDriverEnterpriseCode(driverEnterpriseCode);
UserPo userPo = registerAddUser(userDO);
// 承运企业添加司机补分配driver角色
RoleDo driverRoleDo = new RoleDo();
driverRoleDo.setRoleCode(RoleEnum.DRIVER.getCode());
driverRoleDo.setOrganizationId(loginUser.getUserPo().getOrganizationId());
RoleEntity driverRoleEntity = roleDomainService.selectByOrganizationIdAndRoleCode(driverRoleDo);
if (null != driverRoleEntity) {
UserRoleDo driverUserRoleDo = new UserRoleDo();
driverUserRoleDo.setUserId(userPo.getUserId());
driverUserRoleDo.setRoleId(driverRoleEntity.getRoleId());
userRoleDomainService.addUserRole(driverUserRoleDo);
// 更新user表role_code和role_name为driver承运企业司机不需要must
userMapper.update(null, new LambdaUpdateWrapper<UserEntity>()
.set(UserEntity::getRoleCode, RoleEnum.DRIVER.getCode())
.set(UserEntity::getRoleName, RoleEnum.DRIVER.getName())
.eq(UserEntity::getUserId, userPo.getUserId()));
}
//20240314 运输企业添加司机默认生成一条空的司机信息方便列表查询
UserDriverDO userDriverDO = new UserDriverDO();
userDriverDO.setUserId(userPo.getUserId());
@@ -521,6 +521,7 @@ public class UserShipperApplicationService {
userShipperDO.setUpdateBy(loginUserPo.getUserId());
userShipperDO.setUpdateByName(loginUserPo.getUserName());
userShipperDO.setUpdateTime(new Date());
userShipperDO.setRoleCode("ownerCargo");
updateUserInformation(userShipperDO);
//保存托运人信息
userShipperDomainService.saveUserShipper(userShipperDO);
@@ -583,6 +584,7 @@ public class UserShipperApplicationService {
refreshShipperDictData(userShipperDO);
UserDO userDO = new UserDO();
BeanUtils.copyProperties(userShipperDO, userDO, IgnoreNullUtil.getNullPropertyNames(userShipperDO));
//修改用户表信息
UserPo userPo = userApplicationService.updateUser(userDO);
@@ -1372,6 +1374,62 @@ public class UserShipperApplicationService {
throw new ServiceException("获取组织配置失败");
}
// 检查是否已存在相同customerNcCode的委托方可能在不同组织
List<UserShipperEntity> existingShippers = userShipperMapper.selectList(
new LambdaQueryWrapper<UserShipperEntity>()
.eq(UserShipperEntity::getShipperEnterpriseName, record.getDesc1())
.eq(UserShipperEntity::getDelFlag, 1));
if (CollUtil.isNotEmpty(existingShippers)) {
// 找到已存在的委托方检查是否已经有该组织
UserShipperEntity existingShipper = existingShippers.get(0);
String existingOrgCode = existingShipper.getOrgCode();
boolean hasOrg = false;
com.alibaba.fastjson.JSONArray orgCodeArray = new com.alibaba.fastjson.JSONArray();
if (StringUtils.isNotEmpty(existingOrgCode)) {
try {
orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(existingOrgCode);
// 检查是否已包含当前组织
for (int i = 0; i < orgCodeArray.size(); i++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(i);
Long itemCode = orgItem.getLong("code");
if (targetOrganizationId.equals(itemCode)) {
hasOrg = true;
break;
}
}
} catch (Exception e) {
log.error("解析orgCode失败,shipperId={}", existingShipper.getShipperId(), e);
}
}
if (!hasOrg) {
// 添加新组织到orgCode数组
com.alibaba.fastjson.JSONObject newOrgItem = new com.alibaba.fastjson.JSONObject();
newOrgItem.put("name", targetOrganizationName);
newOrgItem.put("code", targetOrganizationId);
newOrgItem.put("ncCustomer", record.getCode());
newOrgItem.put("names", targetOrganizationId);
orgCodeArray.add(newOrgItem);
// 更新委托方的orgCode字段
existingShipper.setOrgCode(orgCodeArray.toJSONString());
existingShipper.setUpdateBy(loginUser.getUserPo().getUserId());
existingShipper.setUpdateByName(loginUser.getUserPo().getUserName());
existingShipper.setUpdateTime(new Date());
userShipperMapper.updateById(existingShipper);
log.info("委托方已存在,添加新组织到orgCodecustomerNcCode={},新增组织code={}name={}",
record.getCode(), targetOrganizationId, targetOrganizationName);
} else {
log.info("委托方已存在且已包含该组织,跳过添加,customerNcCode={},组织code={}",
record.getCode(), targetOrganizationId);
}
return; // 不新增直接返回
}
// 不存在相同的委托方执行新增逻辑
UserShipperDO userShipperDO = buildShipperDOFromMasterData(record, loginUser,
targetOrganizationId, targetOrganizationName, targetTopOrganizationId);
userShipperDO.setDataSource(1);
@@ -1581,95 +1639,247 @@ public class UserShipperApplicationService {
com.alibaba.fastjson.JSONObject allResults = new com.alibaba.fastjson.JSONObject();
for (UserShipperEntity userShipperEntity : customerNcCodeList) {
if (StringUtils.isEmpty(userShipperEntity.getCustomerNcCode())) {
UserShipperEntity userShipperEntity1 = userShipperMapper.selectOne(new LambdaQueryWrapper<UserShipperEntity>()
.eq(UserShipperEntity::getUserId, userShipperEntity.getUserId()));
if (userShipperEntity1 == null) {
log.warn("未找到对应货主,custcode={}", userShipperEntity.getCustomerNcCode());
continue;
}
UserShipperEntity userShipperEntity1 = userShipperMapper.selectOne(new LambdaQueryWrapper<UserShipperEntity>()
.eq(UserShipperEntity::getCustomerNcCode, userShipperEntity.getCustomerNcCode())
.eq(UserShipperEntity::getUserId, userShipperEntity.getUserId()));
String orgcode = userShipperMapper.getOrgNcCode(userShipperEntity1.getOrganizationId());
if (StringUtils.isEmpty(orgcode)) {
return AjaxResult.error("组织NC编码不能为空");
}
try {
com.alibaba.fastjson.JSONObject queryParam = new com.alibaba.fastjson.JSONObject();
queryParam.put("custcode", userShipperEntity.getCustomerNcCode());
queryParam.put("orgcode", orgcode);
log.info("调用赊销额度查询接口,custcode={}orgcode={}", userShipperEntity.getCustomerNcCode(), orgcode);
String queryResult = HttpRequest.post(queryUrl)
.header("Content-Type", "application/json")
.header("uap_token", uapToken)
.header("uap_usercode", uapUsercode)
.header("uap_dataSource", uapDataSource)
.header("token", "94B3992EAD9747D3598CC6F7775F6239B5DC3B526DF7DE0091CB8B2D")
.body(queryParam.toJSONString())
.execute()
.body();
log.info("赊销额度查询接口返回,custcode={}result={}", userShipperEntity.getCustomerNcCode(), queryResult);
if (StringUtils.isNotEmpty(queryResult)) {
com.alibaba.fastjson.JSONObject resultJson = com.alibaba.fastjson.JSONObject.parseObject(queryResult);
allResults.put(userShipperEntity.getCustomerNcCode(), resultJson);
// 第三步查询成功更新货主的额度同步时间limitTime
if (userShipperEntity1 != null) {
// 根据查询结果同步数据
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
if (dataJson != null) {
// 同步额度数据limitdatas
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
if (limitdatas != null && !limitdatas.isEmpty()) {
com.alibaba.fastjson.JSONObject limitData = limitdatas.getJSONObject(0);
userShipperEntity1.setLimitTime(new Date());
userShipperEntity1.setAuthorizedQuota(limitData.getBigDecimal("nlimitmny"));
userShipperEntity1.setAuthorizedUsedAmount(limitData.getBigDecimal("nengrossmny"));
userShipperEntity1.setSettlementCurrency(limitData.getString("currencycode"));
userShipperEntity1.setCreditAmount(limitData.getBigDecimal("nbalancemny"));
userShipperMapper.updateById(userShipperEntity1);
log.info("更新货主额度同步成功,custcode={}shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
} else {
log.info("赊销额度查询无limitdatas返回,跳过额度更新,custcode={}", userShipperEntity1.getCustomerNcCode());
// 解析org_code支持多组织
List<Long> orgCodeList = new ArrayList<>();
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
// 解析JSON数组[{"name":"通宇","code":2830,"ncOrganizationId":"145222101124","names":2830},...]
com.alibaba.fastjson.JSONArray orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
if (orgCodeArray != null && !orgCodeArray.isEmpty()) {
for (int i = 0; i < orgCodeArray.size(); i++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(i);
Long code = orgItem.getLong("code");
if (code != null) {
orgCodeList.add(code);
}
}
}
log.info("解析org_code成功,custcode={}orgCodeList={}", userShipperEntity.getCustomerNcCode(), orgCodeList);
} catch (Exception e) {
log.error("解析org_code失败,custcode={}orgCode={}", userShipperEntity.getCustomerNcCode(), userShipperEntity1.getOrgCode(), e);
}
}
// 同步协议明细agreedaydatas与limitdatas独立
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
// 先删除该货主已有的协议明细避免重复
agreementDetailsMapper.delete(new LambdaQueryWrapper<AgreementDetails>()
.eq(AgreementDetails::getShipperId, userShipperEntity1.getShipperId()));
int i;
for (i = 0; i < agreedaydatas.size(); i++) {
com.alibaba.fastjson.JSONObject agreeItem = agreedaydatas.getJSONObject(i);
AgreementDetails agreementDetails = new AgreementDetails();
agreementDetails.setShipperId(userShipperEntity1.getShipperId());
agreementDetails.setOrgcode(agreeItem.getString("orgcode"));
agreementDetails.setCode(agreeItem.getString("code"));
agreementDetails.setPday(agreeItem.getString("pday"));
agreementDetails.setPname(agreeItem.getString("pname"));
agreementDetails.setPtypename(agreeItem.getString("ptypename"));
agreementDetails.setPcode(agreeItem.getString("pcode"));
agreementDetails.setPtype(agreeItem.getString("ptype"));
agreementDetailsMapper.insert(agreementDetails);
// 如果org_code为空或解析失败使用原来的organizationId方式
if (orgCodeList.isEmpty()) {
Long organizationId = userShipperEntity1.getOrganizationId();
if (organizationId != null) {
orgCodeList.add(organizationId);
log.info("org_code为空,使用organizationIdcustcode={}organizationId={}", organizationId);
}
}
if (orgCodeList.isEmpty()) {
log.warn("货主无组织信息,跳过查询,custcode={}");
continue;
}
// 遍历每个组织code分别调用接口
int orgIndex = 0; // 组织循环计数器
for (Long orgCode : orgCodeList) {
String orgcode = userShipperMapper.getOrgNcCode(orgCode);
if (StringUtils.isEmpty(orgcode)) {
log.warn("组织NC编码为空,跳过查询,custcode={}orgCode={}", orgCode);
orgIndex++;
continue;
}
// 从orgCode数组中获取当前组织的ncCustomer字段
String ncCustomer = null;
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
com.alibaba.fastjson.JSONArray orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
for (int i = 0; i < orgCodeArray.size(); i++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(i);
Long itemCode = orgItem.getLong("code");
if (orgCode.equals(itemCode)) {
ncCustomer = orgItem.getString("ncCustomer");
break;
}
}
} catch (Exception e) {
log.error("解析orgCode数组获取ncCustomer失败,orgCode={}", orgCode, e);
}
}
if (StringUtils.isEmpty(ncCustomer)) {
log.warn("未找到组织code={}对应的ncCustomer,跳过查询,custcode={}", orgCode);
orgIndex++;
continue;
}
try {
com.alibaba.fastjson.JSONObject queryParam = new com.alibaba.fastjson.JSONObject();
queryParam.put("custcode", ncCustomer); // 使用当前组织的ncCustomer
queryParam.put("orgcode", orgcode);
log.info("调用赊销额度查询接口,custcode={}ncCustomer={}orgcode={}", ncCustomer, orgcode);
String queryResult = HttpRequest.post(queryUrl)
.header("Content-Type", "application/json")
.header("uap_token", uapToken)
.header("uap_usercode", uapUsercode)
.header("uap_dataSource", uapDataSource)
.header("token", "94B3992EAD9747D3598CC6F7775F6239B5DC3B526DF7DE0091CB8B2D")
.body(queryParam.toJSONString())
.execute()
.body();
log.info("赊销额度查询接口返回,custcode={}ncCustomer={}orgcode={}result={}", ncCustomer, orgcode, queryResult);
if (StringUtils.isNotEmpty(queryResult)) {
com.alibaba.fastjson.JSONObject resultJson = com.alibaba.fastjson.JSONObject.parseObject(queryResult);
allResults.put(ncCustomer + "_" + orgcode, resultJson); // 使用ncCustomer作为key
// 第三步查询成功更新货主的额度同步时间limitTime
if (userShipperEntity1 != null) {
// 根据查询结果同步数据
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
if (dataJson != null) {
// 解析现有的orgCode数组
com.alibaba.fastjson.JSONArray orgCodeArray = new com.alibaba.fastjson.JSONArray();
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
} catch (Exception e) {
log.warn("解析现有orgCode失败,将创建新的数组,shipperId={}", userShipperEntity1.getShipperId());
}
}
userShipperEntity1.setAgreementCount(i);
userShipperMapper.updateById(userShipperEntity1);
log.info("同步协议明细成功,custcode={}shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId(), agreedaydatas.size());
// 同步额度数据limitdatas
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
if (limitdatas != null && !limitdatas.isEmpty()) {
// 将limitdatas按orgcode值合并到orgCode数组中
for (int i = 0; i < limitdatas.size(); i++) {
com.alibaba.fastjson.JSONObject limitItem = limitdatas.getJSONObject(i);
String limitOrgcode = limitItem.getString("orgcode"); // 例如 "NA01"
if (StringUtils.isNotEmpty(limitOrgcode)) {
// 在orgCode数组中查找code匹配的组织注意这里的code是2830, 2839等
boolean found = false;
for (int j = 0; j < orgCodeArray.size(); j++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(j);
String orgItemCode = orgItem.getString("code"); // orgCode数组中的code
// 如果orgCode数组中的code与当前orgCode(如2830)匹配将limitdatas的字段添加到该组织对象中
String currentOrgCodeStr = String.valueOf(orgCode);
if (currentOrgCodeStr.equals(orgItemCode)) {
orgItem.putAll(limitItem);
found = true;
log.info("匹配到code={}的组织,将额度数据(orgcode={})添加到orgCode中,custcode={}", orgItemCode, limitOrgcode, userShipperEntity1.getCustomerNcCode());
break;
}
}
// 如果没有找到匹配的组织创建新的组织对象
if (!found) {
com.alibaba.fastjson.JSONObject newOrgItem = new com.alibaba.fastjson.JSONObject();
newOrgItem.put("code", orgCode); // 使用当前orgCode
newOrgItem.putAll(limitItem);
orgCodeArray.add(newOrgItem);
log.info("未找到code={}的组织,创建新组织并添加额度数据(orgcode={})custcode={}", orgCode, limitOrgcode, userShipperEntity1.getCustomerNcCode());
}
}
}
// 使用limitdatas中的数据更新额度字段
com.alibaba.fastjson.JSONObject firstLimitData = limitdatas.getJSONObject(0);
userShipperEntity1.setLimitTime(new Date());
userShipperEntity1.setAuthorizedQuota(firstLimitData.getBigDecimal("nlimitmny"));
userShipperEntity1.setAuthorizedUsedAmount(firstLimitData.getBigDecimal("nengrossmny"));
userShipperEntity1.setSettlementCurrency(firstLimitData.getString("currencycode"));
userShipperEntity1.setCreditAmount(firstLimitData.getBigDecimal("nbalancemny"));
log.info("更新货主额度同步成功,custcode={}orgcode={}shipperId={}orgCode组织数={}", userShipperEntity1.getCustomerNcCode(), orgcode, userShipperEntity1.getShipperId(), orgCodeArray.size());
} else {
log.info("赊销额度查询无limitdatas返回,跳过额度更新,custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
// 同步协议明细agreedaydatas与limitdatas独立
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
// 只在第一次循环时删除该货主的所有协议明细避免重复
if (orgIndex == 0) {
agreementDetailsMapper.delete(new LambdaQueryWrapper<AgreementDetails>()
.eq(AgreementDetails::getShipperId, userShipperEntity1.getShipperId()));
log.info("第一次循环,删除货主所有协议明细,shipperId={}", userShipperEntity1.getShipperId());
}
// 将agreedaydatas保存到orgCode数组中与code同一级别
String currentOrgCodeStr = String.valueOf(orgCode);
boolean foundOrg = false;
for (int j = 0; j < orgCodeArray.size(); j++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(j);
String orgItemCode = orgItem.getString("code");
// 找到当前组织将agreedaydatas添加到该组织对象中
if (currentOrgCodeStr.equals(orgItemCode)) {
orgItem.put("agreedaydatas", agreedaydatas);
foundOrg = true;
log.info("将agreedaydatas添加到code={}的组织中,共{}条", orgItemCode, agreedaydatas.size());
break;
}
}
// 如果没找到创建新组织对象
if (!foundOrg) {
com.alibaba.fastjson.JSONObject newOrgItem = new com.alibaba.fastjson.JSONObject();
newOrgItem.put("code", orgCode);
newOrgItem.put("agreedaydatas", agreedaydatas);
orgCodeArray.add(newOrgItem);
log.info("创建新组织并添加agreedaydatascode={},共{}条", orgCode, agreedaydatas.size());
}
// 同时插入到agreement_details表
for (int i = 0; i < agreedaydatas.size(); i++) {
com.alibaba.fastjson.JSONObject agreeItem = agreedaydatas.getJSONObject(i);
AgreementDetails agreementDetails = new AgreementDetails();
agreementDetails.setShipperId(userShipperEntity1.getShipperId());
agreementDetails.setOrgcode(agreeItem.getString("orgcode"));
agreementDetails.setCode(agreeItem.getString("code"));
agreementDetails.setPday(agreeItem.getString("pday"));
agreementDetails.setPname(agreeItem.getString("pname"));
agreementDetails.setPtypename(agreeItem.getString("ptypename"));
agreementDetails.setPcode(agreeItem.getString("pcode"));
agreementDetails.setPtype(agreeItem.getString("ptype"));
agreementDetailsMapper.insert(agreementDetails);
}
log.info("同步协议明细成功,custcode={}orgcode={}shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), orgcode, userShipperEntity1.getShipperId(), agreedaydatas.size());
} else {
log.info("赊销额度查询无agreedaydatas返回,跳过协议明细同步,custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
// 保存更新后的orgCode数组统一在最后保存
userShipperEntity1.setOrgCode(orgCodeArray.toJSONString());
} else {
log.info("赊销额度查询无agreedaydatas返回,跳过协议明细同步custcode={}", userShipperEntity1.getCustomerNcCode());
log.info("赊销额度查询无data返回,跳过更新custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
} else {
log.info("赊销额度查询无data返回,跳过更新custcode={}", userShipperEntity1.getCustomerNcCode());
log.warn("未找到对应货主custcode={}orgCode={}", orgCode);
}
} else {
log.warn("未找到对应货主custcode={}organizationId={}", userShipperEntity1.getCustomerNcCode(), userShipperDTO.getOrganizationId());
log.warn("赊销额度查询返回为空custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
} else {
log.warn("赊销额度查询返回为空custcode={}", userShipperEntity1.getCustomerNcCode());
} catch (Exception e) {
log.error("查询赊销额度异常custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode, e);
} finally {
orgIndex++; // 计数器递增
}
} catch (Exception e) {
log.error("查询赊销额度异常,custcode={}", userShipperEntity1.getCustomerNcCode(), e);
}
// 所有组织循环完成后统一更新数据库只更新一次
if (userShipperEntity1 != null) {
userShipperMapper.updateById(userShipperEntity1);
log.info("批量更新货主额度完成,custcode={}shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
}
}
return AjaxResult.success(allResults);
@@ -1723,89 +1933,243 @@ public class UserShipperApplicationService {
UserShipperEntity userShipperEntity1 = userShipperMapper.selectOne(new LambdaQueryWrapper<UserShipperEntity>()
.eq(UserShipperEntity::getCustomerNcCode, userShipperEntity.getCustomerNcCode())
.eq(UserShipperEntity::getUserId, userShipperEntity.getUserId()));
String orgcode = userShipperMapper.getOrgNcCode(userShipperEntity1.getOrganizationId());
if (StringUtils.isEmpty(orgcode)) {
return AjaxResult.error("组织NC编码不能为空");
if (userShipperEntity1 == null) {
log.warn("未找到对应货主,custcode={}", userShipperEntity.getCustomerNcCode());
continue;
}
try {
com.alibaba.fastjson.JSONObject queryParam = new com.alibaba.fastjson.JSONObject();
queryParam.put("custcode", userShipperEntity.getCustomerNcCode());
queryParam.put("orgcode", orgcode);
log.info("调用赊销额度查询接口,custcode={}orgcode={}", userShipperEntity.getCustomerNcCode(), orgcode);
String queryResult = HttpRequest.post(queryUrl)
.header("Content-Type", "application/json")
.header("uap_token", uapToken)
.header("uap_usercode", uapUsercode)
.header("uap_dataSource", uapDataSource)
.header("token", "94B3992EAD9747D3598CC6F7775F6239B5DC3B526DF7DE0091CB8B2D")
.body(queryParam.toJSONString())
.execute()
.body();
log.info("赊销额度查询接口返回,custcode={}result={}", userShipperEntity.getCustomerNcCode(), queryResult);
if (StringUtils.isNotEmpty(queryResult)) {
com.alibaba.fastjson.JSONObject resultJson = com.alibaba.fastjson.JSONObject.parseObject(queryResult);
allResults.put(userShipperEntity.getCustomerNcCode(), resultJson);
// 第三步查询成功更新货主的额度同步时间limitTime
if (userShipperEntity1 != null) {
// 根据查询结果同步数据
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
if (dataJson != null) {
// 同步额度数据limitdatas
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
if (limitdatas != null && !limitdatas.isEmpty()) {
com.alibaba.fastjson.JSONObject limitData = limitdatas.getJSONObject(0);
userShipperEntity1.setLimitTime(new Date());
userShipperEntity1.setAuthorizedQuota(limitData.getBigDecimal("nlimitmny"));
userShipperEntity1.setAuthorizedUsedAmount(limitData.getBigDecimal("nengrossmny"));
userShipperEntity1.setSettlementCurrency(limitData.getString("currencycode"));
userShipperEntity1.setCreditAmount(limitData.getBigDecimal("nbalancemny"));
userShipperMapper.updateById(userShipperEntity1);
log.info("更新货主额度同步成功,custcode={}shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
} else {
log.info("赊销额度查询无limitdatas返回,跳过额度更新,custcode={}", userShipperEntity1.getCustomerNcCode());
// 解析org_code支持多组织
List<Long> orgCodeList = new ArrayList<>();
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
// 解析JSON数组[{"name":"通宇","code":2830,"ncOrganizationId":"145222101124","names":2830},...]
com.alibaba.fastjson.JSONArray orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
if (orgCodeArray != null && !orgCodeArray.isEmpty()) {
for (int i = 0; i < orgCodeArray.size(); i++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(i);
Long code = orgItem.getLong("code");
if (code != null) {
orgCodeList.add(code);
}
}
}
log.info("解析org_code成功,custcode={}orgCodeList={}", userShipperEntity.getCustomerNcCode(), orgCodeList);
} catch (Exception e) {
log.error("解析org_code失败,custcode={}orgCode={}", userShipperEntity.getCustomerNcCode(), userShipperEntity1.getOrgCode(), e);
}
}
// 同步协议明细agreedaydatas与limitdatas独立
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
// 先删除该货主已有的协议明细避免重复
agreementDetailsMapper.delete(new LambdaQueryWrapper<AgreementDetails>()
.eq(AgreementDetails::getShipperId, userShipperEntity1.getShipperId()));
int i;
for (i = 0; i < agreedaydatas.size(); i++) {
com.alibaba.fastjson.JSONObject agreeItem = agreedaydatas.getJSONObject(i);
AgreementDetails agreementDetails = new AgreementDetails();
agreementDetails.setShipperId(userShipperEntity1.getShipperId());
agreementDetails.setOrgcode(agreeItem.getString("orgcode"));
agreementDetails.setCode(agreeItem.getString("code"));
agreementDetails.setPday(agreeItem.getString("pday"));
agreementDetails.setPname(agreeItem.getString("pname"));
agreementDetails.setPtypename(agreeItem.getString("ptypename"));
agreementDetails.setPcode(agreeItem.getString("pcode"));
agreementDetails.setPtype(agreeItem.getString("ptype"));
agreementDetailsMapper.insert(agreementDetails);
// 如果org_code为空或解析失败使用原来的organizationId方式
if (orgCodeList.isEmpty()) {
Long organizationId = userShipperEntity1.getOrganizationId();
if (organizationId != null) {
orgCodeList.add(organizationId);
log.info("org_code为空,使用organizationIdcustcode={}organizationId={}", userShipperEntity.getCustomerNcCode(), organizationId);
}
}
if (orgCodeList.isEmpty()) {
log.warn("货主无组织信息,跳过查询,custcode={}", userShipperEntity.getCustomerNcCode());
continue;
}
// 遍历每个组织code分别调用接口
int orgIndex = 0; // 组织循环计数器
for (Long orgCode : orgCodeList) {
String orgcode = userShipperMapper.getOrgNcCode(orgCode);
if (StringUtils.isEmpty(orgcode)) {
log.warn("组织NC编码为空,跳过查询,custcode={}orgCode={}", userShipperEntity.getCustomerNcCode(), orgCode);
orgIndex++;
continue;
}
// 从orgCode数组中获取当前组织的ncCustomer字段
String ncCustomer = null;
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
com.alibaba.fastjson.JSONArray orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
for (int i = 0; i < orgCodeArray.size(); i++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(i);
Long itemCode = orgItem.getLong("code");
if (orgCode.equals(itemCode)) {
ncCustomer = orgItem.getString("ncCustomer");
break;
}
}
} catch (Exception e) {
log.error("解析orgCode数组获取ncCustomer失败,orgCode={}", orgCode, e);
}
}
if (StringUtils.isEmpty(ncCustomer)) {
log.warn("未找到组织code={}对应的ncCustomer,跳过查询,custcode={}", orgCode, userShipperEntity.getCustomerNcCode());
orgIndex++;
continue;
}
try {
com.alibaba.fastjson.JSONObject queryParam = new com.alibaba.fastjson.JSONObject();
queryParam.put("custcode", ncCustomer); // 使用当前组织的ncCustomer
queryParam.put("orgcode", orgcode);
log.info("调用赊销额度查询接口,custcode={}ncCustomer={}orgcode={}", userShipperEntity.getCustomerNcCode(), ncCustomer, orgcode);
String queryResult = HttpRequest.post(queryUrl)
.header("Content-Type", "application/json")
.header("uap_token", uapToken)
.header("uap_usercode", uapUsercode)
.header("uap_dataSource", uapDataSource)
.header("token", "94B3992EAD9747D3598CC6F7775F6239B5DC3B526DF7DE0091CB8B2D")
.body(queryParam.toJSONString())
.execute()
.body();
log.info("赊销额度查询接口返回,custcode={}ncCustomer={}orgcode={}result={}", userShipperEntity.getCustomerNcCode(), ncCustomer, orgcode, queryResult);
if (StringUtils.isNotEmpty(queryResult)) {
com.alibaba.fastjson.JSONObject resultJson = com.alibaba.fastjson.JSONObject.parseObject(queryResult);
allResults.put(ncCustomer + "_" + orgcode, resultJson); // 使用ncCustomer作为key
// 第三步查询成功更新货主的额度同步时间limitTime
if (userShipperEntity1 != null) {
// 根据查询结果同步数据
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
if (dataJson != null) {
// 解析现有的orgCode数组提到外面limitdatas和agreedaydatas共用
com.alibaba.fastjson.JSONArray orgCodeArray = new com.alibaba.fastjson.JSONArray();
if (StringUtils.isNotEmpty(userShipperEntity1.getOrgCode())) {
try {
orgCodeArray = com.alibaba.fastjson.JSONArray.parseArray(userShipperEntity1.getOrgCode());
} catch (Exception e) {
log.warn("解析现有orgCode失败,将创建新的数组,shipperId={}", userShipperEntity1.getShipperId());
}
}
userShipperEntity1.setAgreementCount(i);
userShipperMapper.updateById(userShipperEntity1);
log.info("同步协议明细成功,custcode={}shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId(), agreedaydatas.size());
// 同步额度数据limitdatas
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
if (limitdatas != null && !limitdatas.isEmpty()) {
// 将limitdatas按orgcode值合并到orgCode数组中
for (int i = 0; i < limitdatas.size(); i++) {
com.alibaba.fastjson.JSONObject limitItem = limitdatas.getJSONObject(i);
String limitOrgcode = limitItem.getString("orgcode"); // 例如 "NA01"
if (StringUtils.isNotEmpty(limitOrgcode)) {
// 在orgCode数组中查找code匹配的组织注意这里的code是2830, 2839等
boolean found = false;
for (int j = 0; j < orgCodeArray.size(); j++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(j);
String orgItemCode = orgItem.getString("code"); // orgCode数组中的code
// 如果orgCode数组中的code与当前orgCode(如2830)匹配将limitdatas的字段添加到该组织对象中
String currentOrgCodeStr = String.valueOf(orgCode);
if (currentOrgCodeStr.equals(orgItemCode)) {
orgItem.putAll(limitItem);
found = true;
log.info("匹配到code={}的组织,将额度数据(orgcode={})添加到orgCode中,custcode={}", orgItemCode, limitOrgcode, userShipperEntity1.getCustomerNcCode());
break;
}
}
// 如果没有找到匹配的组织创建新的组织对象
if (!found) {
com.alibaba.fastjson.JSONObject newOrgItem = new com.alibaba.fastjson.JSONObject();
newOrgItem.put("code", orgCode); // 使用当前orgCode
newOrgItem.putAll(limitItem);
orgCodeArray.add(newOrgItem);
log.info("未找到code={}的组织,创建新组织并添加额度数据(orgcode={})custcode={}", orgCode, limitOrgcode, userShipperEntity1.getCustomerNcCode());
}
}
}
// 使用limitdatas中的数据更新额度字段
com.alibaba.fastjson.JSONObject firstLimitData = limitdatas.getJSONObject(0);
userShipperEntity1.setLimitTime(new Date());
userShipperEntity1.setAuthorizedQuota(firstLimitData.getBigDecimal("nlimitmny"));
userShipperEntity1.setAuthorizedUsedAmount(firstLimitData.getBigDecimal("nengrossmny"));
userShipperEntity1.setSettlementCurrency(firstLimitData.getString("currencycode"));
userShipperEntity1.setCreditAmount(firstLimitData.getBigDecimal("nbalancemny"));
log.info("更新货主额度同步成功,custcode={}orgcode={}shipperId={}orgCode组织数={}", userShipperEntity1.getCustomerNcCode(), orgcode, userShipperEntity1.getShipperId(), orgCodeArray.size());
} else {
log.info("赊销额度查询无limitdatas返回,跳过额度更新,custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
// 同步协议明细agreedaydatas与limitdatas独立
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
// 只在第一次循环时删除该货主的所有协议明细避免重复
if (orgIndex == 0) {
agreementDetailsMapper.delete(new LambdaQueryWrapper<AgreementDetails>()
.eq(AgreementDetails::getShipperId, userShipperEntity1.getShipperId()));
log.info("第一次循环,删除货主所有协议明细,shipperId={}", userShipperEntity1.getShipperId());
}
// 将agreedaydatas保存到orgCode数组中与code同一级别
String currentOrgCodeStr = String.valueOf(orgCode);
boolean foundOrg = false;
for (int j = 0; j < orgCodeArray.size(); j++) {
com.alibaba.fastjson.JSONObject orgItem = orgCodeArray.getJSONObject(j);
String orgItemCode = orgItem.getString("code");
// 找到当前组织将agreedaydatas添加到该组织对象中
if (currentOrgCodeStr.equals(orgItemCode)) {
orgItem.put("agreedaydatas", agreedaydatas);
foundOrg = true;
log.info("将agreedaydatas添加到code={}的组织中,共{}条", orgItemCode, agreedaydatas.size());
break;
}
}
// 如果没找到创建新组织对象
if (!foundOrg) {
com.alibaba.fastjson.JSONObject newOrgItem = new com.alibaba.fastjson.JSONObject();
newOrgItem.put("code", orgCode);
newOrgItem.put("agreedaydatas", agreedaydatas);
orgCodeArray.add(newOrgItem);
log.info("创建新组织并添加agreedaydatascode={},共{}条", orgCode, agreedaydatas.size());
}
// 同时插入到agreement_details表
for (int i = 0; i < agreedaydatas.size(); i++) {
com.alibaba.fastjson.JSONObject agreeItem = agreedaydatas.getJSONObject(i);
AgreementDetails agreementDetails = new AgreementDetails();
agreementDetails.setShipperId(userShipperEntity1.getShipperId());
agreementDetails.setOrgcode(agreeItem.getString("orgcode"));
agreementDetails.setCode(agreeItem.getString("code"));
agreementDetails.setPday(agreeItem.getString("pday"));
agreementDetails.setPname(agreeItem.getString("pname"));
agreementDetails.setPtypename(agreeItem.getString("ptypename"));
agreementDetails.setPcode(agreeItem.getString("pcode"));
agreementDetails.setPtype(agreeItem.getString("ptype"));
agreementDetailsMapper.insert(agreementDetails);
}
log.info("同步协议明细成功,custcode={}orgcode={}shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), orgcode, userShipperEntity1.getShipperId(), agreedaydatas.size());
} else {
log.info("赊销额度查询无agreedaydatas返回,跳过协议明细同步,custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
// 保存更新后的orgCode数组统一在最后保存
userShipperEntity1.setOrgCode(orgCodeArray.toJSONString());
} else {
log.info("赊销额度查询无agreedaydatas返回,跳过协议明细同步custcode={}", userShipperEntity1.getCustomerNcCode());
log.info("赊销额度查询无data返回,跳过更新custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
} else {
log.info("赊销额度查询无data返回,跳过更新custcode={}", userShipperEntity1.getCustomerNcCode());
log.warn("未找到对应货主custcode={}orgCode={}", userShipperEntity.getCustomerNcCode(), orgCode);
}
} else {
log.warn("未找到对应货主custcode={}organizationId={}", userShipperEntity1.getCustomerNcCode(), userShipperDTO.getOrganizationId());
log.warn("赊销额度查询返回为空custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode);
}
} else {
log.warn("赊销额度查询返回为空custcode={}", userShipperEntity1.getCustomerNcCode());
} catch (Exception e) {
log.error("查询赊销额度异常custcode={}orgcode={}", userShipperEntity1.getCustomerNcCode(), orgcode, e);
} finally {
orgIndex++; // 计数器递增
}
} catch (Exception e) {
log.error("查询赊销额度异常,custcode={}", userShipperEntity1.getCustomerNcCode(), e);
}
// 所有组织循环完成后统一更新数据库只更新一次
if (userShipperEntity1 != null) {
userShipperMapper.updateById(userShipperEntity1);
log.info("批量更新货主额度完成,custcode={}shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
}
}
return AjaxResult.success(allResults);
@@ -0,0 +1,148 @@
package com.mhd.user.application.service;
import com.alibaba.fastjson.JSONObject;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.user.interfaces.dto.wechat.WxPhoneNumberDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ConcurrentHashMap;
/**
* 微信小程序手机号快速验证
* appId/appSecret bootstrap.yml / Nacos 中配置不同环境配置不同值即可
*/
@Service
@Slf4j
public class WechatMiniAppService {
private static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
private static final String GET_PHONE_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=%s";
@Value("${wechat.miniapp.appId:}")
private String appId;
@Value("${wechat.miniapp.appSecret:}")
private String appSecret;
/** access_token 缓存:{token, expireTime} */
private volatile String cachedToken;
private volatile long tokenExpireTime;
public AjaxResult wxGetPhoneNumber(WxPhoneNumberDTO dto, Long organizationId) {
if (dto == null || dto.getCode() == null || dto.getCode().isEmpty()) {
return AjaxResult.error("code 不能为空");
}
if (appId.isEmpty() || appSecret.isEmpty()) {
return AjaxResult.error("未配置 wechat.miniapp.appId / wechat.miniapp.appSecret");
}
try {
String accessToken = getAccessToken();
String body = "{\"code\":\"" + dto.getCode() + "\"}";
String phoneJson = doPost(String.format(GET_PHONE_URL, accessToken), body);
JSONObject result = JSONObject.parseObject(phoneJson);
int errcode = result.getIntValue("errcode");
if (errcode != 0) {
String errmsg = result.getString("errmsg");
log.error("微信手机号解密失败, errcode={}, errmsg={}", errcode, errmsg);
return AjaxResult.error("获取手机号失败:" + errmsg);
}
JSONObject phoneInfo = result.getJSONObject("phone_info");
if (phoneInfo == null) {
return AjaxResult.error("未获取到手机号信息");
}
JSONObject data = new JSONObject();
data.put("phoneNumber", phoneInfo.getString("phoneNumber"));
data.put("purePhoneNumber", phoneInfo.getString("purePhoneNumber"));
data.put("countryCode", phoneInfo.getString("countryCode"));
return AjaxResult.success(data);
} catch (ServiceException e) {
throw e;
} catch (Exception e) {
log.error("微信手机号验证异常", e);
return AjaxResult.error("微信手机号验证失败:" + e.getMessage());
}
}
private String getAccessToken() {
if (cachedToken != null && System.currentTimeMillis() < tokenExpireTime) {
return cachedToken;
}
synchronized (this) {
if (cachedToken != null && System.currentTimeMillis() < tokenExpireTime) {
return cachedToken;
}
String url = String.format(ACCESS_TOKEN_URL, appId, appSecret);
String response = doGet(url);
JSONObject result = JSONObject.parseObject(response);
if (result.containsKey("errcode") && result.getIntValue("errcode") != 0) {
throw new ServiceException("获取微信 access_token 失败:" + result.getString("errmsg"));
}
cachedToken = result.getString("access_token");
int expiresIn = result.getIntValue("expires_in");
tokenExpireTime = System.currentTimeMillis() + (expiresIn - 300) * 1000L;
return cachedToken;
}
}
private String doGet(String urlStr) {
try {
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(10000);
conn.setReadTimeout(10000);
return readResponse(conn);
} catch (Exception e) {
throw new ServiceException("微信接口请求失败:" + e.getMessage());
}
}
private String doPost(String urlStr, String body) {
try {
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "application/json;charset=utf-8");
conn.setConnectTimeout(10000);
conn.setReadTimeout(10000);
try (OutputStream os = conn.getOutputStream()) {
os.write(body.getBytes(StandardCharsets.UTF_8));
os.flush();
}
return readResponse(conn);
} catch (Exception e) {
throw new ServiceException("微信接口请求失败:" + e.getMessage());
}
}
private String readResponse(HttpURLConnection conn) throws Exception {
int code = conn.getResponseCode();
BufferedReader reader = new BufferedReader(new InputStreamReader(
code >= 400 ? conn.getErrorStream() : conn.getInputStream(), StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
reader.close();
if (code >= 400) {
throw new ServiceException("微信接口 HTTP " + code + "" + sb);
}
return sb.toString();
}
}
@@ -291,4 +291,7 @@ public class UserShipperEntity extends BaseVOEntity {
@ApiModelProperty(name = "是否校验信用")
private String isCheckCredit;
@ApiModelProperty(name = "组织代码")
private String orgCode;
}
@@ -354,4 +354,6 @@ public class UserShipperPo implements Serializable {
private BigDecimal agreementCount;
@ApiModelProperty(name = "是否校验信用")
private String isCheckCredit;
@ApiModelProperty(name = "组织代码")
private String orgCode;
}
@@ -322,4 +322,7 @@ public class UserShipperDO extends UserDO {
private String userPassword;
@ApiModelProperty(name = "是否校验信用")
private String isCheckCredit;
@ApiModelProperty(name = "组织代码")
private String orgCode;
}
@@ -268,4 +268,7 @@ public class UserShipperDTO extends UserDTO {
private String userPassword;
@ApiModelProperty(name = "是否校验信用")
private String isCheckCredit;
@ApiModelProperty(name = "组织代码")
private String orgCode;
}
@@ -0,0 +1,14 @@
package com.mhd.user.interfaces.dto.wechat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 微信小程序手机号快速验证请求参数
*/
@Data
public class WxPhoneNumberDTO {
@ApiModelProperty("wx.getPhoneNumber 返回的 code(注意:非 wx.login 的 code")
private String code;
}
@@ -12,9 +12,11 @@ import com.mhd.common.log.enums.BusinessType;
import com.mhd.user.application.service.UserApplicationService;
import com.mhd.user.application.service.UserDriverApplicationService;
import com.mhd.user.application.service.UserShipperApplicationService;
import com.mhd.user.domain.roleAggregate.repository.todo.RoleDo;
import com.mhd.user.domain.userAggregate.repository.po.UserDocumentWarningQueryPo;
import com.mhd.user.domain.userAggregate.repository.todo.*;
import com.mhd.user.domain.userAggregate.service.UserRoleDomainService;
import com.mhd.user.interfaces.assember.*;
import com.mhd.user.interfaces.dto.addDTO.*;
import com.mhd.user.interfaces.dto.queryDTO.UserDataPermissionQueryDTO;
@@ -5,7 +5,9 @@ import com.mhd.common.core.domain.entity.R;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.log.annotation.Log;
import com.mhd.common.log.enums.BusinessType;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.domain.UserShipperFeignDTO;
import com.mhd.system.api.model.LoginUser;
import com.mhd.user.application.service.UserApplicationService;
import com.mhd.user.application.service.UserShipperApplicationService;
import com.mhd.user.domain.userAggregate.repository.todo.*;
@@ -18,6 +20,7 @@ import com.mhd.common.core.web.page.TableDataInfo;
import com.mhd.common.security.annotation.RepeatSubmit;
import com.mhd.common.security.service.TokenService;
import com.mhd.user.application.service.UserShipperMasterDataSyncService;
import com.mhd.user.application.service.WechatMiniAppService;
import com.mhd.user.interfaces.dto.updateDTO.SettlementInfoUpdateDTO;
import com.mhd.user.interfaces.vo.SettlementInfoQueryVo;
import com.mhd.user.interfaces.vo.ShipperMasterDataSyncTimeVo;
@@ -42,6 +45,8 @@ public class UserShipperAPI extends BaseController {
@Resource
private UserShipperMasterDataSyncService userShipperMasterDataSyncService;
@Resource
private WechatMiniAppService wechatMiniAppService;
@Resource
private UserApplicationService userApplicationService;
@Resource
private UserShipperAssember userShipperAssember;
@@ -342,4 +347,13 @@ public class UserShipperAPI extends BaseController {
}
return AjaxResult.success(resultMap);
}
@ApiOperation("微信小程序手机号快速验证")
@PostMapping("/wxGetPhoneNumber")
public AjaxResult wxGetPhoneNumber(@RequestBody com.mhd.user.interfaces.dto.wechat.WxPhoneNumberDTO dto) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long organizationId = (loginUser != null && loginUser.getUserPo() != null)
? loginUser.getUserPo().getOrganizationId() : null;
return wechatMiniAppService.wxGetPhoneNumber(dto, organizationId);
}
}
@@ -20,15 +20,15 @@ spring:
discovery:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
# server-addr: 10.102.192.31:6848
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
config:
# server-addr: 127.0.0.1:8848
# 线上测试环境配置 容器名+端口号
server-addr: 10.33.0.129:6010
# server-addr: 10.102.192.31:6848
# server-addr: 10.33.0.129:6010
server-addr: 10.102.192.31:6848
username: nacos
password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
@@ -264,8 +264,8 @@
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
<if test="organizationId != null">
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
and a.organization_id = #{organizationId}
and a.organization_name IS NOT NULL
and (a.organization_id = #{organizationId}
or b.ORG_CODE like concat('%', to_char(#{organizationId}), '%'))
</if>
<if test="topOrganizationId != null">
<!-- 如果设置了 topOrganizationId,添加 top_organization_id 条件 -->
@@ -773,7 +773,13 @@
</if>
/*组织ID - 数据隔离:南光组织(organizationId=2827)查询全部,其他组织查询自己组织的数据*/
<if test="organizationId !=null">
AND u.organization_id = #{organizationId}
AND (
u.organization_id = #{organizationId}
OR b.org_code LIKE concat('%"code":"', #{organizationId}, '"%')
OR b.org_code LIKE concat('%code:', #{organizationId}, '%')
OR b.org_code LIKE concat('%code: ', #{organizationId}, '%')
OR b.org_code LIKE concat('%"code":', #{organizationId}, '%')
)
AND u.organization_name IS NOT NULL
</if>
GROUP BY u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name, u.user_phone, u.has_default_address, b.shipper_id, b.shipper_enterprise_name, u.DOCUMENT_PREPARER_NC_CODE, b.CUSTOMER_NC_CODE, u.organization_id, u.top_organization_id, b.settlement_currency
@@ -67,6 +67,7 @@
a.esign_auth_status,
a.esign_enterprise_status,
a.CUSTOMER_NC_CODE,
a.org_code,
a.esign_seal_auth_id
FROM user_shipper a
LEFT JOIN "USER" b ON a.user_id = b.user_id
@@ -171,7 +172,8 @@
b.LIMIT_TIME,
b.CREDIT_AMOUNT,
b.IS_CHECK_CREDIT,
b.AGREEMENT_COUNT
b.AGREEMENT_COUNT,
b.org_code
FROM "USER" a
LEFT JOIN user_shipper b ON a.user_id = b.user_id
left join (select user_id, LISTAGG(DISTINCT r.role_name, '&amp;') WITHIN GROUP(ORDER BY r.role_name) AS roleName
@@ -375,7 +377,13 @@
</if>
/*用户组织ID*/
<if test="organizationId !=null">
and a.organization_id = #{organizationId}
AND (
a.organization_id = #{organizationId}
OR b.org_code LIKE concat('%"code":"', #{organizationId}, '"%')
OR b.org_code LIKE concat('%code:', #{organizationId}, '%')
OR b.org_code LIKE concat('%code: ', #{organizationId}, '%')
OR b.org_code LIKE concat('%"code":', #{organizationId}, '%')
)
</if>
/*组织名称*/
<if test="organizationName != null and organizationName != ''">
@@ -511,6 +519,7 @@
</foreach>
OR a.create_by = #{createBy})
</if>
</sql>
<select id="getShipperCountByMatter" parameterType="com.mhd.common.core.domain.todo.StatisticalMattersDo"
@@ -17,6 +17,7 @@ import com.mhd.bms.domain.billManage.service.BillManageDomainService;
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService;
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService;
import com.mhd.bms.domain.ncLog.entity.NcLog;
import com.mhd.bms.domain.ncLog.repository.mapper.NcLogMapper;
@@ -384,6 +385,86 @@ public class BillManageApplicationService {
return flag && flagTwo && three;
}
/**
* 复制账单
*/
@Transactional
public Boolean copyBill(BillManageDTO billManageDTO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
if (billManageDTO.getBillManageId() == null) {
throw new ServiceException("原账单id不能为空");
}
// 1. 获取原账单信息
BillManagePO originalBill = billManageDomainService.getInfo(billManageDTO.getBillManageId());
if (null == originalBill) {
throw new ServiceException("原账单信息未找到");
}
// 2. 获取原账单明细
List<BillDetailPO> originalDetails = billDetailDomainService.getDetailsByBillManageId(billManageDTO.getBillManageId());
if (originalDetails == null || originalDetails.isEmpty()) {
throw new ServiceException("原账单明细为空,无法复制");
}
// 3. 创建新账单除账单编号外完全复制原账单
String newBillNumber = OrderSequence.getOrderCode("ZD");
BillManage newBill = new BillManage();
BeanUtils.copyProperties(originalBill, newBill);
newBill.setBillManageId(null);
newBill.setBillNumber(newBillNumber);
newBill.setCreateBy(loginUser.getUserPo().getUserId());
newBill.setCreateByName(loginUser.getUserPo().getUserName());
newBill.setCreateTime(new Date());
newBill.setUpdateBy(loginUser.getUserPo().getUserId());
newBill.setUpdateByName(loginUser.getUserPo().getUserName());
newBill.setUpdateTime(new Date());
newBill.setDelFlag(1);
// 保存新账单
boolean flag = billManageDomainService.saveEntity(newBill);
if (!flag) {
throw new ServiceException("复制账单失败,请重试");
}
// 4. 复制账单明细
List<BillDetail> newDetailList = new ArrayList<>();
for (BillDetailPO originalDetail : originalDetails) {
BillDetail newDetail = new BillDetail();
BeanUtils.copyProperties(originalDetail, newDetail);
newDetail.setBillDetailId(null);
newDetail.setBillManageId(newBill.getBillManageId());
newDetail.setBillNumber(newBillNumber);
newDetail.setCreateBy(loginUser.getUserPo().getUserId());
newDetail.setCreateByName(loginUser.getUserPo().getUserName());
newDetail.setCreateTime(new Date());
newDetailList.add(newDetail);
}
Boolean flagTwo = billDetailDomainService.insertBatch(newDetailList);
// 5. 复制计费流水billing_statement
List<BillingStatementPO> originalStatements = billingStatementDomainService.getDetailsByManageId(billManageDTO.getBillManageId());
boolean flagThree = true;
if (originalStatements != null && !originalStatements.isEmpty()) {
List<BillingStatement> newStatementList = new ArrayList<>();
for (BillingStatementPO originalStatement : originalStatements) {
BillingStatement newStatement = new BillingStatement();
BeanUtils.copyProperties(originalStatement, newStatement);
newStatement.setBillingStatementId(null);
newStatement.setBillManageId(newBill.getBillManageId());
newStatement.setCreateBy(loginUser.getUserPo().getUserId());
newStatement.setCreateByName(loginUser.getUserPo().getUserName());
newStatement.setCreateTime(new Date());
newStatementList.add(newStatement);
}
flagThree = billingStatementDomainService.saveEntityBatch(newStatementList);
}
// 6. 保存操作日志
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
billOperationLogDO.setBillManageId(newBill.getBillManageId());
billOperationLogDO.setOperationInfo(StringUtils.format(BillLogsConstants.copy_bill_text, originalBill.getBillNumber(), newBillNumber));
billOperationLogDO.setOperationType(1);
boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO);
return flag && flagTwo && flagThree && three;
}
/**
* 应收账单-客户确认
*/
@@ -7,10 +7,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.mhd.bms.application.server.billingRules.CostCalculationApplicationService;
import com.mhd.bms.application.server.settlementCustomers.SettlementCustomersApplicationService;
import com.mhd.bms.domain.billManage.entity.BillDetail;
import com.mhd.bms.domain.billManage.entity.BillManage;
import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService;
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO;
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
import com.mhd.bms.domain.billingStatement.repository.mapper.BillingStatementMapper;
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService;
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
import com.mhd.bms.domain.businessDocument.repository.mapper.BusinessDocumentMapper;
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
import com.mhd.bms.domain.businessDocument.service.BusinessDocumentDomainService;
@@ -30,6 +38,7 @@ import com.mhd.bms.infrastructure.feign.vo.ContractManagePO;
import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO;
import com.mhd.bms.interfaces.assembler.businessDocument.BusinessDocumentAssembler;
import com.mhd.bms.interfaces.dto.billingRules.CostCalculationDTO;
import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO;
import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO;
import com.mhd.common.core.domain.dto.BusinessDataPushDTO;
import com.mhd.common.core.domain.po.OrganizationPo;
@@ -86,6 +95,14 @@ public class BusinessDocumentApplicationService {
private CostCalculationApplicationService costCalculationApplicationService;
@Autowired
private ISettlementCustomersService settlementCustomersService;
@Autowired
private BusinessDocumentMapper businessDocumentMapper;
@Autowired
private BillingStatementMapper billingStatementMapper;
@Autowired
private IBillManageService billManageService;
@Autowired
private IBillDetailService billDetailService;
/**
@@ -202,6 +219,112 @@ public class BusinessDocumentApplicationService {
return businessDocumentDomainService.insert(businessDocumentDO);
}
@Transactional(rollbackFor = Exception.class)
public Boolean manageAddFee(BusinessDocumentDO businessDocumentDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
//先设置组织信息因为handleDate方法中需要使用topOrganizationId
businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
businessDocumentDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
businessDocumentDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
UserPo userPo = loginUser.getUserPo();
businessDocumentDO.setCreateBy(userPo.getUserId());
businessDocumentDO.setCreateByName(userPo.getUserName());
//校验使用的表单是否必填校验
checkDoucumentType(businessDocumentDO);
//处理数据
handleDate(businessDocumentDO);
businessDocumentDO.setDataSources(2);
businessDocumentDO.setBusinessFlow(OrderSequence.getOrderCode("LS"));
//调用费用计算计算费用金额进行保存
CostCalculationDTO costCalculationDTO = new CostCalculationDTO();
costCalculationDTO.setOriginalBusinessNum(businessDocumentDO.getOriginalBusinessNum());
costCalculationDTO.setContractNumber(businessDocumentDO.getContractNumber());
costCalculationDTO.setFormJson(businessDocumentDO.getDocumentFormJson());
costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocumentDO.getSecondSubjectCode()) ? businessDocumentDO.getFirstSubjectCode():businessDocumentDO.getSecondSubjectCode());
costCalculationDTO.setDocumentTypeCode(businessDocumentDO.getDocumentTypeCode());
costCalculationDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
costCalculationDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
costCalculationDTO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO);
businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost());
BillingRulesPO billingRulesPO = billingCostPo.getBillingRulesPO();
List<BillingParamsPO> billingParamsPOList = billingRulesPO.getBillingParamsPOList();
if (ObjectUtil.isNotNull(billingParamsPOList)&&billingParamsPOList.size()>0) {
BillingParamsPO billingParamsPO = billingParamsPOList.get(0);
String billingParamsJson = billingParamsPO.getBillingParamsJson();
String preSetRules = billingParamsPO.getPreSetRules();
String documentFormJson = businessDocumentDO.getDocumentFormJson();
JSONObject paramObj = JSONObject.parseObject(documentFormJson);
List<BillingParamsEntity> billingParamsEntityList = JSON.parseArray(billingParamsJson, BillingParamsEntity.class);
for (BillingParamsEntity billingParamsEntity : billingParamsEntityList) {
String isFee = billingParamsEntity.getIsFee();
String fields = billingParamsEntity.getFields();
// 安全获取值并转 BigDecimal不会报错
BigDecimal value = getSafeBigDecimal(paramObj, fields);
if ("1".equals(isFee)) {
businessDocumentDO.setBillingUnitPrice(value.setScale(2, BigDecimal.ROUND_HALF_UP));
} else {
businessDocumentDO.setBillingNum(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}
}
}
BusinessDocument businessDocument = businessDocumentDomainService.insertRetrun(businessDocumentDO);
BusinessDocumentDTO businessDocumentDTO = new BusinessDocumentDTO();
businessDocumentDTO.setBusinessDocumentIds(businessDocument.getBusinessDocumentId().toString());
businessDocumentDTO.setAuditOperation(1);
takeEffectByIds(businessDocumentDTO);
auditByIds(businessDocumentDTO);
List<BillingStatement> billingStatements = billingStatementMapper.selectList(new LambdaQueryWrapper<BillingStatement>()
.eq(BillingStatement::getBusinessDocumentId, businessDocument.getBusinessDocumentId())
.eq(BillingStatement::getDelFlag, 1));
BillingStatement billingStatement = null;
if (ObjectUtil.isNotNull(billingStatements)&&billingStatements.size()>0) {
billingStatement = billingStatements.get(0);
BillingStatementDTO billingStatementDTO = new BillingStatementDTO();
billingStatementDTO.setBillingStatementIds(billingStatement.getBillingStatementId().toString());
billingStatementDTO.setAuditOperation(1);
billingStatementDomainService.reviewBilling(billingStatementDTO);
}
BillManage billManage = billManageService.getById(businessDocumentDO.getBillManageId());
BillDetail billDetail = new BillDetail();
billDetail.setBillManageId(businessDocumentDO.getBillManageId());
billDetail.setBillNumber(billManage.getBillNumber());
billDetail.setBillingStatementId(billingStatement.getBillingStatementId());
billDetail.setBillingFlow(billingStatement.getBillingFlow());
billDetail.setOrganizationId(billManage.getOrganizationId());
billDetail.setOrganizationName(billManage.getOrganizationName());
billDetail.setTopOrganizationId(billManage.getTopOrganizationId());
billDetail.setCreateBy(userPo.getUserId());
billDetail.setCreateByName(userPo.getUserName());
billDetail.setCreateTime(new Date());
billDetail.setDelFlag(1);
billDetail.setBillingTotalAmount(billingStatement.getBillingAmount());
billDetail.setBillingDiscountAmount(BigDecimal.ZERO);
billDetail.setBillingAmount(billingStatement.getBillingAmount());
billDetail.setBillType(1);
billDetail.setBillingExpectedAmount(BigDecimal.ZERO);
billDetail.setFeeType(billingStatement.getServiceItemsName());
billDetail.setInvoiceItem(billingStatement.getFirstSubjectCode());
billDetail.setInvoiceItemName(billingStatement.getFirstSubjectName());
billDetail.setSettlementCurrency(billingStatement.getSettlementCurrency());
billDetail.setTaxAmount(billingStatement.getTaxAmount());
billDetail.setTaxFreeFee(billingStatement.getTaxFreeFee());
billDetail.setTaxRate(billingStatement.getTaxRate());
billDetailService.save(billDetail);
BigDecimal billAmount = billManage.getBillAmount();
BigDecimal amount = billAmount.add(billDetail.getBillingAmount());
billManage.setBillAmount(amount);
billManage.setBillTotalAmount(amount);
billManageService.updateById(billManage);
return true;
}
/**
* JSONObject 安全获取 BigDecimal支持
* 数字整数字符串小数字符串null空字符串
@@ -484,7 +607,7 @@ public class BusinessDocumentApplicationService {
if(businessDocumentDO.getBelongModuleCode().equals(BelongModuleCode.WMS.getCode())){
contractType = 1;
}
AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomerAndOrganizationId(businessDocumentDO.getSettlementCustomersCode(),contractType,businessDocumentDO.getTopOrganizationId(),businessDocumentDO.getOrganizationId());
AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomerAndSecondSubjectCode(businessDocumentDO.getSettlementCustomersCode(),contractType,businessDocumentDO.getFirstSubjectCode(),businessDocumentDO.getTopOrganizationId(),businessDocumentDO.getOrganizationId());
if(!"200".equals(String.valueOf(ajaxResult.get("code")))) {
throw new ServiceException("合同信息未找到");
}
@@ -25,6 +25,8 @@ public interface BillManageMapper extends BaseMapper<BillManage>
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
String getsalespersonNcCode(@Param("salesmanId") String salesmanId);
@@ -1,9 +1,13 @@
package com.mhd.bms.domain.billManage.repository.persistence;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mhd.bms.domain.billManage.entity.BillManage;
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
@@ -66,6 +70,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 账单管理Service业务层处理
@@ -211,6 +216,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = billManageMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String settlementCurrency=reconciliation.getSettlementCurrency();
String orgCodeNc = billManageMapper.getOrgCodeNc(organizationId);
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
@@ -436,6 +461,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
reconciliation.setSynchronousStatus(2);
billManageMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -528,6 +557,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = billManageMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
String settlementCurrency=reconciliation.getSettlementCurrency();
String settlementCurrencyNcCode = settlementCurrency;
@@ -722,6 +771,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
reconciliation.setSynchronousStatus(2);
billManageMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -94,6 +94,13 @@ public class BillManageDomainService {
return billManageService.insert(billManageDO);
}
/**
* 直接保存账单管理实体
*/
public boolean saveEntity(BillManage billManage) {
return billManageService.save(billManage);
}
/**
* 修改账单管理
*/
@@ -119,6 +119,13 @@ public class BillingStatementDomainService {
return billingStatementService.getInfo(billingStatementId);
}
/**
* 批量保存计费流水实体
*/
public boolean saveEntityBatch(List<BillingStatement> list) {
return billingStatementService.saveBatch(list);
}
/**
* 批量审核
*/
@@ -675,8 +682,8 @@ public class BillingStatementDomainService {
billingStatementDO.setSettlementCustomersCode(billManagePO.getSettlementCustomersCode());
billingStatementDO.setBelongModuleCode(billManagePO.getBelongModuleCode());
billingStatementDO.setAccountExpenseType(billManagePO.getBillType());
billingStatementDO.setCycleBeginTime(billManagePO.getCycleBeginTime());
billingStatementDO.setCycleEndTime(billManagePO.getCycleEndTime());
// billingStatementDO.setCycleBeginTime(billManagePO.getCycleBeginTime());
// billingStatementDO.setCycleEndTime(billManagePO.getCycleEndTime());
billingStatementDO.setBillingState(2);
startPage();
return billingStatementService.queryList(billingStatementDO);
@@ -218,4 +218,6 @@ public class BusinessDocumentDO extends BaseVOEntity{
private BigDecimal billingUnitPrice;
@ApiModelProperty("nc科目编码")
private String ncSubjectCode;
private Long billManageId;
}
@@ -96,4 +96,12 @@ public class BillLogsConstants
public static final String payment_bill_text = "付款单号:{},付款金额:{}元";
/**
* 复制账单
* 原账单编号{}新账单编号{}
*/
public static final String copy_bill_title = "复制账单";
public static final String copy_bill_text = "原账单编号:{},新账单编号:{}";
}
@@ -213,4 +213,6 @@ public class BusinessDocumentDTO extends BaseVOEntity{
private String paymentAccountId;
@ApiModelProperty("收款帐户名称")
private String paymentAccountName;
private Long billManageId;
}
@@ -229,6 +229,22 @@ public class BillManageApi extends BaseController{
}
@ApiOperation("复制账单")
@PostMapping("/copyBill")
public AjaxResult copyBill(@RequestBody BillManageDTO billManageDTO)
{
if(billManageDTO.getBillManageId() == null){
throw new ServiceException("原账单id不能为空");
}
try {
Boolean result = billManageApplicationService.copyBill(billManageDTO);
return toAjax(result);
}catch (Exception e){
return AjaxResult.error("复制账单失败:"+e.getMessage());
}
}
@ApiOperation("应收账单-客户确认")
@PostMapping("/customerConfirmation")
public AjaxResult customerConfirmation(@RequestBody BillManageDTO billManageDTO)
@@ -79,6 +79,25 @@ public class BusinessDocumentApi extends BaseController{
}
/**
* 保存业务单据
*/
@ApiOperation("账单添加费用")
@PostMapping("/manageAddFee")
public AjaxResult manageAddFee(@RequestBody BusinessDocumentDTO businessDocumentDTO)
{
try {
//转换实体
BusinessDocumentDO businessDocumentDO = businessDocumentAssembler.toDO(businessDocumentDTO);
return toAjax(businessDocumentApplicationService.manageAddFee(businessDocumentDO));
} catch (ServiceException e) {
return AjaxResult.error(e.getMessage());
} catch (Exception e){
return AjaxResult.error("保存业务单据失败:" + e.getMessage());
}
}
/**
* 保存业务单据
@@ -118,6 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getCustomerCodeNcJson" parameterType="java.lang.String" resultType="java.lang.String">
SELECT ORG_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
</select>
@@ -39,6 +39,8 @@ public interface ReconciliationMapper extends BaseMapper<Reconciliation>
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.linke.finance.domain.approvalDocument.entity.ApprovalDocument;
import com.linke.finance.domain.approvalDocument.repository.mapper.ApprovalDocumentMapper;
@@ -725,6 +727,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> list = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (list != null && list.size() > 0) {
Map<String, Object> targetMap = list.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String settlementCurrency=order.getSettlementCurrency();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
@@ -952,6 +974,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1008,6 +1034,27 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> list = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (list != null && list.size() > 0) {
Map<String, Object> targetMap = list.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String settlementCurrency=order.getSettlementCurrency();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
@@ -1235,6 +1282,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1560,6 +1611,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
String settlementCurrency=order.getSettlementCurrency();
String settlementCurrencyNcCode = settlementCurrency;
@@ -1759,6 +1830,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1844,6 +1919,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
String settlementCurrency=order.getSettlementCurrency();
String settlementCurrencyNcCode = settlementCurrency;
@@ -2046,6 +2141,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -373,6 +373,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getCustomerCodeNcJson" parameterType="java.lang.String" resultType="java.lang.String">
SELECT ORG_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
</select>
@@ -123,6 +123,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTmsReceiptPo1"/>
</select>
<select id="selectCnName" resultType="java.lang.String">
select chinese_name from NGWL_TEST_WLHY.TMS_SETTLEMENT_EXCHANGE_RATE where english_name = #{settlementCount}
select chinese_name from NGWL_TEST_WLHY.TMS_SETTLEMENT_EXCHANGE_RATE where english_name = #{settlementCount} limit 1
</select>
</mapper>
@@ -25,6 +25,8 @@ import com.mhd.oms.domain.gwLog.entity.GwLog;
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
import com.mhd.oms.domain.documentPushMaterialRecord.entity.DocumentPushMaterialRecord;
import com.mhd.oms.domain.documentPushMaterialRecord.repository.mapper.DocumentPushMaterialRecordMapper;
import com.mhd.oms.domain.erpCountry.entity.ErpCountry;
import com.mhd.oms.domain.erpCountry.repository.mapper.ErpCountryMapper;
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO;
import com.mhd.system.api.model.LoginUser;
@@ -42,6 +44,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -93,6 +96,9 @@ public class BusinessDocumentOrderApplicationService {
@Resource
private DocumentPushMaterialRecordMapper documentPushMaterialRecordMapper;
@Resource
private ErpCountryMapper erpCountryMapper;
/**
* 分页查询请填写功能名称列表
*/
@@ -246,6 +252,10 @@ public class BusinessDocumentOrderApplicationService {
body.put("goodsType", goodsType != null ? goodsType : "");
body.put("ieFlag", order.getIeType() != null ? order.getIeType() : "");
body.put("corpCode", corpCode != null ? corpCode : "");
// 启运/运抵国地区收货地ErpCountry表
body.put("stshipTrsarvNatcd", lookupErpCountryCode(order.getUnloadAreaId(), order.getUnloadName()));
// 贸易国地区发货地ErpCountry表
body.put("tradeAreaCode", lookupErpCountryCode(order.getLoadingAreaId(), order.getLoadingName()));
List<Map<String, Object>> billList = new ArrayList<>();
if (cargoList != null && !cargoList.isEmpty()) {
@@ -257,28 +267,53 @@ public class BusinessDocumentOrderApplicationService {
billMap.put("packNo", cargo.getCargoNum() != null ? cargo.getCargoNum() : "");
billMap.put("erpQty", cargo.getCargoNum() != null ? cargo.getCargoNum() : "");
// 查询物料基础信息计算净重和毛重
// 查询物料基础信息
MaterialBaseInfoPO material = null;
if (cargo.getMaterialBaseInfoId() != null) {
MaterialBaseInfoPO material = reservationStockInOrderMapper.getinfo(cargo.getMaterialBaseInfoId());
if (material != null && cargo.getCargoNum() != null) {
if (material.getWeightLimit() != null) {
billMap.put("netWt", material.getWeightLimit().multiply(cargo.getCargoNum()));
} else {
billMap.put("netWt", "");
}
if (material.getGrossWeight() != null) {
billMap.put("grossWt", material.getGrossWeight().multiply(cargo.getCargoNum()));
} else {
billMap.put("grossWt", "");
}
material = reservationStockInOrderMapper.getinfo(cargo.getMaterialBaseInfoId());
}
if (material != null) {
// 净重和毛重
if (cargo.getCargoNum() != null) {
billMap.put("netWt", material.getWeightLimit() != null
? material.getWeightLimit().multiply(cargo.getCargoNum()) : "");
billMap.put("grossWt", material.getGrossWeight() != null
? material.getGrossWeight().multiply(cargo.getCargoNum()) : "");
} else {
billMap.put("netWt", "");
billMap.put("grossWt", "");
}
// 货物名称
billMap.put("goodsName", material.getMaterialName() != null ? material.getMaterialName() : "");
// 成交单位申报单位
billMap.put("gUnit", material.getDeclarationUnit() != null ? material.getDeclarationUnit() : "");
// 币制
billMap.put("currency", material.getCurrency() != null ? material.getCurrency() : "");
// 原产国countryCode
billMap.put("countryCode", material.getOriginCountry() != null ? material.getOriginCountry() : "");
// 单价企业单价
BigDecimal unitPrice = material.getUnitPrice();
billMap.put("unitPrice", unitPrice != null ? unitPrice : "");
// 总价entTotal = 成交数量 × 单价
if (unitPrice != null && cargo.getCargoNum() != null) {
billMap.put("entTotal", unitPrice.multiply(cargo.getCargoNum()));
} else {
billMap.put("entTotal", "");
}
} else {
billMap.put("netWt", "");
billMap.put("grossWt", "");
billMap.put("goodsName", "");
billMap.put("gUnit", "");
billMap.put("currency", "");
billMap.put("countryCode", "");
billMap.put("unitPrice", "");
billMap.put("entTotal", "");
}
// 最终目的国收货地
billMap.put("destinationCountry", order.getUnloadName() != null ? order.getUnloadName() : "");
// 境内货源地发货地
billMap.put("domesticSourcePlace", order.getLoadingName() != null ? order.getLoadingName() : "");
billList.add(billMap);
}
}
@@ -401,6 +436,30 @@ public class BusinessDocumentOrderApplicationService {
}
/** 根据区域ID或名称查ErpCountry表获取国别编码 */
private String lookupErpCountryCode(String areaId, String areaName) {
if (areaId == null && areaName == null) return "";
try {
LambdaQueryWrapper<ErpCountry> qw = new LambdaQueryWrapper<>();
qw.eq(ErpCountry::getDelFlag, 1);
if (areaId != null) {
qw.eq(ErpCountry::getErpCountryCode, areaId);
}
List<ErpCountry> list = erpCountryMapper.selectList(qw);
if (!list.isEmpty()) return list.get(0).getErpCountryCode();
// 按名称模糊匹配
if (areaName != null) {
LambdaQueryWrapper<ErpCountry> qw2 = new LambdaQueryWrapper<>();
qw2.eq(ErpCountry::getDelFlag, 1).like(ErpCountry::getErpCountryName, areaName);
List<ErpCountry> list2 = erpCountryMapper.selectList(qw2);
if (!list2.isEmpty()) return list2.get(0).getErpCountryCode();
}
} catch (Exception e) {
log.warn("查ErpCountry失败 areaId={} areaName={}", areaId, areaName, e);
}
return areaId != null ? areaId : "";
}
private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, String pushBy, String pushByName) {
try {
@@ -0,0 +1,396 @@
package com.mhd.oms.domain.executionInMaterialDetail.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionInMaterialDetail extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
@TableId(type = IdType.AUTO)
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty(value = "饮用时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date drinkDate;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
}
@@ -0,0 +1,68 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailBaseDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import java.util.List;
/**
* 物料明细Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IExecutionInMaterialDetailService extends IService<ExecutionInMaterialDetail>
{
/**
* 分页查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryList(ExecutionInMaterialDetailDO inMaterialDetailDO);
public List<ExecutionInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
/**
* 分页查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryListChildren(ExecutionInMaterialDetailDO inMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean insert(ExecutionInMaterialDetailDO inMaterialDetailDO);
/**
* 修改物料明细
*/
public Boolean update(ExecutionInMaterialDetailDO inMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean batchInsert(String orderNumber, List<ExecutionInMaterialDetailDO> inMaterialDetailDOList);
/**
* 修改物料明细
*/
public Boolean batchUpdate(List<ExecutionInMaterialDetailDO> inMaterialDetailDOList, ExecutionInMaterialDetailBaseDO inMaterialDetailBaseDO);
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds);
/**
* 查询物料明细
*/
public ExecutionInMaterialDetailPO getInfo(Long materialDetailId);
public List<InventoryAdjustmentRecordPO> getkctzjl(Long materialBaseInfoId, String orderNumber, String adjustType);
}
@@ -0,0 +1,33 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 物料明细Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ExecutionInMaterialDetailMapper extends BaseMapper<ExecutionInMaterialDetail>
{
/**
* 查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryList(ExecutionInMaterialDetailDO inMaterialDetailDO);
/**
* 关联入库单查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
public List<InventoryAdjustmentRecordPO> getkctzjl(@Param("materialBaseInfoId") Long materialBaseInfoId, @Param("orderNumber") String orderNumber, @Param("adjustType") String adjustType);
}
@@ -0,0 +1,312 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.persistence;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.utils.uuid.IdGenerator;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
import com.mhd.oms.domain.executionInMaterialDetail.repository.mapper.ExecutionInMaterialDetailMapper;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailBaseDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService;
import com.mhd.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 物料明细Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public class ExecutionInMaterialDetailImpl extends ServiceImpl<ExecutionInMaterialDetailMapper, ExecutionInMaterialDetail> implements IExecutionInMaterialDetailService {
@Autowired
private ExecutionInMaterialDetailMapper inMaterialDetailMapper;
// @Autowired
// private IMaterialBaseInfoService materialBaseInfoService;
// @Autowired
// private IMaterialGoodsRuleService materialGoodsRuleService;
// @Autowired
// private IMaterialWarehouseControlService materialWarehouseControlService;
// @Autowired
// private SystemServiceFeign systemServiceFeign;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IReservationMaterialInventoryService reservationMaterialInventoryService;
/**
* 查询物料明细列表
*/
@Override
public List<ExecutionInMaterialDetailPO> queryList(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailMapper.queryList(inMaterialDetailDO);
}
/**
* 关联入库单查询物料明细列表
*/
@Override
public List<ExecutionInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO) {
return inMaterialDetailMapper.queryInOrderList(queryOrderOverStockDO);
}
/**
* 查询物料明细列表
*/
@Override
public List<ExecutionInMaterialDetailPO> queryListChildren(ExecutionInMaterialDetailDO inMaterialDetailDO)
{
List<ExecutionInMaterialDetailPO> inMaterialDetailPOList = inMaterialDetailMapper.queryList(inMaterialDetailDO);
// 获取查询的层级
List<ExecutionInMaterialDetailPO> inMaterialDetailPOParentList = inMaterialDetailPOList
.stream().filter(e -> 1 == e.getLevel()).collect(Collectors.toList());
// 递归查询子集
inMaterialDetailPOParentList.forEach(materialDetailPO -> materialDetailPO.setChildren(getChildren(materialDetailPO.getUniqueId(), inMaterialDetailPOList, 2)));
return inMaterialDetailPOParentList;
}
private List<ExecutionInMaterialDetailPO> getChildren(Long parentUniqueId, List<ExecutionInMaterialDetailPO> inMaterialDetailPOList, Integer maxLevel){
List<ExecutionInMaterialDetailPO> childrenCityList = inMaterialDetailPOList.stream().filter(materialDetailPO -> parentUniqueId.equals(materialDetailPO.getParentUniqueId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(childrenCityList)){
childrenCityList.forEach(childrenCity -> {
if (childrenCity.getLevel() < maxLevel){
childrenCity.setChildren(getChildren(childrenCity.getUniqueId(), inMaterialDetailPOList, maxLevel));
}
});
}
return childrenCityList;
}
/**
* 新增物料明细
*/
@Override
public Boolean insert(ExecutionInMaterialDetailDO inMaterialDetailDO) {
ExecutionInMaterialDetail inMaterialDetail = new ExecutionInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
return this.save(inMaterialDetail);
}
/**
* 修改物料明细
*/
@Override
public Boolean update(ExecutionInMaterialDetailDO inMaterialDetailDO) {
ExecutionInMaterialDetail inMaterialDetail = new ExecutionInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
return this.updateById(inMaterialDetail);
}
/**
* @description 批量新增物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param inOrderNumber
* @param inMaterialDetailDOList
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchInsert(String inOrderNumber, List<ExecutionInMaterialDetailDO> inMaterialDetailDOList) {
if (CollectionUtils.isEmpty(inMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
// 批量新增或修改
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
for (ExecutionInMaterialDetailDO inMaterialDetailDO : inMaterialDetailDOList){
ExecutionInMaterialDetail inMaterialDetail = new ExecutionInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId());
inMaterialDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName());
inMaterialDetail.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
inMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
inMaterialDetail.setInOrderNumber(inOrderNumber);
inMaterialDetail.setLevel(1);
inMaterialDetail.setCreateBy(loginUser.getUserid());
inMaterialDetail.setCreateByName(userRealName);
inMaterialDetail.setCreateTime(new Date());
// 新增入库单明细时如果计划数量为空则使用入库数量作为计划数量
if (inMaterialDetail.getQuantity() == null && inMaterialDetailDO.getInboundQuantity() != null) {
inMaterialDetail.setQuantity(inMaterialDetailDO.getInboundQuantity());
}
if (inMaterialDetail.getInboundQuantity() == null && inMaterialDetailDO.getQuantity() != null) {
inMaterialDetail.setInboundQuantity(inMaterialDetailDO.getQuantity());
}
inMaterialDetailList.add(inMaterialDetail);
}
//插入库存表
putIntoInventory(inMaterialDetailList);
return saveBatch(inMaterialDetailList);
}
private void putIntoInventory(List<ExecutionInMaterialDetail> inMaterialDetailList) {
for (ExecutionInMaterialDetail reservationInMaterialDetail : inMaterialDetailList) {
ReservationMaterialInventory reservationMaterialInventory = new ReservationMaterialInventory();
BeanUtils.copyProperties(reservationInMaterialDetail, reservationMaterialInventory);
reservationMaterialInventory.setLotNumber(reservationInMaterialDetail.getLotNo());
UpdateWrapper<ReservationMaterialInventory> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.eq(reservationMaterialInventory.getShipperId() != null,ReservationMaterialInventory::getShipperId, reservationMaterialInventory.getShipperId())
.eq(reservationMaterialInventory.getWarehouseId() != null,ReservationMaterialInventory::getWarehouseId, reservationMaterialInventory.getWarehouseId())
.eq(reservationMaterialInventory.getMaterialBaseInfoId() != null,ReservationMaterialInventory::getMaterialBaseInfoId, reservationMaterialInventory.getMaterialBaseInfoId())
.eq(reservationMaterialInventory.getInOrderNumber() != null,ReservationMaterialInventory::getInOrderNumber, reservationMaterialInventory.getInOrderNumber())
.eq(reservationMaterialInventory.getLotNumber() != null,ReservationMaterialInventory::getLotNumber, reservationMaterialInventory.getLotNumber())
.eq(reservationMaterialInventory.getBatchNumber() != null,ReservationMaterialInventory::getBatchNumber, reservationMaterialInventory.getBatchNumber())
;
//reservationMaterialInventoryService.saveOrUpdate(reservationMaterialInventory,updateWrapper);
}
}
/**
* @description 批量修改物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param inMaterialDetailDOList
* @param inMaterialDetailBaseDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchUpdate(List<ExecutionInMaterialDetailDO> inMaterialDetailDOList, ExecutionInMaterialDetailBaseDO inMaterialDetailBaseDO) {
if (CollectionUtils.isEmpty(inMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
// 查询所有记录包括已删除的用于判断是否需要恢复已删除的记录
List<ExecutionInMaterialDetail> inMaterialDetailDbAllList = inMaterialDetailMapper.selectList(new QueryWrapper<ExecutionInMaterialDetail>().lambda()
.eq(ExecutionInMaterialDetail::getInOrderNumber, inMaterialDetailBaseDO.getInOrderNumber()));
// 查询未删除的记录用于正常的更新逻辑
List<ExecutionInMaterialDetail> inMaterialDetailDbList = inMaterialDetailDbAllList.stream()
.filter(item -> item.getDelFlag() != null && item.getDelFlag() == 1)
.collect(Collectors.toList());
Map<Long, ExecutionInMaterialDetail> materialDetailMap = inMaterialDetailDbList.stream().collect(Collectors.toMap(ExecutionInMaterialDetail::getMaterialDetailId, Function.identity()));
// 查询已删除的记录用于恢复逻辑
Map<Long, ExecutionInMaterialDetail> materialDetailDeletedMap = inMaterialDetailDbAllList.stream()
.filter(item -> item.getDelFlag() != null && item.getDelFlag() == 2)
.collect(Collectors.toMap(ExecutionInMaterialDetail::getMaterialDetailId, Function.identity()));
//批量新增或修改物料信息
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
//需要修改的物流明细
List<Long> materialDetailIdsByUpdate = new ArrayList<>();
for (ExecutionInMaterialDetailDO inMaterialDetailDO : inMaterialDetailDOList){
//判断是否需要修改
ExecutionInMaterialDetail inMaterialDetail = null;
if (inMaterialDetailDO.getMaterialDetailId() != null) {
// 先查找未删除的记录
inMaterialDetail = materialDetailMap.get(inMaterialDetailDO.getMaterialDetailId());
// 如果未删除的记录中找不到检查是否在已删除的记录中
if (inMaterialDetail == null) {
ExecutionInMaterialDetail deletedDetail = materialDetailDeletedMap.get(inMaterialDetailDO.getMaterialDetailId());
if (deletedDetail != null) {
// 恢复已删除的记录
inMaterialDetail = deletedDetail;
inMaterialDetail.setDelFlag(1); // 恢复记录
}
}
}
if (inMaterialDetail == null){
// 新增明细清空 materialDetailId让数据库自动生成
inMaterialDetail = new ExecutionInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setMaterialDetailId(null); // 清空ID确保新增
inMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
inMaterialDetail.setInOrderNumber(inMaterialDetailBaseDO.getInOrderNumber());
inMaterialDetail.setOrganizationId(inMaterialDetailBaseDO.getOrganizationId());
inMaterialDetail.setOrganizationName(inMaterialDetailBaseDO.getOrganizationName());
inMaterialDetail.setTopOrganizationId(inMaterialDetailBaseDO.getTopOrganizationId());
inMaterialDetail.setDelFlag(1); // 确保新增记录的delFlag为1
}else {
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setUpdateBy(loginUser.getUserid());
inMaterialDetail.setUpdateByName(userRealName);
inMaterialDetail.setUpdateTime(new Date());
materialDetailIdsByUpdate.add(inMaterialDetailDO.getMaterialDetailId());
}
inMaterialDetailList.add(inMaterialDetail);
}
//需修改的物料明细id集合不为空
if (!CollectionUtils.isEmpty(inMaterialDetailDbList) && !CollectionUtils.isEmpty(materialDetailIdsByUpdate)){
List<Long> materialDetailIdsByDb = inMaterialDetailDbList.stream().map(ExecutionInMaterialDetail::getMaterialDetailId).collect(Collectors.toList());
//过滤需要修改的id集合
materialDetailIdsByDb.removeAll(materialDetailIdsByUpdate);
//判断是否存在需要删除的物流明细 标记删除
if (!CollectionUtils.isEmpty(materialDetailIdsByDb)){
update(new UpdateWrapper<ExecutionInMaterialDetail>().lambda()
.set(ExecutionInMaterialDetail::getDelFlag, 2)
.set(ExecutionInMaterialDetail::getUpdateBy, loginUser.getUserid())
.set(ExecutionInMaterialDetail::getUpdateByName, userRealName)
.set(ExecutionInMaterialDetail::getUpdateTime, new Date())
.in(ExecutionInMaterialDetail::getMaterialDetailId, materialDetailIdsByDb));
}
}
//保存物料明细信息
return saveOrUpdateBatch(inMaterialDetailList);
}
/**
* 批量删除物料明细
*/
@Override
public Boolean delete(Long[] materialDetailIds ) {
List<ExecutionInMaterialDetail> list = new ArrayList<>();
for (Long id : materialDetailIds) {
ExecutionInMaterialDetail inMaterialDetail = new ExecutionInMaterialDetail();
inMaterialDetail.setMaterialDetailId(id);
inMaterialDetail.setDelFlag(2);
list.add(inMaterialDetail);
}
return this.updateBatchById(list);
}
/**
* 修改物料明细
*/
@Override
public ExecutionInMaterialDetailPO getInfo(Long materialDetailId) {
ExecutionInMaterialDetail inMaterialDetail = this.getById(materialDetailId);
ExecutionInMaterialDetailPO inMaterialDetailPO = new ExecutionInMaterialDetailPO();
BeanUtils.copyProperties(inMaterialDetail, inMaterialDetailPO);
return inMaterialDetailPO;
}
@Override
public List<InventoryAdjustmentRecordPO> getkctzjl(Long materialBaseInfoId, String orderNumber, String adjustType) {
return inMaterialDetailMapper.getkctzjl(materialBaseInfoId, orderNumber, adjustType);
}
}
@@ -0,0 +1,498 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.oms.domain.executionStockInOrder.repository.po.ExecutionStockInOrderBasePO;
import io.swagger.annotations.ApiModel;
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;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "物料明细对象", description = "物料明细响应对象")
public class ExecutionInMaterialDetailPO extends ExecutionStockInOrderBasePO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("未收货数量")
@Excel(name = "未收货数量")
private BigDecimal waitReceiptQuantity;
@ApiModelProperty("未上架数量")
@Excel(name = "未上架数量")
private BigDecimal waitShelvesQuantity;
@ApiModelProperty("物料明细")
private List<ExecutionInMaterialDetailPO> children;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("生产日期")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date productionDate;
@ApiModelProperty("过期日期")
@Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date expiryDate;
@ApiModelProperty("存货日期")
@Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date inventoryDate;
@ApiModelProperty("扩展属性1")
@Excel(name = "扩展属性1")
private String extAttr1;
@ApiModelProperty("扩展属性2")
@Excel(name = "扩展属性2")
private String extAttr2;
@ApiModelProperty("扩展属性3")
@Excel(name = "扩展属性3")
private String extAttr3;
@ApiModelProperty("扩展属性4")
@Excel(name = "扩展属性4")
private String extAttr4;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty(value = "饮用时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date drinkDate;
private String lotNumber;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
private String khdm;
}
@@ -0,0 +1,42 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZhouGY
* @title StockBaseDO
* @description: TODO
* @date 2024/5/23 20:30
**/
@Data
public class ExecutionInMaterialDetailBaseDO implements Serializable {
private static final long serialVersionUID = 1L;
@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 inOrderNumber;
@ApiModelProperty("收货单号")
@Excel(name = "收货单号")
private String receiptOrderNumber;
@ApiModelProperty("上架单号")
@Excel(name = "上架单号")
private String shelfOrderNumber;
}
@@ -0,0 +1,463 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ExecutionStockInOrderBaseDO;
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderBaseDO;
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;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionInMaterialDetailDO extends ExecutionStockInOrderBaseDO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ExecutionInMaterialDetailDO> children;
// @ApiModelProperty("更多属性")
// private List<MaterialMoreDetailDO> materialMoreDetailList;
// @ApiModelProperty("序列号")
// private List<ExecutionInMaterialDetailSerialNumberDO> materialDetailSerialNumberList;
@ApiModelProperty("入库单号集合")
@Excel(name = "入库单号集合")
private List<String> inOrderNumberList;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号(选择物料后自动带出,不可编辑)")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码(选择物料后自动带出,不可编辑)")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位(数据字典下拉选择框)")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "ruku数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty(value = "饮用时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date drinkDate;
private String expiryDate;
private String productionDate;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
}
@@ -0,0 +1,469 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionInMaterialDetailDTO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 inOrderNumber;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
// @ApiModelProperty("更多属性")
// private List<MaterialMoreDetailDTO> materialMoreDetailList;
// @ApiModelProperty("序列号")
// private List<InMaterialDetailSerialNumberDTO> materialDetailSerialNumberList;
@ApiModelProperty("入库单号集合")
@Excel(name = "入库单号集合")
private List<String> inOrderNumberList;
@ApiModelProperty("是否是差异单")
private Integer isDifferentType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号(选择物料后自动带出,不可编辑)")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码(选择物料后自动带出,不可编辑)")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位(数据字典下拉选择框)")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("出库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty(value = "饮用时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date drinkDate;
private String expiryDate;
private String productionDate;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
}
@@ -0,0 +1,254 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
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.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* 库存调整记录对象 inventory_adjustment_record
*
* @author gen
* @date 2024-07-17
*/
@Data
@ApiModel(value = "库存调整记录对象", description = "库存调整记录响应对象")
public class InventoryAdjustmentRecordPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("库存调整记录id")
private Long inventoryAdjustmentId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("物料库存id")
private Long materialInventoryId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@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 storageSectionId;
@ApiModelProperty("库区编码")
@Excel(name = "库区编码")
private String storageCode;
@ApiModelProperty("库区名称")
@Excel(name = "库区名称")
private String storageName;
@ApiModelProperty("库位id")
@Excel(name = "库位id")
private Long storageLocationId;
@ApiModelProperty("库位编码")
@Excel(name = "库位编码")
private String storageLocationCode;
@ApiModelProperty("库位名称")
@Excel(name = "库位名称")
private String storageLocationName;
@ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
private Long adjustType;
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
private Long adjustDirection;
@ApiModelProperty("调整前状态编码")
@Excel(name = "调整前状态编码")
private String adjustBeforeStatusCode;
@ApiModelProperty("调整前状态名称")
@Excel(name = "调整前状态名称")
private String adjustBeforeStatusName;
@ApiModelProperty("调整后状态编码")
@Excel(name = "调整后状态编码")
private String adjustAfterStatusCode;
@ApiModelProperty("调整后状态名称")
@Excel(name = "调整后状态名称")
private String adjustAfterStatusName;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("扩展字段1")
@Excel(name = "扩展字段1")
private String extAttr1;
@ApiModelProperty("扩展字段2")
@Excel(name = "扩展字段2")
private String extAttr2;
@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 productionDate;
@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 expiryDate;
@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 inventoryDate;
@ApiModelProperty("ExtAttr3")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr3;
@ApiModelProperty("ExtAttr4")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr4;
//
// @ApiModelProperty("物料更多属性列表(批次属性)")
// private List<MaterialMoreDetailPO> materialMoreDetailList;
@ApiModelProperty("调整动作")
@Excel(name = "调整动作")
private String adjustAction;
@ApiModelProperty("关联单号")
@Excel(name = "关联单号")
private String relateNo;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("LOT编号")
@Excel(name = "LOT编号")
// private String LotNumber;
private String lotNumber;
}
@@ -0,0 +1,140 @@
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
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.util.Date;
import java.util.List;
/**
* 越库管理对象 over_stock
*
* @author gen
* @date 2024-07-23
*/
@Data
public class QueryOrderOverStockDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@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("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String inOrderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String inOrderTypeName;
@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 inOrderExpectStartTime;
@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 inOrderExpectEndTime;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String outOrderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String outOrderTypeName;
@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 outOrderExpectStartTime;
@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 outOrderExpectEndTime;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private List<Long> shipperIdList;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private List<Long> materialBaseInfoIdList;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer inStatus;
@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 outStatus;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
}
@@ -0,0 +1,72 @@
package com.mhd.oms.domain.executionInMaterialDetail.service;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细ApplicationService
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ExecutionInMaterialDetailApplicationService {
@Autowired
private ExecutionInMaterialDetailDomainService inMaterialDetailDomainService;
/**
* 分页查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryList(ExecutionInMaterialDetailDO inMaterialDetailDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null){
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
if (topOrganizationId != null && topOrganizationId != 1){
inMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
}
return inMaterialDetailDomainService.queryList(inMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailDomainService.insert(inMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailDomainService.update(inMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public boolean delete(Long[] materialDetailIds) {
return inMaterialDetailDomainService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ExecutionInMaterialDetailPO getInfo(Long materialDetailId)
{
return inMaterialDetailDomainService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.executionInMaterialDetail.service;
import cn.hutool.core.util.ObjectUtil;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDTO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 物料明细Assembler
*
* @author gen
* @date 2024-05-21
*/
@Component
public class ExecutionInMaterialDetailAssembler {
/**
* 转换实体
*/
public ExecutionInMaterialDetailDO toDO(ExecutionInMaterialDetailDTO inMaterialDetailDTO) {
ExecutionInMaterialDetailDO inMaterialDetailDO = new ExecutionInMaterialDetailDO();
// 拷贝
BeanUtils.copyProperties(inMaterialDetailDTO, inMaterialDetailDO, IgnoreNullUtil.getNullPropertyNames(inMaterialDetailDTO));
return inMaterialDetailDO;
}
/**
* 转换实体
*/
public ExecutionInMaterialDetailDO toDOByEdit(ExecutionInMaterialDetailDTO inMaterialDetailDTO) {
ExecutionInMaterialDetailDO inMaterialDetailDO = new ExecutionInMaterialDetailDO();
// 拷贝
BeanUtils.copyProperties(inMaterialDetailDTO, inMaterialDetailDO, IgnoreNullUtil.getNullPropertyNames(inMaterialDetailDTO));
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取登录人id
Long userId = loginUser.getUserid();
if(inMaterialDetailDTO.getMaterialDetailId() != null){
inMaterialDetailDO.setUpdateBy(userId);
inMaterialDetailDO.setUpdateByName(userName);
inMaterialDetailDO.setUpdateTime(new Date());
}else {
inMaterialDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
inMaterialDetailDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
inMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
inMaterialDetailDO.setCreateBy(userId);
inMaterialDetailDO.setCreateByName(userName);
inMaterialDetailDO.setCreateTime(new Date());
inMaterialDetailDO.setDelFlag(1);
}
return inMaterialDetailDO;
}
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.executionInMaterialDetail.service;
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ExecutionInMaterialDetailDomainService {
@Autowired
private IExecutionInMaterialDetailService materialDetailService;
/**
* 分页查询物料明细列表
*/
public List<ExecutionInMaterialDetailPO> queryList(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.queryList(inMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.insert(inMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ExecutionInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.update(inMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds) {
return materialDetailService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ExecutionInMaterialDetailPO getInfo(Long materialDetailId)
{
return materialDetailService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,521 @@
package com.mhd.oms.domain.executionOutMaterialDetail.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionOutMaterialDetail extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
@TableId(type = IdType.AUTO)
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
*
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("扩展属性1")
@Excel(name = "扩展属性1")
@TableField("ext_attr_1")
private String extAttr1;
@ApiModelProperty("扩展属性2")
@Excel(name = "扩展属性2")
@TableField("ext_attr_2")
private String extAttr2;
@ApiModelProperty("生产日期")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productionDate;
@ApiModelProperty("过期日期")
@Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expiryDate;
@ApiModelProperty("存货日期")
@Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inventoryDate;
@ApiModelProperty("扩展属性3")
@Excel(name = "扩展属性3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@TableField("ext_attr_3")
private Date extAttr3;
@ApiModelProperty("扩展属性4")
@Excel(name = "扩展属性4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@TableField("ext_attr_4")
private Date extAttr4;
/**
* 库存数量仅用于前端展示从material_inventory表中带出
*/
@ApiModelProperty("分配时库存数量")
private BigDecimal inventoryQuantity;
@TableField(exist = false)
private BigDecimal actualQuantity;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
private String inOrderNumberGw;
private String inLineNumGw;
private String opWhLocGw;
private String warehouseGw;
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailBaseDO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import java.util.List;
/**
* 物料明细Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IExecutionOutMaterialDetailService extends IService<ExecutionOutMaterialDetail>
{
/**
* 分页查询物料明细列表
*/
public List<ExecutionOutMaterialDetailPO> queryList(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* 关联出库单 查询物料明细列表
*/
public List<ExecutionOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
public List<ExecutionOutMaterialDetailPO> queryListChildren(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean insert(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* 修改物料明细
*/
public Boolean update(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean batchInsert(String orderNumber, List<ExecutionOutMaterialDetailDO> outMaterialDetailDOList);
/**
* 修改物料明细
*/
public Boolean batchUpdate(List<ExecutionOutMaterialDetailDO> outMaterialDetailDOList, ExecutionOutMaterialDetailBaseDO outMaterialDetailBaseDO);
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds);
/**
* 查询物料明细
*/
public ExecutionOutMaterialDetailPO getInfo(Long materialDetailId);
}
@@ -0,0 +1,70 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 物料明细Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ExecutionOutMaterialDetailMapper extends BaseMapper<ExecutionOutMaterialDetail>
{
/**
* 查询物料明细列表
*/
public List<ExecutionOutMaterialDetailPO> queryList(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* 关联出库单 查询物料明细列表
*/
public List<ExecutionOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
/**
* @description 批量修改指定物料明细分配数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddAllocationQuantityByIds(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* @description 批量修改指定物料明细拣货数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddPickingQuantityByIds(ExecutionOutMaterialDetailDO outMaterialDetailDO);
/**
* @description 批量修改指定物料明细拣货数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddPickingQuantityByUniqueIds(ExecutionOutMaterialDetailDO outMaterialDetailDO);
public Long getKcId(@Param("lotNo") String lotNo);
public String getLot(@Param("uniqueId") Long uniqueId);
public Long getkcIdByUniqueId(@Param("uniqueId") Long uniqueId);
public String getInOrderNumber(@Param("id") Long id);
public String getWarehouse(@Param("id") Long id);
public String getOpWhLoc(@Param("id") Long id);
public String getLotByKcId(@Param("id") Long id);
public String getInLotNo(@Param("inOrderNumber") String inOrderNumber, @Param("baseId") Long baseId);
}
@@ -0,0 +1,264 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.persistence;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.utils.uuid.IdGenerator;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.mapper.ExecutionOutMaterialDetailMapper;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailBaseDO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import com.mhd.oms.domain.executionStockInOrder.repository.mapper.ExecutionStockInOrderMapper;
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
//import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ExecutionStockInOrderMapper;
//import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 物料明细Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public class ExecutionOutMaterialDetailImpl extends ServiceImpl<ExecutionOutMaterialDetailMapper, ExecutionOutMaterialDetail> implements IExecutionOutMaterialDetailService {
@Autowired
private ExecutionOutMaterialDetailMapper outMaterialDetailMapper;
// @Autowired
// private IExecutionOutMaterialDetailSerialNumberService outMaterialDetailSerialNumberService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private ExecutionStockInOrderMapper reservationStockInOrderMapper;
// @Autowired
// private MaterialBaseInfoMapper materialBaseInfoMapper;
/**
* 查询物料明细列表
*/
@Override
public List<ExecutionOutMaterialDetailPO> queryList(ExecutionOutMaterialDetailDO outMaterialDetailDO)
{
return outMaterialDetailMapper.queryList(outMaterialDetailDO);
}
/**
* 关联出库单 查询物料明细列表
*/
@Override
public List<ExecutionOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO) {
return outMaterialDetailMapper.queryOutOrderList(queryOrderOverStockDO);
}
/**
* 查询物料明细列表
*/
@Override
public List<ExecutionOutMaterialDetailPO> queryListChildren(ExecutionOutMaterialDetailDO outMaterialDetailDO)
{
List<ExecutionOutMaterialDetailPO> outMaterialDetailPOList = outMaterialDetailMapper.queryList(outMaterialDetailDO);
// 获取查询的层级
List<ExecutionOutMaterialDetailPO> outMaterialDetailParentList = outMaterialDetailPOList
.stream().filter(e -> 1 == e.getLevel()).collect(Collectors.toList());
// 递归查询子集
outMaterialDetailParentList.forEach(materialDetailPO -> materialDetailPO.setChildren(getChildren(materialDetailPO.getUniqueId(), outMaterialDetailPOList, 2)));
return outMaterialDetailParentList;
}
private List<ExecutionOutMaterialDetailPO> getChildren(Long parentUniqueId, List<ExecutionOutMaterialDetailPO> materialDetailPOList, Integer maxLevel){
List<ExecutionOutMaterialDetailPO> childrenCityList = materialDetailPOList.stream().filter(materialDetailPO -> parentUniqueId.equals(materialDetailPO.getParentUniqueId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(childrenCityList)){
childrenCityList.forEach(childrenCity -> {
if (childrenCity.getLevel() < maxLevel){
childrenCity.setChildren(getChildren(childrenCity.getUniqueId(), materialDetailPOList, maxLevel));
}
});
}
return childrenCityList;
}
/**
* 新增物料明细
*/
@Override
public Boolean insert(ExecutionOutMaterialDetailDO outMaterialDetailDO) {
ExecutionOutMaterialDetail outMaterialDetail = new ExecutionOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
return this.save(outMaterialDetail);
}
/**
* 修改物料明细
*/
@Override
public Boolean update(ExecutionOutMaterialDetailDO outMaterialDetailDO) {
ExecutionOutMaterialDetail outMaterialDetail = new ExecutionOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
return this.updateById(outMaterialDetail);
}
/**
* @description 批量新增物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param outOrderNumber
* @param outMaterialDetailDOList
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchInsert(String outOrderNumber, List<ExecutionOutMaterialDetailDO> outMaterialDetailDOList) {
if (CollectionUtils.isEmpty(outMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 批量新增或修改
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
final String userRealName = (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
&& !loginUser.getUserPo().getUserName().trim().isEmpty())
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null && !loginUser.getRealname().trim().isEmpty())
? loginUser.getRealname()
: loginUser.getUsername();
List<ExecutionOutMaterialDetail> outMaterialDetailList = new ArrayList<>();
for (ExecutionOutMaterialDetailDO outMaterialDetailDO : outMaterialDetailDOList){
ExecutionOutMaterialDetail outMaterialDetail = new ExecutionOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
outMaterialDetail.setOutOrderNumber(outOrderNumber);
outMaterialDetail.setTopOrganizationId(loginUser.getUserPo().getOrganizationId());
outMaterialDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId());
outMaterialDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName());
outMaterialDetail.setCreateBy(loginUser.getUserid());
outMaterialDetail.setCreateByName(userRealName);
outMaterialDetail.setCreateTime(new Date());
// 计划数量接口常传 quantity outboundQuantity 时与 quantity 对齐否则用 quantity 回填 outbound
if (outMaterialDetail.getOutboundQuantity() != null) {
outMaterialDetail.setQuantity(outMaterialDetail.getOutboundQuantity());
} else if (outMaterialDetail.getQuantity() != null) {
outMaterialDetail.setOutboundQuantity(outMaterialDetail.getQuantity());
}
String materialNo = outMaterialDetail.getMaterialNo();
List<MaterialBaseInfoPO> materialBaseInfos = reservationStockInOrderMapper.getMaterialBaseInfoList(materialNo);
//List<MaterialBaseInfoPO> materialBaseInfos = materialBaseInfoMapper.selectList(new QueryWrapper<MaterialBaseInfo>().lambda().eq(MaterialBaseInfo::getMaterialCode, materialNo));
if (!CollectionUtils.isEmpty(materialBaseInfos) && materialBaseInfos.size() > 0) {
outMaterialDetail.setCommodityName(materialBaseInfos.get(0).getMaterialName());
outMaterialDetail.setBarCode(materialBaseInfos.get(0).getBarCode());
outMaterialDetail.setPackName(materialBaseInfos.get(0).getPackName());
outMaterialDetail.setPackCode(materialBaseInfos.get(0).getPackCode());
outMaterialDetail.setUnitCode(materialBaseInfos.get(0).getUnitCode());
outMaterialDetail.setUnitName(materialBaseInfos.get(0).getUnitName());
}
outMaterialDetailList.add(outMaterialDetail);
}
return saveBatch(outMaterialDetailList);
}
/**
* @description 批量修改物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param outMaterialDetailDOList
* @param outMaterialDetailBaseDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchUpdate(List<ExecutionOutMaterialDetailDO> outMaterialDetailDOList, ExecutionOutMaterialDetailBaseDO outMaterialDetailBaseDO) {
if (CollectionUtils.isEmpty(outMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
List<ExecutionOutMaterialDetail> outMaterialDetailDbList = outMaterialDetailMapper.selectList(new QueryWrapper<ExecutionOutMaterialDetail>().lambda().eq(ExecutionOutMaterialDetail::getOutOrderNumber, outMaterialDetailBaseDO.getOutOrderNumber()));
Map<Long, ExecutionOutMaterialDetail> materialDetailMap = outMaterialDetailDbList.stream().collect(Collectors.toMap(ExecutionOutMaterialDetail::getMaterialDetailId, Function.identity()));
//批量新增或修改物料信息
List<ExecutionOutMaterialDetail> outMaterialDetailList = new ArrayList<>();
//需要修改的物流明细
List<Long> materialDetailIdsByUpdate = new ArrayList<>();
for (ExecutionOutMaterialDetailDO outMaterialDetailDO : outMaterialDetailDOList){
//判断是否需要修改
ExecutionOutMaterialDetail outMaterialDetail = materialDetailMap.get(outMaterialDetailDO.getMaterialDetailId());
if (outMaterialDetail == null){
outMaterialDetail = new ExecutionOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
outMaterialDetail.setOutOrderNumber(outMaterialDetailBaseDO.getOutOrderNumber());
outMaterialDetail.setOrganizationId(outMaterialDetailBaseDO.getOrganizationId());
outMaterialDetail.setOrganizationName(outMaterialDetailBaseDO.getOrganizationName());
outMaterialDetail.setTopOrganizationId(outMaterialDetailBaseDO.getTopOrganizationId());
}else {
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUpdateBy(loginUser.getUserid());
outMaterialDetail.setUpdateByName(loginUser.getUsername());
outMaterialDetail.setUpdateTime(new Date());
materialDetailIdsByUpdate.add(outMaterialDetailDO.getMaterialDetailId());
}
outMaterialDetailList.add(outMaterialDetail);
}
//需修改的物料明细id集合不为空
if (!CollectionUtils.isEmpty(materialDetailIdsByUpdate)){
List<Long> materialDetailIdsByDb = outMaterialDetailDbList.stream().map(ExecutionOutMaterialDetail::getMaterialDetailId).collect(Collectors.toList());
//过滤需要修改的id集合
materialDetailIdsByDb.removeAll(materialDetailIdsByUpdate);
//判断是否存在需要删除的物流明细 标记删除
if (!CollectionUtils.isEmpty(materialDetailIdsByDb)){
update(new UpdateWrapper<ExecutionOutMaterialDetail>().lambda()
.set(ExecutionOutMaterialDetail::getDelFlag, 2)
.set(ExecutionOutMaterialDetail::getUpdateBy, loginUser.getUserid())
.set(ExecutionOutMaterialDetail::getUpdateByName, loginUser.getUsername())
.set(ExecutionOutMaterialDetail::getUpdateTime, new Date())
.in(ExecutionOutMaterialDetail::getMaterialDetailId, materialDetailIdsByDb));
}
}
//保存物料明细信息
return saveOrUpdateBatch(outMaterialDetailList);
}
/**
* 批量删除物料明细
*/
@Override
public Boolean delete(Long[] materialDetailIds ) {
List<ExecutionOutMaterialDetail> list = new ArrayList<>();
for (Long id : materialDetailIds) {
ExecutionOutMaterialDetail outMaterialDetail = new ExecutionOutMaterialDetail();
outMaterialDetail.setMaterialDetailId(id);
outMaterialDetail.setDelFlag(2);
list.add(outMaterialDetail);
}
return this.updateBatchById(list);
}
/**
* 修改物料明细
*/
@Override
public ExecutionOutMaterialDetailPO getInfo(Long materialDetailId) {
ExecutionOutMaterialDetail outMaterialDetail = this.getById(materialDetailId);
ExecutionOutMaterialDetailPO outMaterialDetailPO = new ExecutionOutMaterialDetailPO();
BeanUtils.copyProperties(outMaterialDetail, outMaterialDetailPO);
return outMaterialDetailPO;
}
}
@@ -0,0 +1,607 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ExecutionStockOutOrderBaseDO;
import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderBaseDO;
import com.mhd.system.api.domain.MaterialMoreDetailPO;
import io.swagger.annotations.ApiModel;
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;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "物料明细对象", description = "物料明细响应对象")
public class ExecutionOutMaterialDetailPO extends ExecutionStockOutOrderBaseDO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("待复核数量")
@Excel(name = "待复核数量")
private BigDecimal waitCheckQuantity;
@ApiModelProperty("复核数量输入框字段,默认等于待复核数量")
@TableField(exist = false)
private BigDecimal actualQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("物料明细")
private List<ExecutionOutMaterialDetailPO> children;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
*
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("扩展字段1")
@Excel(name = "扩展字段1")
private String extAttr1;
@ApiModelProperty("扩展字段2")
@Excel(name = "扩展字段2")
private String extAttr2;
@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 productionDate;
@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 expiryDate;
@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 inventoryDate;
@ApiModelProperty("ExtAttr3")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr3;
@ApiModelProperty("ExtAttr4")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr4;
@ApiModelProperty("更多属性明细列表")
@TableField(exist = false)
private List<MaterialMoreDetailPO> materialMoreDetailList;
@ApiModelProperty("分配按钮显示类型:1-显示库存分配,2-显示取消分配")
@TableField(exist = false)
private Integer allocationButtonType;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("出库异常明细:计划数量(复核异常场景=拣货数量)")
@TableField(exist = false)
private BigDecimal abnormalPlanQuantity;
@ApiModelProperty("出库异常明细:作业数量(复核异常场景=实际复核数量)")
@TableField(exist = false)
private BigDecimal abnormalWorkQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
private String inOrderNumberGw;
private String inLineNumGw;
private String khdm;
}
@@ -0,0 +1,42 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author ZhouGY
* @title OutMaterialCheckPO
* @description: 出库复审信息统计
* @date 2024/5/31 10:33
**/
@Data
public class OutMaterialCheckPO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("物料数")
private Integer count;
@ApiModelProperty("总重量")
@Excel(name = "总重量")
private BigDecimal weightLimit;
@ApiModelProperty("总体积")
@Excel(name = "总体积")
private BigDecimal volumeLimit;
@ApiModelProperty("数量EA")
private BigDecimal number;
@ApiModelProperty("需扫描数")
private BigDecimal wantNumber;
@ApiModelProperty("已扫描数")
private BigDecimal alreadyNumber;
@ApiModelProperty("未扫描数")
private BigDecimal notHaveNumber;
}
@@ -0,0 +1,34 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.todo;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZhouGY
* @title StockBaseDO
* @description: TODO
* @date 2024/5/23 20:30
**/
@Data
public class ExecutionOutMaterialDetailBaseDO implements Serializable {
private static final long serialVersionUID = 1L;
@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 outOrderNumber;
}
@@ -0,0 +1,550 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.todo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionOutMaterialDetailDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("分配时库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ExecutionOutMaterialDetailDO> children;
// @ApiModelProperty("序列号")
// private List<ExecutionOutMaterialDetailSerialNumberDO> materialDetailSerialNumberList;
@ApiModelProperty("出单号集合")
@Excel(name = "出单号集合")
private List<String> outOrderNumberList;
@ApiModelProperty("取消分配数量")
@Excel(name = "取消分配数量")
private BigDecimal cancelAllocationQuantity;
@ApiModelProperty("订单物料明细id")
private List<Long> materialDetailIds;
@ApiModelProperty("作业数量(例如:分配数量 拣货数量 复核数量)")
@Excel(name = "作业数量(例如:分配数量 拣货数量 复核数量)")
private BigDecimal actualQuantity;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
*
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
private String inOrderNumberGw;
private String inLineNumGw;
}
@@ -0,0 +1,541 @@
package com.mhd.oms.domain.executionOutMaterialDetail.repository.todo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionOutMaterialDetailDTO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@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 outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("作业数量(例如:分配数量 拣货数量 复核数量 取消数量)")
@Excel(name = "作业数量(例如:分配数量 拣货数量 复核数量 取消数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("物料明细子集")
private List<ExecutionOutMaterialDetailDO> children;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ExecutionOutMaterialDetailDTO> materialDetailList;
// @ApiModelProperty("序列号")
// private List<OutMaterialDetailSerialNumberDTO> materialDetailSerialNumberList;
@ApiModelProperty("出单号集合")
@Excel(name = "出单号集合")
private List<String> outOrderNumberList;
@ApiModelProperty("取消分配数量")
@Excel(name = "取消分配数量")
private BigDecimal cancelAllocationQuantity;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
*
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
@ApiModelProperty("单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
//订单行号
private String lineNumGw;
//物料规格
private String specGw;
//计量单位
private String unitGw;
//数量
private BigDecimal qtyGw;
//企业币制
private String erpCurrGw;
//企业单价
private BigDecimal erpPriceGw;
//申报总价
private BigDecimal amountGw;
private String inOrderNumberGw;
private String inLineNumGw;
}
@@ -0,0 +1,67 @@
package com.mhd.oms.domain.executionOutMaterialDetail.service;
//import com.mhd.wms.domain.outMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
//import com.mhd.wms.domain.outMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
//import com.mhd.wms.domain.outMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ExecutionOutMaterialDetailDomainService {
@Autowired
private IExecutionOutMaterialDetailService outMaterialDetailService;
/**
* 分页查询物料明细列表
*/
public List<ExecutionOutMaterialDetailPO> queryList(ExecutionOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.queryList(outMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ExecutionOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.insert(outMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ExecutionOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.update(outMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds) {
return outMaterialDetailService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ExecutionOutMaterialDetailPO getInfo(Long materialDetailId)
{
return outMaterialDetailService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,459 @@
package com.mhd.oms.domain.executionStockInOrder.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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;
/**
* 入库单对象 stock_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionStockInOrder extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
@TableId(type = IdType.AUTO)
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库业务单号")
@Excel(name = "入库业务单号")
private String businessInOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
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 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 auditTime;
@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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String pictureUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@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 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 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 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 closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("调度单号")
private String mobilizeCode;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
@TableField(value = "\"TO\"")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@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 orderStatus;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
@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("总价")
@Excel(name = "总价")
private BigDecimal amount;
@ApiModelProperty("推送人")
private Long pushBy;
@ApiModelProperty("推送人姓名")
private String pushByName;
@ApiModelProperty("运输业务单号")
private String businessNumber;
@ApiModelProperty("是否免费夫力费费")
private String isFreeManpowerFee;
@ApiModelProperty("折扣")
private BigDecimal discount;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
@ApiModelProperty("夫力费")
private BigDecimal manpowerFee;
@ApiModelProperty("总仓租")
private BigDecimal totalWarehouseRent;
@ApiModelProperty("业务计价类型")
private String businessChargeType;
@ApiModelProperty("业务计价方式")
private String businessPriceWay;
}
@@ -0,0 +1,69 @@
package com.mhd.oms.domain.executionStockInOrder.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
import com.mhd.oms.domain.executionStockInOrder.repository.po.ExecutionStockInOrderPO;
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.DeliveryDataDTO;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.StockInDataDTO;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 入库单Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IExecutionStockInOrderService extends IService<ExecutionStockInOrder>
{
/**
* 分页查询入库单列表
*/
public List<ExecutionStockInOrderPO> queryList(ExecutionStockInOrderDO stockInOrderDO);
/**
* 新增入库单
*/
public Boolean insert(ExecutionStockInOrderDO stockInOrderDO);
/**
* 修改入库单
*/
public Boolean update(ExecutionStockInOrderDO stockInOrderDO);
/**
* 批量删除入库单
*/
public Boolean delete(Long[] inOrderIds);
/**
* 查询入库单
*/
public ExecutionStockInOrderPO getInfo(Long inOrderId);
List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO);
List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDTO);
/**
* 解析Excel文件并获取出库数据
* @param file Excel文件
* @param sheetName 工作表名称出库导入/参考数据
* @return 出库数据DTO
* @throws Exception 解析异常
*/
DeliveryDataDTO parseExcelFile(MultipartFile file, String sheetName) throws Exception;
/**
* 解析入库单Excel文件
* @param file Excel文件
* @param sheetName 工作表名称默认入库模版
* @return 入库单完整数据表头+明细
* @throws Exception 解析异常
*/
StockInDataDTO parseStockInExcel(MultipartFile file, String sheetName) throws Exception;
}
@@ -0,0 +1,513 @@
package com.mhd.oms.domain.executionStockInOrder.repository.listener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.CustomerDeliveryDetail;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.DeliveryHeader;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.ProductDetail;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.*;
import java.util.regex.Pattern;
/**
* 维他奶出库Excel解析监听器最终完整版
* 核心功能
* 1. 正确解析多单元格数据解决发票张数/纪录合共读取错误
* 2. 支持动态行数的货品明细/客户配送明细解析
* 3. 自动处理文本型数字转换StringInteger/BigDecimal
* 4. 完整的异常处理和日志记录
*/
public class DynamicDeliveryExcelListener extends AnalysisEventListener<Map<String, Object>> {
// 日志实例
private static final Logger LOGGER = LoggerFactory.getLogger(DynamicDeliveryExcelListener.class);
// ---------------------- 常量定义便于维护 ----------------------
// 正则表达式匹配整数支持正负数
private static final Pattern INTEGER_PATTERN = Pattern.compile("-?\\d+");
// 正则表达式匹配小数支持正负数和整数形式
private static final Pattern DECIMAL_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?");
// 关键字定义Excel标签匹配
private static final String KEYWORD_DELIVERY_DATE = "送貨日期";
private static final String KEYWORD_PRODUCT_DETAIL = "货品明细";
private static final String KEYWORD_TOTAL_RECORD = "紀錄合共";
private static final String KEYWORD_CUSTOMER_DETAIL = "客户配送明细";
private static final String KEYWORD_INVOICE_COUNT = "發票張數";
private static final String KEYWORD_TOTAL_COUNT = "總計";
private static final String KEYWORD_SUBTOTAL = "小計";
// 支持的日期格式String转Date
private static final String[] SUPPORTED_DATE_FORMATS = {"yyyy-MM-dd", "yyyy/MM/dd", "yyyyMMdd", "yyyy-MM-dd HH:mm:ss"};
// ---------------------- 数据存储解析结果 ----------------------
private DeliveryHeader deliveryHeader = new DeliveryHeader();
private List<ProductDetail> productDetailList = new ArrayList<>();
private List<CustomerDeliveryDetail> customerDeliveryDetailList = new ArrayList<>();
// ---------------------- 解析状态管理动态切换 ----------------------
public enum ParseStatus {
IDLE, // 空闲状态未进入任何表格
PRODUCT_DETAIL,// 货品明细解析状态
CUSTOMER_DETAIL// 客户配送明细解析状态
}
private ParseStatus currentStatus = ParseStatus.IDLE;
// ---------------------- 核心解析方法EasyExcel回调 ----------------------
@Override
public void invoke(Map<String, Object> data, AnalysisContext context) {
try {
int rowNum = context.readRowHolder().getRowIndex() + 1;
LOGGER.debug("第{}行:开始解析,所有单元格数据:{}", rowNum, data);
// 1. 获取第一列数据用于状态判断标签通常在第一列
String firstCellValue = getFirstCellValue(data);
LOGGER.debug("第{}行:第一列数据(状态判断依据):{}", rowNum, firstCellValue);
// 2. 状态切换判断传递完整data支持多单元格解析
if (isStatusSwitchTrigger(firstCellValue)) {
switchStatus(firstCellValue, rowNum, data);
return;
}
// 3. 根据当前状态解析对应表格数据
switch (currentStatus) {
case PRODUCT_DETAIL:
if (isValidProductDetailRow(data, firstCellValue)) {
parseProductDetail(data, rowNum);
}
break;
case CUSTOMER_DETAIL:
if (isValidCustomerDetailRow(data, firstCellValue)) {
parseCustomerDeliveryDetail(data, rowNum);
}
break;
case IDLE:
// 空闲状态解析表头信息送货日期行多单元格数据
if (firstCellValue.contains(KEYWORD_DELIVERY_DATE)) {
parseHeaderInfo(data, rowNum);
}
break;
}
} catch (ExcelDataConvertException e) {
// Excel内置转换异常如日期格式错误
int rowNum = context.readRowHolder().getRowIndex() + 1;
LOGGER.error("第{}行:Excel数据转换异常,列号:{},列名:{}",
rowNum, e.getColumnIndex() + 1, getColumnNameByIndex(data, e.getColumnIndex()), e);
throw new RuntimeException("Excel数据转换异常(行:" + rowNum + ",列:" + (e.getColumnIndex() + 1) + "", e);
} catch (Exception e) {
// 其他解析异常
int rowNum = context.readRowHolder().getRowIndex() + 1;
LOGGER.error("第{}行:Excel解析异常,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("Excel解析异常(行:" + rowNum + "", e);
}
}
// ---------------------- 解析完成回调 ----------------------
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
LOGGER.info("Excel解析全部完成!最终统计结果:");
LOGGER.info("1. 表头信息:送货日期={},发票张数={},总记录数={},小计金额={}",
deliveryHeader.getDeliveryDate(),
deliveryHeader.getInvoiceCount(),
deliveryHeader.getTotalRecordCount(),
deliveryHeader.getSubtotalAmount());
LOGGER.info("2. 货品明细:共{}条记录", productDetailList.size());
LOGGER.info("3. 客户配送明细:共{}条记录", customerDeliveryDetailList.size());
}
// ---------------------- 状态管理方法传递完整data ----------------------
/**
* 判断是否触发状态切换根据第一列标签关键字
*/
private boolean isStatusSwitchTrigger(String firstCellValue) {
return firstCellValue.contains(KEYWORD_PRODUCT_DETAIL)
|| firstCellValue.contains(KEYWORD_TOTAL_RECORD)
|| firstCellValue.contains(KEYWORD_CUSTOMER_DETAIL)
|| firstCellValue.contains(KEYWORD_INVOICE_COUNT);
}
/**
* 切换解析状态核心传递完整data支持多单元格解析
*/
private void switchStatus(String firstCellValue, int rowNum, Map<String, Object> data) {
if (firstCellValue.contains(KEYWORD_PRODUCT_DETAIL)) {
currentStatus = ParseStatus.PRODUCT_DETAIL;
LOGGER.info("第{}行:检测到【{}】标签,切换到【货品明细】解析状态", rowNum, KEYWORD_PRODUCT_DETAIL);
} else if (firstCellValue.contains(KEYWORD_TOTAL_RECORD)) {
currentStatus = ParseStatus.IDLE;
parseTotalRecord(data, rowNum); // 解析纪录合共多单元格
LOGGER.info("第{}行:检测到【{}】标签,切换到【空闲】状态,已解析货品明细{}条",
rowNum, KEYWORD_TOTAL_RECORD, productDetailList.size());
} else if (firstCellValue.contains(KEYWORD_CUSTOMER_DETAIL)) {
currentStatus = ParseStatus.CUSTOMER_DETAIL;
LOGGER.info("第{}行:检测到【{}】标签,切换到【客户配送明细】解析状态", rowNum, KEYWORD_CUSTOMER_DETAIL);
} else if (firstCellValue.contains(KEYWORD_INVOICE_COUNT)) {
currentStatus = ParseStatus.IDLE;
parseInvoiceCount(data, rowNum); // 解析发票张数多单元格核心修复
LOGGER.info("第{}行:检测到【{}】标签,切换到【空闲】状态,已解析客户配送明细{}条",
rowNum, KEYWORD_INVOICE_COUNT, customerDeliveryDetailList.size());
}
}
// ---------------------- 数据有效性校验方法 ----------------------
/**
* 校验货品明细行是否有效排除表头和空行
*/
private boolean isValidProductDetailRow(Map<String, Object> data, String firstCellValue) {
// 有效条件1.货品编号第一列不为空 2.不是表头行表头第一列是"貨品編號"
Object productCode = getValueSafely(data, 0);
return productCode != null
&& !"貨品編號".equals(productCode.toString().trim())
&& !productCode.toString().trim().isEmpty();
}
/**
* 校验客户配送明细行是否有效排除表头和空行
*/
private boolean isValidCustomerDetailRow(Map<String, Object> data, String firstCellValue) {
// 有效条件1.类别第一列不为空 2.不是表头行表头第一列是"類别"
Object category = getValueSafely(data, 0);
return category != null
&& !"類别".equals(category.toString().trim())
&& !category.toString().trim().isEmpty();
}
// ---------------------- 具体数据解析方法全部支持多单元格 ----------------------
/**
* 解析表头信息送货日期送货线号车次
* 列对应关系0=送貨日期标签1=送貨日期值2=送貨線號标签3=送貨線號值4=車次标签5=車次值
*/
private void parseHeaderInfo(Map<String, Object> data, int rowNum) {
try {
// 读取多单元格数据标签在左数值在右
Date deliveryDate = getValueSafely(data, 1, Date.class); // 第2列送货日期值
String deliveryLineNo = getValueSafely(data, 3, String.class); // 第4列送货线号值
Integer trainNumber = getValueSafely(data, 5, Integer.class); // 第6列车次值
// 赋值空值处理
if (deliveryDate != null) {
deliveryHeader.setDeliveryDate(deliveryDate);
}
deliveryHeader.setDeliveryLineNo(deliveryLineNo);
deliveryHeader.setTrainNumber(getDefaultValue(trainNumber, 0));
LOGGER.debug("第{}行:解析表头信息完成,送货日期={},送货线号={},车次={}",
rowNum, deliveryHeader.getDeliveryDate(),
deliveryHeader.getDeliveryLineNo(), deliveryHeader.getTrainNumber());
} catch (Exception e) {
LOGGER.error("第{}行:解析表头信息失败,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("解析表头信息失败(行:" + rowNum + "", e);
}
}
/**
* 解析纪录合共多单元格版
* 列对应关系0=紀錄合共标签1=总记录数值4=總計标签5=总箱数值6=总支数值
*/
private void parseTotalRecord(Map<String, Object> data, int rowNum) {
try {
// 1. 验证是否为纪录合共行第一列包含标签
Object totalRecordLabel = getValueSafely(data, 0, String.class);
if (totalRecordLabel == null || !totalRecordLabel.toString().trim().contains(KEYWORD_TOTAL_RECORD)) {
LOGGER.warn("第{}行:不是纪录合共行,跳过解析,第一列内容:{}", rowNum, totalRecordLabel);
return;
}
// 2. 读取多单元格数值标签右侧对应列
Integer totalRecordCount = getValueSafely(data, 1, Integer.class); // 第2列总记录数
Integer totalBoxCount = getValueSafely(data, 5, Integer.class); // 第6列总箱数
Integer totalPieceCount = getValueSafely(data, 6, Integer.class); // 第7列总支数
// 3. 赋值与日志
deliveryHeader.setTotalRecordCount(getDefaultValue(totalRecordCount, 0));
deliveryHeader.setTotalBoxCount(getDefaultValue(totalBoxCount, 0));
deliveryHeader.setTotalPieceCount(getDefaultValue(totalPieceCount, 0));
LOGGER.debug("第{}行:解析纪录合共完成,总记录数={},总箱数={},总支数={}",
rowNum, deliveryHeader.getTotalRecordCount(),
deliveryHeader.getTotalBoxCount(), deliveryHeader.getTotalPieceCount());
} catch (Exception e) {
LOGGER.error("第{}行:解析纪录合共失败,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("解析纪录合共失败(行:" + rowNum + "", e);
}
}
/**
* 核心修复解析发票张数多单元格版正确读取右侧单元格
* 列对应关系
* - 0=發票張數标签列A列1=发票张数数值列B列
* - 4=小計标签列E列5=小计箱数列F列6=小计支数列G列7=小计金额列H列
*/
private void parseInvoiceCount(Map<String, Object> data, int rowNum) {
try {
// 1. 验证是否为发票张数行第一列包含标签
Object invoiceLabel = getValueSafely(data, 0, String.class);
if (invoiceLabel == null || !invoiceLabel.toString().trim().contains(KEYWORD_INVOICE_COUNT)) {
LOGGER.warn("第{}行:不是发票张数行,跳过解析,第一列内容:{}", rowNum, invoiceLabel);
return;
}
// 2. 解析发票张数标签右侧第1列B列索引1
Integer invoiceCount = getValueSafely(data, 1, Integer.class);
deliveryHeader.setInvoiceCount(getDefaultValue(invoiceCount, 0));
LOGGER.debug("第{}行:解析发票张数,标签列(A列):{},数值列(B列):{}",
rowNum, invoiceLabel, deliveryHeader.getInvoiceCount());
// 3. 解析小计信息标签在E列数值在F/G/H列
Object subtotalLabel = getValueSafely(data, 3, String.class); // E列小計标签
if (subtotalLabel != null && subtotalLabel.toString().trim().contains(KEYWORD_SUBTOTAL)) {
Integer subtotalBoxCount = getValueSafely(data, 4, Integer.class); // F列小计箱数
Integer subtotalPieceCount = getValueSafely(data, 5, Integer.class); // G列小计支数
BigDecimal subtotalAmount = getValueSafely(data, 6, BigDecimal.class); // H列小计金额
// 赋值空值处理
deliveryHeader.setSubtotalBoxCount(getDefaultValue(subtotalBoxCount, 0));
deliveryHeader.setSubtotalPieceCount(getDefaultValue(subtotalPieceCount, 0));
deliveryHeader.setSubtotalAmount(getDefaultValue(subtotalAmount, BigDecimal.ZERO));
LOGGER.debug("第{}行:解析小计信息,标签列(E列):{},箱数列(F列):{},支数列(G列):{},金额列(H列):{}",
rowNum, subtotalLabel,
deliveryHeader.getSubtotalBoxCount(),
deliveryHeader.getSubtotalPieceCount(),
deliveryHeader.getSubtotalAmount());
} else {
LOGGER.warn("第{}行:未找到小计标签(E列),或标签内容不匹配,跳过小计解析", rowNum);
deliveryHeader.setSubtotalBoxCount(0);
deliveryHeader.setSubtotalPieceCount(0);
deliveryHeader.setSubtotalAmount(BigDecimal.ZERO);
}
// 4. 解析完成日志
LOGGER.debug("第{}行:解析发票张数行完成,最终结果:发票张数={},小计金额={}",
rowNum, deliveryHeader.getInvoiceCount(), deliveryHeader.getSubtotalAmount());
} catch (Exception e) {
LOGGER.error("第{}行:解析发票张数失败,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("解析发票张数失败(行:" + rowNum + "),请检查Excel列对应关系", e);
}
}
/**
* 解析货品明细多单元格动态行数适配
* 列对应关系0=貨品編號1=簡稱4=5=
*/
private void parseProductDetail(Map<String, Object> data, int rowNum) {
try {
ProductDetail productDetail = new ProductDetail();
// 读取对应列的多单元格数据
String productCode = getValueSafely(data, 0, String.class); // 第1列货品编号
String productName = getValueSafely(data, 1, String.class); // 第2列货品简称
Integer boxCount = getValueSafely(data, 4, Integer.class); // 第5列箱数
Integer pieceCount = getValueSafely(data, 5, Integer.class); // 第6列支数
// 赋值空值处理+去空格
productDetail.setProductCode(getDefaultValue(productCode, "").trim());
productDetail.setProductName(getDefaultValue(productName, "").trim());
productDetail.setBoxCount(getDefaultValue(boxCount, 0));
productDetail.setPieceCount(getDefaultValue(pieceCount, 0));
// 添加到列表
productDetailList.add(productDetail);
LOGGER.debug("第{}行:解析货品明细完成,货品编号={},名称={},箱数={},支数={}",
rowNum, productDetail.getProductCode(), productDetail.getProductName(),
productDetail.getBoxCount(), productDetail.getPieceCount());
} catch (Exception e) {
LOGGER.error("第{}行:解析货品明细失败,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("解析货品明细失败(行:" + rowNum + "", e);
}
}
/**
* 解析客户配送明细多单元格动态行数适配
* 列对应关系0=類别1=發票編號2=客户編號3=名稱4=5=6=金額
*/
private void parseCustomerDeliveryDetail(Map<String, Object> data, int rowNum) {
try {
CustomerDeliveryDetail customerDetail = new CustomerDeliveryDetail();
// 读取对应列的多单元格数据
String category = getValueSafely(data, 0, String.class); // 第1列类别
String invoiceNo = getValueSafely(data, 1, String.class); // 第2列发票编号
String customerCode = getValueSafely(data, 2, String.class); // 第3列客户编号
String customerName = getValueSafely(data, 3, String.class); // 第4列客户名称
Integer boxCount = getValueSafely(data, 4, Integer.class); // 第5列箱数
Integer packageCount = getValueSafely(data, 5, Integer.class); // 第6列包数
BigDecimal amount = getValueSafely(data, 6, BigDecimal.class); // 第7列金额
// 赋值空值处理+去空格
customerDetail.setCategory(getDefaultValue(category, "").trim());
customerDetail.setInvoiceNo(getDefaultValue(invoiceNo, "").trim());
customerDetail.setCustomerCode(getDefaultValue(customerCode, "").trim());
customerDetail.setCustomerName(getDefaultValue(customerName, "").trim());
customerDetail.setBoxCount(getDefaultValue(boxCount, 0));
customerDetail.setPackageCount(getDefaultValue(packageCount, 0));
customerDetail.setAmount(getDefaultValue(amount, BigDecimal.ZERO));
// 添加到列表
customerDeliveryDetailList.add(customerDetail);
LOGGER.debug("第{}行:解析客户配送明细完成,客户编号={},名称={},金额={}",
rowNum, customerDetail.getCustomerCode(), customerDetail.getCustomerName(),
customerDetail.getAmount());
} catch (Exception e) {
LOGGER.error("第{}行:解析客户配送明细失败,所有单元格数据:{}", rowNum, data, e);
throw new RuntimeException("解析客户配送明细失败(行:" + rowNum + "", e);
}
}
// ---------------------- 核心工具方法支持多单元格+类型转换 ----------------------
/**
* 获取第一列数据用于状态判断
*/
private String getFirstCellValue(Map<String, Object> data) {
if (data == null || data.isEmpty()) {
return "";
}
Object firstValue = data.values().iterator().next();
return firstValue != null ? firstValue.toString().trim() : "";
}
/**
* 根据列索引获取列名用于异常定位
*/
private String getColumnNameByIndex(Map<String, Object> data, int columnIndex) {
if (data == null || data.isEmpty()) {
return "未知列";
}
int index = 0;
for (String key : data.keySet()) {
if (index == columnIndex) {
return key;
}
index++;
}
return "" + (columnIndex + 1) + "";
}
/**
* 按列索引安全获取原始值不做类型转换
*/
private Object getValueSafely(Map<String, Object> data, int columnIndex) {
if (data == null || data.isEmpty()) {
return null;
}
int index = 0;
for (Object value : data.values()) {
if (index == columnIndex) {
return value;
}
index++;
}
LOGGER.warn("列索引{}超出当前行单元格数量({}列),返回null", columnIndex, data.size());
return null;
}
/**
* 按列索引安全获取值支持多类型转换核心工具
* 功能1. 直接类型匹配 2. String转数字/日期 3. 数字类型间转换
*/
private <T> T getValueSafely(Map<String, Object> data, int columnIndex, Class<T> expectedType) {
Object value = getValueSafely(data, columnIndex);
if (value == null) {
LOGGER.debug("列索引{}:单元格值为null,返回null", columnIndex);
return null;
}
// 1. 直接类型匹配
if (expectedType.isInstance(value)) {
return expectedType.cast(value);
}
// 2. String类型转目标类型核心处理文本型数字
if (value instanceof String) {
String strValue = ((String) value).trim();
if (strValue.isEmpty()) {
LOGGER.debug("列索引{}:单元格值为空字符串,返回null", columnIndex);
return null;
}
// String Integer
if (expectedType == Integer.class) {
try {
return expectedType.cast(Integer.parseInt(strValue));
} catch (NumberFormatException e) {
LOGGER.warn("列索引{}String转Integer失败,原始值:{}", columnIndex, strValue, e);
return null;
}
}
// String Long
if (expectedType == Long.class) {
try {
return expectedType.cast(Long.parseLong(strValue));
} catch (NumberFormatException e) {
LOGGER.warn("列索引{}String转Long失败,原始值:{}", columnIndex, strValue, e);
return null;
}
}
// String BigDecimal支持千分位符号"1,234.56"
if (expectedType == BigDecimal.class) {
try {
String cleanValue = strValue.replace(",", ""); // 去除千分位逗号
return expectedType.cast(new BigDecimal(cleanValue));
} catch (NumberFormatException e) {
LOGGER.warn("列索引{}String转BigDecimal失败,原始值:{}", columnIndex, strValue, e);
return null;
}
}
// String Date支持多种日期格式
if (expectedType == Date.class) {
try {
return expectedType.cast(DateUtils.parseDate(strValue, SUPPORTED_DATE_FORMATS));
} catch (ParseException e) {
LOGGER.warn("列索引{}String转Date失败,原始值:{},支持格式:{}",
columnIndex, strValue, Arrays.toString(SUPPORTED_DATE_FORMATS), e);
return null;
}
}
}
// 3. 数字类型间转换如DoubleIntegerLongBigDecimal
if (value instanceof Number) {
Number numValue = (Number) value;
if (expectedType == Integer.class) {
return expectedType.cast(numValue.intValue());
}
if (expectedType == Long.class) {
return expectedType.cast(numValue.longValue());
}
if (expectedType == BigDecimal.class) {
return expectedType.cast(new BigDecimal(numValue.toString()));
}
}
// 4. 不支持的转换
LOGGER.warn("列索引{}:不支持的类型转换,期望类型:{},实际类型:{},原始值:{}",
columnIndex, expectedType.getSimpleName(), value.getClass().getSimpleName(), value);
return null;
}
/**
* 空值处理返回默认值
*/
private <T> T getDefaultValue(T value, T defaultValue) {
return value != null ? value : defaultValue;
}
// ---------------------- Getter方法供Service层获取解析结果 ----------------------
public DeliveryHeader getDeliveryHeader() {
return deliveryHeader;
}
public List<ProductDetail> getProductDetailList() {
return productDetailList;
}
public List<CustomerDeliveryDetail> getCustomerDeliveryDetailList() {
return customerDeliveryDetailList;
}
}
@@ -0,0 +1,259 @@
package com.mhd.oms.domain.executionStockInOrder.repository.listener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.StockInHeader;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.StockInProductDetail;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 入库单Excel解析监听器
* 功能1. 解析第一行表头数据 2. 解析第二行开始的产品明细 3. 支持文本型数字转换
*/
public class StockInExcelListener extends AnalysisEventListener<Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(StockInExcelListener.class);
// 存储解析结果
private final StockInHeader stockInHeader = new StockInHeader();
private final List<StockInProductDetail> productDetailList = new ArrayList<>();
// 支持的日期格式用于String转Date
private static final String[] SUPPORTED_DATE_FORMATS = {
"yyyy-MM-dd", "yyyy/MM/dd", "yyyyMMdd", "yyyy-MM-dd HH:mm:ss"
};
// 行号标记用于区分第一行和表格行
private int currentRowNum = 0;
@Override
public void invoke(Map<String, Object> data, AnalysisContext context) {
currentRowNum = context.readRowHolder().getRowIndex() + 1; // 行号从1开始
try {
LOGGER.debug("第{}行解析开始,数据:{}", currentRowNum, data);
// 1. 解析第一行表头数据入库日期OrderNO
if (currentRowNum == 1) {
parseHeaderData(data);
}
// 2. 解析第二行及以后产品明细跳过表头行第2行是表格列名
else if (currentRowNum >= 3) {
if (isValidProductRow(data)) {
StockInProductDetail detail = parseProductDetail(data);
productDetailList.add(detail);
}
}
} catch (ExcelDataConvertException e) {
// Excel内置转换异常如日期格式错误
LOGGER.error("第{}行数据转换异常,列号:{},列名:{}",
currentRowNum, e.getColumnIndex() + 1, getColumnNameByIndex(data, e.getColumnIndex()), e);
throw new RuntimeException("" + currentRowNum + "行列" + (e.getColumnIndex() + 1) + "数据格式错误", e);
} catch (Exception e) {
// 其他解析异常
LOGGER.error("第{}行解析异常,数据:{}", currentRowNum, data, e);
throw new RuntimeException("" + currentRowNum + "行数据解析失败", e);
}
}
/**
* 解析第一行表头数据
* 列对应关系0=入库日期标签1=入库日期值2=OrderNO标签3=OrderNO值
*/
private void parseHeaderData(Map<String, Object> data) {
// 入库日期第2列索引1
Object stockInDateObj = getValueSafely(data, 1);
if (stockInDateObj != null) {
Date stockInDate = convertToDate(stockInDateObj);
stockInHeader.setStockInDate(stockInDate);
LOGGER.debug("第1行:入库日期解析完成,值:{}", stockInDate);
}
// OrderNO第4列索引3
Object orderNoObj = getValueSafely(data, 3);
if (orderNoObj != null) {
String orderNo = orderNoObj.toString().trim();
stockInHeader.setOrderNo(orderNo);
LOGGER.debug("第1行:OrderNO解析完成,值:{}", orderNo);
}
// 校验表头数据完整性
if (stockInHeader.getStockInDate() == null || stockInHeader.getOrderNo().isEmpty()) {
LOGGER.warn("第1行表头数据不完整,入库日期:{},OrderNO:{}",
stockInHeader.getStockInDate(), stockInHeader.getOrderNo());
}
}
/**
* 解析产品明细数据一行对应一个产品
*/
private StockInProductDetail parseProductDetail(Map<String, Object> data) {
StockInProductDetail detail = new StockInProductDetail();
// 产品编号第1列索引0- 支持文本型数字转换
detail.setProductCode(convertToString(getValueSafely(data, 0)).toString());
// 产品名称第2列索引1
detail.setProductName(convertToString(getValueSafely(data, 1)));
// 箱含量第5列索引4
detail.setBoxCapacity(convertToInteger(getValueSafely(data, 4)));
// 件数第6列索引5
detail.setPieceCount(convertToInteger(getValueSafely(data, 5)));
// 箱数第7列索引6
detail.setBoxCount(convertToInteger(getValueSafely(data, 6)));
// 饮用日期第8列索引7
detail.setDrinkDate(convertToDate(getValueSafely(data, 7)));
LOGGER.debug("第{}行产品明细解析完成,产品编号:{},产品名称:{}",
currentRowNum, detail.getProductCode(), detail.getProductName());
return detail;
}
/**
* 校验产品行是否有效排除空行和合计行
*/
private boolean isValidProductRow(Map<String, Object> data) {
// 有效条件产品编号不为空 + 不是合计行合计行产品编号为null且包含"Total"
Object productCodeObj = getValueSafely(data, 0);
Object productNameObj = getValueSafely(data, 1);
// 排除合计行如第7行Total68
if (productNameObj != null && productNameObj.toString().contains("Total")) {
LOGGER.debug("第{}行是合计行,跳过解析", currentRowNum);
return false;
}
// 排除空行产品编号为空
return productCodeObj != null && !productCodeObj.toString().trim().isEmpty();
}
/**
* 解析完成回调
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
LOGGER.info("Excel解析全部完成!解析结果:");
LOGGER.info("1. 表头信息:入库日期={}OrderNO={}",
stockInHeader.getStockInDate(), stockInHeader.getOrderNo());
LOGGER.info("2. 产品明细:共{}条记录", productDetailList.size());
}
// ---------------------- 工具方法类型转换+安全取值 ----------------------
/**
* 按列索引安全获取值支持列索引越界处理
*/
private Object getValueSafely(Map<String, Object> data, int columnIndex) {
if (data == null || data.isEmpty()) {
return null;
}
int index = 0;
for (Object value : data.values()) {
if (index == columnIndex) {
return value;
}
index++;
}
LOGGER.warn("第{}行列索引{}超出范围(当前行共{}列),返回null",
currentRowNum, columnIndex, data.size());
return null;
}
/**
* 根据列索引获取列名用于异常定位
*/
private String getColumnNameByIndex(Map<String, Object> data, int columnIndex) {
if (data == null || data.isEmpty()) {
return "未知列";
}
int index = 0;
for (String key : data.keySet()) {
if (index == columnIndex) {
return key;
}
index++;
}
return "" + (columnIndex + 1) + "";
}
/**
* 通用转换Object转String
*/
private String convertToString(Object value) {
if (value == null) {
return "";
}
return value.toString().trim();
}
/**
* 通用转换Object转Integer支持文本型数字Number类型
*/
private Integer convertToInteger(Object value) {
if (value == null) {
return 0;
}
try {
// 文本型数字如String"1741"
if (value instanceof String) {
String strValue = ((String) value).trim();
return strValue.isEmpty() ? 0 : Integer.parseInt(strValue);
}
// Number类型如DoubleLong
if (value instanceof Number) {
return ((Number) value).intValue();
}
} catch (NumberFormatException e) {
LOGGER.warn("值转换为Integer失败,值:{},返回0", value, e);
}
return 0;
}
/**
* 通用转换Object转Date支持Date类型String类型
*/
private Date convertToDate(Object value) {
if (value == null) {
return null;
}
// 直接是Date类型
if (value instanceof Date) {
return (Date) value;
}
// String类型转Date支持多种格式
if (value instanceof String) {
String strValue = ((String) value).trim();
try {
return DateUtils.parseDate(strValue, SUPPORTED_DATE_FORMATS);
} catch (ParseException e) {
LOGGER.warn("值转换为Date失败,值:{},支持格式:{}",
strValue, String.join(",", SUPPORTED_DATE_FORMATS), e);
}
}
return null;
}
// ---------------------- Getter方法供Service层获取解析结果 ----------------------
public StockInHeader getStockInHeader() {
return stockInHeader;
}
public List<StockInProductDetail> getProductDetailList() {
return productDetailList;
}
}
@@ -0,0 +1,71 @@
package com.mhd.oms.domain.executionStockInOrder.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialGoodsRulePO;
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialWarehouseControlPO;
import com.mhd.oms.domain.executionStockInOrder.repository.po.ExecutionStockInOrderPO;
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* 入库单Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ExecutionStockInOrderMapper extends BaseMapper<ExecutionStockInOrder>
{
/**
* 查询入库单列表
*/
public List<ExecutionStockInOrderPO> queryList(ExecutionStockInOrderDO stockInOrderDO);
public MaterialBaseInfoPO getinfo(@Param("id") Long id);
public MaterialBaseInfoPO getByName(@Param("name") String name);
public MaterialBaseInfoPO getByCode(@Param("code") String code);
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id);
public String getUserNcCode(@Param("id") Long id);
public void delWOrder(@Param("inOrderNumber") String inOrderNumber);
public void delWOrderDetail(@Param("inOrderNumber") String inOrderNumber);
public String getWShOrder(@Param("inOrderNumber") String inOrderNumber);
public void delWShOrder(@Param("inOrderNumber") String inOrderNumber);
public void delWShOrderDetail(@Param("receiptOrderNumber") String receiptOrderNumber);
List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO);
List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDO);
public void updateByTransportationNumber(@Param("transportationNumber") String transportationNumber);
public void updateByOrderId(@Param("orderId") String orderId);
public void updateWmsOut(@Param("orderNumber") String orderNumber, @Param("quantity") BigDecimal quantity);
public String getIsCheckCredit(@Param("id") Long id);
public BigDecimal getCreditAmount(@Param("id") Long id);
public String getCustomerNcCode(@Param("id") Long id);
String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId);
}
@@ -0,0 +1,583 @@
package com.mhd.oms.domain.executionStockInOrder.repository.persistence;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.enums.DictCode;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.StringUtils;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService;
import com.mhd.oms.domain.executionStockInOrder.repository.listener.DynamicDeliveryExcelListener;
import com.mhd.oms.domain.executionStockInOrder.repository.listener.StockInExcelListener;
import com.mhd.oms.domain.executionStockInOrder.repository.mapper.ExecutionStockInOrderMapper;
import com.mhd.oms.domain.executionStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.executionStockInOrder.repository.po.ExecutionStockInOrderPO;
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO;
import com.mhd.oms.domain.executionStockInOrder.repository.vo.*;
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.todo.ExecutionStockOutOrderDO;
import com.mhd.oms.domain.executionStockOutOrder.service.ExecutionStockOutOrderApplicationService;
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.UserServiceFeign;
import com.mhd.system.api.domain.SysDictData;
import com.mhd.system.api.domain.WarehouseFeignPO;
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
import com.mhd.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 入库单Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public class ExecutionStockInOrderImpl extends ServiceImpl<ExecutionStockInOrderMapper, ExecutionStockInOrder> implements IExecutionStockInOrderService {
@Autowired
private ExecutionStockInOrderMapper stockInOrderMapper;
@Autowired
private ExecutionStockOutOrderMapper stockOutOrderMapper;
@Autowired
private IReservationDeliveryDetailsLinkService reservationDeliveryDetailsLinkService;
@Autowired
private ExecutionStockOutOrderApplicationService reservationStockOutOrderApplicationService;
@Autowired
private UserServiceFeign userServiceFeign;
@Autowired
private SystemServiceFeign systemServiceFeign;
@Autowired
private IExecutionInMaterialDetailService materialDetailService;
/**
* 查询入库单列表
*/
@Override
public List<ExecutionStockInOrderPO> queryList(ExecutionStockInOrderDO stockInOrderDO)
{
return stockInOrderMapper.queryList(stockInOrderDO);
}
/**
* 新增入库单
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean insert(ExecutionStockInOrderDO stockInOrderDO) {
ExecutionStockInOrder stockInOrder = new ExecutionStockInOrder();
BeanUtils.copyProperties(stockInOrderDO,stockInOrder);
return this.save(stockInOrder);
}
/**
* 修改入库单
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean update(ExecutionStockInOrderDO stockInOrderDO) {
ExecutionStockInOrder stockInOrder = new ExecutionStockInOrder();
BeanUtils.copyProperties(stockInOrderDO,stockInOrder);
return this.updateById(stockInOrder);
}
/**
* 批量删除入库单
*/
@Override
public Boolean delete(Long[] inOrderIds ) {
List<ExecutionStockInOrder> list = new ArrayList<>();
for (Long id : inOrderIds) {
ExecutionStockInOrder stockInOrder = new ExecutionStockInOrder();
stockInOrder.setInOrderId(id);
stockInOrder.setDelFlag(2);
list.add(stockInOrder);
}
return this.updateBatchById(list);
}
/**
* 修改入库单
*/
@Override
public ExecutionStockInOrderPO getInfo(Long inOrderId) {
ExecutionStockInOrder stockInOrder = this.getById(inOrderId);
ExecutionStockInOrderPO stockInOrderPO = new ExecutionStockInOrderPO();
BeanUtils.copyProperties(stockInOrder,stockInOrderPO);
return stockInOrderPO;
}
@Override
public List<ExecutionStockInOrderPO> queryNoticePrint(ExecutionStockInOrderDO stockInOrderDO) {
return stockInOrderMapper.queryNoticePrint(stockInOrderDO);
}
@Override
public List<ExecutionInMaterialDetailPO> queryNoticePrintDetail(ExecutionStockInOrderDO stockInOrderDO) {
return stockInOrderMapper.queryNoticePrintDetail(stockInOrderDO);
}
@Override
public DeliveryDataDTO parseExcelFile(MultipartFile file, String sheetName) throws Exception {
LoginUser loginUser = SecurityUtils.getLoginUser();
// 校验文件和工作表名称逻辑不变
if (file.isEmpty()) {
throw new IllegalArgumentException("上传的Excel文件不能为空");
}
if (!"出库导入".equals(sheetName) && !"参考数据".equals(sheetName)) {
sheetName = "出库导入";
}
// 关键变更使用动态行数监听器
DynamicDeliveryExcelListener listener = new DynamicDeliveryExcelListener();
try (InputStream inputStream = file.getInputStream()) {
EasyExcel.read(inputStream, listener)
.sheet(sheetName)
.headRowNumber(0) // 无固定表头全部行交由监听器处理
.doRead();
}
// 封装DTO逻辑不变
DeliveryDataDTO deliveryDataDTO = new DeliveryDataDTO();
deliveryDataDTO.setDeliveryHeader(listener.getDeliveryHeader());
deliveryDataDTO.setProductDetailList(listener.getProductDetailList());
deliveryDataDTO.setCustomerDeliveryDetailList(listener.getCustomerDeliveryDetailList());
List<ProductDetail> productDetailList = deliveryDataDTO.getProductDetailList();
List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>();
for (ProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) {
Map<String, Object> shipper = new HashMap<>();
shipper.put("shipperId", shipperId);
shipper.put("shipperName", materialBaseInfoPO.getShipperName());
shipper.put("shipperCode", materialBaseInfoPO.getShipperCode());
shipperIds.add(shipper);
}
}
}
if (shipperIds.isEmpty()) {
throw new Exception("出库物料货主不存在!");
}
if (shipperIds.size() > 1) {
throw new Exception("出库物料不是同一个货主!");
}
ExecutionStockOutOrderDO reservationStockOutOrderDO = new ExecutionStockOutOrderDO();
reservationStockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
reservationStockOutOrderDO.setShipperId((Long) shipperIds.get(0).get("shipperId"));
reservationStockOutOrderDO.setShipperName((String) shipperIds.get(0).get("shipperName"));
reservationStockOutOrderDO.setShipperCode((String) shipperIds.get(0).get("shipperCode"));
reservationStockOutOrderDO.setNeedTransportFlag("1");
reservationStockOutOrderDO.setNeedDeclareFlag("1");
reservationStockOutOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
reservationStockOutOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
reservationStockOutOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
reservationStockOutOrderDO.setIssueStatus(0);
reservationStockOutOrderDO.setSalesmanId(loginUser.getUserPo().getUserId().toString());
reservationStockOutOrderDO.setSalesmanName(loginUser.getUserPo().getUserName());
reservationStockOutOrderDO.setCreateTime(new Date());
reservationStockOutOrderDO.setDocumentDate(new Date());
reservationStockOutOrderDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationStockOutOrderDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationStockOutOrderDO.setDelFlag(1);
reservationStockOutOrderDO.setDocumentCreator(loginUser.getUserPo().getUserId().toString());
reservationStockOutOrderDO.setDocumentCreatorName(loginUser.getUserPo().getUserName());
reservationStockOutOrderDO.setOrderTypeCode("pu_tong_chu_ku");
reservationStockOutOrderDO.setBusinessType("pu_tong_chu_ku");
reservationStockOutOrderDO.setOrderTypeName("普通出库");
DeliveryHeader deliveryHeader = deliveryDataDTO.getDeliveryHeader();
reservationStockOutOrderDO.setTotalAmount(deliveryHeader.getSubtotalAmount());
reservationStockOutOrderDO.setRoute(deliveryHeader.getDeliveryLineNo());
reservationStockOutOrderDO.setReservationOrderSource("数据导入");
reservationStockOutOrderDO.setOutboundDate(deliveryHeader.getDeliveryDate());
reservationStockOutOrderDO.setTrainNo(deliveryHeader.getTrainNumber());
int index = 1;
List<ExecutionOutMaterialDetailDO> reservationOutMaterialDetailDOList = new ArrayList<>();
for (ProductDetail productDetail : productDetailList) {
ExecutionOutMaterialDetailDO reservationOutMaterialDetailDO = new ExecutionOutMaterialDetailDO();
reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
if (materialBaseInfoPO != null) {
reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
reservationOutMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
reservationOutMaterialDetailDO.setBarCode(materialBaseInfoPO.getBarCode());
BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice();
if (unitPrice != null) {
reservationOutMaterialDetailDO.setUnitPrice(unitPrice);
BigDecimal amount = unitPrice.multiply(reservationOutMaterialDetailDO.getQuantity());
reservationOutMaterialDetailDO.setTotalAmount(amount);
} else {
reservationOutMaterialDetailDO.setUnitPrice(BigDecimal.ZERO);
reservationOutMaterialDetailDO.setTotalAmount(BigDecimal.ZERO);
}
}
reservationOutMaterialDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
reservationOutMaterialDetailDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
reservationOutMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
reservationOutMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationOutMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
String lot = generateDateSerialNumber();
lot = lot+"-"+index;
index++;
reservationOutMaterialDetailDO.setLotNo(lot);
reservationOutMaterialDetailDOList.add(reservationOutMaterialDetailDO);
}
reservationStockOutOrderDO.setMaterialDetailList(reservationOutMaterialDetailDOList);
reservationStockOutOrderApplicationService.insert(reservationStockOutOrderDO);
List<CustomerDeliveryDetail> customerDeliveryDetailList = deliveryDataDTO.getCustomerDeliveryDetailList();
for (CustomerDeliveryDetail customerDeliveryDetail : customerDeliveryDetailList) {
ReservationDeliveryDetailsLink reservationDeliveryDetailsLink = new ReservationDeliveryDetailsLink();
reservationDeliveryDetailsLink.setInvoiceNumber(customerDeliveryDetail.getInvoiceNo());
reservationDeliveryDetailsLink.setAmount(customerDeliveryDetail.getAmount());
reservationDeliveryDetailsLink.setCustomerNumber(customerDeliveryDetail.getCustomerCode());
reservationDeliveryDetailsLink.setDeliveryName(customerDeliveryDetail.getCustomerName());
reservationDeliveryDetailsLink.setBox(customerDeliveryDetail.getBoxCount());
reservationDeliveryDetailsLink.setBag(customerDeliveryDetail.getPackageCount());
reservationDeliveryDetailsLink.setCategory(customerDeliveryDetail.getCategory());
reservationDeliveryDetailsLink.setOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
List<ExecutionStockOutOrder> reservationStockOutOrderDOList = stockOutOrderMapper.selectList(new LambdaQueryWrapper<ExecutionStockOutOrder>().eq(ExecutionStockOutOrder::getOutOrderNumber, reservationStockOutOrderDO.getOutOrderNumber()));
if (reservationStockOutOrderDOList != null && !reservationStockOutOrderDOList.isEmpty() && reservationStockOutOrderDOList.get(0) != null) {
reservationDeliveryDetailsLink.setOrderId(reservationStockOutOrderDOList.get(0).getOutOrderId());
}
reservationDeliveryDetailsLinkService.save(reservationDeliveryDetailsLink);
}
return deliveryDataDTO;
}
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;
}
private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionStockInOrderImpl.class);
// 默认工作表名称与Excel一致
private static final String DEFAULT_SHEET_NAME = "入库模版";
@Override
public StockInDataDTO parseStockInExcel(MultipartFile file, String sheetName) throws Exception {
LoginUser loginUser = SecurityUtils.getLoginUser();
// 1. 校验文件
if (file.isEmpty()) {
LOGGER.error("上传的Excel文件为空");
throw new IllegalArgumentException("Excel文件不能为空");
}
// 2. 校验工作表名称默认使用"入库模版"
String targetSheetName = (sheetName == null || sheetName.trim().isEmpty())
? DEFAULT_SHEET_NAME : sheetName.trim();
// 3. 使用EasyExcel解析指定监听器
StockInExcelListener listener = new StockInExcelListener();
try (InputStream inputStream = file.getInputStream()) {
EasyExcel.read(inputStream, listener)
.sheet(targetSheetName) // 指定工作表
.headRowNumber(0) // 从第1行开始解析不跳过任何行
.doRead();
}
// 4. 封装DTO返回
StockInDataDTO resultDTO = new StockInDataDTO();
resultDTO.setStockInHeader(listener.getStockInHeader());
resultDTO.setProductDetailList(listener.getProductDetailList());
LOGGER.info("Excel解析成功,工作表:{},产品明细数:{}",
targetSheetName, resultDTO.getProductDetailList().size());
List<StockInProductDetail> productDetailList = resultDTO.getProductDetailList();
List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>();
for (StockInProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) {
Map<String, Object> shipper = new HashMap<>();
shipper.put("shipperId", shipperId);
shipper.put("shipperName", materialBaseInfoPO.getShipperName());
shipper.put("shipperCode", materialBaseInfoPO.getShipperCode());
shipperIds.add(shipper);
}
}
}
ExecutionStockInOrderDO reservationStockInOrderDO = new ExecutionStockInOrderDO();
reservationStockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
reservationStockInOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
reservationStockInOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
reservationStockInOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
reservationStockInOrderDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationStockInOrderDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationStockInOrderDO.setCreateTime(new Date());
reservationStockInOrderDO.setDelFlag(1);
reservationStockInOrderDO.setDocumentCreator(loginUser.getUserPo().getUserId().toString());
reservationStockInOrderDO.setDocumentCreatorName(loginUser.getUserPo().getUserName());
reservationStockInOrderDO.setDocumentDate(new Date());
reservationStockInOrderDO.setOrderTypeCode("pu_tong_ru_ku");
reservationStockInOrderDO.setOrderTypeName("普通入库");
reservationStockInOrderDO.setIssueStatus(0);
reservationStockInOrderDO.setSalesmanId(loginUser.getUserPo().getUserId().toString());
reservationStockInOrderDO.setSalesmanName(loginUser.getUserPo().getUserName());
reservationStockInOrderDO.setShipperId((Long) shipperIds.get(0).get("shipperId"));
reservationStockInOrderDO.setShipperName((String) shipperIds.get(0).get("shipperName"));
reservationStockInOrderDO.setShipperCode((String) shipperIds.get(0).get("shipperCode"));
StockInHeader stockInHeader = resultDTO.getStockInHeader();
reservationStockInOrderDO.setWarehouseDate(stockInHeader.getStockInDate());
reservationStockInOrderDO.setStorageTime(stockInHeader.getStockInDate());
reservationStockInOrderDO.setExpectTime(stockInHeader.getStockInDate());
reservationStockInOrderDO.setBusinessOrderNo(stockInHeader.getOrderNo());
reservationStockInOrderDO.setReservationOrderSource("数据导入");
List<ExecutionInMaterialDetailDO> reservationInMaterialDetailDOList = new ArrayList<>();
int index = 1;
for (StockInProductDetail stockInProductDetail : productDetailList) {
ExecutionInMaterialDetailDO reservationInMaterialDetailDO = new ExecutionInMaterialDetailDO();
reservationInMaterialDetailDO.setInOrderNumber(reservationStockInOrderDO.getInOrderNumber());
reservationInMaterialDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
reservationInMaterialDetailDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
reservationInMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationInMaterialDetailDO.setCreateTime(new Date());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(stockInProductDetail.getProductCode());
reservationInMaterialDetailDO.setQuantity(new BigDecimal(stockInProductDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
if (materialBaseInfoPO != null) {
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
reservationInMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
reservationInMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
// reservationInMaterialDetailDO.setQuantity(new BigDecimal(stockInProductDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice();
if (unitPrice != null) {
reservationInMaterialDetailDO.setUnitPrice(unitPrice);
BigDecimal amount = unitPrice.multiply(reservationInMaterialDetailDO.getQuantity());
reservationInMaterialDetailDO.setTotalPrice(amount);
} else {
reservationInMaterialDetailDO.setUnitPrice(BigDecimal.ZERO);
reservationInMaterialDetailDO.setTotalPrice(BigDecimal.ZERO);
}
}
String lot = generateDateSerialNumber();
lot = lot+"-"+index;
index++;
reservationInMaterialDetailDO.setLotNo(lot);
reservationInMaterialDetailDO.setDrinkDate(stockInProductDetail.getDrinkDate());
reservationInMaterialDetailDOList.add(reservationInMaterialDetailDO);
}
reservationStockInOrderDO.setMaterialDetailList(reservationInMaterialDetailDOList);
insertApplication(reservationStockInOrderDO);
return resultDTO;
}
public Boolean insertApplication(ExecutionStockInOrderDO stockInOrderDO) {
// 如果仓库ID为空从当前登录用户的关联仓库中获取
if (stockInOrderDO.getWarehouseId() == null) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
throw new ServiceException("登录已失效,请重新登录");
}
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
if (associationWarehouseCacheDO == null || associationWarehouseCacheDO.getWarehouseId() == null) {
throw new ServiceException("当前用户未配置关联仓库,请先配置仓库");
}
stockInOrderDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
}
//设置仓库
setWarehouseInfo(stockInOrderDO);
// 设置货主信息
shipperParam(stockInOrderDO);
// 设置供应商信息
supplierParam(stockInOrderDO);
// 设置数据字典键值
setDataDict(stockInOrderDO);
return insertDomain(stockInOrderDO);
}
@Transactional(rollbackFor = Exception.class)
public Boolean insertDomain(ExecutionStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getInOrderNumber() == null) {
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
}
// //统计总计划数
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ExecutionInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setQuantity(quantity);
BigDecimal amount = stockInOrderDO.getMaterialDetailList().stream().map(ExecutionInMaterialDetailDO::getTotalPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setAmount(amount);
this.insert(stockInOrderDO);
return materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
}
private void setWarehouseInfo(ExecutionStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getWarehouseId() == null) {
throw new ServiceException("仓库ID不能为空");
}
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockInOrderDO.getWarehouseId());
if (ajaxResult == null) {
throw new ServiceException("获取仓库信息失败:返回结果为空,仓库ID:" + stockInOrderDO.getWarehouseId());
}
Object codeObj = ajaxResult.get("code");
if (codeObj == null || !"200".equals(String.valueOf(codeObj))) {
String errorMsg = ajaxResult.get("msg") != null ? String.valueOf(ajaxResult.get("msg")) : "未知错误";
throw new ServiceException("获取仓库信息失败,仓库ID" + stockInOrderDO.getWarehouseId() + ",错误信息:" + errorMsg);
}
Object dataObj = ajaxResult.get("data");
if (dataObj == null) {
throw new ServiceException("获取仓库信息失败:返回数据为空,仓库ID:" + stockInOrderDO.getWarehouseId());
}
WarehouseFeignPO warehouseFeignPO = JSON.parseObject(JSONObject.toJSONString(dataObj), WarehouseFeignPO.class);
if (warehouseFeignPO == null) {
throw new ServiceException("获取仓库信息失败:数据解析失败,仓库ID:" + stockInOrderDO.getWarehouseId());
}
stockInOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
stockInOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
}
/**
* @description 封装货主信息改为与出库单相同的简洁逻辑使用入库单的字段shipperName
* @author ZhouGY
* @date 2024/5/9 20:43
* @param stockInOrderDO
*/
private void shipperParam(ExecutionStockInOrderDO stockInOrderDO){
// 新增/编辑时前端可能只传 shipperId下拉选中值shipperName 为空
// 这里优先按 shipperId 回填货主编码/名称其次再按 shipperName名称或数字ID字符串回填
// 1) 优先按 shipperId 查询
if (ObjectUtil.isNotNull(stockInOrderDO.getShipperId())) {
AjaxResult ajaxResult = userServiceFeign.getInfo(stockInOrderDO.getShipperId());
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
throw new ServiceException("获取货主信息失败");
}
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
stockInOrderDO.setShipperId(userPo.getUserId());
stockInOrderDO.setShipperCode(userPo.getUserMemberCode());
stockInOrderDO.setShipperName(userPo.getUserName());
return;
}
// 2) shipperId 为空时 shipperName 兜底
String shipperName = stockInOrderDO.getShipperName();
if (StringUtils.isEmpty(shipperName)) {
return;
}
if (!shipperName.matches("\\d+")) {
// 按名称查询
AjaxResult ajaxResult = userServiceFeign.getInfoByName(shipperName);
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
throw new ServiceException("获取货主信息失败");
}
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
stockInOrderDO.setShipperId(userPo.getUserId());
stockInOrderDO.setShipperCode(userPo.getUserMemberCode());
stockInOrderDO.setShipperName(userPo.getUserName());
} else {
// shipperName 是数字按ID查询
AjaxResult ajaxResult = userServiceFeign.getInfo(Long.valueOf(shipperName));
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
throw new ServiceException("获取货主信息失败");
}
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
stockInOrderDO.setShipperId(userPo.getUserId());
stockInOrderDO.setShipperCode(userPo.getUserMemberCode());
stockInOrderDO.setShipperName(userPo.getUserName());
}
}
/**
* @description 封装供应商信息
* @author ZhouGY
* @date 2024/5/9 20:43
* @param stockInOrderDO
*/
private void supplierParam(ExecutionStockInOrderDO stockInOrderDO){
if (ObjectUtil.isNotNull(stockInOrderDO.getSupplierId())){
AjaxResult ajaxResult = userServiceFeign.getInfo(stockInOrderDO.getSupplierId());
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
throw new ServiceException("获取供应商信息失败");
}
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
stockInOrderDO.setSupplierName(userPo.getUserName());
}
}
/**
* @description 设置数据字典键值
* @author ZhouGY
* @date 2024/4/7 14:33
* @param stockInOrderDO
*/
private void setDataDict(ExecutionStockInOrderDO stockInOrderDO){
//翻译单据类型
if (StringUtils.isNotBlank(stockInOrderDO.getOrderTypeCode())){
AjaxResult documentTypeResult = systemServiceFeign.selectListByDictType(DictCode.DOCUMENT_TYPE.getCode());
if (!"200".equals(String.valueOf(documentTypeResult.get("code")))) {
throw new ServiceException("单据类型数据字典不存在");
}
List<SysDictData> documentTypeDataList = JSON.parseArray(JSONUtil.toJsonStr(documentTypeResult.get("data")), SysDictData.class);
SysDictData documentTypeData = documentTypeDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), stockInOrderDO.getOrderTypeCode())).findAny().orElse(null);
if (null == documentTypeData) {
throw new ServiceException("单据类型【" + stockInOrderDO.getOrderTypeCode() + "】数据字典不存在 请联系管理员");
}
stockInOrderDO.setOrderTypeName(documentTypeData.getDictLabel());
}
//翻译优先级别类型
if (StringUtils.isNotBlank(stockInOrderDO.getPriorityLevelCode())){
AjaxResult priorityLevelResult = systemServiceFeign.selectListByDictType(DictCode.PRIORITY_LEVEL.getCode());
if (!"200".equals(String.valueOf(priorityLevelResult.get("code")))) {
throw new ServiceException("优先级别类型数据字典不存在");
}
List<SysDictData> priorityLevelDataList = JSON.parseArray(JSONUtil.toJsonStr(priorityLevelResult.get("data")), SysDictData.class);
SysDictData priorityLevelData = priorityLevelDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), stockInOrderDO.getPriorityLevelCode())).findAny().orElse(null);
if (null == priorityLevelData) {
throw new ServiceException("优先级别类型【" + stockInOrderDO.getPriorityLevelCode() + "】数据字典不存在 请联系管理员");
}
stockInOrderDO.setPriorityLevelName(priorityLevelData.getDictLabel());
}
}
}
@@ -0,0 +1,116 @@
package com.mhd.oms.domain.executionStockInOrder.repository.po;
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;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ExecutionStockInOrderBasePO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@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("货主code")
@Excel(name = "货主code")
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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件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;
}
@@ -0,0 +1,481 @@
package com.mhd.oms.domain.executionStockInOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
import io.swagger.annotations.ApiModel;
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_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "入库单对象", description = "入库单响应对象")
public class ExecutionStockInOrderPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
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 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 auditTime;
@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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量(原字段)")
@Excel(name = "计划数量(原字段)")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
/**
* 计划入库数量取入库单明细中的入库数量汇总
*/
@ApiModelProperty("计划入库数量")
@Excel(name = "计划入库数量")
private BigDecimal planInQuantity;
/**
* 收货数量入库单对应的收货单实际收货数量汇总
*/
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
/**
* 上架数量入库单对应的上架单实际上架数量汇总
*/
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@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 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 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 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 closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("物料明细")
private List<ExecutionInMaterialDetailPO> materialDetailList;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@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 orderStatus;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("业务单对象")
private List<BusinessDocumentOrder> businessDocumentOrderDOList;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
@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("总价")
@Excel(name = "总价")
private BigDecimal amount;
@ApiModelProperty("推送人姓名")
private String pushByName;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String pictureUrl;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
@ApiModelProperty("运输业务单号")
private String businessNumber;
@ApiModelProperty("是否免费夫力费费")
private String isFreeManpowerFee;
@ApiModelProperty("折扣")
private BigDecimal discount;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
@ApiModelProperty("夫力费")
private BigDecimal manpowerFee;
@ApiModelProperty("总仓租")
private BigDecimal totalWarehouseRent;
@ApiModelProperty("业务计价类型")
private String businessChargeType;
@ApiModelProperty("业务计价方式")
private String businessPriceWay;
private String khdm;
}
@@ -0,0 +1,250 @@
package com.mhd.oms.domain.executionStockInOrder.repository.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.handler.ListTypeHandler;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料基础信息对象 material_base_info
*
* @author gen
* @date 2024-05-07
*/
@Data
@ApiModel(value = "物料基础信息对象", description = "物料基础信息响应对象")
public class MaterialBaseInfoPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@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 materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("物料分类编码")
@TableField(typeHandler = ListTypeHandler.class)
private List<String> materialClassifyCode;
@ApiModelProperty("物料分类名称")
@TableField(typeHandler = ListTypeHandler.class)
private List<String> materialClassifyName;
@ApiModelProperty("物料分类编码(导出用,逗号分隔)")
@Excel(name = "物料分类编码")
private String materialClassifyCodeStr;
@ApiModelProperty("物料分类名称(导出用,逗号分隔)")
@Excel(name = "物料分类名称")
private String materialClassifyNameStr;
@ApiModelProperty("物料种类编码 数据字典")
@Excel(name = "物料种类编码 数据字典")
private String materialType;
@ApiModelProperty("物料种类名称 数据字典")
@Excel(name = "物料种类名称 数据字典")
private String materialTypeName;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装单位编码")
@Excel(name = "包装单位编码")
private String unitCode;
@ApiModelProperty("包装单位名称")
@Excel(name = "包装单位名称")
private String unitName;
@ApiModelProperty("品牌id")
@Excel(name = "品牌id")
private Long brandId;
@ApiModelProperty("品牌编码")
@Excel(name = "品牌编码")
private String brandCode;
@ApiModelProperty("品牌名称")
@Excel(name = "品牌名称")
private String brandName;
@ApiModelProperty("保质期 单位:天")
@Excel(name = "保质期 单位:天")
private Long shelfLife;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("毛重 单位:千克")
@Excel(name = "毛重 单位:千克")
private BigDecimal grossWeight;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("商品形态编码 数据字典")
@Excel(name = "商品形态编码 数据字典")
private String materialShape;
@ApiModelProperty("商品形态名称 数据字典")
@Excel(name = "商品形态名称 数据字典")
private String materialShapeName;
@ApiModelProperty("物料大小 长*宽*高 单位:米")
@Excel(name = "物料大小 长*宽*高 单位:米")
private String materialSize;
@ApiModelProperty("物料大小-长 单位:米")
@Excel(name = "物料大小-长 单位:米")
private BigDecimal materialLength;
@ApiModelProperty("物料大小-宽 单位:米")
@Excel(name = "物料大小-宽 单位:米")
private BigDecimal materialWidth;
@ApiModelProperty("物料大小-高 单位:米")
@Excel(name = "物料大小-高 单位:米")
private BigDecimal materialHeight;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("是否作废: 1-是 2-否")
@Excel(name = "是否作废: 1-是 2-否")
private Integer nullify;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("商品规则")
private MaterialGoodsRulePO materialGoodsRule;
//
// @ApiModelProperty("公共信息")
// private MaterialCommonPO materialCommon;
@ApiModelProperty("仓库控制信息")
private MaterialWarehouseControlPO materialWarehouseControl;
//
// @ApiModelProperty("库存预警信息")
// private List<MaterialInventoryWarningPO> materialInventoryWarningList;
// @ApiModelProperty("条码信息")
// private List<MaterialBarCodePO> materialBarCodeList;
//
// @ApiModelProperty("物料批次属性")
// private List<MaterialMoreDetailPO> materialMoreDetailList;
@ApiModelProperty("是否公用: 1-是 2-否")
@Excel(name = "是否公用: 1-是 2-否")
private Integer common;
@ApiModelProperty("SKU码")
private String skuCode;
@ApiModelProperty("单价")
private BigDecimal unitPrice;
@ApiModelProperty("币制")
private String currency;
@ApiModelProperty("原产国")
private String originCountry;
@ApiModelProperty("HS码")
private String hsCode;
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
@Excel(name = "货物类型:0-物料 1-半成品 2-成品")
private Integer goodsType;
@ApiModelProperty("申报单位")
private String declarationUnit;
@ApiModelProperty("法定单位")
private String statutoryUnit;
@ApiModelProperty("法定第二单位")
private String statutorySecondUnit;
@ApiModelProperty("规格型号")
private String specificationModel;
@ApiModelProperty("批次ID")
@Excel(name = "批次ID")
private Long batchId;
@ApiModelProperty("批次编码")
@Excel(name = "批次编码")
private String batchCode;
@ApiModelProperty("批次名称")
@Excel(name = "批次名称")
private String batchName;
@ApiModelProperty("库存预警数量")
@Excel(name = "库存预警数量")
private Integer inventoryWarningCount;
@ApiModelProperty("临期预警数量")
@Excel(name = "临期预警数量")
private Integer expirationWarningCount;
//库存件数
private BigDecimal stockQuantity;
}
@@ -0,0 +1,131 @@
package com.mhd.oms.domain.executionStockInOrder.repository.po;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 物料商品规则对象 material_goods_rule
*
* @author gen
* @date 2024-05-07
*/
@Data
@ApiModel(value = "物料商品规则对象", description = "物料商品规则响应对象")
public class MaterialGoodsRulePO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("商品规则id")
private Long materialGoodsRuleId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("批次id")
@Excel(name = "批次id")
private Long batchId;
@ApiModelProperty("批次编码")
@Excel(name = "批次编码")
private String batchCode;
@ApiModelProperty("批次名称")
@Excel(name = "批次名称")
private String batchName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("上架规则id")
@Excel(name = "上架规则id")
private Long ruleId;
@ApiModelProperty("上架规则编码")
@Excel(name = "上架规则编码")
private String ruleCode;
@ApiModelProperty("上架规则名称")
@Excel(name = "上架规则名称")
private String ruleName;
@ApiModelProperty("上架库位指定规则id")
@Excel(name = "上架库位指定规则id")
private Long specifyRuleId;
@ApiModelProperty("上架库位指定规则编码")
@Excel(name = "上架库位指定规则编码")
private String specifyRuleCode;
@ApiModelProperty("上架库位指定规则名称")
@Excel(name = "上架库位指定规则名称")
private String specifyRuleName;
@ApiModelProperty("周转规则id")
@Excel(name = "周转规则id")
private Long turnoverRuleId;
@ApiModelProperty("周转规则编码")
@Excel(name = "周转规则编码")
private String turnoverRuleCode;
@ApiModelProperty("周转规则名称")
@Excel(name = "周转规则名称")
private String turnoverRuleName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
}
@@ -0,0 +1,97 @@
package com.mhd.oms.domain.executionStockInOrder.repository.po;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 仓库控制信息对象 material_warehouse_control
*
* @author gen
* @date 2024-05-07
*/
@Data
@ApiModel(value = "仓库控制信息对象", description = "仓库控制信息响应对象")
public class MaterialWarehouseControlPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("商品规则id")
private Long materialWarehouseControlId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("是否效期控制: 1-是 2-否")
@Excel(name = "是否效期控制: 1-是 2-否")
private Integer temperatureControl;
@ApiModelProperty("周期类型: 1-生产日期 2-失效日期")
@Excel(name = "周期类型: 1-生产日期 2-失效日期")
private Integer cycleType;
@ApiModelProperty("入库效期 单位:天")
@Excel(name = "入库效期 单位:天")
private Integer inValidityPeriod;
@ApiModelProperty("入库效期 单位:天")
@Excel(name = "入库效期 单位:天")
private Integer outValidityPeriod;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("ABC分类:A-A类 B-B类 C-C类")
@Excel(name = "ABC分类:A-A类 B-B类 C-C类")
private String classify;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
}
@@ -0,0 +1,111 @@
package com.mhd.oms.domain.executionStockInOrder.repository.todo;
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;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ExecutionStockInOrderBaseDO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
}
@@ -0,0 +1,110 @@
package com.mhd.oms.domain.executionStockInOrder.repository.todo;
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;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ExecutionStockInOrderBaseDTO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@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;
/**
* 兼容前端使用 userName 作为货主名称字段
* 如果请求体中只传了 userName将在组装器中自动回填到 shipperName
*/
@ApiModelProperty("货主名称(兼容字段:userName")
private String userName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
}
@@ -0,0 +1,512 @@
package com.mhd.oms.domain.executionStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
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_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionStockInOrderDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
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 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 auditTime;
@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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal amount;
@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 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 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 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 closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货4-数据导入")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("入库单id集合")
private List<Long> inOrderIds;
@ApiModelProperty("物料明细")
private List<ExecutionInMaterialDetailDO> materialDetailList;
@ApiModelProperty("小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer ltStatus;
@ApiModelProperty("大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer gtStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer ltAuditStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer gtAuditStatus;
@ApiModelProperty("调度单号")
private String mobilizeCode;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商(先做成输入框,待定)")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式(数据字典:一般贸易)")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物(默认:否)")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关(默认:是)")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输(默认:否)")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@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 orderStatus;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty(name = "入库时间查询条件开始日期")
private String storageTimeStart;
@ApiModelProperty(name = "入库时间查询条件结束日期")
private String storageTimeEnd;
@ApiModelProperty(name = "入库时间查询条件开始日期")
private String expectTimeStart;
@ApiModelProperty(name = "入库时间查询条件结束日期")
private String expectTimeEnd;
@ApiModelProperty("入库明细-物料名称(商品名称),模糊匹配")
private String materialName;
@ApiModelProperty("入库明细-物料编码,模糊匹配")
private String materialCode;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
@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("附件url")
@Excel(name = "附件url")
private String pictureUrl;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
@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;
private String xfStatus;
@ApiModelProperty("运输业务单号")
private String businessNumber;
@ApiModelProperty("是否免费夫力费费")
private String isFreeManpowerFee;
@ApiModelProperty("折扣")
private BigDecimal discount;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
@ApiModelProperty("夫力费")
private BigDecimal manpowerFee;
@ApiModelProperty("总仓租")
private BigDecimal totalWarehouseRent;
@ApiModelProperty("业务计价类型")
private String businessChargeType;
@ApiModelProperty("业务计价方式")
private String businessPriceWay;
}
@@ -0,0 +1,509 @@
package com.mhd.oms.domain.executionStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDTO;
//import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ExecutionStockInOrderBaseDTO;
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDTO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDTO;
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_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ExecutionStockInOrderDTO extends ExecutionStockInOrderBaseDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal amount;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
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 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 auditTime;
@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 supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@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 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("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@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 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 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 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 closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("入库单id集合")
private List<Long> inOrderIds;
@ApiModelProperty("物料明细")
private List<ExecutionInMaterialDetailDTO> materialDetailList;
@ApiModelProperty("小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer ltStatus;
@ApiModelProperty("大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer gtStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer ltAuditStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer gtAuditStatus;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商(先做成输入框,待定)")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式(数据字典:一般贸易)")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物(默认:否)")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关(默认:是)")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输(默认:否)")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@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 orderStatus;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty("入库明细-物料名称(商品名称),模糊匹配,与前端参数 materialName 一致")
private String materialName;
@ApiModelProperty("入库明细-物料编码,模糊匹配,与前端参数 materialCode 一致")
private String materialCode;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
@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("附件url")
@Excel(name = "附件url")
private String pictureUrl;
@ApiModelProperty("NC客户编码")
private String customerNcCode;
@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;
private String xfStatus;
@ApiModelProperty(name = "入库时间查询条件开始日期")
private String storageTimeStart;
@ApiModelProperty(name = "入库时间查询条件结束日期")
private String storageTimeEnd;
@ApiModelProperty(name = "入库时间查询条件开始日期")
private String expectTimeStart;
@ApiModelProperty(name = "入库时间查询条件结束日期")
private String expectTimeEnd;
@ApiModelProperty("运输业务单号")
private String businessNumber;
@ApiModelProperty("是否免费夫力费费")
private String isFreeManpowerFee;
@ApiModelProperty("折扣")
private BigDecimal discount;
@ApiModelProperty("火险保费")
private BigDecimal fireInsureFee;
@ApiModelProperty("夫力费")
private BigDecimal manpowerFee;
@ApiModelProperty("总仓租")
private BigDecimal totalWarehouseRent;
@ApiModelProperty("业务计价类型")
private String businessChargeType;
@ApiModelProperty("业务计价方式")
private String businessPriceWay;
}
@@ -0,0 +1,211 @@
package com.mhd.oms.domain.executionStockInOrder.repository.todo;
import com.mhd.common.core.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
/**
* 入库单导入行DTO一个Excel行=一个明细行表头字段可重复
*
* 约定委托编号NO作为同一张入库单的分组键同一个委托编号可导入多条物料明细
*/
@Data
public class ExecutionStockInOrderImportRowDTO {
// ====== 分组/表头基础字段建议在Excel中每行重复填写 ======
// @Excel(name = "仓库ID")
// private Long warehouseId;
// @Excel(name = "货主ID")
// private Long shipperId;
@Excel(name = "货主编号")
private String shipperCode;
// @Excel(name = "供应商ID")
// private Long supplierId;
// @Excel(name = "入库单据类型")
// private String orderTypeCode;
@Excel(name = "委托编号NO")
private String consignmentNo;
// ====== 表头报关字段与页面一致 ======
@Excel(name = "To")
private String to;
@Excel(name = "联系人")
private String contactPerson;
@Excel(name = "车型及车牌")
private String vehicleInfo;
@Excel(name = "Tel")
private String tel;
@Excel(name = "司机签名")
private String driverSignature;
@Excel(name = "Fax")
private String fax;
@Excel(name = "申报地关区")
private String declarationArea;
@Excel(name = "生产商")
private String manufacturer;
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@Excel(name = "送货地址")
private String deliveryAddress;
@Excel(name = "进出境关别")
private String entryExitCustoms;
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
// 客户名称只在表头中明细行不需要此字段代码会从表头读取并应用到此字段
@Excel(name = "客户名称")
private String shipperName;
@Excel(name = "承运商")
private String carrier;
@Excel(name = "柜号")
private String containerNo;
@Excel(name = "运输方式")
private String transportMethod;
@Excel(name = "监管方式")
private String supervisionMethod;
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@Excel(name = "是否需要运输")
private Integer needTransport;
@Excel(name = "入仓日期")
private String warehouseDate; // 导入先按字符串后端可根据需要转Date当前入库单服务未强制使用
@Excel(name = "完成时间")
private String completionTime;
@Excel(name = "下单日期")
private String orderDate;
@Excel(name = "备注")
private String remark;
// ====== 明细字段一个Excel行=一个明细 ======
@Excel(name = "序号")
private Integer serialNumber;
@Excel(name = "商品名称")
private String materialName;
@Excel(name = "料号")
private String materialCode;
// @Excel(name = "物料基础信息ID")
// private Long materialBaseInfoId;
// 模板中没有此字段注释掉
// @Excel(name = "计划数量")
private BigDecimal quantity;
@Excel(name = "仓库数量")
private BigDecimal warehouseQuantity;
// 支持"入库数量"列名"仓库数量"映射到同一个字段
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@Excel(name = "商品SKU码")
private String skuCode;
@Excel(name = "Invoice No.")
private String invoiceNo;
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@Excel(name = "申报单位")
private String declarationUnit;
@Excel(name = "")
private BigDecimal liter;
@Excel(name = "箱数")
private BigDecimal boxCount;
@Excel(name = "件数")
private BigDecimal pieceCount;
@Excel(name = "尺寸")
private String dimensions;
// @Excel(name = "出库数量")
private BigDecimal outboundQuantity;
@Excel(name = "单位")
private String unit;
// 支持多种列名格式处理换行符空格括号等
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@Excel(name = "总净重\n(KG)")
private BigDecimal totalNetWeight2;
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@Excel(name = "总毛重 (KG)")
private BigDecimal totalGrossWeight2;
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@Excel(name = "总体积\n(CBM)")
private BigDecimal totalVolume2;
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea2;
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@Excel(name = "原产国")
private String originCountry;
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@Excel(name = "总价")
private BigDecimal totalPrice;
@Excel(name = "币制")
private String currency;
@Excel(name = "备注")
private String detailRemark;
}
@@ -0,0 +1,26 @@
package com.mhd.oms.domain.executionStockInOrder.repository.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 客户配送明细实体类
*/
@Data
public class CustomerDeliveryDetail {
// 类别
private String category;
// 发票编号
private String invoiceNo;
// 客户编号
private String customerCode;
// 客户名称
private String customerName;
// 箱数
private Integer boxCount;
// 包数
private Integer packageCount;
// 金额
private BigDecimal amount;
}
@@ -0,0 +1,18 @@
package com.mhd.oms.domain.executionStockInOrder.repository.vo;
import lombok.Data;
import java.util.List;
/**
* 出库数据DTO包含表头货品明细客户配送明细
*/
@Data
public class DeliveryDataDTO {
// 表头信息
private DeliveryHeader deliveryHeader;
// 货品明细列表
private List<ProductDetail> productDetailList;
// 客户配送明细列表
private List<CustomerDeliveryDetail> customerDeliveryDetailList;
}
@@ -0,0 +1,33 @@
package com.mhd.oms.domain.executionStockInOrder.repository.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 出库表头信息包含送货日期纪录合共发票张数等
*/
@Data
public class DeliveryHeader {
// 送货日期
private Date deliveryDate;
// 送货线号
private String deliveryLineNo;
// 车次
private Integer trainNumber;
// 纪录合共-货品总数量
private Integer totalRecordCount;
// 纪录合共-总箱数
private Integer totalBoxCount;
// 纪录合共-总支数
private Integer totalPieceCount;
// 发票张数
private Integer invoiceCount;
// 小计-总箱数
private Integer subtotalBoxCount;
// 小计-总支数
private Integer subtotalPieceCount;
// 小计-总金额
private BigDecimal subtotalAmount;
}
@@ -0,0 +1,29 @@
package com.mhd.oms.domain.executionStockInOrder.repository.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class GwInDetail {
//订单号
private String billNo;
//订单行号
private String lineNum;
//物料号
private String itemNo;
//物料名称
private String itemName;
//物料规格
private String spec;
//计量单位
private String unit;
//数量
private BigDecimal qty;
//企业币制
private String erpCurr;
//企业单价
private BigDecimal erpPrice;
//申报总价
private BigDecimal amount;
}

Some files were not shown because too many files have changed in this diff Show More