diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java index ce67818f8..055817bad 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java @@ -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.3:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class) public interface BmsServiceFeign { diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java index 30ff739ad..812fc1719 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java @@ -8,6 +8,7 @@ import com.mhd.system.api.factory.RemoteOmsFeignFallbackFactory; import com.mhd.system.api.feign.FeignAutoConfiguration; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -39,4 +40,13 @@ public interface OmsServiceFeign { @ApiOperation("库存调整记录插入") @PostMapping("/reservationInventoryAdjustmentRecordApi/edit") AjaxResult inventoryAdjustmentRecordInsert(InventoryAdjustmentRecord inventoryAdjustmentRecord); + + @ApiOperation("查询企业单位列表-新增物料时显示下拉框数据") + @GetMapping("/erpEnterpriseUnitApi/unitList") + public AjaxResult getUnitList(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO); + + //查询企业国别列表-新增物料时显示下拉框数据 + @ApiOperation("查询企业国别列表-新增物料时显示下拉框数据") + @GetMapping("/erpCountryApi/countryList") + public AjaxResult getCountryList(ErpCountryDTO erpCountryDTO); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/SystemServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/SystemServiceFeign.java index 066fd3c56..12993e41f 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/SystemServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/SystemServiceFeign.java @@ -363,6 +363,9 @@ public interface SystemServiceFeign { @GetMapping("/contractManageApi/getInfoByCustomer2") public AjaxResult getInfoByCustomer2(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("topOrganizationId") Long topOrganizationId); + @GetMapping("/contractManageApi/getInfoByCustomerAndOrganizationId") + public AjaxResult getInfoByCustomerAndOrganizationId(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("topOrganizationId") Long topOrganizationId,@RequestParam("organizationId") Long organizationId); + @GetMapping("/contractManageApi/queryList") public AjaxResult queryList(); @@ -377,4 +380,4 @@ public interface SystemServiceFeign { public AjaxResult matchForMaterialImport(@RequestParam("keyword") String keyword, @RequestParam("organizationId") Long organizationId); -} +} \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java index 63e2ae236..1af715b05 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java @@ -9,15 +9,19 @@ import com.mhd.common.core.domain.dto.UserDriverDTO; import com.mhd.common.core.domain.entity.R; import com.mhd.common.core.domain.todo.StatisticalMattersDo; import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.system.api.domain.UserDTO; +import com.mhd.system.api.domain.UserShipperQueryDTO; import com.mhd.system.api.domain.UserUpdateDTO; import com.mhd.system.api.factory.RemoteUserFeignFallbackFactory; import com.mhd.system.api.feign.FeignAutoConfiguration; import com.mhd.system.api.model.LoginUser; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; import java.util.Map; @@ -195,4 +199,19 @@ public interface UserServiceFeign { @ApiOperation("设置路线") @PostMapping("/userApi/updateLineManagement") public AjaxResult updateLineManagement(@RequestBody UserDTO userDTO); + + + + + @ApiOperation("商业合作伙伴-分页查询托运人列表") + @GetMapping("/userShipperApi/userShipperList") + public TableDataInfo userShipperList(@SpringQueryMap UserShipperQueryDTO userShipperQueryDTO); + + + @PostMapping("/userShipperApi/updatePushStatus") + public AjaxResult updatePushStatus(@RequestParam(value = "shipperId") Long shipperId, + @RequestParam(value = "pushStatus", required = false) Integer pushStatus, + @RequestParam(value = "pushTime", required = false) String pushTime, + @RequestParam(value = "pushBy", required = false) Long pushBy, + @RequestParam(value = "pushByName", required = false) String pushByName); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java index 5297c1fc5..fdee7b2ed 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java @@ -538,4 +538,19 @@ public interface WlhyServiceFeign { @GetMapping("/feign/order/cancelIssueDocuments") public AjaxResult cancelIssueDocuments(@RequestParam(name="executeOrderId") String executeOrderId); + + @GetMapping(value = "/ntocc/tmsSettlementExchangeRate/queryList") + public AjaxResult queryList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="pushStatus", required = false) String pushStatus, + @RequestParam(name="organizationId", required = false) String organizationId); + + + @ApiOperation("汇率-更新推送状态") + @PostMapping("/ntocc/tmsSettlementExchangeRate/updatePushStatus") + void updateExchangeRatePushStatus(@RequestParam("id") String id, + @RequestParam("pushStatus") Integer pushStatus, + @RequestParam(name="pushTime",required = false) String pushTime, + @RequestParam(name="pushBy",required = false) Long pushBy, + @RequestParam(name="pushByName",required = false) String pushByName); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java index 815c7f04e..48fa38331 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java @@ -2,6 +2,7 @@ package com.mhd.system.api; import com.mhd.common.core.constant.ServiceNameConstants; import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.system.api.domain.*; import com.mhd.system.api.factory.RemoteWmsFallbackFactory; import com.mhd.system.api.feign.FeignAutoConfiguration; @@ -95,4 +96,16 @@ public interface WmsServiceFeign { @ApiOperation("oms下发单明细保存") @PostMapping(value = "/stockInOrderApi/omsInOrderAddDetail") public void omsInOrderAddDetail(@RequestBody List inMaterialDetails); + + @ApiOperation("oms查询物料列表") + @GetMapping("/materialBaseInfoApi/queryList") + public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO); + + @ApiOperation("oms物料列表推送-更新推送信息") + @PostMapping("/materialBaseInfoApi/updatePushStatus") + public AjaxResult updateMaterialPushStatus(@RequestParam("materialBaseInfoId") Long materialBaseInfoId, + @RequestParam("pushStatus") Integer pushStatus, + @RequestParam(value = "pushTime",required = false) String pushTime, + @RequestParam(value = "pushBy",required = false) Long pushBy, + @RequestParam(value = "pushByName",required = false) String pushByName); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpCountryDTO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpCountryDTO.java new file mode 100644 index 000000000..3280adbe0 --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpCountryDTO.java @@ -0,0 +1,24 @@ +package com.mhd.system.api.domain; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "企业国别DTO") +public class ErpCountryDTO { + + @ApiModelProperty("主键id") + private Long id; + + @ApiModelProperty("ERP国别编码") + private String erpCountryCode; + + @ApiModelProperty("ERP国别名称") + private String erpCountryName; + + @ApiModelProperty("所属组织ID") + private Long organizationId; + +} diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpEnterpriseUnitDTO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpEnterpriseUnitDTO.java new file mode 100644 index 000000000..f30e6662d --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/ErpEnterpriseUnitDTO.java @@ -0,0 +1,22 @@ +package com.mhd.system.api.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "企业单位DTO") +public class ErpEnterpriseUnitDTO { + + @ApiModelProperty("企业单位id") + private Long id; + + @ApiModelProperty("企业单位名称") + private String erpName; + + @ApiModelProperty("企业单位编码") + private String erpCode; + + @ApiModelProperty("组织ID") + private Long organizationId; +} diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java index 3df1b8a6c..79b899031 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java @@ -207,6 +207,14 @@ public class MaterialBaseInfoFeign extends BaseVOEntity{ @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + /** * 规格型号 */ diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInfoDTO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInfoDTO.java new file mode 100644 index 000000000..165951f86 --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInfoDTO.java @@ -0,0 +1,57 @@ +package com.mhd.system.api.domain; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + + + +@Data +@ApiModel(description = "物料信息查询DTO") +public class MaterialInfoDTO { + + @ApiModelProperty("物料id") + private Long materialBaseInfoId; + + @ApiModelProperty("物料id") + private String materialCode; + + @ApiModelProperty("物料名称") + private String materialName; + + @ApiModelProperty("货物类型 0-料件 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("组织ID") + private Long organizationId; + + @ApiModelProperty("创建时间起") + private String createTimeStart; + + @ApiModelProperty("创建时间止") + private String createTimeEnd; + + @ApiModelProperty("更新时间起") + private String updateTimeStart; + + @ApiModelProperty("更新时间止") + private String updateTimeEnd; + + @ApiModelProperty("推送状态") + private Integer pushStatus; + + @ApiModelProperty("推送时间起") + private String pushTimeStart; + + @ApiModelProperty("推送时间止") + private String pushTimeEnd; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + +} diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/SysDictType.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/SysDictType.java index 790628d41..6b461fc11 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/SysDictType.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/SysDictType.java @@ -34,6 +34,45 @@ public class SysDictType extends BaseEntity @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; + /** 组织表ID */ + private Long organizationId; + + /** 组织名称 */ + private String organizationName; + + /** 一级组织表ID */ + private Long topOrganizationId; + + public Long getOrganizationId() + { + return organizationId; + } + + public void setOrganizationId(Long organizationId) + { + this.organizationId = organizationId; + } + + public String getOrganizationName() + { + return organizationName; + } + + public void setOrganizationName(String organizationName) + { + this.organizationName = organizationName; + } + + public Long getTopOrganizationId() + { + return topOrganizationId; + } + + public void setTopOrganizationId(Long topOrganizationId) + { + this.topOrganizationId = topOrganizationId; + } + public Long getDictId() { return dictId; @@ -86,6 +125,9 @@ public class SysDictType extends BaseEntity .append("dictName", getDictName()) .append("dictType", getDictType()) .append("status", getStatus()) + .append("organizationId", getOrganizationId()) + .append("organizationName", getOrganizationName()) + .append("topOrganizationId", getTopOrganizationId()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/UserShipperQueryDTO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/UserShipperQueryDTO.java new file mode 100644 index 000000000..3370f6a0a --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/UserShipperQueryDTO.java @@ -0,0 +1,52 @@ +package com.mhd.system.api.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +public class UserShipperQueryDTO { + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + + @ApiModelProperty(value = "登录账号") + private String userAccount; + + @ApiModelProperty(value = "企业名称") + private String shipperEnterpriseName; + + @ApiModelProperty(value = "组织ID") + private String organizationId; + + @ApiModelProperty(value = "组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建时间起") + private String createTimeFrom; + + @ApiModelProperty(value = "创建时间止") + private String createTimeTo; + + @ApiModelProperty(value = "更新时间起") + private String updateTimeFrom; + + @ApiModelProperty(value = "更新时间止") + private String updateTimeTo; + + @ApiModelProperty(value = "货主类型") + private String shipperType; + + @ApiModelProperty(value = "推送状态") + private Integer pushStatus; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + +} diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java index 87cf89b87..c53068c61 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java @@ -58,6 +58,16 @@ public class RemoteOmsFeignFallbackFactory implements FallbackFactory()); + tableDataInfo.setTotal(0); + tableDataInfo.setCode(500); + tableDataInfo.setMsg("查询失败:" + throwable.getMessage()); + return tableDataInfo; + } + + + @Override + public AjaxResult updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { + return AjaxResult.error("更新失败" + throwable.getMessage()); + } }; } } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java index 23fb98c50..b5f9d74d3 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java @@ -550,6 +550,16 @@ public class RemoteWlhyFallbackFactory implements FallbackFactory queryList(Integer pageNo, Integer pageSize, String pushStatus, String organizationId) { + return AjaxResult.error(cause.getMessage()); + } + + @Override + public void updateExchangeRatePushStatus(String id, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { + + } }; } } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java index 954a979b6..5b0cb292e 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java @@ -2,6 +2,7 @@ package com.mhd.system.api.factory; import com.mhd.common.core.domain.entity.R; import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.system.api.WlhyServiceFeign; import com.mhd.system.api.WmsServiceFeign; import com.mhd.system.api.domain.*; @@ -11,6 +12,7 @@ import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -69,6 +71,20 @@ public class RemoteWmsFallbackFactory implements FallbackFactory inMaterialDetails) { } + + @Override + public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO) { + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(new ArrayList<>()); + tableDataInfo.setTotal(0); + tableDataInfo.setCode(500); + return tableDataInfo; + } + + @Override + public AjaxResult updateMaterialPushStatus(Long materialBaseInfoId, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { + return AjaxResult.error(cause.getMessage()); + } }; } } \ No newline at end of file diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/BusinessDocumentDTO.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/BusinessDocumentDTO.java index 67055a95b..457658fe8 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/BusinessDocumentDTO.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/BusinessDocumentDTO.java @@ -1,5 +1,6 @@ package com.mhd.common.core.domain.dto; +import com.baomidou.mybatisplus.annotation.TableField; import com.mhd.common.core.annotation.Excel; import lombok.Data; import java.util.Date; @@ -233,4 +234,15 @@ public class BusinessDocumentDTO extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsShipperDTO.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsShipperDTO.java index 2034e51b9..c66ff4d73 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsShipperDTO.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsShipperDTO.java @@ -27,6 +27,8 @@ public class TmsShipperDTO implements Serializable { /**货主类型(0-个人货主,1-企业货主))*/ @ApiModelProperty(value = "货主类型(0-个人货主,1-企业货主))") private Integer shipperType; + @ApiModelProperty(name = "货主账号") + private String userAccount; @ApiModelProperty(name = "最高组织id") private Long topOrganizationId; @ApiModelProperty(name = "归属组织id") diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserShipperPo.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserShipperPo.java index 72525bfaf..97d9bd4e4 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserShipperPo.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserShipperPo.java @@ -1,6 +1,7 @@ package com.mhd.common.core.domain.po; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.mhd.common.core.annotation.Excel; import com.mhd.common.core.annotation.fieldsetvalue.NeedSetValue; import io.swagger.annotations.ApiModelProperty; @@ -12,6 +13,7 @@ import java.math.BigDecimal; import java.util.Date; @Data +@JsonIgnoreProperties(ignoreUnknown = true) public class UserShipperPo { private static final long serialVersionUID = 1L; @@ -266,6 +268,9 @@ public class UserShipperPo { @ApiModelProperty("结算币种") private String settlementCurrency; + + @ApiModelProperty("货主code") + private String roleCodeShipper; } diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/utils/ip/IpUtil.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/utils/ip/IpUtil.java index ebdb79b58..5a348a3e4 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/utils/ip/IpUtil.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/utils/ip/IpUtil.java @@ -65,27 +65,67 @@ public class IpUtil { public static IpLocation getLocation(String ip) { IpLocation location = new IpLocation(); location.setIp(ip); - try (InputStream inputStream = IpUtils.class.getResourceAsStream("/ip2region.xdb");) { + if (StrUtil.isBlank(ip) || "unknown".equalsIgnoreCase(ip.trim())) + { + return location; + } + String ipv4 = ip.trim(); + if (ipv4.contains(",")) + { + ipv4 = ipv4.substring(0, ipv4.indexOf(',')).trim(); + } + // ip2region xdb 对 IPv6 / 非法串可能抛 ArrayIndexOutOfBoundsException,仅对 IPv4 做库查询 + if (!isLikelyIpv4(ipv4)) + { + return location; + } + try (InputStream inputStream = IpUtils.class.getResourceAsStream("/ip2region.xdb")) + { + if (inputStream == null) + { + log.warn("ip2region.xdb 未找到,跳过 IP 归属解析"); + return location; + } byte[] bytes = IoUtil.readBytes(inputStream); Searcher searcher = Searcher.newWithBuffer(bytes); - String region = searcher.search(ip); - if (StrUtil.isAllNotBlank(region)) { - // xdb返回格式 国家|区域|省份|城市|ISP, - // 只有中国的数据绝大部分精确到了城市,其他国家部分数据只能定位到国家,后前的选项全部是0 - String[] result = region.split("\\|"); - location.setCountry(ZERO.equals(result[0]) ? StrUtil.EMPTY : result[0]); - location.setProvince(ZERO.equals(result[2]) ? StrUtil.EMPTY : result[2]); - location.setCity(ZERO.equals(result[3]) ? StrUtil.EMPTY : result[3]); - location.setIsp(ZERO.equals(result[4]) ? StrUtil.EMPTY : result[4]); + try + { + String region = searcher.search(ipv4); + if (StrUtil.isNotBlank(region)) + { + // xdb返回格式 国家|区域|省份|城市|ISP, + String[] result = region.split("\\|"); + if (result.length >= 5) + { + location.setCountry(ZERO.equals(result[0]) ? StrUtil.EMPTY : result[0]); + location.setProvince(ZERO.equals(result[2]) ? StrUtil.EMPTY : result[2]); + location.setCity(ZERO.equals(result[3]) ? StrUtil.EMPTY : result[3]); + location.setIsp(ZERO.equals(result[4]) ? StrUtil.EMPTY : result[4]); + } + } } - searcher.close(); - } catch (Exception e) { - log.error("ip地址解析异常,error:", e); + finally + { + searcher.close(); + } + } + catch (Exception e) + { + log.warn("ip地址解析失败,ip={}, msg={}", ipv4, e.getMessage()); return location; } return location; } + private static boolean isLikelyIpv4(String ip) + { + if (ip == null || ip.contains(":")) + { + return false; + } + return ip.chars().filter(ch -> ch == '.').count() == 3L; + } + /** * 根据iP获取归属地信息 - 拼接 * @@ -93,7 +133,7 @@ public class IpUtil { */ public static String getLocationSplicing(String ip) { IpLocation location = getLocation(ip); - return location.getProvince()+location.getCity(); + return StrUtil.nullToEmpty(location.getProvince()) + StrUtil.nullToEmpty(location.getCity()); } public static void main(String[] args) { diff --git a/mhd-common/mhd-common-log/src/main/java/com/mhd/common/log/aspect/LogAspect.java b/mhd-common/mhd-common-log/src/main/java/com/mhd/common/log/aspect/LogAspect.java index 394e4aaf3..abbaa6569 100644 --- a/mhd-common/mhd-common-log/src/main/java/com/mhd/common/log/aspect/LogAspect.java +++ b/mhd-common/mhd-common-log/src/main/java/com/mhd/common/log/aspect/LogAspect.java @@ -80,7 +80,15 @@ public class LogAspect // 请求的地址 String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); operLog.setOperIp(ip); - operLog.setOperLocation(StrUtil.isNotEmpty(operLog.getOperIp()) ? IpUtil.getLocationSplicing(operLog.getOperIp()) : ""); + try + { + operLog.setOperLocation(StrUtil.isNotEmpty(operLog.getOperIp()) ? IpUtil.getLocationSplicing(operLog.getOperIp()) : ""); + } + catch (Throwable t) + { + log.warn("操作日志 IP 归属解析跳过: {}", t.getMessage()); + operLog.setOperLocation(""); + } operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); LoginUser loginUser = SecurityUtils.getLoginUser(); if (loginUser != null){ diff --git a/mhd-common/mhd-common-security/src/main/java/com/mhd/common/security/utils/DictUtils.java b/mhd-common/mhd-common-security/src/main/java/com/mhd/common/security/utils/DictUtils.java index 6eed94dc9..227d578f1 100644 --- a/mhd-common/mhd-common-security/src/main/java/com/mhd/common/security/utils/DictUtils.java +++ b/mhd-common/mhd-common-security/src/main/java/com/mhd/common/security/utils/DictUtils.java @@ -72,4 +72,13 @@ public class DictUtils { return Constants.SYS_DICT_KEY + configKey; } + + /** + * 字典缓存键:同一 dict_type 在不同组织下可并存,需带上组织维度(null 视为 0 平台) + */ + public static String dictTypeOrgCacheKey(String dictType, Long organizationId) + { + long oid = organizationId == null ? 0L : organizationId.longValue(); + return dictType + "@" + oid; + } } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java index b0dc1861d..7b13ec085 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java @@ -106,10 +106,10 @@ public class BatchDetailApplicationService { throw new ServiceException("获取物料规则信息失败"); } MaterialGoodsRuleFeign materialGoodsRuleFeign = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), MaterialGoodsRuleFeign.class); + // 无商品规则或未绑定批次模板时,不返回任何批次属性(避免 batchId 空导致查全表) if (ObjectUtil.isNull(materialGoodsRuleFeign) || materialGoodsRuleFeign.getBatchId() == null) { - // 未绑定批次时只返回空列表,不可按空 batchId 全表查 batch_detail return new ArrayList<>(); } return getBatchDetailListByBatchId(materialGoodsRuleFeign.getBatchId()); } -} +} \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java index f22d0d317..e6cc462bf 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java @@ -337,6 +337,165 @@ public class ContractManageApplicationService { return result; } + /** 单据类型「仓库进出仓单」编码(与 BMS / WMS 推送一致) */ + public static final String DOCUMENT_TYPE_CODE_WAREHOUSE_IN_OUT_ORDER = "WMS_ckjccd"; + + /** + * 按结算主体取仓储合同结算设置中,单据类型包含指定类型的费用科目编码(按明细行顺序,可重复,调用方去重)。 + * 科目编码优先取二级 {@code second_subject_code},为空则取一级 {@code first_subject_code}。 + * settlementCustomersCode 为空时与同模块合同逻辑一致:使用通用仓储合同(commonContractFlag=1)。 + */ + public List listSecondSubjectCodesBySettlementAndDocumentType(String settlementCustomersCode, + Long organizationId, + Long topOrganizationId, + String documentTypeCode) { + if (StringUtils.isEmpty(documentTypeCode)) { + return Collections.emptyList(); + } + ContractManagePO contractManagePO = getInfoByCustomerAndOrganizationId(settlementCustomersCode, 1, topOrganizationId, organizationId); + if (contractManagePO == null || contractManagePO.getContractManageId() == null) { + return Collections.emptyList(); + } + List detailPOS = contractManageDetailDomainService.queryListByManageId(contractManagePO.getContractManageId()); + if (detailPOS == null || detailPOS.isEmpty()) { + return Collections.emptyList(); + } + List codes = new ArrayList<>(); + for (ContractManageDetailPO detail : detailPOS) { + if (detail == null) { + continue; + } + String subjectCode = resolveContractDetailExpenseSubjectCode(detail); + if (StringUtils.isEmpty(subjectCode)) { + continue; + } + if (!matchesContractDetailWarehouseInOut(detail, documentTypeCode)) { + continue; + } + codes.add(subjectCode); + } + return codes; + } + + /** + * 合同结算行的费用科目编码:有二级科目用二级,否则用一级。 + */ + private static String resolveContractDetailExpenseSubjectCode(ContractManageDetailPO detail) { + if (detail == null) { + return null; + } + if (!StringUtils.isEmpty(detail.getSecondSubjectCode())) { + return detail.getSecondSubjectCode().trim(); + } + if (!StringUtils.isEmpty(detail.getFirstSubjectCode())) { + return detail.getFirstSubjectCode().trim(); + } + return null; + } + + /** + * 是否属于「仓库进出仓单」类结算行:优先按单据类型编码精确匹配(含逗号分隔多编码), + * 避免因 BMS 主数据编码与 WMS 计费推送编码(如 WMS_ckjccd)不一致导致筛掉全部行; + * 兼容按单据类型名称包含「仓库进出仓」判定(合同保存时会拼接中文名称)。 + */ + private static boolean matchesContractDetailWarehouseInOut(ContractManageDetailPO detail, String documentTypeCode) { + if (detail == null || StringUtils.isEmpty(documentTypeCode)) { + return false; + } + if (contractDetailContainsDocumentType(detail.getDocumentTypeCode(), documentTypeCode)) { + return true; + } + String typeNames = detail.getDocumentType(); + if (StringUtils.isEmpty(typeNames)) { + return false; + } + return Stream.of(typeNames.split(",")) + .map(String::trim) + .filter(s -> !StringUtils.isEmpty(s)) + .anyMatch(n -> n.contains("仓库进出仓")); + } + + private static boolean contractDetailContainsDocumentType(String detailDocumentTypeCodes, String documentTypeCode) { + if (StringUtils.isEmpty(detailDocumentTypeCodes)) { + return false; + } + return Stream.of(detailDocumentTypeCodes.split(",")) + .map(String::trim) + .filter(s -> !StringUtils.isEmpty(s)) + .anyMatch(code -> code.equalsIgnoreCase(documentTypeCode)); + } + + /** + * 按单据类型取合同结算行上的计费单价(计费策略展开的 isFee 项)。 + *

多条结算明细共用同一计费策略(accounting_strategy_id 相同)时,只展开一次策略参数, + * 避免前端出现重复的单价列。

+ */ + public List getPrice(String documentTypeCode, String settlementCustomersCode,Long organizationId,Long topOrganizationId) { + List result = new ArrayList<>(); + ContractManagePO contractManagePO = getInfoByCustomerAndOrganizationId(settlementCustomersCode, 1, topOrganizationId, organizationId); + List detailPOS = contractManageDetailDomainService.queryListByManageId(contractManagePO.getContractManageId()); + contractManagePO.setContractManageDetailPOList(detailPOS); + if (contractManagePO != null) { + List contractManageDetailPOList = contractManagePO.getContractManageDetailPOList(); + if (contractManageDetailPOList != null && contractManageDetailPOList.size() > 0) { + List contractManageDetailPOs = contractManageDetailPOList.stream() + .filter(item -> contractDetailContainsDocumentType(item.getDocumentTypeCode(), documentTypeCode)) + .collect(Collectors.toList()); + if (contractManageDetailPOs != null && contractManageDetailPOs.size() > 0) { + Set expandedAccountingStrategyIds = new HashSet<>(); + for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOs) { + Long accountingStrategyId = contractManageDetailPO.getAccountingStrategyId(); + if (accountingStrategyId == null || !expandedAccountingStrategyIds.add(accountingStrategyId)) { + continue; + } + List billingParams = contractManageDetailMapper.getBillingParams(accountingStrategyId); + if (billingParams != null && billingParams.size() > 0) { + //if (billingParams != null && billingParams.size() > 0) { + BillingParamsPO billingParam = billingParams.get(0); + String billingParamsJson = billingParam.getBillingParamsJson(); + String preSetRules = billingParam.getPreSetRules(); + Long billingParamsId = billingParam.getBillingParamsId(); + List> preSetRulesList = JSON.parseObject(preSetRules, new TypeReference>>() {}); + List> billingParamsList = JSON.parseObject(billingParamsJson, new TypeReference>>() {}); + if (preSetRulesList != null && preSetRulesList.size() > 0) { + Map stringObjectMap1 = preSetRulesList.get(0); + for (Map stringObjectMap : billingParamsList) { + String fieldsName = (String) stringObjectMap.get("fieldsName"); + String isShow = (String) stringObjectMap.get("isShow"); + String isFee = (String) stringObjectMap.get("isFee"); + String isPush = (String) stringObjectMap.get("isPush"); + if ("1".equals(isFee)) { + Integer sort = (Integer) stringObjectMap.get("sort"); + String chargingId = (String) stringObjectMap.get("chargingId"); + String fields = (String) stringObjectMap.get("fields"); + String price = (String) stringObjectMap1.get("fields" + sort); + SubjectAndPriceReturn subjectAndPriceReturn = new SubjectAndPriceReturn(); + subjectAndPriceReturn.setName(fieldsName); + subjectAndPriceReturn.setPrice(new BigDecimal(price)); + subjectAndPriceReturn.setChargingId(chargingId); + subjectAndPriceReturn.setFields(fields); + subjectAndPriceReturn.setBillingRulesId(accountingStrategyId); + subjectAndPriceReturn.setIsShow(isShow); + subjectAndPriceReturn.setIsFee(isFee); + subjectAndPriceReturn.setIsPush(isPush); + subjectAndPriceReturn.setRulesId(billingParamsId); + result.add(subjectAndPriceReturn); + } + } + } + //} + } else { + throw new ServiceException("计费参数不存在"); + } + } + } + } + } else { + throw new ServiceException("合同信息不存在"); + } + return result; + } + public List getSubject(SubjectAndPriceDTO contractManageDTO) { List result = new ArrayList<>(); Long settlementCustomersId = contractManageDTO.getSettlementCustomersId(); @@ -757,6 +916,100 @@ public class ContractManageApplicationService { return resultContract; } + /** + * 根据结算主体获取合同信息 + * @param settlementCustomersCode 结算主体code + * @param contractType 合同类型 + */ + public ContractManagePO getInfoByCustomerAndOrganizationId(String settlementCustomersCode,Integer contractType, Long topOrganizationId, Long organizationId) { + /* + 首先根据合同类型(仓储、运输),以及结算客户,查询合同信息 + 如果传了结算主体,则根据结算主体以及当前时间查询有效的特殊合同,如果特殊合同没有,则查询通用合同 + */ + //获取当前登录人信息 + 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")); + if (!ObjectUtil.isNull(loginUser)) { + queryParam.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + }else { + queryParam.setTopOrganizationId(topOrganizationId); + } + if (ObjectUtil.isNotEmpty(organizationId)) { + queryParam.setOrganizationId(organizationId); + } + List contractManagePOList = contractManageDomainService.queryList(queryParam); + 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){ + if(contractType==1){ + //仓储合同 + resultContract = contractManagePOList.stream() + .filter(item -> + item.getContractType()==1 && + item.getCommonContractFlag() == 1 && item.getContractState() ==2) + .findFirst().orElse(null); + }else{ + //运输合同 + resultContract = contractManagePOList.stream().filter(item -> item.getContractType()==2 + && item.getCommonContractFlag() == 1 && item.getContractState() ==2).findFirst().orElse(null); + } + }else { + resultContract = contractManagePO; + } + }else { + if(contractType==1){ + //仓储合同 + resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==1 + && contractManagePO.getCommonContractFlag() == 1 && contractManagePO.getContractState() ==2).findFirst().orElse(null); + }else{ + //运输合同 + resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==2 + && contractManagePO.getCommonContractFlag() == 1 && contractManagePO.getContractState() ==2).findFirst().orElse(null); + } + } + if(null == resultContract){ + throw new ServiceException("找不到匹配的合同,请重试"); + } + //得到合同后,查询合同明细 + List contractManageDetailPOList = contractManageDetailDomainService.queryListByManageId(resultContract.getContractManageId()); + List 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 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 contractManageDTO diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java index 6b9c350ac..c73322b87 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/expenseAccount/ExpenseAccountApplicationService.java @@ -9,6 +9,7 @@ import com.mhd.basic.domain.expenseAccount.repository.po.QueryExpenseAccountPO; import com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO; import com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDoMap; import com.mhd.basic.domain.expenseAccount.repository.todo.SearchExpenseAccountDO; +import com.mhd.basic.application.service.contractManage.ContractManageApplicationService; import com.mhd.basic.domain.expenseAccount.service.ExpenseAccountDomainService; import com.mhd.basic.infrastructure.feign.vo.SysDictDataVo; import com.mhd.basic.interfaces.dto.expenseAccount.ExpenseAccountDTO; @@ -27,8 +28,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -45,8 +48,64 @@ public class ExpenseAccountApplicationService { @Autowired private ExpenseAccountDomainService expenseAccountDomainService; @Autowired + private ContractManageApplicationService contractManageApplicationService; + @Autowired private SystemServiceFeign systemServiceFeign; + /** + * 入库/出库费用登记等场景:按仓储合同「仓库进出仓单」结算行取科目(二级编码优先,否则一级),再关联费用科目主数据。 + *

科目范围以合同结算设置为准;若 {@code expenseAccountDO.inOrderDisplay} 或 {@code expenseAccountDO.outOrderDisplay} 非空, + * 再按主数据「入库单是否固定显示 / 出库单是否固定显示」(0-否 1-是)与入参相等过滤,二者同时传则同时满足(AND)。

+ * settlementCustomersCode 不传或为空时使用通用仓储合同。 + */ + public List queryListFromContractWarehouseInOutSettlement(ExpenseAccountDO expenseAccountDO, String settlementCustomersCode) { + Long topOrgIdForExpense = expenseAccountDO.getTopOrganizationId(); + if (topOrgIdForExpense == null) { + LoginUser lu = SecurityUtils.getLoginUser(); + if (lu != null && lu.getUserPo() != null && lu.getUserPo().getTopOrganizationId() != null) { + topOrgIdForExpense = lu.getUserPo().getTopOrganizationId(); + } + } + List orderedCodes = contractManageApplicationService.listSecondSubjectCodesBySettlementAndDocumentType( + settlementCustomersCode, + expenseAccountDO.getOrganizationId(), + topOrgIdForExpense, + ContractManageApplicationService.DOCUMENT_TYPE_CODE_WAREHOUSE_IN_OUT_ORDER); + log.info("按合同取费用科目编码:topOrgIdForExpense={}, 命中结算行科目数={}", topOrgIdForExpense, + orderedCodes != null ? orderedCodes.size() : 0); + boolean filterIn = expenseAccountDO.getInOrderDisplay() != null; + boolean filterOut = expenseAccountDO.getOutOrderDisplay() != null; + if (filterIn || filterOut) { + log.info("合同科目叠加主数据出入库显示过滤:inOrderDisplay={}, outOrderDisplay={}", + expenseAccountDO.getInOrderDisplay(), expenseAccountDO.getOutOrderDisplay()); + } + List result = new ArrayList<>(); + for (String code : orderedCodes) { + if (StringUtils.isEmpty(code)) { + continue; + } + ExpenseAccountPO po = expenseAccountDomainService.getInfoByCode2(code.trim(), topOrgIdForExpense); + if (po != null && po.getExpenseAccountId() != null && passWarehouseInOutDisplayFilter(po, expenseAccountDO)) { + result.add(po); + } + } + return result; + } + + /** + * 合同路径下可选:与主数据 in_order_display / out_order_display 一致才保留(入参为 null 的维度不参与过滤)。 + */ + private static boolean passWarehouseInOutDisplayFilter(ExpenseAccountPO po, ExpenseAccountDO filter) { + if (filter.getInOrderDisplay() != null + && !Objects.equals(po.getInOrderDisplay(), filter.getInOrderDisplay())) { + return false; + } + if (filter.getOutOrderDisplay() != null + && !Objects.equals(po.getOutOrderDisplay(), filter.getOutOrderDisplay())) { + return false; + } + return true; + } /** * 分页查询费用科目列表 diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java index dc3fc8eb6..5860b8df2 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java @@ -107,7 +107,31 @@ public class AssociationWarehouseImpl extends ServiceImpl().lambda() + .eq(AssociationWarehouse::getWarehouseId, associationWarehouseDO.getWarehouseId()) + .eq(AssociationWarehouse::getDelFlag, 1) + .and(w -> w.isNull(AssociationWarehouse::getIsDefault) + .or() + .ne(AssociationWarehouse::getIsDefault, 2))); + List stillBoundRows = associationWarehouseMapper.selectList(new QueryWrapper().lambda() + .eq(AssociationWarehouse::getWarehouseId, associationWarehouseDO.getWarehouseId()) + .eq(AssociationWarehouse::getDelFlag, 1)); + Set alreadyBoundCorrelationIds = stillBoundRows.stream() + .map(AssociationWarehouse::getCorrelationId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + LinkedHashSet distinctCorrelationIds = CollectionUtils.isEmpty(associationWarehouseDO.getCorrelationIdList()) + ? new LinkedHashSet<>() + : new LinkedHashSet<>(associationWarehouseDO.getCorrelationIdList()); + for (Long correlationId : distinctCorrelationIds) { + if (correlationId == null) { + continue; + } + // 仍在库内的绑定(多为创建人默认仓 is_default=2)不再插入,否则撞唯一 IDX_ASS_COR_WAR_ID + if (alreadyBoundCorrelationIds.contains(correlationId)) { + continue; + } AssociationWarehouse associationWarehouse = new AssociationWarehouse(); associationWarehouse.setOrganizationId(loginUser.getUserPo().getOrganizationId()); associationWarehouse.setOrganizationName(loginUser.getUserPo().getOrganizationName()); @@ -121,13 +145,6 @@ public class AssociationWarehouseImpl extends ServiceImpl().lambda() - .eq(AssociationWarehouse::getWarehouseId, associationWarehouseDO.getWarehouseId()) - .eq(AssociationWarehouse::getDelFlag, 1) - .and(w -> w.isNull(AssociationWarehouse::getIsDefault) - .or() - .ne(AssociationWarehouse::getIsDefault, 2))); } return saveBatch(associationWarehouseList); } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java index 738e4a94d..ddcdff8cc 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java @@ -75,4 +75,4 @@ public class BatchDetailDomainService { batchDetailDO.setBatchId(batchId); return batchDetailService.queryList(batchDetailDO); } -} +} \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/entity/ExpenseAccount.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/entity/ExpenseAccount.java index 26c82423b..88d5cf7fa 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/entity/ExpenseAccount.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/entity/ExpenseAccount.java @@ -1,6 +1,7 @@ package com.mhd.basic.domain.expenseAccount.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.mhd.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; @@ -113,4 +114,25 @@ public class ExpenseAccount extends BaseVOEntity{ @ApiModelProperty("费率") private BigDecimal rate; + @ApiModelProperty("计费单位") + private String billingUnit; + + @ApiModelProperty("计费单位英文") + private String billingUnitEn; + + @ApiModelProperty("计费单位2") + private String billingUnit2; + + @ApiModelProperty("计费单位2英文") + private String billingUnitEn2; + + @ApiModelProperty("计费单位中文默认") + private String billingUnitDefaultCn; + + @ApiModelProperty("计费单位英文默认") + private String billingUnitDefaultEn; + + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; + } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/po/ExpenseAccountPO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/po/ExpenseAccountPO.java index dfbd0e340..07cca5026 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/po/ExpenseAccountPO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/po/ExpenseAccountPO.java @@ -1,5 +1,6 @@ package com.mhd.basic.domain.expenseAccount.repository.po; +import com.baomidou.mybatisplus.annotation.TableField; import com.mhd.common.core.annotation.Excel; import lombok.Data; import java.util.Date; @@ -136,4 +137,26 @@ public class ExpenseAccountPO extends BaseVOEntity{ @ApiModelProperty(name = "出库单是否固定显示 0-否 1-是") private Integer outOrderDisplay; + + + @ApiModelProperty("计费单位") + private String billingUnit; + + @ApiModelProperty("计费单位英文") + private String billingUnitEn; + + @ApiModelProperty("计费单位2") + private String billingUnit2; + + @ApiModelProperty("计费单位2英文") + private String billingUnitEn2; + + @ApiModelProperty("计费单位中文默认") + private String billingUnitDefaultCn; + + @ApiModelProperty("计费单位英文默认") + private String billingUnitDefaultEn; + + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/todo/ExpenseAccountDO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/todo/ExpenseAccountDO.java index 1fafefb54..90ab9e727 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/todo/ExpenseAccountDO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/expenseAccount/repository/todo/ExpenseAccountDO.java @@ -153,4 +153,32 @@ public class ExpenseAccountDO extends BaseVOEntity{ @ApiModelProperty(name = "创建者姓名") private String updateByName; + + + @ApiModelProperty("计费单位") + private String billingUnit; + + @ApiModelProperty("计费单位英文") + private String billingUnitEn; + + @ApiModelProperty("计费单位2") + private String billingUnit2; + + @ApiModelProperty("计费单位2英文") + private String billingUnitEn2; + + @ApiModelProperty("计费单位中文默认") + private String billingUnitDefaultCn; + + @ApiModelProperty("计费单位英文默认") + private String billingUnitDefaultEn; + + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; + + /** 查询参数:是否按仓储合同结算设置拉取科目 */ + private Boolean contractSettlementQuery; + + /** 查询参数:结算主体编码(货主编码等) */ + private String settlementCustomersCode; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 4146f856c..267d6da50 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -389,4 +389,13 @@ public class MaterialBaseInfo extends BaseVOEntity{ @ApiModelProperty("是否抄码: 1-是 2-否") @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index 9535baa31..28b99e2f6 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -365,6 +365,14 @@ public class MaterialBaseInfoPO extends BaseVOEntity{ @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + @ApiModelProperty("商品规则") private MaterialGoodsRuleFeign materialGoodsRule; diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java index 2f4012adf..a71a79e8e 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java @@ -385,4 +385,12 @@ public class MaterialBaseInfoDO extends BaseVOEntity{ @ApiModelProperty("是否抄码: 1-是 2-否") @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/expenseAccount/ExpenseAccountDTO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/expenseAccount/ExpenseAccountDTO.java index c6fbe3362..11ba9b86f 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/expenseAccount/ExpenseAccountDTO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/expenseAccount/ExpenseAccountDTO.java @@ -138,4 +138,35 @@ public class ExpenseAccountDTO extends BaseVOEntity{ @ApiModelProperty(name = "出库单是否固定显示 0-否 1-是") private Integer outOrderDisplay; + + + @ApiModelProperty("计费单位") + private String billingUnit; + + @ApiModelProperty("计费单位英文") + private String billingUnitEn; + + @ApiModelProperty("计费单位2") + private String billingUnit2; + + @ApiModelProperty("计费单位2英文") + private String billingUnitEn2; + + @ApiModelProperty("计费单位中文默认") + private String billingUnitDefaultCn; + + @ApiModelProperty("计费单位英文默认") + private String billingUnitDefaultEn; + + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; + + /** + * 为 true 时从仓储合同「结算设置」取费用科目(入库/出库费用登记等) + */ + @ApiModelProperty("是否按合同结算设置查询费用科目(入库/出库费用登记;为 true 时可传 inOrderDisplay=1 或 outOrderDisplay=1 再按主数据入库/出库显示过滤)") + private Boolean contractSettlementQuery; + + @ApiModelProperty("结算主体编码(通常为货主编码);不传则按通用仓储合同的结算设置取科目") + private String settlementCustomersCode; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java index f6a8e5e61..7704c15c9 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java @@ -364,4 +364,13 @@ public class MaterialBaseInfoDTO extends BaseVOEntity{ @ApiModelProperty("是否抄码: 1-是 2-否") @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/contractManage/ContractManageApi.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/contractManage/ContractManageApi.java index 2dd6e4bd1..1e2039f0e 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/contractManage/ContractManageApi.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/contractManage/ContractManageApi.java @@ -70,6 +70,19 @@ public class ContractManageApi extends BaseController{ return AjaxResult.success(contractManageApplicationService.getSubject(subjectAndPriceDTO)); } + /** + * 获取单价 + */ + @ApiOperation("获取单价") + @GetMapping(value = "/getPrice") + public AjaxResult getPrice(@RequestParam("documentTypeCode") String documentTypeCode, + @RequestParam("settlementCustomersCode") String settlementCustomersCode, + @RequestParam("organizationId") Long organizationId, + @RequestParam("topOrganizationId") Long topOrganizationId) + { + return AjaxResult.success(contractManageApplicationService.getPrice(documentTypeCode,settlementCustomersCode,organizationId,topOrganizationId)); + } + /** * 获取科目和单价 */ @@ -154,6 +167,13 @@ public class ContractManageApi extends BaseController{ return AjaxResult.success(contractManageApplicationService.getInfoByCustomer(settlementCustomersCode,contractType,topOrganizationId)); } + @ApiOperation("根据结算主体获取合同信息") + @GetMapping(value = "/getInfoByCustomerAndOrganizationId") + public AjaxResult getInfoByCustomerAndOrganizationId(@RequestParam("settlementCustomersCode") String settlementCustomersCode,@RequestParam("contractType") Integer contractType,@RequestParam("topOrganizationId") Long topOrganizationId,@RequestParam("organizationId") Long organizationId) + { + return AjaxResult.success(contractManageApplicationService.getInfoByCustomerAndOrganizationId(settlementCustomersCode,contractType,topOrganizationId,organizationId)); + } + @ApiOperation("根据合同编码获取合同管理") @GetMapping(value = "/getInfoByCode") public AjaxResult getInfoByCode(@RequestParam(value = "contractNumber",required = true) String contractNumber) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java index 5c39ccc49..dfdec8e29 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facade/expenseAccount/ExpenseAccountApi.java @@ -50,6 +50,11 @@ public class ExpenseAccountApi extends BaseController{ /** * 分页查询费用科目列表 + * + *

入库/出库费用登记等场景传 {@code contractSettlementQuery=true}(与单据类型「仓库进出仓单」合同结算行一致), + * 科目来源、结算主体为空走通用合同等逻辑入库与出库相同。 + * 先按合同结算行取科目,再关联主数据;若请求中传入 {@code inOrderDisplay} 或 {@code outOrderDisplay}(0-否 1-是), + * 则再按主数据「入库单 / 出库单是否固定显示」与入参相等过滤(二者都传则同时满足)。不传则不在此维度过滤。

*/ @ApiOperation("查询费用科目列表") @GetMapping("/list") @@ -62,6 +67,18 @@ public class ExpenseAccountApi extends BaseController{ expenseAccountDTO = new ExpenseAccountDTO(); logger.info("expenseAccountDTO 为 null,创建新对象"); } + if (Boolean.TRUE.equals(expenseAccountDTO.getContractSettlementQuery())) { + ExpenseAccountDO contractQueryDO = new ExpenseAccountDO(); + BeanUtils.copyProperties(expenseAccountDTO, contractQueryDO); + logger.info("按合同结算设置查询费用科目,settlementCustomersCode={},inOrderDisplay={},outOrderDisplay={}", + expenseAccountDTO.getSettlementCustomersCode(), + expenseAccountDTO.getInOrderDisplay(), expenseAccountDTO.getOutOrderDisplay()); + List contractList = + expenseAccountApplicationService.queryListFromContractWarehouseInOutSettlement( + contractQueryDO, expenseAccountDTO.getSettlementCustomersCode()); + logger.info("按合同结算设置查询完成,条数:{}", contractList != null ? contractList.size() : 0); + return getDataTable(contractList != null ? contractList : new ArrayList<>()); + } ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO(); BeanUtils.copyProperties(expenseAccountDTO, expenseAccountDO); logger.info("转换后的 ExpenseAccountDO:{}", expenseAccountDO); diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java index 4286d6293..bd6a1d37b 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java @@ -5,6 +5,9 @@ import com.mhd.basic.interfaces.vo.MaterialStockInfoVo; import java.util.List; import java.util.stream.Collectors; +import com.mhd.system.api.OmsServiceFeign; +import com.mhd.system.api.domain.ErpCountryDTO; +import com.mhd.system.api.domain.ErpEnterpriseUnitDTO; import com.mhd.system.api.domain.MaterialBarCodeFeign; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -41,6 +44,9 @@ public class MaterialBaseInfoApi extends BaseController{ @Resource private MaterialBaseInfoAssembler materialBaseInfoAssembler; + @Resource + private OmsServiceFeign omsServiceFeign; + /** * 分页查询物料基础信息列表 */ @@ -108,4 +114,16 @@ public class MaterialBaseInfoApi extends BaseController{ return R.ok(materialBaseInfoApplicationService.getMaterialStockList(shipperName,materialName,machineCode,pageNum,pageSize)); } + + @ApiOperation("获取企业单位列表-申报单位下拉框用") + @GetMapping("/getDeclarationUnitList") + public AjaxResult getDeclarationUnitList(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) { + return omsServiceFeign.getUnitList(erpEnterpriseUnitDTO); + } + + @ApiOperation("获取企业国别列表-原产国下拉框用") + @GetMapping("/getCountryList") + public AjaxResult getCountryList(ErpCountryDTO erpCountryDTO) { + return omsServiceFeign.getCountryList(erpCountryDTO); + } } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java index 1866d8a12..e9d4c29c6 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/controller/SysDictTypeController.java @@ -15,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.mhd.common.core.constant.UserConstants; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.utils.StringUtils; import com.mhd.common.core.utils.poi.ExcelUtil; import com.mhd.common.core.web.controller.BaseController; import com.mhd.common.core.web.domain.AjaxResult; @@ -23,6 +25,7 @@ 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.SysDictType; +import com.mhd.system.api.model.LoginUser; /** * 数据字典信息 @@ -73,14 +76,56 @@ public class SysDictTypeController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysDictType dict) { + fillDictTypeOrganization(dict); if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { - return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); + return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)"); } dict.setCreateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.insertDictType(dict)); } + /** + * 写入组织维度:优先使用请求体中选择的组织;未传时使用当前登录用户所属组织;无登录上下文时按平台(0)处理。 + */ + private void fillDictTypeOrganization(SysDictType dict) + { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser == null || loginUser.getUserPo() == null) + { + if (dict.getOrganizationId() == null) + { + dict.setOrganizationId(0L); + } + return; + } + UserPo userPo = loginUser.getUserPo(); + if (dict.getOrganizationId() == null) + { + dict.setOrganizationId(userPo.getOrganizationId()); + if (StringUtils.isEmpty(dict.getOrganizationName())) + { + dict.setOrganizationName(userPo.getOrganizationName()); + } + if (dict.getTopOrganizationId() == null) + { + dict.setTopOrganizationId(userPo.getTopOrganizationId()); + } + } + else + { + if (dict.getTopOrganizationId() == null) + { + dict.setTopOrganizationId(userPo.getTopOrganizationId()); + } + if (StringUtils.isEmpty(dict.getOrganizationName()) + && java.util.Objects.equals(dict.getOrganizationId(), userPo.getOrganizationId())) + { + dict.setOrganizationName(userPo.getOrganizationName()); + } + } + } + /** * 修改字典类型 */ @@ -89,9 +134,10 @@ public class SysDictTypeController extends BaseController @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictType dict) { + fillDictTypeOrganization(dict); if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { - return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); + return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)"); } dict.setUpdateBy(SecurityUtils.getUsername()); return toAjax(dictTypeService.updateDictType(dict)); diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictDataMapper.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictDataMapper.java index b91b23a2a..e7c16554a 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictDataMapper.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictDataMapper.java @@ -98,4 +98,12 @@ public interface SysDictDataMapper extends BaseMapper * @return 结果 */ public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); + + /** + * 按字典类型批量同步字典数据的组织信息(与字典类型归属一致) + */ + int updateDictDataOrganizationByDictType(@Param("dictType") String dictType, + @Param("organizationId") Long organizationId, + @Param("organizationName") String organizationName, + @Param("topOrganizationId") Long topOrganizationId); } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictTypeMapper.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictTypeMapper.java index 9984a5605..bd6d92ead 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictTypeMapper.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/mapper/SysDictTypeMapper.java @@ -79,5 +79,5 @@ public interface SysDictTypeMapper * @param dictType 字典类型 * @return 结果 */ - public SysDictType checkDictTypeUnique(String dictType); + public SysDictType checkDictTypeUnique(SysDictType dictType); } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictDataServiceImpl.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictDataServiceImpl.java index f10053b47..e2ec28888 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictDataServiceImpl.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictDataServiceImpl.java @@ -4,17 +4,24 @@ import java.util.ArrayList; import java.util.List; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.basic.infrastructure.feign.ProductServiceFeign; import com.mhd.basic.infrastructure.util.annotation.DataPermissions; +import com.mhd.common.core.domain.po.OrganizationPo; import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; import com.mhd.common.core.exception.digitalLogisticsException.UserError; +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.system.api.domain.SysDictType; import com.mhd.system.api.model.LoginUser; import com.mhd.system.domain.vo.SysBankDictInfo; import com.mhd.system.domain.vo.SysDictDataVO; import com.mhd.system.mapper.SysDictDataMapper; import com.mhd.system.service.ISysDictDataService; +import com.mhd.system.service.ISysDictTypeService; import org.springframework.stereotype.Service; import com.mhd.common.security.utils.DictUtils; import com.mhd.system.api.domain.SysDictData; @@ -33,6 +40,12 @@ public class SysDictDataServiceImpl extends ServiceImpl 0) @@ -179,14 +203,29 @@ public class SysDictDataServiceImpl extends ServiceImpl 0) { + String dictTypeForCache = StringUtils.isNotEmpty(data.getDictType()) ? data.getDictType() : sysDictData.getDictType(); SysDictData dictData = new SysDictData(); - dictData.setDictType(data.getDictType()); + dictData.setDictType(dictTypeForCache); List dictDatas = dictDataMapper.selectDictDataByType(dictData); - DictUtils.setDictCache(data.getDictType(), dictDatas); + DictUtils.setDictCache(dictTypeForCache, dictDatas); } return row; } @@ -386,6 +425,69 @@ public class SysDictDataServiceImpl extends ServiceImpl selectDictList(SysDictData sysDictData) { return dictDataMapper.selectDictDataList(sysDictData); diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java index 5d3d4ffac..f9f6f237c 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/system/service/impl/SysDictTypeServiceImpl.java @@ -3,9 +3,14 @@ package com.mhd.system.service.impl; import java.util.Comparator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import javax.annotation.PostConstruct; +import com.alibaba.fastjson.JSONObject; +import com.mhd.basic.infrastructure.feign.ProductServiceFeign; +import com.mhd.common.core.domain.po.OrganizationPo; +import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.system.mapper.SysDictDataMapper; import com.mhd.system.mapper.SysDictTypeMapper; import com.mhd.system.service.ISysDictTypeService; @@ -16,8 +21,10 @@ import com.mhd.common.core.constant.UserConstants; import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.utils.StringUtils; import com.mhd.common.security.utils.DictUtils; +import com.mhd.common.security.utils.SecurityUtils; import com.mhd.system.api.domain.SysDictData; import com.mhd.system.api.domain.SysDictType; +import com.mhd.system.api.model.LoginUser; /** * 字典 业务层处理 @@ -33,6 +40,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService @Autowired private SysDictDataMapper dictDataMapper; + @Autowired + private ProductServiceFeign productServiceFeign; + /** * 项目启动时,初始化字典到缓存 */ @@ -177,6 +187,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService @Override public int insertDictType(SysDictType dict) { + fillOrganizationNameFromProductCenter(dict); + if (dict.getOrganizationId() != null && StringUtils.isEmpty(dict.getOrganizationName())) + { + dict.setOrganizationName(""); + } int row = dictTypeMapper.insertDictType(dict); if (row > 0) { @@ -196,10 +211,16 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService public int updateDictType(SysDictType dict) { SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); + mergeDictTypeOrganizationNameForUpdate(dict, oldDict); dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); int row = dictTypeMapper.updateDictType(dict); if (row > 0) { + if (dictDataMapper.countDictDataByType(dict.getDictType()) > 0) + { + dictDataMapper.updateDictDataOrganizationByDictType(dict.getDictType(), + dict.getOrganizationId(), dict.getOrganizationName(), dict.getTopOrganizationId()); + } SysDictData dictData = new SysDictData(); dictData.setDictType(dict.getDictType()); List dictDatas = dictDataMapper.selectDictDataByType(dictData); @@ -218,11 +239,76 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService public String checkDictTypeUnique(SysDictType dict) { Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); - SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); + SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict); if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; } + + /** + * 修改字典类型时,请求体常不带 organizationName;若与库中或当前登录用户组织一致则补全,避免 UPDATE 把名称写成 null。 + */ + private void mergeDictTypeOrganizationNameForUpdate(SysDictType dict, SysDictType oldDict) + { + if (dict == null || oldDict == null || StringUtils.isNotEmpty(dict.getOrganizationName())) + { + return; + } + if (dict.getOrganizationId() == null) + { + return; + } + if (Objects.equals(dict.getOrganizationId(), oldDict.getOrganizationId()) + && StringUtils.isNotEmpty(oldDict.getOrganizationName())) + { + dict.setOrganizationName(oldDict.getOrganizationName()); + return; + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null && loginUser.getUserPo() != null + && Objects.equals(dict.getOrganizationId(), loginUser.getUserPo().getOrganizationId()) + && StringUtils.isNotEmpty(loginUser.getUserPo().getOrganizationName())) + { + dict.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + } + fillOrganizationNameFromProductCenter(dict); + if (dict.getOrganizationId() != null && StringUtils.isEmpty(dict.getOrganizationName())) + { + dict.setOrganizationName(""); + } + } + + /** + * 已存在 organizationId 但名称为空时,从产品中心按组织 id 补全名称(与 BasicAgreement 等模块一致)。 + */ + private void fillOrganizationNameFromProductCenter(SysDictType dict) + { + if (dict == null || dict.getOrganizationId() == null || StringUtils.isNotEmpty(dict.getOrganizationName())) + { + return; + } + Long oid = dict.getOrganizationId(); + if (oid == 0L) + { + return; + } + try + { + AjaxResult res = productServiceFeign.getOrganizationInfo(oid); + if (res != null && "200".equals(String.valueOf(res.get("code"))) && res.get("data") != null) + { + OrganizationPo po = JSONObject.parseObject(JSONObject.toJSONString(res.get("data")), OrganizationPo.class); + if (po != null && StringUtils.isNotEmpty(po.getOrganizationName())) + { + dict.setOrganizationName(po.getOrganizationName()); + } + } + } + catch (Exception ignored) + { + // 远程不可用时保持后续逻辑(如置空字符串以便 UPDATE 写入列) + } + } } diff --git a/mhd-modules/mhd-system/src/main/resources/mapper/basic/ExpenseAccountMapper.xml b/mhd-modules/mhd-system/src/main/resources/mapper/basic/ExpenseAccountMapper.xml index 2cb7e8fc9..b90857cba 100644 --- a/mhd-modules/mhd-system/src/main/resources/mapper/basic/ExpenseAccountMapper.xml +++ b/mhd-modules/mhd-system/src/main/resources/mapper/basic/ExpenseAccountMapper.xml @@ -107,12 +107,12 @@ - - where dict_type = #{dictType} limit 1 + where dict_type = #{dictType} + limit 1 @@ -78,6 +90,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dict_type = #{dictType}, status = #{status}, remark = #{remark}, + organization_id = #{organizationId}, + organization_name = #{organizationName}, + top_organization_id = #{topOrganizationId}, update_by = #{updateBy}, update_time = sysdate() @@ -90,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dict_type, status, remark, + organization_id, + organization_name, + top_organization_id, create_by, create_time )values( @@ -97,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{dictType}, #{status}, #{remark}, + #{organizationId}, + #{organizationName}, + #{topOrganizationId}, #{createBy}, sysdate() ) diff --git a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java index 94c6cec03..87e3aaac0 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java +++ b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserShipperApplicationService.java @@ -33,6 +33,7 @@ import com.mhd.common.core.domain.po.RolePO; import com.mhd.user.domain.userAggregate.entity.UserRoleEntity; import com.mhd.user.domain.userAggregate.entity.UserShipperEntity; import com.mhd.user.domain.userAggregate.event.ShipperEventPublisher; +import com.mhd.user.domain.userAggregate.repository.mapper.UserShipperMapper; import com.mhd.user.domain.userAggregate.repository.po.UserDriverPo; import com.mhd.user.domain.userAggregate.repository.todo.*; import com.mhd.user.domain.userAggregate.service.*; @@ -112,6 +113,9 @@ public class UserShipperApplicationService { @Resource private WlhyServiceFeign wlhyServiceFeign; + @Resource + private UserShipperMapper userShipperMapper; + /** * @Description 查询托运人列表 * @Author Alex @@ -1209,5 +1213,23 @@ public class UserShipperApplicationService { } } - + /** + * 推送状态更新 + * @param shipperId + * @param pushStatus + * @param pushTime + * @param pushBy + * @return + */ + public int updatePushStatus(Long shipperId, Integer pushStatus, String pushTime, Long pushBy,String pushByName) { + UserShipperEntity userShipper = new UserShipperEntity(); + userShipper.setShipperId(shipperId); + userShipper.setPushStatus(pushStatus); + if (pushTime != null && !"".equals(pushTime)) { + userShipper.setPushTime(DateUtil.parse(pushTime)); + } + userShipper.setPushBy(pushBy); + userShipper.setPushByName(pushByName); + return userShipperMapper.updatePushStatus(userShipper); + } } \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java index c3e4a8879..9dc934f64 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/entity/UserShipperEntity.java @@ -263,4 +263,16 @@ public class UserShipperEntity extends BaseVOEntity { @ApiModelProperty(name = "组织名称") private String organizationName; + + @ApiModelProperty(name = "推送状态 1-未推送 2-推送中 3-推送成功 4-推送失败") + private Integer pushStatus; + @ApiModelProperty(name = "推送时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date pushTime; + @ApiModelProperty(name = "推送人") + private Long pushBy; + @ApiModelProperty(name = "推送人姓名") + private String pushByName; + } diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserShipperMapper.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserShipperMapper.java index 96f7cb79c..3631288cb 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserShipperMapper.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserShipperMapper.java @@ -7,6 +7,7 @@ import com.mhd.user.domain.userAggregate.repository.todo.UserShipperDO; import com.mhd.user.domain.userAggregate.repository.po.UserShipperPo; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; public interface UserShipperMapper extends BaseMapper { @@ -28,4 +29,11 @@ public interface UserShipperMapper extends BaseMapper { List selectBySealId(@Param("userShipperEntity") UserShipperEntity userShipperEntity); public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId); + + /** + * + * @param userShipper + * @return + */ + int updatePushStatus(UserShipperEntity userShipper); } \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java index 7b3cd24b4..f02467097 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/po/UserShipperPo.java @@ -321,4 +321,18 @@ public class UserShipperPo implements Serializable { @ApiModelProperty(name = "备注") private String userRemarkShipper; + + @ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @ApiModelProperty(value = "推送时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTime; + + @ApiModelProperty(value = "推送人ID") + private Long pushBy; + + @ApiModelProperty(value = "推送人姓名") + private String pushByName; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserShipperDO.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserShipperDO.java index d58dc3547..d779cab3e 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserShipperDO.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserShipperDO.java @@ -288,4 +288,25 @@ public class UserShipperDO extends UserDO { @ApiModelProperty(name = "备注") private String userRemark; + + @ApiModelProperty("创建时间起") + private Date createTimeFrom; + + @ApiModelProperty("创建时间止") + private Date createTimeTo; + + @ApiModelProperty("更新时间起") + private String updateTimeFrom; + + @ApiModelProperty("更新时间止") + private String updateTimeTo; + + @ApiModelProperty("推送状态") + private Integer pushStatus; + + @ApiModelProperty("推送时间起") + private String pushTimeFrom; + + @ApiModelProperty("推送时间止") + private String pushTimeTo; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserShipperDTO.java b/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserShipperDTO.java index 27944fa50..f79f793d0 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserShipperDTO.java +++ b/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserShipperDTO.java @@ -235,4 +235,19 @@ public class UserShipperDTO extends UserDTO { private String taxNumber; + + @ApiModelProperty(value = "更新时间起") + private String updateTimeFrom; + + @ApiModelProperty(value = "更新时间止") + private String updateTimeTo; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + + @ApiModelProperty(value = "推送状态") + private Integer pushStatus; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java b/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java index 863b63d10..d354f95aa 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java +++ b/mhd-user-center/src/main/java/com/mhd/user/interfaces/facade/UserShipperAPI.java @@ -20,9 +20,11 @@ import com.mhd.user.interfaces.vo.SettlementInfoQueryVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Date; import java.util.List; @Api(tags = "用户中台管理-托运人管理") @@ -235,4 +237,21 @@ public class UserShipperAPI extends BaseController { } } + @ApiOperation("商业合作伙伴-更新推送状态") + @PostMapping("/updatePushStatus") + public AjaxResult updatePushStatus(@RequestParam("shipperId") Long shipperId, + @RequestParam("pushStatus") Integer pushStatus, + @RequestParam(value = "pushTime", required = false) String pushTime, + @RequestParam(value = "pushBy", required = false) Long pushBy, + @RequestParam(value = "pushByName", required = false) String pushByName){ + + try{ + int result = userShipperApplicationService.updatePushStatus(shipperId,pushStatus,pushTime,pushBy,pushByName); + return result > 0 ? AjaxResult.success() : AjaxResult.error("更新失败"); + }catch (Exception e){ + log.error("更新推送状态异常: shipperId = {} , error = ", e.getMessage()); + return AjaxResult.error("更新推送状态异常:" + e.getMessage()); + } + } + } diff --git a/mhd-user-center/src/main/resources/bootstrap.yml b/mhd-user-center/src/main/resources/bootstrap.yml index ca12007b7..90cf188c9 100644 --- a/mhd-user-center/src/main/resources/bootstrap.yml +++ b/mhd-user-center/src/main/resources/bootstrap.yml @@ -20,17 +20,17 @@ spring: discovery: # server-addr: 127.0.0.1:8848 # 线上测试环境配置 容器名+端口号 -# server-addr: 10.33.0.129:6010 - server-addr: 10.102.192.5:6848 - username: nacos - password: manhuoda@2023 + server-addr: 10.33.0.129:6010 +# server-addr: 10.102.192.5: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.5:6848 - username: nacos - password: manhuoda@2023 + server-addr: 10.33.0.129:6010 +# server-addr: 10.102.192.5:6848 +# username: nacos +# password: manhuoda@2023 group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置 file-extension: yml #默认properties # 共享配置 diff --git a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml index 7a1343681..d4b0edc7a 100644 --- a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml +++ b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml @@ -161,7 +161,11 @@ b.invoice_title, b.tax_number, b.user_email, - b.user_remark as userRemarkShipper + b.user_remark as userRemarkShipper, + b.push_status, + b.push_time, + b.push_by, + b.push_by_name 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, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName @@ -312,6 +316,24 @@ and DATE_FORMAT(a.create_time,'%Y-%m-%d') DATE_FORMAT(#{createTimeTo},'%Y-%m-%d') + /*更新时间*/ + + and DATE_FORMAT(a.update_time,'%Y-%m-%d') >= #{updateTimeFrom} + + + and DATE_FORMAT(a.update_time,'%Y-%m-%d') <= #{updateTimeTo} + + /*推送状态*/ + + and b.push_status = #{pushStatus} + + /*推送时间*/ + + and DATE_FORMAT(b.push_time,'%Y-%m-%d') >= #{pushTimeFrom} + + + and DATE_FORMAT(b.push_time,'%Y-%m-%d') <= #{pushTimeTo} + /*审核时间*/ and DATE_FORMAT(b.shipper_fill_time,'%Y-%m-%d') =]]> @@ -401,4 +423,17 @@ and esign_enterprise_status = #{userShipperEntity.esignEnterpriseStatus} + + + UPDATE user_shipper + + push_status = #{pushStatus}, + push_time = #{pushTime}, + push_by = #{pushBy}, + push_by_name = #{pushByName}, + + WHERE shipper_id = #{shipperId} + + + \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java index 7e907c2d6..c3492d48a 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java @@ -92,6 +92,7 @@ public class CostCalculationApplicationService { //第二步 根据计费策略公式进行替换,并根据配置的公式计算结果 BigDecimal computationalCost = computational(billingRulesPO,costCalculationDTO,taskFlowRecordsDO); result.setComputationalCost(computationalCost); + result.setBillingRulesPO(billingRulesPO); //第三步 产生计费任务记录 taskFlowRecordsDO.setBillingResults(computationalCost.toString()); diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java index 7b7014500..ce684c175 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java @@ -7,11 +7,14 @@ 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.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; 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; +import com.mhd.bms.domain.costCalculation.entity.BillingParamsEntity; import com.mhd.bms.domain.costCalculation.po.BillingCostPo; import com.mhd.bms.domain.documentType.entity.DocumentFromEntity; import com.mhd.bms.domain.documentType.entity.DocumentType; @@ -173,10 +176,52 @@ public class BusinessDocumentApplicationService { costCalculationDTO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost()); + BillingRulesPO billingRulesPO = billingCostPo.getBillingRulesPO(); + List 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 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)); + } + } + } // businessDocumentDO.setEstimatedCost(new BigDecimal("100")); return businessDocumentDomainService.insert(businessDocumentDO); } + /** + * 从 JSONObject 安全获取 BigDecimal,支持: + * 数字、整数字符串、小数字符串、null、空字符串 + */ + private BigDecimal getSafeBigDecimal(JSONObject paramObj, String fields) { + Object obj = paramObj.get(fields); + + if (obj == null) { + return BigDecimal.ZERO; // 空值默认返回0,避免空指针 + } + + try { + // 统一转字符串再转 BigDecimal,最安全 + return new BigDecimal(obj.toString().trim()); + } catch (Exception e) { + // 无法解析的非法值,默认返回0 + return BigDecimal.ZERO; + } + } + /** * 新增业务单据 @@ -390,12 +435,39 @@ public class BusinessDocumentApplicationService { businessDocumentDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); businessDocumentDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); businessDocumentDO.setSecondSubjectCode(""); + String billingUnitDefaultCn = expenseAccountPO.getBillingUnitDefaultCn(); + String billingUnitDefaultEn = expenseAccountPO.getBillingUnitDefaultEn(); + if ("1".equals(billingUnitDefaultCn)) { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnit()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnit2()); + } else if ("1".equals(billingUnitDefaultEn)) { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnitEn()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnitEn2()); + } else { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnit()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnit2()); + } + + businessDocumentDO.setNcSubjectCode(expenseAccountPO.getNcSubjectCode()); }else { //不是一级科目 businessDocumentDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); businessDocumentDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); businessDocumentDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); businessDocumentDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + String billingUnitDefaultCn = expenseAccountPO.getBillingUnitDefaultCn(); + String billingUnitDefaultEn = expenseAccountPO.getBillingUnitDefaultEn(); + if ("1".equals(billingUnitDefaultCn)) { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnit()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnit2()); + } else if ("1".equals(billingUnitDefaultEn)) { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnitEn()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnitEn2()); + } else { + businessDocumentDO.setBillingUnit(expenseAccountPO.getBillingUnit()); + businessDocumentDO.setBillingUnit2(expenseAccountPO.getBillingUnit2()); + } + businessDocumentDO.setNcSubjectCode(expenseAccountPO.getNcSubjectCode()); } //判断如果前端没有传费用类别,则此处根据费用科目获取关联费用类别 if(StringUtils.isEmpty(businessDocumentDO.getServiceItemsCode())){ @@ -412,7 +484,7 @@ public class BusinessDocumentApplicationService { if(businessDocumentDO.getBelongModuleCode().equals(BelongModuleCode.WMS.getCode())){ contractType = 1; } - AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomer2(businessDocumentDO.getSettlementCustomersCode(),contractType,businessDocumentDO.getTopOrganizationId()); + AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomerAndOrganizationId(businessDocumentDO.getSettlementCustomersCode(),contractType,businessDocumentDO.getTopOrganizationId(),businessDocumentDO.getOrganizationId()); if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { throw new ServiceException("合同信息未找到"); } @@ -1026,18 +1098,40 @@ public class BusinessDocumentApplicationService { businessDocumentDO.setOrganizationName(businessDocumentDO.getOrganizationName()); businessDocumentDO.setOriginalBusinessNum(businessDocumentDO.getOriginalBusinessNum()); //调用费用计算,计算费用金额进行保存 -// 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(businessDocumentDO.getTopOrganizationId()); -// costCalculationDTO.setOrganizationId(businessDocumentDO.getOrganizationId()); -// costCalculationDTO.setOrganizationName(businessDocumentDO.getOrganizationName()); -// BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); -// businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost()); -// businessDocumentDO.setBillAmount(billingCostPo.getComputationalCost());//计费金额与计算金额一致 + 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(businessDocumentDO.getTopOrganizationId()); + costCalculationDTO.setOrganizationId(businessDocumentDO.getOrganizationId()); + costCalculationDTO.setOrganizationName(businessDocumentDO.getOrganizationName()); + BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); + + BillingRulesPO billingRulesPO = billingCostPo.getBillingRulesPO(); + List 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 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)); + } + } + } + log.info("定时任务进入BMS业务单据保存--结束"); BusinessDocument businessDocument = businessDocumentDomainService.insertRetrun(businessDocumentDO); BusinessDocumentDTO businessDocumentDTO = new BusinessDocumentDTO(); diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java index a2b77b5f7..f0f3c4f7a 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java @@ -21,6 +21,8 @@ public interface BillManageMapper extends BaseMapper String getInvoiceItemName(@Param("invoiceItemId") String invoiceItemId); + String getInvoiceItemNcCode(@Param("invoiceItemId") String invoiceItemId); + String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId); String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId); diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java index d08e95350..486aab1ae 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java @@ -240,11 +240,14 @@ public class BillManageImpl extends ServiceImpl im item.setDirection("1"); String invoiceItem = item1.getInvoiceItem(); List names = new ArrayList<>(); + List nccodes = new ArrayList<>(); if (invoiceItem != null && !invoiceItem.isEmpty()) { String[] items = invoiceItem.split(","); for (String s : items) { String invoiceItemName1 = billManageMapper.getInvoiceItemName(s); + String invoiceItemNcCode1 = billManageMapper.getInvoiceItemNcCode(s); names.add(invoiceItemName1); + nccodes.add(invoiceItemNcCode1); } } String invoiceItemName = String.join(",", names); @@ -282,6 +285,9 @@ public class BillManageImpl extends ServiceImpl im item.setDef29(split[0]); //item.setDef29(invoiceItem1); } + if (nccodes != null && !nccodes.isEmpty()&&nccodes.size()>0) { + item.setDef29(nccodes.get(0)); + } item.setTaxcodeid("ZL01"); item.setInvoiceno(invoiceNumber); ysitemList.add(item); diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java index 3be326aac..e0978f0dd 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java @@ -1,6 +1,7 @@ package com.mhd.bms.domain.billingStatement.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.mhd.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; @@ -210,4 +211,15 @@ public class BillingStatement extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java index f77d82eda..2a6ec910a 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java @@ -221,4 +221,15 @@ public class BillingStatementPO extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java index bdc1ee675..438a1e6ac 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java @@ -239,4 +239,15 @@ public class BillingStatementDO extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java index 5eb6a0dbf..c1b895398 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java @@ -1,6 +1,7 @@ package com.mhd.bms.domain.businessDocument.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.mhd.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; @@ -182,4 +183,15 @@ public class BusinessDocument extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("计费数量") + private BigDecimal billingNum; + @ApiModelProperty("计费单价") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java index 6b27d16ee..fb85c302b 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java @@ -187,4 +187,15 @@ public class BusinessDocumentPO extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java index a8cffd45b..129e88965 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java @@ -207,4 +207,15 @@ public class BusinessDocumentDO extends BaseVOEntity{ private String paymentAccountId; @ApiModelProperty("收款帐户名称") private String paymentAccountName; + + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java index 2922a4c04..6e747cf1c 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java @@ -35,4 +35,10 @@ public class BillingParamsEntity { @ApiModelProperty("排序") private Integer sort; -} + private String isPush; + + private String isFee; + + private String isShow; + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java index 145c9faa3..ab7d2957e 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java @@ -1,5 +1,6 @@ package com.mhd.bms.domain.costCalculation.po; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -30,5 +31,7 @@ public class BillingCostPo { @ApiModelProperty("预计金额") private BigDecimal computationalCost; + private BillingRulesPO billingRulesPO; -} + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java index ede94cf81..4950e5455 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java @@ -93,4 +93,7 @@ public class SettlementCustomersPO extends BaseVOEntity{ @ApiModelProperty(name = "nc编码") private String ncCode; + @ApiModelProperty(name = "结算币种") + private String settlementCurrency; + } \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java index e1d138975..aaace0e1a 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java @@ -102,4 +102,41 @@ public class ExpenseAccountPO extends BaseVOEntity{ @ApiModelProperty("服务项税率") @Excel(name = "服务项税率") private BigDecimal taxRate; -} + + + + @ApiModelProperty("费率") + private BigDecimal rate; + + @ApiModelProperty(name = "创建订单是否固定显示 0-否 1-是") + private Integer fixedOrderDisplay; + + + @ApiModelProperty(name = "入库单是否固定显示 0-否 1-是") + private Integer inOrderDisplay; + + @ApiModelProperty(name = "出库单是否固定显示 0-否 1-是") + private Integer outOrderDisplay; + + + @ApiModelProperty("计费单位") + private String billingUnit; + + @ApiModelProperty("计费单位英文") + private String billingUnitEn; + + @ApiModelProperty("计费单位2") + private String billingUnit2; + + @ApiModelProperty("计费单位2英文") + private String billingUnitEn2; + + @ApiModelProperty("计费单位中文默认") + private String billingUnitDefaultCn; + + @ApiModelProperty("计费单位英文默认") + private String billingUnitDefaultEn; + + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java index 1fc8a6da9..a87587d0b 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java @@ -250,4 +250,15 @@ public class BillingStatementDTO extends BaseVOEntity{ private String paymentAccountName; private List billingStatementList; + @ApiModelProperty("计费单位") + private String billingUnit; + @ApiModelProperty("计费单位2") + private String billingUnit2; + @ApiModelProperty("预计费金额") + private BigDecimal billingNum; + @ApiModelProperty("预计费金额") + private BigDecimal billingUnitPrice; + @ApiModelProperty("nc科目编码") + private String ncSubjectCode; + } \ No newline at end of file diff --git a/mhd_bms/src/main/resources/mapper/BillManageMapper.xml b/mhd_bms/src/main/resources/mapper/BillManageMapper.xml index 43b20f2b6..951903728 100644 --- a/mhd_bms/src/main/resources/mapper/BillManageMapper.xml +++ b/mhd_bms/src/main/resources/mapper/BillManageMapper.xml @@ -110,6 +110,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select SUBJECT_NAME from "NGWL_TEST_SYSTEM".EXPENSE_ACCOUNT where status = 1 and SUBJECT_CODE = #{invoiceItemId} limit 1 + + diff --git a/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml index 88197191b..01a8a0035 100644 --- a/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml +++ b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml @@ -31,6 +31,7 @@ + @@ -90,9 +91,9 @@ @@ -106,40 +107,40 @@ - and settlement_entity like concat('%', #{settlementCustomersDO.settlementEntity}, '%') + and a.settlement_entity like concat('%', #{settlementCustomersDO.settlementEntity}, '%') - and settlement_customers_code like concat('%', #{settlementCustomersDO.settlementCustomersCode}, '%') + and a.settlement_customers_code like concat('%', #{settlementCustomersDO.settlementCustomersCode}, '%') - and settlement_method like concat('%', #{settlementCustomersDO.settlementMethod}, '%') + and a.settlement_method like concat('%', #{settlementCustomersDO.settlementMethod}, '%') - and remark like concat('%', #{settlementCustomersDO.remark}, '%') + and a.remark like concat('%', #{settlementCustomersDO.remark}, '%') - AND date_format(create_time,'%Y-%m-%d') =]]> #{settlementCustomersDO.createTimeStart} + AND date_format(a.create_time,'%Y-%m-%d') =]]> #{settlementCustomersDO.createTimeStart} - AND date_format(create_time,'%Y-%m-%d') #{settlementCustomersDO.createTimeEnd} + AND date_format(a.create_time,'%Y-%m-%d') #{settlementCustomersDO.createTimeEnd} - and create_by_name like concat('%', #{settlementCustomersDO.createByName}, '%') + and a.create_by_name like concat('%', #{settlementCustomersDO.createByName}, '%') - and main_role = #{settlementCustomersDO.mainRole} + and a.main_role = #{settlementCustomersDO.mainRole} - and organization_id = #{settlementCustomersDO.organizationId} + and a.organization_id = #{settlementCustomersDO.organizationId} - and top_organization_id = #{settlementCustomersDO.topOrganizationId} + and a.top_organization_id = #{settlementCustomersDO.topOrganizationId} - and customer_type = #{settlementCustomersDO.customerType} + and a.customer_type = #{settlementCustomersDO.customerType} - and customer_type_code = #{settlementCustomersDO.customerTypeCode} + and a.customer_type_code = #{settlementCustomersDO.customerTypeCode} - + \ No newline at end of file diff --git a/mhd_finance/src/main/java/com/linke/finance/domain/reconciliation/repository/persistence/ReconciliationImpl.java b/mhd_finance/src/main/java/com/linke/finance/domain/reconciliation/repository/persistence/ReconciliationImpl.java index 8e6ee732a..19c67e240 100644 --- a/mhd_finance/src/main/java/com/linke/finance/domain/reconciliation/repository/persistence/ReconciliationImpl.java +++ b/mhd_finance/src/main/java/com/linke/finance/domain/reconciliation/repository/persistence/ReconciliationImpl.java @@ -794,6 +794,12 @@ public class ReconciliationImpl extends ServiceImpl businessOrderAccounts = businessOrderAccountMapper.selectList(new LambdaQueryWrapper().eq(BusinessOrderAccount::getOrderId, id).eq(BusinessOrderAccount::getIsDelete, 0)); return businessOrderAccounts; } + + public List queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + businessDocumentOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return businessDocumentOrderDomainService.queryListAndMaterial(businessDocumentOrderDO); + } + + public void reviseApply(BusinessDocumentOrderDTO businessDocumentOrderDTO) { + BusinessDocumentOrder businessDocumentOrder = new BusinessDocumentOrder(); + BeanUtils.copyProperties(businessDocumentOrder,businessDocumentOrderDTO); + businessDocumentOrderMapper.updateById(businessDocumentOrder); + + } + + + + public AjaxResult batchPushForOriginalImportExportDocument(List businessDocumentOrderDTOList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (BusinessDocumentOrderDTO pushData : businessDocumentOrderDTOList) { + // 1. 构建推送数据 + Map body = new HashMap<>(); + body.put("erpBillNo", String.valueOf(pushData.getId())); + body.put("billDate", pushData.getDocumentDate()); + body.put("goodsType", pushData.getGoodsType()); + body.put("ieFlag", pushData.getIeType() != null ? String.valueOf(pushData.getIeType()) : null); + body.put("corpCode", pushData.getAppointShipperId() != null ? pushData.getAppointShipperId().toString() : null); + + List> billList = new ArrayList<>(); + int gNo = 1; + for(OrderWithMaterialDTO orderWithMaterialDTO : pushData.getOrderWithMaterialDTOList()){ + Map billMap = new HashMap<>(); + billMap.put("gNo", gNo++); + billMap.put("goodsCode", orderWithMaterialDTO.getMaterialCode() != null ? orderWithMaterialDTO.getMaterialCode().toString() : null); + billMap.put("netWt", orderWithMaterialDTO.getWeightLimit()); + billMap.put("grossWt", orderWithMaterialDTO.getGrossWeight()); + billMap.put("packNo", orderWithMaterialDTO.getCargoNum()); + billMap.put("erpQty", orderWithMaterialDTO.getCargoNum()); + billList.add(billMap); + } + body.put("billList",billList); + + if (pushData.getId() != null) { + updatePushStatus(pushData.getId(), 2, null, String.valueOf(pushBy), pushByName); + } + + + // 2. 记录日志 + GwLog gwLog = new GwLog(); + gwLog.setType("进出口原始单证"); + gwLog.setBusinessId(Long.valueOf(pushData.getId())); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + // 3. 调用推送接口 + try { + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + httpPost.setEntity(postingString); + + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("verify", VERIFY); + if(pushData.getIeType().equals("I")) + { + httpPost.setHeader("apiName", API_NAME_I); + } + else if (pushData.getIeType().equals("E")) { + httpPost.setHeader("apiName", API_NAME_E); + }else{ + AjaxResult.error("进出口方式错误"); + } + + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + if (pushData.getId() != null) { + updatePushStatus(pushData.getId(), 3, new Date(), String.valueOf(pushBy), pushByName); + } + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + if (pushData.getId() != null) { + updatePushStatus(pushData.getId(), 4, new Date(), String.valueOf(pushBy), pushByName); + } + failCount++; + failMsg.append("物料编码:").append(pushData.getMaterialCode()).append("失败:"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + if (pushData.getId() != null) { + updatePushStatus(pushData.getId(), 4, new Date(), String.valueOf(pushBy), pushByName); + } + failCount++; + failMsg.append("物料编码:").append(pushData.getMaterialCode()).append("异常:").append(e.getMessage()); + log.error("GW推送异常:materialCode={}, error={}", pushData.getMaterialCode(), e.getMessage()); + } + } + + String resultMsg = "推送完成:成功" + successCount + "条,失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + + } + + + private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, String pushBy, String pushByName) { + try { + BusinessDocumentOrder update = new BusinessDocumentOrder(); + update.setId(id); + update.setPushStatus(pushStatus); + if (pushTime != null) { + update.setPushTime(pushTime); + } + if (pushBy != null) { + update.setPushBy(pushBy); + } + if (pushByName != null) { + update.setPushByName(pushByName); + } + businessDocumentOrderMapper.updateById(update); + } catch (Exception e) { + log.error("更新推送状态失败: id={}, error={}", id, e.getMessage()); + } + } + + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java new file mode 100644 index 000000000..5ce1d0038 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessPartner/BusinessPartnerApplicationService.java @@ -0,0 +1,187 @@ +package com.mhd.oms.application.service.businessPartner; + + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.interfaces.dto.businessPartner.BusinessPartnerDTO; +import com.mhd.system.api.UserServiceFeign; +import com.mhd.system.api.domain.UserShipperQueryDTO; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +@Slf4j +public class BusinessPartnerApplicationService { + + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "saveCorporation"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; + + + @Resource + private UserServiceFeign userServiceFeign; + + @Resource + private GwLogMapper gwLogMapper; + + + + + + + public TableDataInfo queryShipperPage(BusinessPartnerDTO businessPartnerDTO) { + UserShipperQueryDTO userShipperQueryDTO = new UserShipperQueryDTO(); + BeanUtils.copyProperties(businessPartnerDTO,userShipperQueryDTO); + if(businessPartnerDTO.getOrganizationId()!=null){ + userShipperQueryDTO.setOrganizationId(String.valueOf(businessPartnerDTO.getOrganizationId())); + } + + try { + TableDataInfo userTableDataInfo = userServiceFeign.userShipperList(userShipperQueryDTO); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(userTableDataInfo.getData()); + tableDataInfo.setTotal(userTableDataInfo.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } catch (Exception e) { + log.error("查询托运人列表异常: {}", e.getMessage()); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(500); + return tableDataInfo; + } + } + + + public AjaxResult batchPush(List businessPartnerDTOList) { + if(businessPartnerDTOList == null || businessPartnerDTOList.isEmpty()){ + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (BusinessPartnerDTO businessPartnerDTO :businessPartnerDTOList){ + + Map body = new HashMap<>(); + body.put("copyCode",businessPartnerDTO.getCorpCode()); + body.put("copyName",businessPartnerDTO.getCorpName()); + + GwLog gwLog = new GwLog(); + gwLog.setType("商业合作伙伴"); + gwLog.setBusinessId(Long.valueOf(businessPartnerDTO.getShipperId())); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body),"UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + try{ + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if(response.getStatusLine().getStatusCode() == 200){ + gwLog.setStatus(2); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),3, new Date(), pushBy,pushByName); + successCount++; + }else{ + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("失败:"); + } + gwLogMapper.updateById(gwLog); + response.close(); + + + + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("CorpCode:").append(businessPartnerDTO.getCorpCode()).append("异常:").append(e.getMessage()).append(":"); + log.error("GW推送异常:shipperId={}, error={}",businessPartnerDTO.getShipperId(),e.getMessage()); + + } finally { + try{ + httpClient.close(); + }catch (Exception e){ + log.error("关闭httpClient异常:{}" + e.getMessage()); + } + + } + + } + + String resultMsg = "推送完成:成功" + successCount + "条,失败" + failCount +"条"; + if(failCount > 0){ + resultMsg += "[" + failMsg.toString() + "]"; + } + + return AjaxResult.success(resultMsg); + } + + + + private void updatePushStatus(Long shipperId, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) { + try { + // 调用user-center的Feign接口,更新货主的推送状态 + String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; + AjaxResult result = userServiceFeign.updatePushStatus(shipperId, pushStatus, pushTimeStr, pushBy, pushByName); + log.info("更新返回结果:{}",result); + } catch (Exception e) { + // 如果更新失败,记录错误日志,但不阻断主流程 + log.info("更新推送状态失败: shipperId={}, error={}", shipperId, e.getMessage()); + } + } + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java new file mode 100644 index 000000000..7ab2f9017 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java @@ -0,0 +1,207 @@ +package com.mhd.oms.application.service.erpCountry; + + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.erpCountry.entity.ErpCountry; +import com.mhd.oms.domain.erpCountry.repository.mapper.ErpCountryMapper; +import com.mhd.oms.domain.erpCountry.repository.po.ErpCountryPO; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +@Slf4j +public class ErpCountryApplicationService{ + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "saveCountry"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; + + @Resource + private ErpCountryMapper erpCountryMapper; + + @Resource + private GwLogMapper gwLogMapper; + + public TableDataInfo queryList(ErpCountryDTO erpCountryDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + erpCountryDTO.setTopOrganizationId(topOrganizationId); + } + } + PageHelper.startPage(erpCountryDTO.getPageNum(),erpCountryDTO.getPageSize()); + List list = erpCountryMapper.queryList(erpCountryDTO); + + Page page = (Page) list; + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + + + + } + + public int insert(ErpCountryDTO erpCountryDTO) { + ErpCountry erpCountry = new ErpCountry(); + BeanUtils.copyProperties(erpCountryDTO, erpCountry); + erpCountry.setPushStatus(1); + erpCountry.setDelFlag(1); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + erpCountry.setCreateBy(loginUser.getUserid()); + erpCountry.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + erpCountry.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + erpCountry.setCreateTime(new Date()); + return erpCountryMapper.insert(erpCountry); + } + + public int update(ErpCountryDTO erpCountryDTO) { + ErpCountry erpCountry = new ErpCountry(); + BeanUtils.copyProperties(erpCountryDTO, erpCountry); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + erpCountry.setUpdateBy(loginUser.getUserid()); + erpCountry.setUpdateTime(new Date()); + } + return erpCountryMapper.updateById(erpCountry); + } + + public int deleteByIds(List idList) { + return erpCountryMapper.deleteByIds(idList); + } + + public AjaxResult batchPush(List dtoList) { + if (dtoList == null || dtoList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (ErpCountryDTO dto : dtoList) { + Map body = new HashMap<>(); + body.put("erpCountryCode", dto.getErpCountryCode()); + body.put("erpCountryName", dto.getErpCountryName()); + + GwLog gwLog = new GwLog(); + gwLog.setType("企业国别"); + gwLog.setBusinessId(dto.getId()); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updatePushStatus(dto.getId(), 3, new Date(), pushBy,pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(dto.getErpCountryCode()).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(dto.getErpCountryCode()).append("异常:").append(e.getMessage()).append(";"); + log.error("企业国别推送异常: id={}, error={}", dto.getId(), e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) { + ErpCountry entity = new ErpCountry(); + entity.setId(id); + entity.setPushStatus(pushStatus); + if (pushTime != null) { + entity.setPushTime(pushTime); + } + if (pushBy != null) { + entity.setPushBy(pushBy); + } + if (pushByName != null) { + entity.setPushByName(pushByName); + } + erpCountryMapper.updateById(entity); + } + + public ErpCountry getById(Long id) { + return erpCountryMapper.selectById(id); + } +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java new file mode 100644 index 000000000..8183cab5e --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java @@ -0,0 +1,210 @@ +package com.mhd.oms.application.service.erpEnterpriseUnit; + + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.mapper.ErpEnterpriseUnitMapper; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +@Slf4j +public class ErpEnterpriseUnitApplicationService { + + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "saveUnit"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; + + @Resource + private ErpEnterpriseUnitMapper erpEnterpriseUnitMapper; + + @Resource + private GwLogMapper gwLogMapper; + + public TableDataInfo queryList(ErpEnterpriseUnitDO erpEnterpriseUnitDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + erpEnterpriseUnitDO.setTopOrganizationId(topOrganizationId); + } + } + PageHelper.startPage(erpEnterpriseUnitDO.getPageNum(),erpEnterpriseUnitDO.getPageSize()); + List list = erpEnterpriseUnitMapper.queryList(erpEnterpriseUnitDO); + Page page = (Page) list; + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + public int update(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) { + ErpEnterpriseUnit erpEnterpriseUnit = new ErpEnterpriseUnit(); + BeanUtils.copyProperties(erpEnterpriseUnitDTO,erpEnterpriseUnit); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if(loginUser != null){ + erpEnterpriseUnit.setUpdateBy(loginUser.getUserid()); + erpEnterpriseUnit.setUpdateTime(new Date()); + } + return erpEnterpriseUnitMapper.updateById(erpEnterpriseUnit); + } + + public int insert(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) { + ErpEnterpriseUnit erpEnterpriseUnit = new ErpEnterpriseUnit(); + BeanUtils.copyProperties(erpEnterpriseUnitDTO,erpEnterpriseUnit); + erpEnterpriseUnit.setPushStatus(1); + erpEnterpriseUnit.setDelFlag(1); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if(loginUser != null){ + erpEnterpriseUnit.setCreateBy(loginUser.getUserid()); + //erpEnterpriseUnit.setCreateTime(new Date()); + erpEnterpriseUnit.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + erpEnterpriseUnit.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + erpEnterpriseUnit.setCreateTime(new Date()); + return erpEnterpriseUnitMapper.insert(erpEnterpriseUnit); + + } + + public AjaxResult batchPush(List dtoList) { + if (dtoList == null || dtoList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (ErpEnterpriseUnitDTO dto : dtoList) { + Map body = new HashMap<>(); + body.put("erpUnitCode", dto.getErpCode()); + body.put("erpUnitName", dto.getErpName()); + + GwLog gwLog = new GwLog(); + gwLog.setType("企业单位"); + gwLog.setBusinessId(Long.valueOf(dto.getId())); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(dto.getId(), 2, new Date(), pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updatePushStatus(dto.getId(), 3, new Date(), pushBy,pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpUnitCode:").append(dto.getErpCode()).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(dto.getId(), 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpUnitCode:").append(dto.getErpCode()).append("异常:").append(e.getMessage()).append(";"); + log.error("企业单位推送异常: id={}, error={}", dto.getId(), e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy ,String pushByName) { + ErpEnterpriseUnit entity = new ErpEnterpriseUnit(); + entity.setId(id); + entity.setPushStatus(pushStatus); + if (pushTime != null) { + entity.setPushTime(pushTime); + } + if (pushBy != null) { + entity.setPushBy(String.valueOf(pushBy)); + } + if (pushByName != null) { + entity.setPushByName((pushByName)); + } + erpEnterpriseUnitMapper.updateById(entity); + } + + public int deleteByIds(List idList) { + if(idList == null || idList.isEmpty()){ + return 0; + } + return erpEnterpriseUnitMapper.deleteByIds(idList); + } + + public ErpEnterpriseUnit getById(Long id) { + return erpEnterpriseUnitMapper.selectById(id); + } +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java new file mode 100644 index 000000000..e04ba6238 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java @@ -0,0 +1,184 @@ +package com.mhd.oms.application.service.exchangeRate; + + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.interfaces.dto.exchangeRate.ExchangeRateDTO; +import com.mhd.system.api.WlhyServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + + +@Service +@Slf4j +public class ExchangeRateApplicationService { + + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "saveCurr"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; + + @Resource + private WlhyServiceFeign wlhyServiceFeign; + + @Resource + private GwLogMapper gwLogMapper; + + public TableDataInfo queryExchangeRateList(Integer pageNum, Integer pageSize, String pushStatus, String organizationId) { + try { + log.info("查询汇率列表: pageNum={}, pageSize={}, pushStatus={}, organizationId={}", + pageNum, pageSize, pushStatus, organizationId); + AjaxResult result = wlhyServiceFeign.queryList(pageNum, pageSize, pushStatus, organizationId); + log.info("查询汇率列表结果: code={}, result={}", result.get("code"), result.get("result")); + + if (result != null) { + Object wlhyResult = result.get("result"); + if (wlhyResult != null) { + Map map = (Map) wlhyResult; + Object records = map.get("records"); + Object total = map.get("total"); + List list = records instanceof List ? (List) records : new ArrayList<>(); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(total instanceof Number ? ((Number) total).longValue() : list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + } + } catch (Exception e) { + log.error("查询汇率列表异常: {}", e.getMessage()); + e.printStackTrace(); + } + return buildTableDataInfo(new ArrayList<>()); + } + + private TableDataInfo buildTableDataInfo(List list) { + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + + + + public AjaxResult batchPushExchangeRate(List exchangeRateDTOList) { + if (exchangeRateDTOList == null || exchangeRateDTOList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (ExchangeRateDTO dto : exchangeRateDTOList) { + Map body = new HashMap<>(); + body.put("erpCurrCode", dto.getErpCurrCode()); + body.put("erpCurrName", dto.getErpCurrName()); + + GwLog gwLog = new GwLog(); + gwLog.setType("汇率管理"); + gwLog.setBusinessId(Long.valueOf(dto.getId())); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + // 更新为推送中 + updateExchangeRatePushStatus(dto.getId(), 2, new Date(), pushBy, pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updateExchangeRatePushStatus(dto.getId(), 3, new Date(), pushBy, pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updateExchangeRatePushStatus(dto.getId(), 4, new Date(), pushBy, pushByName); + failCount++; + failMsg.append("erpCurrCode:").append(dto.getErpCurrCode()).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updateExchangeRatePushStatus(dto.getId(), 4, new Date(), pushBy, pushByName); + failCount++; + failMsg.append("erpCurrCode:").append(dto.getErpCurrCode()).append("异常:").append(e.getMessage()).append(";"); + log.error("汇率推送异常: id={}, error={}", dto.getId(), e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updateExchangeRatePushStatus(String id, Integer pushStatus, Date pushTime, Long pushBy, String pushByName) { + try { + String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; + wlhyServiceFeign.updateExchangeRatePushStatus(id, pushStatus, pushTimeStr, pushBy, pushByName); + } catch (Exception e) { + log.error("更新汇率推送状态失败: id={}, error={}", id, e.getMessage()); + } + } + + + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java new file mode 100644 index 000000000..e6f558de1 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/gwLog/GwLogApplicationService.java @@ -0,0 +1,59 @@ +package com.mhd.oms.application.service.gwLog; + + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; +import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +public class GwLogApplicationService { + + + private final GwLogMapper gwLogMapper; + + public GwLogApplicationService(GwLogMapper gwLogMapper) { + this.gwLogMapper = gwLogMapper; + } + + public TableDataInfo queryList(GwLogDTO gwLogDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + gwLogDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + PageHelper.startPage(gwLogDTO.getPageNum(),gwLogDTO.getPageSize()); + List list = gwLogMapper.queryList(gwLogDTO); + Page page = (Page) list; + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + public GwLogPO selectByTypeAndId(GwLogDTO gwLogDTO) { + GwLog gwLog =new GwLog(); + BeanUtils.copyProperties(gwLogDTO,gwLog); + List po1 = gwLogMapper.selectByTypeAndId(gwLog); + if(po1.isEmpty()){ + return null; + } + GwLogPO po = po1.get(0); + return po; + } +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java new file mode 100644 index 000000000..64277b4a4 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java @@ -0,0 +1,178 @@ +package com.mhd.oms.application.service.materialInfo; + + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.system.api.WmsServiceFeign; +import com.mhd.system.api.domain.MaterialInfoDTO; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +@Slf4j +public class MaterialInfoApplicationService { + + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "saveOrgGoods"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; + + @Resource + private GwLogMapper gwLogMapper; + + private final WmsServiceFeign wmsServiceFeign; + + public MaterialInfoApplicationService(WmsServiceFeign wmsServiceFeign) { + this.wmsServiceFeign = wmsServiceFeign; + } + + public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO) { + try { + + TableDataInfo wmsTableDataInfo = wmsServiceFeign.getMaterialBaseInfoList(materialInfoDTO); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(wmsTableDataInfo.getData()); + tableDataInfo.setTotal(wmsTableDataInfo.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } catch (Exception e) { + log.error("查询物料列表异常: {}", e.getMessage()); + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setCode(500); + return tableDataInfo; + } + } + + public AjaxResult batchPush(List dtoList) { + if (dtoList == null || dtoList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (MaterialInfoDTO dto : dtoList) { + Map body = new HashMap<>(); + body.put("goodsCode", dto.getMaterialCode()); + + String goodsTypeString; + if(dto.getGoodsType() == 0){ + goodsTypeString = "0"; + }else if(dto.getGoodsType() == 1){ + goodsTypeString = "1"; + }else if(dto.getGoodsType() == 2){ + goodsTypeString = "2"; + }else{ + throw new ServiceException("货物类型不存在"); + } + body.put("goodsType", goodsTypeString); + body.put("erpName", dto.getMaterialName()); + + + GwLog gwLog = new GwLog(); + gwLog.setType("物料管理"); + gwLog.setBusinessId(dto.getMaterialBaseInfoId()); + gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(dto.getMaterialBaseInfoId(), 2, new Date(), pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updatePushStatus(dto.getMaterialBaseInfoId(), 3, new Date(), pushBy, pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName); + failCount++; + failMsg.append("materialCode:").append(dto.getMaterialCode()).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName); + failCount++; + failMsg.append("materialCode:").append(dto.getMaterialCode()).append("异常:").append(e.getMessage()).append(";"); + log.error("物料推送异常: id={}, error={}", dto.getMaterialBaseInfoId(), e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTime, Long pushBy, String pushByName) { + try { + String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; + wmsServiceFeign.updateMaterialPushStatus(materialBaseInfoId, pushStatus, pushTimeStr, pushBy, pushByName); + log.info("更新返回结果: materialBaseInfoId={}", materialBaseInfoId); + } catch (Exception e) { + log.info("更新推送状态失败: materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage()); + } + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/entity/BusinessDocumentCargoMulti.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/entity/BusinessDocumentCargoMulti.java index 849033891..81182421e 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/entity/BusinessDocumentCargoMulti.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/entity/BusinessDocumentCargoMulti.java @@ -96,10 +96,16 @@ public class BusinessDocumentCargoMulti extends BaseVOEntity{ @ApiModelProperty("") private String materialCode; + @ApiModelProperty("物料id") + private Long materialBaseInfoId; + @ApiModelProperty("$column.columnComment") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String orderId; @ApiModelProperty("货物内容") private String materialContent; + + @ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)") + private Integer productType; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/po/BusinessDocumentCargoMultiPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/po/BusinessDocumentCargoMultiPO.java index 4b635ffe5..8335fac62 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/po/BusinessDocumentCargoMultiPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/po/BusinessDocumentCargoMultiPO.java @@ -62,6 +62,10 @@ public class BusinessDocumentCargoMultiPO extends BaseVOEntity{ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private BigDecimal cargoWeight; + @ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)") + private Integer productType; + @ApiModelProperty("物料id") + private Long materialBaseInfoId; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/todo/BusinessDocumentCargoMultiDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/todo/BusinessDocumentCargoMultiDO.java index 6d6244e98..1f9e2c7f8 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/todo/BusinessDocumentCargoMultiDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentCargoMulti/repository/todo/BusinessDocumentCargoMultiDO.java @@ -67,4 +67,10 @@ public class BusinessDocumentCargoMultiDO extends BaseVOEntity{ @ApiModelProperty(name = "权限菜单ID") private Long permissionMenuId; + + @ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)") + private Integer productType; + + @ApiModelProperty("物料id") + private Long materialBaseInfoId; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/entity/BusinessDocumentOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/entity/BusinessDocumentOrder.java index 7aae3b309..434ec0e1e 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/entity/BusinessDocumentOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/entity/BusinessDocumentOrder.java @@ -756,4 +756,21 @@ public class BusinessDocumentOrder extends BaseVOEntity{ @ApiModelProperty("仓库负责人电话") private String directorPhone; + + @ApiModelProperty("进出口方式:I-进口,E-出口") + private String ieType; + + @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 String pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/facade/IBusinessDocumentOrderService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/facade/IBusinessDocumentOrderService.java index fcb935293..948412564 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/facade/IBusinessDocumentOrderService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/facade/IBusinessDocumentOrderService.java @@ -52,4 +52,6 @@ public interface IBusinessDocumentOrderService extends IService queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO); } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/mapper/BusinessDocumentOrderMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/mapper/BusinessDocumentOrderMapper.java index 59ae93e04..3d0b8c67c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/mapper/BusinessDocumentOrderMapper.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/mapper/BusinessDocumentOrderMapper.java @@ -23,4 +23,5 @@ public interface BusinessDocumentOrderMapper extends BaseMapper queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO); } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/persistence/BusinessDocumentOrderImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/persistence/BusinessDocumentOrderImpl.java index fcccc579e..e45c25531 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/persistence/BusinessDocumentOrderImpl.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/persistence/BusinessDocumentOrderImpl.java @@ -449,4 +449,10 @@ public class BusinessDocumentOrderImpl extends ServiceImpl queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO) + { + return businessDocumentOrderMapper.queryListAndMaterial(businessDocumentOrderDO); + } } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/po/BusinessDocumentOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/po/BusinessDocumentOrderPO.java index d82d72f6d..ccac29933 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/po/BusinessDocumentOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/po/BusinessDocumentOrderPO.java @@ -765,9 +765,39 @@ public class BusinessDocumentOrderPO extends BaseVOEntity{ @ApiModelProperty("出入库单号") private String inOrderNumber; + @ApiModelProperty("仓库负责人") + private String directorName; + + @ApiModelProperty("仓库负责人电话") + private String directorPhone; + + @ApiModelProperty("进出口方式:I-进口,E-出口") + private String ieType; + + @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 String pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; + @ApiModelProperty("执行单") private List executeOrderList; @ApiModelProperty("货物信息") private List businessDocumentCargoMultiList; + + @ApiModelProperty("物料编码") + private String materialCode; + + @ApiModelProperty("商品类型") + private Integer productType; + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/todo/BusinessDocumentOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/todo/BusinessDocumentOrderDO.java index b0dcb690b..c27e9f254 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/todo/BusinessDocumentOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/repository/todo/BusinessDocumentOrderDO.java @@ -775,7 +775,7 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{ @ApiModelProperty(value = "审核意见") private String reviewOpinion; - @ApiModelProperty("订单来源") + @ApiModelProperty("订单来源 0.运输,1.仓储") private String orderSource; @ApiModelProperty(value = "出入库单号") @@ -790,6 +790,23 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{ @ApiModelProperty("仓库负责人电话") private String directorPhone; + @ApiModelProperty("进出口方式:I-进口,E-出口") + private String ieType; + + @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 String pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; + @ApiModelProperty("费用科目明细") private List businessOrderAccountList; @@ -806,4 +823,24 @@ public class BusinessDocumentOrderDO extends BaseVOEntity{ private List loadingAddressList; @ApiModelProperty(value = "卸货地址集合") private List unloadAddressList; + + @ApiModelProperty(value = "单证日期起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date documentDateStart; + + @ApiModelProperty(value = "单证日期止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date documentDateEnd; + + @ApiModelProperty(value = "推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTimeStart; + + @ApiModelProperty(value = "推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTimeEnd; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java index 0a2a5922b..94a8f67f2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java @@ -19,6 +19,8 @@ import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOr import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO; import com.mhd.oms.domain.businessOrderAccount.BusinessOrderAccount; import com.mhd.oms.domain.businessOrderAccount.repository.mapper.BusinessOrderAccountMapper; +import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder; +import com.mhd.oms.domain.reservationOrder.repository.mapper.ReservationOrderMapper; import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO; import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO; import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO; @@ -64,6 +66,9 @@ public class BusinessDocumentOrderDomainService { @Resource private BusinessOrderAccountMapper businessOrderAccountMapper; + + @Resource + private ReservationOrderMapper reservationOrderMapper; /** * 分页查询【请填写功能名称】列表 */ @@ -564,7 +569,19 @@ public class BusinessDocumentOrderDomainService { tmsOrder.setTopOrganizationId(businessDocumentOrderDO.getTopOrganizationId()); } // boolean istrue=businessDocumentOrderService.update(businessDocumentOrderDO); + int i = businessDocumentOrderMapper.updateById(tmsOrder); + if (deliveryFreight != null && deliveryFreight.compareTo(BigDecimal.ZERO) > 0){ + List reservationOrderList = reservationOrderMapper.selectList(new LambdaQueryWrapper().eq(ReservationOrder::getGoodsNumber, businessDocumentOrderDO.getGoodsNumber())); + if (ObjectUtil.isNotEmpty(reservationOrderList) && reservationOrderList.size() > 0) { + for (ReservationOrder reservationOrder : reservationOrderList){ + reservationOrder.setDeliveryFreight(deliveryFreight); + reservationOrderMapper.updateById(reservationOrder); + } + + } + + } //保存货物信息及地址信息 saveAddress2CargoInfo(tmsOrder.getId(), allCargoList, loadingAddressList, unloadAddressList); @@ -623,6 +640,7 @@ public class BusinessDocumentOrderDomainService { tmsCargoInfo.setCargoWeight(tmsCargoInfoDTO.getWeight()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getWeight()); tmsCargoInfo.setCargoNum(tmsCargoInfoDTO.getCargoNum()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getCargoNum()); tmsCargoInfo.setMaterialVolume(tmsCargoInfoDTO.getMaterialVolume()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getMaterialVolume()); + tmsCargoInfo.setMaterialBaseInfoId(tmsCargoInfoDTO.getMaterialBaseInfoId()); businessDocumentCargoMultiMapper.insert(tmsCargoInfo); } @@ -787,4 +805,11 @@ public class BusinessDocumentOrderDomainService { } return null; } + + + + public List queryListAndMaterial(BusinessDocumentOrderDO businessDocumentOrderDO) { + return businessDocumentOrderService.queryListAndMaterial(businessDocumentOrderDO); + } + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/entity/ErpCountry.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/entity/ErpCountry.java new file mode 100644 index 000000000..3a9d3961b --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/entity/ErpCountry.java @@ -0,0 +1,73 @@ +package com.mhd.oms.domain.erpCountry.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +@Data +@TableName("erp_country") +@ApiModel(description = "企业国别实体") +public class ErpCountry implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("ERP国别编码") + private String erpCountryCode; + + @ApiModelProperty("ERP国别名称") + private String erpCountryName; + + @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("所属组织ID") + private Long organizationId; + + @ApiModelProperty("一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty("所属组织名称") + private String organizationName; + + @ApiModelProperty("创建人") + private Long createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新人") + private Long updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + private Date updateTime; + + @ApiModelProperty("删除标记:1-正常,0-删除") + private Integer delFlag; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/mapper/ErpCountryMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/mapper/ErpCountryMapper.java new file mode 100644 index 000000000..2d8e6fedf --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/mapper/ErpCountryMapper.java @@ -0,0 +1,24 @@ +package com.mhd.oms.domain.erpCountry.repository.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.erpCountry.entity.ErpCountry; +import com.mhd.oms.domain.erpCountry.repository.po.ErpCountryPO; +import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ErpCountryMapper extends BaseMapper { + + /** + * + * @param erpCountryDTO + * @return + */ + List queryList(@Param("erpCountryDTO") ErpCountryDTO erpCountryDTO); + + int deleteByIds(@Param("idList") List idList); +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/po/ErpCountryPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/po/ErpCountryPO.java new file mode 100644 index 000000000..fc727789e --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpCountry/repository/po/ErpCountryPO.java @@ -0,0 +1,67 @@ +package com.mhd.oms.domain.erpCountry.repository.po; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class ErpCountryPO { + + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("ERP国别编码") + private String erpCountryCode; + + @ApiModelProperty("ERP国别名称") + private String erpCountryName; + + @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("所属组织ID") + private Long organizationId; + + @ApiModelProperty("一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty("所属组织名称") + private String organizationName; + + @ApiModelProperty("创建人") + private Long createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新人") + private Long updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + private Date updateTime; + + @ApiModelProperty("删除标记:1-正常,0-删除") + private Integer delFlag; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/entity/ErpEnterpriseUnit.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/entity/ErpEnterpriseUnit.java new file mode 100644 index 000000000..132db5825 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/entity/ErpEnterpriseUnit.java @@ -0,0 +1,72 @@ +package com.mhd.oms.domain.erpEnterpriseUnit.entity; + + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + + +import java.util.Date; + +@Data +@ApiModel(description = "企业单位") +public class ErpEnterpriseUnit { + + @ApiModelProperty(value = "主键ID") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "ERP单位编码") + private String erpCode; + + @ApiModelProperty(value = "ERP单位名称") + private String erpName; + + @ApiModelProperty(value = "推送状态: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(value = "推送时间") + private Date pushTime; + + @ApiModelProperty(value = "推送人") + private String pushBy; + + @ApiModelProperty(value = "推送人姓名") + private String pushByName; + + @ApiModelProperty(value = "所属组织ID") + private Long organizationId; + + @ApiModelProperty(value = "一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty(value = "所属组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建人") + private Long createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新人") + private Long updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "删除标记:1-正常,0-删除") + private Integer delFlag; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/mapper/ErpEnterpriseUnitMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/mapper/ErpEnterpriseUnitMapper.java new file mode 100644 index 000000000..7d70ef7f2 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/mapper/ErpEnterpriseUnitMapper.java @@ -0,0 +1,30 @@ +package com.mhd.oms.domain.erpEnterpriseUnit.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +@Mapper +public interface ErpEnterpriseUnitMapper extends BaseMapper { + + /** + * + * @param erpEnterpriseUnitDO + * @return + */ + List queryList(@Param("erpEnterpriseUnitDO")ErpEnterpriseUnitDO erpEnterpriseUnitDO); + + /** + * + * @param idList + * @return + */ + int deleteByIds(@Param("idList") List idList); + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/po/ErpEnterpriseUnitPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/po/ErpEnterpriseUnitPO.java new file mode 100644 index 000000000..4e4777828 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/po/ErpEnterpriseUnitPO.java @@ -0,0 +1,71 @@ +package com.mhd.oms.domain.erpEnterpriseUnit.repository.po; + + +import com.fasterxml.jackson.annotation.JsonFormat; +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.util.Date; + +@Data +@ApiModel(description = "企业单位PO") +public class ErpEnterpriseUnitPO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "主键ID") + private Long id; + + @ApiModelProperty(value = "ERP单位编码") + private String erpCode; + + @ApiModelProperty(value = "ERP单位名称") + private String erpName; + + @ApiModelProperty(value = "推送状态: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(value = "推送时间") + private Date pushTime; + + @ApiModelProperty(value = "推送人") + private Long pushBy; + + @ApiModelProperty(value = "推送人") + private String pushByName; + + @ApiModelProperty(value = "所属组织ID") + private Long organizationId; + + @ApiModelProperty(value = "一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty(value = "所属组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建人") + private Long createBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新人") + private Long updateBy; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "删除标记:1-正常,0-删除") + private Integer delFlag; + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java new file mode 100644 index 000000000..e587d1c6c --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java @@ -0,0 +1,57 @@ +package com.mhd.oms.domain.erpEnterpriseUnit.repository.todo; + + +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class ErpEnterpriseUnitDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键ID") + private Long id; + + @ApiModelProperty(value = "ERP单位编码") + private String erpCode; + + @ApiModelProperty(value = "ERP单位名称") + private String erpName; + + @ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @ApiModelProperty(value = "推送时间") + private String pushTime; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + + @ApiModelProperty(value = "推送人") + private String pushBy; + + @ApiModelProperty(value = "所属组织ID") + private Long organizationId; + + @ApiModelProperty(value = "所属组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建时间起") + private String createTimeFrom; + + @ApiModelProperty(value = "创建时间止") + private String createTimeTo; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + + @ApiModelProperty(value = "每页数量") + private Long TopOrganizationId; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/entity/GwLog.java b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/entity/GwLog.java new file mode 100644 index 000000000..e44550fe3 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/entity/GwLog.java @@ -0,0 +1,64 @@ +package com.mhd.oms.domain.gwLog.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName("gw_log") +public class GwLog implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("日志id") + @TableId(type = IdType.AUTO) + private Long logId; + + @ApiModelProperty("类型") + private String type; + + @ApiModelProperty("业务ID") + private Long businessId; + + @ApiModelProperty("请求报文") + private String requestBody; + + @ApiModelProperty("响应报文") + private String responseBody; + + @ApiModelProperty("状态(1-初始,2-成功,3-失败)") + private Integer status; + + @ApiModelProperty("错误信息") + private String errorMsg; + + @ApiModelProperty("推送时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sendTime; + + @ApiModelProperty("组织ID") + private Long organizationId; + + @ApiModelProperty("一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty("组织名称") + private String organizationName; + + @ApiModelProperty("创建人") + private Long createBy; + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("删除标记:1-正常,0-删除") + private Integer delFlag; +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java new file mode 100644 index 000000000..b3871a637 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/mapper/GwLogMapper.java @@ -0,0 +1,26 @@ +package com.mhd.oms.domain.gwLog.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; +import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + + +@Mapper +public interface GwLogMapper extends BaseMapper { + /** + * + * @param gwLogDTO + * @return + */ + List queryList(GwLogDTO gwLogDTO); + + @Select("select * from gw_log where business_id = #{businessId} and type = #{type} order by create_time desc") + List selectByTypeAndId(@RequestBody GwLog gwLog); +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java new file mode 100644 index 000000000..1272af6f8 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/gwLog/repository/po/GwLogPO.java @@ -0,0 +1,66 @@ +package com.mhd.oms.domain.gwLog.repository.po; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + + +@Data +public class GwLogPO { + + @ApiModelProperty("日志id") + private Long logId; + + @ApiModelProperty("类型") + private String type; + + @ApiModelProperty("业务ID") + private String businessId; + + @ApiModelProperty("请求报文") + private String requestBody; + + @ApiModelProperty("响应报文") + private String responseBody; + + @ApiModelProperty("状态(1-初始,2-成功,3-失败)") + private Integer status; + + @ApiModelProperty("错误信息") + private String errorMsg; + + @ApiModelProperty("推送时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sendTime; + + @ApiModelProperty("组织ID") + private Long organizationId; + + @ApiModelProperty("一级组织ID") + private Long topOrganizationId; + + @ApiModelProperty("组织名称") + private String organizationName; + + @ApiModelProperty("创建人") + private Long createBy; + + @ApiModelProperty("创建人姓名") + private String pushByName; + + @ApiModelProperty("创建时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty("删除标记:1-正常,0-删除") + private Integer delFlag; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/entity/ReservationOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/entity/ReservationOrder.java index 5c7f2d5c8..90c791405 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/entity/ReservationOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/entity/ReservationOrder.java @@ -504,9 +504,6 @@ public class ReservationOrder { @ApiModelProperty(value = "订单结算状态:1未出账、2已出账、3部分结算、4已结算") private Integer settlementStatus; - @ApiModelProperty(value = "订单类型:0-预约单,1-业务单") - private Integer orderType; - @ApiModelProperty(value = "订单运费结算时间") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @@ -701,9 +698,16 @@ public class ReservationOrder { @ApiModelProperty("业务单号") private String businessOrderNumber; + @ApiModelProperty("订单状态(0.待确认,1.待提货,2.待补充,3.运输中,4.已完成,5.已取消)") + private Integer orderType; @ApiModelProperty("起运时间") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private java.util.Date departureTime; + + @ApiModelProperty("业务主管") + private String salesManager; + @ApiModelProperty("审核意见") + private String reviewOpinion; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/facade/IOmsAddressMultiService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/facade/IOmsAddressMultiService.java index e7c2b1654..33d79db43 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/facade/IOmsAddressMultiService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/facade/IOmsAddressMultiService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO; import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder; import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO; +import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO; import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderAddDTO; import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderDTO; import com.mhd.common.core.utils.sms.Result; @@ -16,11 +17,18 @@ import java.security.spec.InvalidKeySpecException; import com.mhd.oms.interfaces.facade.resevationOrder.BatchConfirmResult; import java.util.List; +import java.util.Map; public interface IOmsAddressMultiService { void save(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException; + /** + * 更新预约单 + * @param tmsOrderAddDTO 预约单信息 + */ + void update(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException; + List queryList(OmsOrderDTO omsOrderDTO); /** @@ -28,14 +36,24 @@ public interface IOmsAddressMultiService { * @param goodsNumber 预约单号 * @return 业务单信息 */ - BusinessDocumentOrderPO confirmReservationOrder(String goodsNumber); + Boolean confirmReservationOrder(String goodsNumber); /** * 批量确认预约单,生成业务单 * @param goodsNumbers 预约单号列表 * @return 批量处理结果 */ - Result batchConfirmReservationOrder(List goodsNumbers); + Result batchConfirmReservationOrder(BusinessAuditDTO businessAuditDTO); Result batchRejectReservationOrder(List goodsNumbers); + + /** + * 根据订单状态(orderType)统计各状态的数量 + * @return Map key为orderType值,value为对应数量 + */ + Map countByOrderType(); + + Integer cancelReserve(List goodsNumbers); + + OmsOrderDTO getResevationOrderInfo(String goodsNumber); } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/po/ReservationOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/po/ReservationOrderPO.java index 7e1848a55..c4cbea7c6 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/po/ReservationOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/repository/po/ReservationOrderPO.java @@ -723,7 +723,7 @@ public class ReservationOrderPO { private String executor; @ApiModelProperty("业务单id") - private Long businesssOrderId ; + private Long businessOrderId ; @ApiModelProperty("业务单号") private String businessOrderNumber; @@ -735,4 +735,9 @@ public class ReservationOrderPO { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private java.util.Date departureTime; + + @ApiModelProperty("业务主管") + private String salesManager; + @ApiModelProperty("审核意见") + private String reviewOpinion; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java index c1ecf088f..c3c4a6025 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java @@ -12,6 +12,7 @@ import com.mhd.common.core.utils.sms.Result; import com.mhd.oms.application.service.businessDocumentOrder.BusinessDocumentOrderApplicationService; import com.mhd.oms.domain.businessDocumentOrder.repository.facade.IBusinessDocumentOrderService; import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder; +import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper; import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO; import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti; import com.mhd.oms.domain.businessDocumentCargoMulti.repository.mapper.BusinessDocumentCargoMultiMapper; @@ -30,6 +31,9 @@ import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO; import com.mhd.oms.enums.*; import com.mhd.oms.infrastructure.feign.ThirdPartyServiceFeign; //import com.mhd.oms.infrastructure.feign.TransportServiceFeign; +import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO; +import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO; +import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO; import com.mhd.oms.interfaces.dto.resevationOrder.*; import com.mhd.oms.interfaces.facade.resevationOrder.BatchConfirmResult; import com.mhd.oms.util.DictDataUtils; @@ -41,12 +45,16 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.core.domain.po.UserPo; import com.mhd.common.core.domain.po.UserShipperPo; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang.StringUtils; 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.util.CollectionUtils; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import javax.annotation.Resource; import java.math.BigDecimal; @@ -114,6 +122,9 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { @Autowired private IBusinessDocumentOrderService businessDocumentOrderService; + @Resource + private BusinessDocumentOrderMapper businessDocumentOrderMapper; + @Transactional(rollbackFor = Exception.class) @@ -424,10 +435,10 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { resevationOrder.setLoadingPhone(firstAddress.getContactPhone()); resevationOrder.setLoadingDate(firstAddress.getLayDate()); - resevationOrder.setUnloadAreaId(lastAddress.getAreaCode()); - resevationOrder.setUnloadName(lastAddress.getAreaCode()); - resevationOrder.setUnloadAddress(lastAddress.getAddress()); - String unarea = lastAddress.getAreaCode() + lastAddress.getAddress(); + resevationOrder.setUnloadAreaId(lastAddress.getAreaCode()); + resevationOrder.setUnloadName(lastAddress.getAreaCode()); + resevationOrder.setUnloadAddress(lastAddress.getAddress()); + String unarea = lastAddress.getAreaCode() + lastAddress.getAddress(); /*String ungeo = amapService.geo(unarea); String unloadingLatitude = ungeo.substring(ungeo.indexOf(",") + 1); String unloadingLongitude = ungeo.substring(0,ungeo.indexOf(",")); @@ -524,11 +535,11 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { resevationOrder.setTransportationModeId(1); } } - //设置是否自动审核 - //自动审核用户信息(0否1是) + //设置是否自动审核 + //自动审核用户信息(0否1是) // SysConfigSwitch configSwitch = sysConfigSwitchService.queryBySysOrgCode(); - //查询平台业务员 - // 从UserCenter服务获取平台业务员信息 + //查询平台业务员 + // 从UserCenter服务获取平台业务员信息 // UserDTO userDTO = new UserDTO(); // userDTO.setUserRole("platAuther"); // AjaxResult platAutherResult = AjaxResult.success(userServiceFeign.getUserByTopOrganizationUserAccount(userDTO, "oms")); @@ -867,12 +878,272 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { // tmsBidingDocumentLine.setServiceRate(tmsOrderAddDTO.getServiceRate()); // tmsBidingDocumentLine.setSingleVehicleWeight(tmsOrderAddDTO.getSingleVehicleWeight()); - // tmsBidingDocumentLineMapper.insert(tmsBidingDocumentLine); + // tmsBidingDocumentLineMapper.insert(tmsBidingDocumentLine); // } + } + @Transactional(rollbackFor = Exception.class) + @Override + public void update(OmsOrderAddDTO tmsOrderAddDTO) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { + if (StringUtils.isBlank(tmsOrderAddDTO.getGoodsQuantity())) { + tmsOrderAddDTO.setGoodsQuantity("0"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + //获取登录人 + // 从UserCenter服务获取用户信息 + AjaxResult userInfoResult = userServiceFeign.getInfo(Long.valueOf(loginUser.getUserid())); + if (!userInfoResult.get("code").toString().equals("200")) { + throw new ServiceException("获取用户信息失败"); + } + ObjectMapper objectMapper = new ObjectMapper(); + UserPo userPo = objectMapper.convertValue(userInfoResult.get("data"), UserPo.class); + + // 从UserCenter服务获取货主信息 + AjaxResult shipperInfoResult = userServiceFeign.getShipperByUserId(Long.valueOf(loginUser.getUserid())); + if (!shipperInfoResult.get("code").toString().equals("200")) { + throw new ServiceException("获取货主信息失败"); + } + + //处理费用默认值 + handFee(tmsOrderAddDTO); + + //组织赋值 + Long organizationId = tmsOrderAddDTO.getOrganizationId(); + if (ObjectUtil.isNotEmpty(organizationId)) { + tmsOrderAddDTO.setOrgId(String.valueOf(organizationId)); + tmsOrderAddDTO.setOrgName(tmsOrderAddDTO.getOrganizationName()); + } + + // 获取一份副本等一会需要存储到数据库 + String swzlUserId = String.valueOf(loginUser.getUserid()); + + // 从UserCenter服务获取当前登录用户的货主信息 + AjaxResult shipperResult = userServiceFeign.getShipperByUserId(Long.valueOf(loginUser.getUserid())); + if (!shipperResult.get("code").toString().equals("200")) { + throw new ServiceException("您非货主角色或账号已被删除!"); + } + UserShipperPo userShipperPoInfo = objectMapper.convertValue(shipperResult.get("data"), UserShipperPo.class); + + if (userShipperPoInfo == null) { + throw new ServiceException("您非货主角色或账号已被删除!"); + } + + String orderRemark = tmsOrderAddDTO.getOrderRemark(); + tmsOrderAddDTO.setRemarks(orderRemark); + + tmsOrderAddDTO.setAppointShipperId(String.valueOf(userShipperPoInfo.getShipperId())); + + // 分类处理货物列表 + List allCargoList = tmsOrderAddDTO.getCargoInfoList(); + + //获取货主月结标识, + int receivableType; + int autoAuditOrder; + if (userShipperPoInfo.getShipperType() == 2) { + // 从UserCenter服务获取企业货主信息 + AjaxResult companyShipperResult = userServiceFeign.getShipperByUserId(userShipperPoInfo.getUserId()); + if (!companyShipperResult.get("code").toString().equals("200")) { + throw new ServiceException("获取企业货主信息失败"); + } + UserShipperPo companyUserShipperPo = objectMapper.convertValue(companyShipperResult.get("data"), UserShipperPo.class); + receivableType = companyUserShipperPo.getMonthlySettlementFlag(); + autoAuditOrder = companyUserShipperPo.getIsAutoAuditOrder(); + } else { + receivableType = userShipperPoInfo.getMonthlySettlementFlag(); + autoAuditOrder = userShipperPoInfo.getIsAutoAuditOrder(); + } + tmsOrderAddDTO.setReceivableType(receivableType); + + //非企业员工判断个人信息审核状态x + if (userShipperPoInfo.getShipperType() != 2 && userShipperPoInfo.getShipperFill() != 3) { // 假设3代表审核通过 + throw new ServiceException("未提交个人信息认证或认证未通过,请先认证!"); + } + //企业员工判断企业货主审核状态 + if (userShipperPoInfo.getShipperType() == 2) { + // 从UserCenter服务获取企业用户信息 + AjaxResult companyUserResult = userServiceFeign.getInfo(userShipperPoInfo.getUserId()); + if (!companyUserResult.get("code").toString().equals("200")) { + throw new ServiceException("获取企业用户信息失败"); + } + userPo = objectMapper.convertValue(companyUserResult.get("data"), UserPo.class); + } + + //企业员工判断企业货主审核状态 + if (userShipperPoInfo.getShipperType() == 2) { + // 从UserCenter服务获取企业货主信息 + AjaxResult companyShipperResult = userServiceFeign.getShipperByUserId(userShipperPoInfo.getUserId()); + if (!companyShipperResult.get("code").toString().equals("200")) { + throw new ServiceException("获取企业货主信息失败"); + } + UserShipperPo companyUserShipperPo = objectMapper.convertValue(companyShipperResult.get("data"), UserShipperPo.class); + if (companyUserShipperPo.getShipperFill() != 3) { // 假设3代表审核通过 + throw new ServiceException("未提交个人信息认证或认证未通过,请先认证!"); + } + } + + /** + * 更新货源单信息 + */ + ReservationOrder resevationOrder = new ReservationOrder(); + BeanUtils.copyProperties(tmsOrderAddDTO, resevationOrder); + String id = tmsOrderAddDTO.getId(); + resevationOrder.setId(Long.valueOf(id)); + + // 设置更新时间戳和用户信息 + resevationOrder.setUpdateTime(new Date()); + resevationOrder.setUpdateBy(loginUser.getWlhyLoginUser().getRealname()); +// resevationOrder.setUpdateByName(userPo.getUserName()); + + // 检查ID是否为空 + if (resevationOrder.getId() == null || resevationOrder.getId() <= 0) { + throw new ServiceException("预约单ID不能为空,无法执行更新操作"); + } + List loadingAddressList = tmsOrderAddDTO.getLoadingAddressList();//装货地信息集合 + List unloadAddressList = tmsOrderAddDTO.getUnloadAddressList();//卸货地信息集合 + + /*if (CollUtil.isEmpty(loadingAddressList)) { + throw new ServiceException("请传入装货地址!"); + } + + if (CollUtil.isEmpty(unloadAddressList)) { + throw new ServiceException("请传入卸货地址!"); + }*/ + + String loadCityCounty = "", unloadCityCounty = ""; + //当是短驳的时候不走这个逻辑 + /*for (int i = 0; i < loadingAddressList.size(); i++) { + //根据行政区划代码获取省市县名称 + String areaName= sysComboService.getLoadOrUnloadName(loadingAddressList.get(i).getAreaCode()); + loadingAddressList.get(i).setAreaName(areaName); + // 简称 + String shortName= sysComboService.getCityCountyName(loadingAddressList.get(i).getAreaCode()); + loadingAddressList.get(i).setShortName(shortName); + //获取装卸货地经纬度 + String[] lng2Lat = setLngAndLat(loadingAddressList.get(i).getAreaCode(), loadingAddressList.get(i).getLongitude(), + loadingAddressList.get(i).getLatitude(), loadingAddressList.get(i).getAddress()); + if (null != lng2Lat) { + loadingAddressList.get(i).setLongitude(lng2Lat[0]); + loadingAddressList.get(i).setLatitude(lng2Lat[1]); + } + //获取装货时间 + SysDictData sysDictData = getLayTime(loadingAddressList.get(i).getLayTimeId()); + if (sysDictData != null) { + loadingAddressList.get(i).setLayTimeId(sysDictData.getDictValue()); + loadingAddressList.get(i).setLayTime(sysDictData.getDictLabel()); + } + + loadingAddressList.get(i).setSort(i); + } + for (int i = 0; i < unloadAddressList.size(); i++) { + //根据行政区划代码获取省市县名称 + //String areaName= sysComboService.getLoadOrUnloadName(unloadAddressList.get(i).getAreaCode()); + //unloadAddressList.get(i).setAreaName(areaName); + // 简称 + //String shortName= sysComboService.getCityCountyName(unloadAddressList.get(i).getAreaCode()); + //unloadAddressList.get(i).setShortName(shortName); + //获取装卸货地经纬度 + String[] lng2Lat = setLngAndLat(unloadAddressList.get(i).getAreaCode(), unloadAddressList.get(i).getLongitude(), + unloadAddressList.get(i).getLatitude(), unloadAddressList.get(i).getAddress()); + if (null != lng2Lat) { + unloadAddressList.get(i).setLongitude(lng2Lat[0]); + unloadAddressList.get(i).setLatitude(lng2Lat[1]); + } + //获取装货时间 + SysDictData sysDictData = getLayTime(unloadAddressList.get(i).getLayTimeId()); + if (sysDictData != null) { + unloadAddressList.get(i).setLayTimeId(sysDictData.getDictValue()); + unloadAddressList.get(i).setLayTime(sysDictData.getDictLabel()); + } + + + unloadAddressList.get(i).setSort(i); +// } + //多装多卸获取第一个装货地址和最后一个卸货地址 获取省市县简称 + loadCityCounty = sysComboService.getCityCountyName(loadingAddressList.get(0).getAreaCode()); + unloadCityCounty = sysComboService.getCityCountyName(unloadAddressList.get(unloadAddressList.size() - 1).getAreaCode()); + resevationOrder.setLineTitleLeft(loadCityCounty); + resevationOrder.setLineTitleRight(unloadCityCounty); + }*/ + //获取第一条装货地址和获取最后一条卸货地址 + OmsAddressMultiDTO firstAddress = loadingAddressList.get(0); + OmsAddressMultiDTO lastAddress = unloadAddressList.get(unloadAddressList.size() - 1); + resevationOrder.setLoadingAreaId(firstAddress.getAreaCode()); + resevationOrder.setLoadingName(firstAddress.getAreaCode()); + resevationOrder.setLoadingAddress(firstAddress.getAddress()); + String area = firstAddress.getAreaCode() + firstAddress.getAddress(); + /*String geo = amapService.geo(area); + String loadingLatitude = geo.substring(geo.indexOf(",") + 1); + String loadingLongitude = geo.substring(0,geo.indexOf(",")); + resevationOrder.setLoadingLongitude(loadingLongitude); + resevationOrder.setLoadingLatitude(loadingLatitude); + firstAddress.setLatitude(loadingLatitude); + firstAddress.setLongitude(loadingLongitude);*/ + resevationOrder.setLineTitleLeft(firstAddress.getAreaCode()); + resevationOrder.setLineTitleRight(lastAddress.getAreaCode()); + resevationOrder.setFreighterName(firstAddress.getContactName()); + resevationOrder.setLoadingPhone(firstAddress.getContactPhone()); + resevationOrder.setLoadingDate(firstAddress.getLayDate()); + + resevationOrder.setUnloadAreaId(lastAddress.getAreaCode()); + resevationOrder.setUnloadName(lastAddress.getAreaCode()); + resevationOrder.setUnloadAddress(lastAddress.getAddress()); + String unarea = lastAddress.getAreaCode() + lastAddress.getAddress(); + /*String ungeo = amapService.geo(unarea); + String unloadingLatitude = ungeo.substring(ungeo.indexOf(",") + 1); + String unloadingLongitude = ungeo.substring(0,ungeo.indexOf(",")); + lastAddress.setLatitude(unloadingLatitude); + lastAddress.setLongitude(unloadingLongitude); + resevationOrder.setUnloadLongitude(unloadingLongitude); + resevationOrder.setUnloadLatitude(unloadingLatitude);*/ + resevationOrder.setDischargerName(lastAddress.getContactName()); + resevationOrder.setUnloadPhone(lastAddress.getContactPhone()); + resevationOrder.setUnloadingData(lastAddress.getLayDate()); + // 执行更新操作 + int result = resevationOrderMapper.updateById(resevationOrder); + if (result == 0) { + throw new ServiceException("更新失败:未找到对应的预约单记录"); + } + + // 更新费用科目信息 + List tmsOrderAccountList = tmsOrderAddDTO.getTmsOrderAccountList(); + if (ObjectUtil.isNotNull(tmsOrderAccountList) && tmsOrderAccountList.size() > 0) { + // 先删除旧的费用科目信息 + tmsOrderAccountMapper.delete(new LambdaQueryWrapper().eq(OmsOrderAccount::getOrderId, String.valueOf(resevationOrder.getId()))); + + // 插入新的费用科目信息 + for (OmsOrderAccount tmsOrderAccount : tmsOrderAccountList) { + tmsOrderAccount.setIsDelete(0); + tmsOrderAccount.setOrderId(String.valueOf(resevationOrder.getId())); + tmsOrderAccount.setCreateBy(String.valueOf(userPo.getUserId())); + tmsOrderAccount.setCreateTime(new Date()); + + // 设置组织信息 + if (tmsOrderAddDTO.getOrganizationId() != null) { + tmsOrderAccount.setOrganizationId(tmsOrderAddDTO.getOrganizationId()); + } + if (tmsOrderAddDTO.getOrganizationName() != null) { + tmsOrderAccount.setOrganizationName(tmsOrderAddDTO.getOrganizationName()); + } + if (tmsOrderAddDTO.getTopOrganizationId() != null) { + tmsOrderAccount.setTopOrganizationId(tmsOrderAddDTO.getTopOrganizationId()); + } + + tmsOrderAccountMapper.insert(tmsOrderAccount); + } + } + + // 更新货物信息及地址信息 + saveAddress2CargoInfo(String.valueOf(resevationOrder.getId()), allCargoList, tmsOrderAddDTO.getLoadingAddressList(), tmsOrderAddDTO.getUnloadAddressList()); + } + + + + + @Override public List queryList(OmsOrderDTO omsOrderDTO) { LoginUser loginUser = SecurityUtils.getLoginUser(); @@ -882,6 +1153,10 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { omsOrderDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); } } + Long organizationId = loginUser.getUserPo().getOrganizationId(); + if (organizationId !=2827L){ + omsOrderDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + } List reservationOrderPOS = reservationOrderDomainService.queryList(omsOrderDTO); for (ReservationOrderPO reservationOrderPO : reservationOrderPOS){ List reservationCargoInfoList = reservationCargoInfoMapper.selectList(new LambdaQueryWrapper().eq(ReservationCargoInfo::getOrderId, reservationOrderPO.getId())); @@ -1078,7 +1353,7 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { // } @Override - public BusinessDocumentOrderPO confirmReservationOrder(String goodsNumber) { + public Boolean confirmReservationOrder(String goodsNumber) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ReservationOrder::getGoodsNumber, goodsNumber); @@ -1102,71 +1377,27 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { BusinessDocumentOrderDO businessDocumentOrderDO = new BusinessDocumentOrderDO(); - // 基本信息映射 - businessDocumentOrderDO.setGoodsNumber(OrderSequence.getOrderCodeByDate(new Date())); // 生成业务单号 + businessDocumentOrderDO.setGoodsNumber(reservationOrder.getGoodsNumber()); // 生成业务单号 businessDocumentOrderDO.setOrderStatus(0L); // 业务单状态:0-待审核 businessDocumentOrderDO.setReviewStatus(0L); // 审核状态:0-未审核 - businessDocumentOrderDO.setExecuteStatus(0L); // 执行状态:0-无状态 + businessDocumentOrderDO.setExecuteStatus(0L); businessDocumentOrderDO.setReservationOrderId(reservationOrder.getId()); businessDocumentOrderDO.setReservationOrderNumber(reservationOrder.getGoodsNumber()); + BeanUtils.copyProperties(reservationOrder, businessDocumentOrderDO); - businessDocumentOrderDO.setGoodsName(reservationOrder.getGoodsName()); - businessDocumentOrderDO.setGoodsTypeId(reservationOrder.getGoodsTypeId()); - businessDocumentOrderDO.setWeightMin(reservationOrder.getWeightMin()); - businessDocumentOrderDO.setWeightMax(reservationOrder.getWeightMax()); - businessDocumentOrderDO.setGoodsUntis(reservationOrder.getGoodsUntis()); - businessDocumentOrderDO.setGoodsUntisId(reservationOrder.getGoodsUntisId()); - businessDocumentOrderDO.setLoadingName(reservationOrder.getLoadingName()); - businessDocumentOrderDO.setLoadingAreaId(reservationOrder.getLoadingAreaId()); - businessDocumentOrderDO.setLoadingAddress(reservationOrder.getLoadingAddress()); - businessDocumentOrderDO.setLoadingLongitude(reservationOrder.getLoadingLongitude()); - businessDocumentOrderDO.setLoadingLatitude(reservationOrder.getLoadingLatitude()); - businessDocumentOrderDO.setLoadingPhone(reservationOrder.getLoadingPhone()); - businessDocumentOrderDO.setLoadingDate(reservationOrder.getLoadingDate()); - - businessDocumentOrderDO.setUnloadName(reservationOrder.getUnloadName()); - businessDocumentOrderDO.setUnloadAreaId(reservationOrder.getUnloadAreaId()); - businessDocumentOrderDO.setUnloadAddress(reservationOrder.getUnloadAddress()); - businessDocumentOrderDO.setUnloadLongitude(reservationOrder.getUnloadLongitude()); - businessDocumentOrderDO.setUnloadLatitude(reservationOrder.getUnloadLatitude()); - businessDocumentOrderDO.setUnloadPhone(reservationOrder.getUnloadPhone()); - businessDocumentOrderDO.setUnloadingData(reservationOrder.getUnloadingData()); - businessDocumentOrderDO.setFreighterName(reservationOrder.getFreighterName()); - businessDocumentOrderDO.setDischargerName(reservationOrder.getDischargerName()); - businessDocumentOrderDO.setRemarks(reservationOrder.getRemarks()); - businessDocumentOrderDO.setTransportationModeId(reservationOrder.getTransportationModeId() != null ? - reservationOrder.getTransportationModeId().longValue() : null); - businessDocumentOrderDO.setTransportationName(reservationOrder.getTransportationName()); - businessDocumentOrderDO.setCarType(reservationOrder.getCarType()); - businessDocumentOrderDO.setCarTypeName(reservationOrder.getCarTypeName()); - businessDocumentOrderDO.setServiceRequireId(reservationOrder.getServiceRequireId()); - businessDocumentOrderDO.setServiceRequire(reservationOrder.getServiceRequire()); - businessDocumentOrderDO.setAppointShipperId(reservationOrder.getAppointShipperId()); - businessDocumentOrderDO.setAppointShipper(reservationOrder.getAppointShipper()); businessDocumentOrderDO.setReceivableType(reservationOrder.getReceivableType() != null ? reservationOrder.getReceivableType().longValue() : 2L); businessDocumentOrderDO.setOrderShippingType(reservationOrder.getOrderShippingType() != null ? reservationOrder.getOrderShippingType().longValue() : 1L); - - businessDocumentOrderDO.setOrganizationId(reservationOrder.getOrganizationId()); - businessDocumentOrderDO.setOrganizationName(reservationOrder.getOrganizationName()); - businessDocumentOrderDO.setTopOrganizationId(reservationOrder.getTopOrganizationId()); - businessDocumentOrderDO.setOrgId(reservationOrder.getOrgId()); - businessDocumentOrderDO.setOrgName(reservationOrder.getOrgName()); - - - businessDocumentOrderDO.setRealCreateBy(String.valueOf(loginUser.getUserid())); - businessDocumentOrderDO.setRealCreateName(loginUser.getUsername()); - businessDocumentOrderDO.setCreateBy(loginUser.getUserid()); - businessDocumentOrderDO.setCreateByName(loginUser.getUsername()); - businessDocumentOrderDO.setCreateTime(new Date()); businessDocumentOrderDO.setUpdateTime(new Date()); businessDocumentOrderDO.setDocumentDate(new Date()); + businessDocumentOrderDO.setPayerType(1L); + businessDocumentOrderDO.setLayDate(reservationOrder.getDepartureTime()); if (businessDocumentOrderDO.getOrderShippingType() == null) { businessDocumentOrderDO.setOrderShippingType(1L); // 默认设置为1 @@ -1175,53 +1406,103 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { businessDocumentOrderDO.setInfoFeePayeeType(0L); // 默认设置为0 } - BusinessDocumentOrder businessDocumentOrder = new BusinessDocumentOrder(); - BeanUtils.copyProperties(businessDocumentOrderDO, businessDocumentOrder); - businessDocumentOrder.setId(null); // 确保是新记录 - businessDocumentOrder.setCreateBy(Long.valueOf(loginUser.getUserid())); - businessDocumentOrder.setCreateByName(loginUser.getUsername()); - businessDocumentOrder.setCreateTime(new Date()); - businessDocumentOrder.setUpdateTime(new Date()); - businessDocumentOrder.setDelFlag(1); - - boolean insertResult = businessDocumentOrderService.save(businessDocumentOrder); + // 组装货物信息 - 从 RESERVATION_CARGO_INFO 表查询 + List businessDocumentCargoMultiList = new ArrayList<>(); + LambdaQueryWrapper cargoQueryWrapper = new LambdaQueryWrapper<>(); + cargoQueryWrapper.eq(ReservationCargoInfo::getOrderId, reservationOrder.getId()); + List reservationCargoList = reservationCargoInfoMapper.selectList(cargoQueryWrapper); + if (reservationCargoList.size() > 0) { + for (ReservationCargoInfo reservationCargo : reservationCargoList) { + BusinessDocumentCargoMultiDTO cargoDTO = new BusinessDocumentCargoMultiDTO(); + cargoDTO.setCargoName(reservationCargo.getCargoName()); + cargoDTO.setCargoNum(reservationCargo.getCargoNum() != null ? reservationCargo.getCargoNum() : BigDecimal.ZERO); + cargoDTO.setCargoWeight(reservationCargo.getCargoWeight() != null ? reservationCargo.getCargoWeight() : BigDecimal.ZERO); + cargoDTO.setCargoUnitName(reservationCargo.getCargoUnitName()); + cargoDTO.setWeightUnit(reservationCargo.getCargoUnitName()); + cargoDTO.setGoodsTypeId(reservationCargo.getGoodsTypeId()); + cargoDTO.setGoodsType(reservationCargo.getGoodsType()); + cargoDTO.setGoodsNameId(reservationCargo.getGoodsNameId()); + cargoDTO.setGoodsName(reservationCargo.getGoodsName()); + cargoDTO.setMaterialContent(reservationCargo.getCargoContent()); + cargoDTO.setMachineCode(reservationCargo.getMachineCode()); + businessDocumentCargoMultiList.add(cargoDTO); + } + } + businessDocumentOrderDO.setBusinessDocumentCargoMultiList(businessDocumentCargoMultiList); + + // 组装装卸货地址信息 - 从 RESERVATION_ADDRESS_MULTI 表查询 + List loadingAddressList = new ArrayList<>(); + List unloadAddressList = new ArrayList<>(); + + + // 查询装货地址 (layType = 1) + LambdaQueryWrapper loadingQueryWrapper = new LambdaQueryWrapper<>(); + loadingQueryWrapper.eq(ReservationAddressMulti::getOrderId, reservationOrder.getId()) + .eq(ReservationAddressMulti::getLayType, 1); + List loadingAddressList1 = reservationAddressMultiMapper.selectList(loadingQueryWrapper); +// @ApiModelProperty(value = "装货地址集合") +// private List loadingAddressList; +// @ApiModelProperty(value = "卸货地址集合") +// private List unloadAddressList; + if (loadingAddressList1.size() > 0) { + for (ReservationAddressMulti address : loadingAddressList1) { + BusinessDocumentAddressMultiDTO loadingAddress = new BusinessDocumentAddressMultiDTO(); + loadingAddress.setAreaCode(address.getAreaCode()); + loadingAddress.setAreaName(address.getAreaName()); + loadingAddress.setAddress(address.getAddress()); + loadingAddress.setLongitude(address.getLongitude()); + loadingAddress.setLatitude(address.getLatitude()); + loadingAddress.setContactName(address.getContactName()); + loadingAddress.setContactPhone(address.getContactPhone()); + loadingAddress.setLayDate(address.getLayDate()); + loadingAddress.setLayTimeId(address.getLayTimeId()); + loadingAddress.setLayType(Long.valueOf(address.getLayType())); +// loadingAddress.setSort(Long.valueOf(address.getSort())); +// loadingAddress.setShortName(address.getShortName()); + loadingAddressList.add(loadingAddress); + } + } + + // 查询卸货地址 (layType = 2) + LambdaQueryWrapper unloadQueryWrapper = new LambdaQueryWrapper<>(); + unloadQueryWrapper.eq(ReservationAddressMulti::getOrderId, reservationOrder.getId()) + .eq(ReservationAddressMulti::getLayType, 2); + List unloadAddressList1 = reservationAddressMultiMapper.selectList(unloadQueryWrapper); + if (unloadAddressList1.size() > 0) { + for (ReservationAddressMulti address : unloadAddressList1) { + BusinessDocumentAddressMultiDTO unloadAddress = new BusinessDocumentAddressMultiDTO(); + unloadAddress.setAreaCode(address.getAreaCode()); + unloadAddress.setAreaName(address.getAreaName()); + unloadAddress.setAddress(address.getAddress()); + unloadAddress.setLongitude(address.getLongitude()); + unloadAddress.setLatitude(address.getLatitude()); + unloadAddress.setContactName(address.getContactName()); + unloadAddress.setContactPhone(address.getContactPhone()); + unloadAddress.setLayDate(address.getLayDate()); + unloadAddress.setLayTimeId(address.getLayTimeId()); + unloadAddress.setLayType(Long.valueOf(address.getLayType())); + unloadAddress.setShortName(address.getShortName()); + unloadAddressList.add(unloadAddress); + } + } + + businessDocumentOrderDO.setLoadingAddressList(loadingAddressList); + businessDocumentOrderDO.setUnloadAddressList(unloadAddressList); + businessDocumentOrderDO.setOrderSource("0"); + + // 插入业务单 + Boolean insertResult = businessDocumentOrderApplicationService.insert(businessDocumentOrderDO); if (!insertResult) { throw new ServiceException("创建业务单失败"); } - - - LambdaQueryWrapper orderQueryWrapper = new LambdaQueryWrapper<>(); - orderQueryWrapper.eq(BusinessDocumentOrder::getGoodsNumber, businessDocumentOrderDO.getGoodsNumber()); - BusinessDocumentOrder createdOrder = businessDocumentOrderService.getOne(orderQueryWrapper); - if (createdOrder == null) { - throw new ServiceException("创建业务单后查询失败"); - } - - // 处理货物信息(从预约单获取) -// handleCargoInfoFromReservation(createdOrder.getId(), reservationOrder.getId()); - - // 处理地址信息(从预约单获取) - handleAddressInfoFromReservation(createdOrder.getId(), reservationOrder.getId()); - - // 更新预约单状态 - reservationOrder.setOrderType(1); // 设置为业务单类型 - reservationOrder.setBusinessOrderId(businessDocumentOrder.getId()); // 关联业务单ID - reservationOrder.setBusinessOrderNumber(businessDocumentOrder.getGoodsNumber()); // 关联业务单号 - reservationOrder.setUpdateTime(new Date()); - reservationOrder.setUpdateBy(String.valueOf(loginUser.getUserid())); - - int updateResult = resevationOrderMapper.updateById(reservationOrder); - if (updateResult <= 0) { - throw new ServiceException("更新预约单状态失败"); - } - - - BusinessDocumentOrderPO businessDocumentOrderPO = new BusinessDocumentOrderPO(); - BeanUtils.copyProperties(businessDocumentOrder, businessDocumentOrderPO); - - return businessDocumentOrderPO; + BusinessDocumentOrder businessDocumentOrder = businessDocumentOrderMapper.selectOne(new LambdaQueryWrapper().eq(BusinessDocumentOrder::getGoodsNumber, goodsNumber)); + reservationOrder.setBusinessOrderId(businessDocumentOrder.getId()); + reservationOrder.setBusinessOrderNumber(businessDocumentOrderDO.getGoodsNumber()); + reservationOrder.setOrderType(1); + resevationOrderMapper.updateById(reservationOrder); + return insertResult; } private void saveAddress2CargoInfo(String id, List cargoInfoList, List loadingAddressList, List unloadAddressList) { @@ -1356,7 +1637,8 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { @Override - public Result batchConfirmReservationOrder(List goodsNumbers) { + public Result batchConfirmReservationOrder(BusinessAuditDTO businessAuditDTO) { + List goodsNumbers = businessAuditDTO.getGoodsNumber(); BatchConfirmResult result = new BatchConfirmResult(); result.setTotal(goodsNumbers.size()); result.setSuccessList(new ArrayList<>()); @@ -1365,8 +1647,17 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { // 同步处理,避免线程池问题 for (String goodsNumber : goodsNumbers) { try { - BusinessDocumentOrderPO businessOrder = confirmReservationOrder(goodsNumber); - result.getSuccessList().add(businessOrder); + Boolean businessOrder = confirmReservationOrder(goodsNumber); + if (businessOrder) { + + } else { + result.getFailList().add(new BatchConfirmResult.FailItem(goodsNumber, "确认失败")); + } + ReservationOrder reservationOrder = resevationOrderMapper.selectOne(new LambdaQueryWrapper().eq(ReservationOrder::getGoodsNumber, goodsNumber)); + reservationOrder.setSalesManager(businessAuditDTO.getSalesManager()); + reservationOrder.setReviewOpinion(businessAuditDTO.getReviewOpinion()); + reservationOrder.setSalesmanName(businessAuditDTO.getSalesmanName()); + resevationOrderMapper.updateById(reservationOrder); result.setSuccessCount(result.getSuccessCount() + 1); } catch (Exception e) { result.getFailList().add(new BatchConfirmResult.FailItem(goodsNumber, e.getMessage())); @@ -1389,6 +1680,84 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { } } + @Override + public Map countByOrderType() { + // 使用MyBatis Plus的LambdaQueryWrapper进行分组统计 + Map countMap = new HashMap<>(); + + // 查询所有非删除的订单,按orderType值分别计数 + for (int i = 0; i <= 5; i++) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ReservationOrder::getIsDelete, 0) + .eq(ReservationOrder::getOrderType, i); + long count = resevationOrderMapper.selectCount(queryWrapper); + countMap.put(i, count); + } + + return countMap; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Integer cancelReserve(List goodsNumbers) { + int count = 0; + + for (String goodsNumber : goodsNumbers) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ReservationOrder::getGoodsNumber, goodsNumber); + ReservationOrder reservationOrder = resevationOrderMapper.selectOne(queryWrapper); + List businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper().eq(BusinessDocumentOrder::getGoodsNumber, goodsNumber)); + if (businessDocumentOrders != null && businessDocumentOrders.size() > 0) { + BusinessDocumentOrder businessDocumentOrder = businessDocumentOrders.get(0); + Long orderStatus = businessDocumentOrder.getOrderStatus(); + if (orderStatus ==0L || orderStatus == 1L) { + businessDocumentOrder.setOrderStatus(4L); + businessDocumentOrderMapper.updateById(businessDocumentOrder); + reservationOrder.setOrderType(5); + resevationOrderMapper.updateById(reservationOrder); + count++; + + }else { + throw new ServiceException("订单进行中无法取消,请联系运营人员处理"); + } + }else { + reservationOrder.setOrderType(5); + resevationOrderMapper.updateById(reservationOrder); + count++; + } + } + + // 返回成功修改的条数 + return count; + } + + @Override + public OmsOrderDTO getResevationOrderInfo(String goodsNumber) { + OmsOrderDTO omsOrderDTO = new OmsOrderDTO(); + ReservationOrder reservationOrder = resevationOrderMapper.selectOne(new LambdaQueryWrapper().eq(ReservationOrder::getGoodsNumber, goodsNumber)); + if (reservationOrder == null) { + throw new ServiceException("订单不存在"); + } + BeanUtils.copyProperties(reservationOrder, omsOrderDTO); + Long id = reservationOrder.getId(); + List reservationCargoInfos = reservationCargoInfoMapper.selectList(new LambdaQueryWrapper().eq(ReservationCargoInfo::getOrderId, id)); + if (reservationCargoInfos != null && reservationCargoInfos.size() > 0) { + omsOrderDTO.setReservationCargoInfo(reservationCargoInfos); + } + ReservationAddressMulti loadingAddressMulti = reservationAddressMultiMapper.selectOne(new LambdaQueryWrapper().eq(ReservationAddressMulti::getOrderId, id).eq(ReservationAddressMulti::getLayType,1).eq(ReservationAddressMulti::getDelFlag, 1)); + if (loadingAddressMulti != null) { + omsOrderDTO.setLoadingAddressMulti(loadingAddressMulti); + } + ReservationAddressMulti unloadAddressMulti = reservationAddressMultiMapper.selectOne(new LambdaQueryWrapper().eq(ReservationAddressMulti::getOrderId, id).eq(ReservationAddressMulti::getLayType,2).eq(ReservationAddressMulti::getDelFlag, 1)); + if (unloadAddressMulti != null) { + omsOrderDTO.setUnloadAddressMulti(unloadAddressMulti); + } + + + return omsOrderDTO; + } + @Override public Result batchRejectReservationOrder(List goodsNumbers) { BatchConfirmResult result = new BatchConfirmResult(); diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/assembler/erpEnterpriseUnit/ErpEnterpriseUnitAssembler.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/assembler/erpEnterpriseUnit/ErpEnterpriseUnitAssembler.java new file mode 100644 index 000000000..eacab45de --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/assembler/erpEnterpriseUnit/ErpEnterpriseUnitAssembler.java @@ -0,0 +1,56 @@ +package com.mhd.oms.interfaces.assembler.erpEnterpriseUnit; + +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.security.utils.SecurityUtils; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO; +import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO; +import com.mhd.system.api.model.LoginUser; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +import java.util.Date; + +@Component +public class ErpEnterpriseUnitAssembler { + + /** + * 转换实体 + */ + public ErpEnterpriseUnitDO toDO(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) { + ErpEnterpriseUnitDO erpEnterpriseUnitDO = new ErpEnterpriseUnitDO(); + BeanUtils.copyProperties(erpEnterpriseUnitDTO, erpEnterpriseUnitDO, IgnoreNullUtil.getNullPropertyNames(erpEnterpriseUnitDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + Long userId = loginUser.getUserid(); + if (erpEnterpriseUnitDTO.getId() != null) { + if (userId != null) { + erpEnterpriseUnitDO.setUpdateBy(userId); + } else { + erpEnterpriseUnitDO.setUpdateBy(new Long("0")); + } + erpEnterpriseUnitDO.setUpdateByName(userName); + erpEnterpriseUnitDO.setUpdateTime(new Date()); + } else { + if (userId != null) { + erpEnterpriseUnitDO.setCreateBy(userId); + erpEnterpriseUnitDO.setUpdateBy(userId); + } else { + erpEnterpriseUnitDO.setCreateBy(new Long("0")); + erpEnterpriseUnitDO.setUpdateBy(new Long("0")); + } + erpEnterpriseUnitDO.setCreateByName(userName); + erpEnterpriseUnitDO.setUpdateByName(userName); + erpEnterpriseUnitDO.setCreateTime(new Date()); + erpEnterpriseUnitDO.setUpdateTime(new Date()); + erpEnterpriseUnitDO.setDelFlag(1); + } + return erpEnterpriseUnitDO; + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentAddressMulti/BusinessAuditDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentAddressMulti/BusinessAuditDTO.java index 4de71763d..9611b8cd6 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentAddressMulti/BusinessAuditDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentAddressMulti/BusinessAuditDTO.java @@ -14,11 +14,17 @@ import java.util.List; public class BusinessAuditDTO { private List ids; + //业务主管 private String salesManager; + //审核意见 private String reviewOpinion; private Long reviewStatus; private String salesManagerName; private String reviewOpinionName; @ApiModelProperty("组织id") private Long organizationId; + private List goodsNumber; + //业务员 + private String salesmanName; + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentCargoMulti/BusinessDocumentCargoMultiDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentCargoMulti/BusinessDocumentCargoMultiDTO.java index 168c2f5ab..c5fbd0692 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentCargoMulti/BusinessDocumentCargoMultiDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentCargoMulti/BusinessDocumentCargoMultiDTO.java @@ -99,10 +99,16 @@ public class BusinessDocumentCargoMultiDTO extends BaseVOEntity{ @ApiModelProperty("") private String materialCode; + @ApiModelProperty("物料id") + private Long materialBaseInfoId; + @ApiModelProperty("体积") private BigDecimal materialVolume; @ApiModelProperty("货物内容") private String materialContent; + @ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)") + private Integer productType; + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentOrder/BusinessDocumentOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentOrder/BusinessDocumentOrderDTO.java index 6e75b9a37..798dd487a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentOrder/BusinessDocumentOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessDocumentOrder/BusinessDocumentOrderDTO.java @@ -7,6 +7,7 @@ import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCarg import com.mhd.oms.domain.businessOrderAccount.BusinessOrderAccount; import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessDocumentAddressMultiDTO; import com.mhd.oms.interfaces.dto.businessDocumentCargoMulti.BusinessDocumentCargoMultiDTO; +import com.mhd.oms.interfaces.dto.originalImportExportDocument.OrderWithMaterialDTO; import lombok.Data; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -671,6 +672,8 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{ @ApiModelProperty("$column.columnComment") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date documentDate; @@ -777,6 +780,23 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{ @ApiModelProperty("仓库负责人电话") private String directorPhone; + @ApiModelProperty("进出口方式:I-进口,E-出口") + private String ieType; + + @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 String pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; + @ApiModelProperty("业务单地址集合") private List businessDocumentAddressMultiDTOList; @@ -796,4 +816,48 @@ public class BusinessDocumentOrderDTO extends BaseVOEntity{ @ApiModelProperty("费用科目明细") private List businessOrderAccountList; + + @ApiModelProperty(value = "物料编码") + private String materialCode; + + @ApiModelProperty(value = "物料名称") + private String materialName; + + @ApiModelProperty(value = "净重") + private BigDecimal weightLimit; + + @ApiModelProperty(value = "毛重") + private BigDecimal grossWeight; + + @ApiModelProperty(value = "单价") + private BigDecimal unitPrice; + + @ApiModelProperty(value = "申报单位") + private String declarationUnit; + + @ApiModelProperty(value = "原产国") + private String originCountry; + + @ApiModelProperty(value = "物料明细列表") + private List orderWithMaterialDTOList; + + @ApiModelProperty(value = "单证日期起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date documentDateStart; + + @ApiModelProperty(value = "单证日期止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date documentDateEnd; + + @ApiModelProperty(value = "推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTimeStart; + + @ApiModelProperty(value = "推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTimeEnd; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java new file mode 100644 index 000000000..46b79aa2a --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/businessPartner/BusinessPartnerDTO.java @@ -0,0 +1,62 @@ +package com.mhd.oms.interfaces.dto.businessPartner; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "商业合作伙伴DTO") +public class BusinessPartnerDTO { + + @ApiModelProperty(value = "登录账号") + private String userAccount; + + @ApiModelProperty(value = "企业名称") + private String shipperEnterpriseName; + + @ApiModelProperty(value = "组织ID") + private Long organizationId; + + @ApiModelProperty(value = "组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建时间起") + private String createTimeFrom; + + @ApiModelProperty(value = "创建时间止") + private String createTimeTo; + + @ApiModelProperty(value = "更新时间起") + private String updateTimeFrom; + + @ApiModelProperty(value = "更新时间止") + private String updateTimeTo; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + + @ApiModelProperty(value = "推送状态") + private Integer pushStatus; + + @ApiModelProperty(value = "货主类型:1-个人,2-企业") + private Integer shipperType; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + + @ApiModelProperty(value = "合作伙伴代码") + private String corpCode; + + @ApiModelProperty(value = "公司中文名称") + private String corpName; + + @ApiModelProperty(value = "货主id") + private String shipperId; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java new file mode 100644 index 000000000..ddf8639cf --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java @@ -0,0 +1,42 @@ +package com.mhd.oms.interfaces.dto.erpCountry; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "企业国别DTO") +public class ErpCountryDTO { + + @ApiModelProperty(value = "主键id") + private Long id; + + @ApiModelProperty(value = "ERP国别编码") + private String erpCountryCode; + + @ApiModelProperty(value = "ERP国别名称") + private String erpCountryName; + + @ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + + @ApiModelProperty(value = "所属组织ID") + private Long organizationId; + + @ApiModelProperty(value = "所属组织ID") + private Long TopOrganizationId; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpEnterpriseUnit/ErpEnterpriseUnitDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpEnterpriseUnit/ErpEnterpriseUnitDTO.java new file mode 100644 index 000000000..412e80c2b --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpEnterpriseUnit/ErpEnterpriseUnitDTO.java @@ -0,0 +1,54 @@ +package com.mhd.oms.interfaces.dto.erpEnterpriseUnit; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "企业单位DTO") +public class ErpEnterpriseUnitDTO { + + @ApiModelProperty(value = "主键ID") + private Long id; + + @ApiModelProperty(value = "ERP单位编码") + private String erpCode; + + @ApiModelProperty(value = "ERP单位名称") + private String erpName; + + @ApiModelProperty(value = "推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @ApiModelProperty(value = "推送时间") + private String pushTime; + + @ApiModelProperty(value = "推送时间起") + private String pushTimeFrom; + + @ApiModelProperty(value = "推送时间止") + private String pushTimeTo; + + @ApiModelProperty(value = "推送人") + private String pushBy; + + @ApiModelProperty(value = "所属组织ID") + private Long organizationId; + + @ApiModelProperty(value = "所属组织名称") + private String organizationName; + + @ApiModelProperty(value = "创建时间起") + private String createTimeFrom; + + @ApiModelProperty(value = "创建时间止") + private String createTimeTo; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/exchangeRate/ExchangeRateDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/exchangeRate/ExchangeRateDTO.java new file mode 100644 index 000000000..6d76960aa --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/exchangeRate/ExchangeRateDTO.java @@ -0,0 +1,19 @@ +package com.mhd.oms.interfaces.dto.exchangeRate; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(description = "汇率批量推送DTO") +public class ExchangeRateDTO { + + @ApiModelProperty(value = "汇率ID") + private String id; + + @ApiModelProperty(value = "币种编码(ERP编码)") + private String erpCurrCode; + + @ApiModelProperty(value = "币种名称(ERP名称)") + private String erpCurrName; +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java new file mode 100644 index 000000000..3d01e57f9 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/gwLog/GwLogDTO.java @@ -0,0 +1,45 @@ +package com.mhd.oms.interfaces.dto.gwLog; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +@Data +public class GwLogDTO { + + + @ApiModelProperty("日志类型") + private String type; + + @ApiModelProperty("业务Id") + private Long businessId; + + @ApiModelProperty("状态:1-初始 2-成功 3-失败") + private Integer status; + + @ApiModelProperty("组织id") + private Long organizationId ; + + @ApiModelProperty("推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String sendTimeFrom; + + @ApiModelProperty("推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String sendTimeTo; + + @ApiModelProperty("一级组织id") + private Long topOrganizationId ; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/originalImportExportDocument/OrderWithMaterialDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/originalImportExportDocument/OrderWithMaterialDTO.java new file mode 100644 index 000000000..4a094af1e --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/originalImportExportDocument/OrderWithMaterialDTO.java @@ -0,0 +1,819 @@ +package com.mhd.oms.interfaces.dto.originalImportExportDocument; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +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; + +@Data +public class OrderWithMaterialDTO { + + @ApiModelProperty("物料编码") + private String materialCode; + + @ApiModelProperty("进出口类型") + private String ieType; + + @ApiModelProperty("物料名称") + private String materialName; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("申报单位") + private String declarationUnit; + + @ApiModelProperty("原产国") + private String originCountry; + + @ApiModelProperty("单价") + private BigDecimal unitPrice; + + @ApiModelProperty("净重") + private BigDecimal weightLimit; + + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long id; + + @ApiModelProperty("创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty("修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String realCreateBy; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String realCreateName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String createCompanyId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingAreaId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingAddress; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingLongitude; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingLatitude; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingUnit; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String freighterName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String loadingPhone; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date loadingDate; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadAreaId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadAddress; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadLongitude; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadLatitude; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String dischargerName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadPhone; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date unloadingData; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsTypeId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsNameId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal weightMin; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal weightMax; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsUntisId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsUntis; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long transportationModeId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String transportationName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String carType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String carTypeName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String serviceRequireId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String serviceRequire; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String remarks; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long waybillFrom; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isSource; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date sourceCloseTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String executorId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isDelete; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String lineTitleLeft; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String lineTitleRight; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String sysOrgCode; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isCommon; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsTypeMajor; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long auditStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long waybillMode; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date latestBiddingTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal deliveryFreight; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal collectedFreight; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal uncollectedFreight; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal collectLessFreight; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String auditBy; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date auditTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String businessType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal transportationUnitPrice; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long radioValue; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String createrName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String createrPhone; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isElectricFence; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String wxaQrcode; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String appointShipperId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String createUserId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String appointShipper; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String signatureAddress; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String qrCodeImgUrl; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String shippingNote; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long receivableType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String thirdPartyOrderNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String dispatchOrderNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String appointDriverEnterpriseId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String appointDriverEnterprise; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String cancelOrderRemark; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String orderDriverId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal goodsQuantity; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsQuantityUnitId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsQuantityUnit; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String biddingUnit; + + @ApiModelProperty("业务单状态 0-待审核 1-待执行 2-进行中 3-已完成 4-已取消 5-运输中 6-已拦截") + private Long orderStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long splicingOrderType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long splicingStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String mainOrderId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String mainOrderNum; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String mergeOrderId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String mergeOrderNum; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long payerType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String machineNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long stockFlag; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal infoFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long infoFeePayeeType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String infoFeePayee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long infoFeeStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String infoFeeDocumentNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long orderShippingType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String recipientId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String recipientName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long settlementStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date settlementTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date paymentTime; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String reconciliationInnerNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String receivePaymentNumber; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String invoiceId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isInvoice; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String vehicleTypeId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String vehicleTypeName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String carrier; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String carrierName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long szwlUserId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal freightUnitPrice; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long biddingStatus; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String biddingRemarks; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal cargoInsuranceAmount; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String destination; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal freightCharges; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String payer; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String salesmanId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long isDeclare; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String route; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String containerType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String containerTypeName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String cardType; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String cardTypeName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String externalContainerNo; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String transitPlace; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String shipper; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsShipper; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsShipperTel; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String unloadingCompany; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String contractNo; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal freightFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal unloadingFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal customsFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal shortageFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal miscellaneousFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal otherFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal detentionFee; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal taxRate; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String settlementCurrency; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private BigDecimal volume; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String detailContent; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsRoute; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsPort; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsContact; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsContactPhone; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customsRemark; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String orgId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String goodsCategory; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String makerCodeNc; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String salesmanCodeNc; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String customerCodeNc; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String salesmanName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String orgName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long organizationId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String organizationName; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long topOrganizationId; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date documentDate; + + + @ApiModelProperty( "审核状态 0-未审核 1-审核通过 2-已驳回") + private Long reviewStatus; + + @ApiModelProperty("审核时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date reviewTime; + + @ApiModelProperty("审核人id") + private Long reviewId; + + @ApiModelProperty("审核人") + private String review; + + @ApiModelProperty("$column.columnComment") + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long EXECUTE_STATUS; + + @ApiModelProperty( "执行状态 0-无状态 1-未执行 2-已执行 3-已下发") + private Long executeStatus; + + @ApiModelProperty("执行时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date executeTime; + + @ApiModelProperty("执行人id") + private Long executeId; + + @ApiModelProperty("审核人") + private String executor; + + @ApiModelProperty("预约单id") + private Long reservationOrderId ; + + @ApiModelProperty("预约单号") + private String reservationOrderNumber; + + @ApiModelProperty("执行单id") + private String executeOrderId; + + @ApiModelProperty("执行单号") + private String executeOrderNumber; + + @ApiModelProperty("收款账户id") + private String paymentAccountId; + + @ApiModelProperty("收款账户信息") + private String accountInformation; + + @ApiModelProperty("业务类型") + private Integer businessCategory; + + @ApiModelProperty(value = "组织地址") + private String companyAddress; + + @ApiModelProperty(value = "组织公司名称") + private String companyName; + + @ApiModelProperty(value = "组织公司名称英文") + private String companyNameEn; + + @ApiModelProperty(value = "负责人姓名") + private String contact; + + @ApiModelProperty(value = "组织负责人id") + private String contactPhone; + + @ApiModelProperty(value = "账户名称") + private String accountName; + + @ApiModelProperty(value = "开户银行") + private String accountBank; + + @ApiModelProperty(value = "业务主管") + private String salesManager; + + @ApiModelProperty(value = "审核意见") + private String reviewOpinion; + + @ApiModelProperty(value = "订单来源") + private String orderSource; + + @ApiModelProperty(value = "出入库单号") + private String entryNumber; + + @ApiModelProperty("预计出发日期") + private Date layDate; + + @ApiModelProperty("出入库单号") + private String inOrderNumber; + + @ApiModelProperty("仓库负责人") + private String directorName; + + @ApiModelProperty("仓库负责人电话") + private String directorPhone; + + @ApiModelProperty("仓库负责人电话") + private BigDecimal CargoNum; + + @ApiModelProperty("币制") + private BigDecimal currency; + + @ApiModelProperty("包装规格") + private BigDecimal packName; + + @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 String pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; + + @ApiModelProperty("物料id") + private Long materialBaseInfoId; + + @ApiModelProperty("商品类型/货物类型(0料件,1半成品,2成品)") + private Integer productType; + + @ApiModelProperty("物料ID列表") + private List materialBaseInfoIdList; + + @ApiModelProperty("商品类型列表") + private List productTypeList; +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderDTO.java index 6f5f47bcb..24f22ef88 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderDTO.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.mhd.common.core.annotation.Excel; +import com.mhd.oms.domain.reservationOrder.entity.ReservationAddressMulti; +import com.mhd.oms.domain.reservationOrder.entity.ReservationCargoInfo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -29,6 +31,10 @@ public class OmsOrderDTO { // // @ApiModelProperty(value = "运距(千米)") // private BigDecimal haulDistance; + @ApiModelProperty(value = "订单创建时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private java.util.Date createTime; @ApiModelProperty(value = "订单开始时间") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @@ -786,5 +792,22 @@ public class OmsOrderDTO { @ApiModelProperty("业务单号") private String businessOrderNumber; + + @ApiModelProperty("货物信息") + private List reservationCargoInfo; + + @ApiModelProperty("装货地址") + private ReservationAddressMulti loadingAddressMulti; + + @ApiModelProperty("卸货地址") + private ReservationAddressMulti unloadAddressMulti; + + @ApiModelProperty("业务主管") + private String salesManager; + @ApiModelProperty("审核意见") + private String reviewOpinion; + @ApiModelProperty("起运时间") + private Date departureTime; + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/businessPartner/BusinessPartnerApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/businessPartner/BusinessPartnerApi.java new file mode 100644 index 000000000..f7c504bc7 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/businessPartner/BusinessPartnerApi.java @@ -0,0 +1,35 @@ +package com.mhd.oms.interfaces.facade.businessPartner; + + +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.businessPartner.BusinessPartnerApplicationService; +import com.mhd.oms.interfaces.dto.businessPartner.BusinessPartnerDTO; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +@RestController +@RequestMapping("/businessPartnerApi") +public class BusinessPartnerApi { + + @Resource + private BusinessPartnerApplicationService businessPartnerApplicationService; + + @ApiOperation("商业合作伙伴-分页查询委托方列表") + @GetMapping("/shippperList") + public TableDataInfo shipperList(BusinessPartnerDTO businessPartnerDTO){ + return businessPartnerApplicationService.queryShipperPage(businessPartnerDTO); + + } + + @ApiOperation("商业合作伙伴-批量推送") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List businessPartnerDTOList){ + return businessPartnerApplicationService.batchPush(businessPartnerDTOList); + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java new file mode 100644 index 000000000..dd5e79990 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpCountry/ErpCountryApi.java @@ -0,0 +1,80 @@ +package com.mhd.oms.interfaces.facade.erpCountry; + + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.erpCountry.ErpCountryApplicationService; +import com.mhd.oms.domain.erpCountry.entity.ErpCountry; +import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + + +@Api(tags = "企业国别管理") +@RestController +@RequestMapping("/erpCountryApi") +public class ErpCountryApi extends BaseController{ + @Autowired + private ErpCountryApplicationService erpCountryApplicationService; + + @ApiOperation("查询企业国别列表") + @GetMapping("/list") + public TableDataInfo list(ErpCountryDTO erpCountryDTO){ + startPage(); + return erpCountryApplicationService.queryList(erpCountryDTO); + } + + @ApiOperation("编辑企业国别") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ErpCountryDTO erpCountryDTO) { + if (erpCountryDTO.getId() != null) { + return toAjax(erpCountryApplicationService.update(erpCountryDTO)); + } else { + return toAjax(erpCountryApplicationService.insert(erpCountryDTO)); + } + } + + + @ApiOperation("删除企业国别") + @DeleteMapping("/deleteBatch") + public AjaxResult deleteBatch(@RequestParam("ids") String ids) { + if (ids == null || ids.isEmpty()) { + return AjaxResult.error("没有选择要删除的数据"); + } + List idList = new ArrayList<>(); + for (String id : ids.split(",")) { + idList.add(Long.parseLong(id)); + } + return toAjax(erpCountryApplicationService.deleteByIds(idList)); + } + + @ApiOperation("批量推送企业国别") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List dtoList) { + return erpCountryApplicationService.batchPush(dtoList); + } + + @ApiOperation("获取企业国别详情") + @GetMapping("/getInfo") + public AjaxResult getInfo(Long id) { + if (id == null) { + return AjaxResult.error("ID不能为空"); + } + ErpCountry erpCountry = erpCountryApplicationService.getById(id); + return AjaxResult.success(erpCountry); + } + + @ApiOperation("查询企业国别列表-下拉框用") + @GetMapping("/countryList") + public AjaxResult countryList(ErpCountryDTO erpCountryDTO){ + TableDataInfo tableDataInfo = erpCountryApplicationService.queryList(erpCountryDTO); + return AjaxResult.success(tableDataInfo.getData()); + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpEnterpriseUnit/ErpEnterpriseUnitApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpEnterpriseUnit/ErpEnterpriseUnitApi.java new file mode 100644 index 000000000..2ff5a1071 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/erpEnterpriseUnit/ErpEnterpriseUnitApi.java @@ -0,0 +1,94 @@ +package com.mhd.oms.interfaces.facade.erpEnterpriseUnit; + + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.erpEnterpriseUnit.ErpEnterpriseUnitApplicationService; +import com.mhd.oms.domain.erpEnterpriseUnit.entity.ErpEnterpriseUnit; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.po.ErpEnterpriseUnitPO; +import com.mhd.oms.domain.erpEnterpriseUnit.repository.todo.ErpEnterpriseUnitDO; +import com.mhd.oms.interfaces.assembler.erpEnterpriseUnit.ErpEnterpriseUnitAssembler; +import com.mhd.oms.interfaces.dto.erpEnterpriseUnit.ErpEnterpriseUnitDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + + +@Api(tags = "企业单位管理") +@RestController +@RequestMapping("/erpEnterpriseUnitApi") +@Slf4j +public class ErpEnterpriseUnitApi extends BaseController { + + @Resource + private ErpEnterpriseUnitApplicationService erpEnterpriseUnitApplicationService; + + @Resource + private ErpEnterpriseUnitAssembler erpEnterpriseUnitAssembler; + + + @ApiOperation("查询企业单位列表") + @GetMapping("/list") + public TableDataInfo list(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO){ + ErpEnterpriseUnitDO erpEnterpriseUnitDO = erpEnterpriseUnitAssembler.toDO(erpEnterpriseUnitDTO); + startPage(); + return erpEnterpriseUnitApplicationService.queryList(erpEnterpriseUnitDO); + + } + + + @ApiOperation("编辑企业单位") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ErpEnterpriseUnitDTO erpEnterpriseUnitDTO){ + if(erpEnterpriseUnitDTO.getId() !=null){ + return toAjax(erpEnterpriseUnitApplicationService.update(erpEnterpriseUnitDTO)); + }else{ + return toAjax(erpEnterpriseUnitApplicationService.insert(erpEnterpriseUnitDTO)); + } + } + + + @ApiOperation("批量推送企业单位") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List dtoList) { + return erpEnterpriseUnitApplicationService.batchPush(dtoList); + } + + @ApiOperation("批量删除企业单位") + @DeleteMapping("/deleteBatch") + public AjaxResult deleteBatch(@RequestParam("ids") String ids) { + if (ids == null || ids.isEmpty()) { + return AjaxResult.error("没有选择要删除的数据"); + } + List idList = new ArrayList<>(); + for (String id : ids.split(",")) { + idList.add(Long.parseLong(id)); + } + return toAjax(erpEnterpriseUnitApplicationService.deleteByIds(idList)); + } + + @ApiOperation("获取企业单位详情") + @GetMapping("/getInfo") + public AjaxResult getInfo(Long id) { + if (id == null) { + return AjaxResult.error("ID不能为空"); + } + ErpEnterpriseUnit erpEnterpriseUnit = erpEnterpriseUnitApplicationService.getById(id); + return AjaxResult.success(erpEnterpriseUnit); + } + + @ApiOperation("查询企业单位列表-下拉框用") + @GetMapping("/unitList") + public AjaxResult unitList(ErpEnterpriseUnitDTO erpEnterpriseUnitDTO) { + ErpEnterpriseUnitDO erpEnterpriseUnitDO = erpEnterpriseUnitAssembler.toDO(erpEnterpriseUnitDTO); + TableDataInfo tableDataInfo = erpEnterpriseUnitApplicationService.queryList(erpEnterpriseUnitDO); + return AjaxResult.success(tableDataInfo.getData()); + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java new file mode 100644 index 000000000..ef1cd1e62 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java @@ -0,0 +1,49 @@ +package com.mhd.oms.interfaces.facade.exchangeRate; + + +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.exchangeRate.ExchangeRateApplicationService; +import com.mhd.oms.interfaces.dto.exchangeRate.ExchangeRateDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import java.util.List; + +import static com.mhd.common.core.utils.PageUtils.startPage; + + +@Api(tags = "汇率管理") +@RestController +@RequestMapping("/exchangeRateApi") +public class ExchangeRateApi { + + @Resource + private ExchangeRateApplicationService exchangeRateApplicationService; + + @ApiOperation("查询汇率列表") + @GetMapping("/list") + public TableDataInfo list(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(value = "pushStatus", required = false) String pushStatus, + @RequestParam(value = "organizationId", required = false) String organizationId) { + startPage(); + return exchangeRateApplicationService.queryExchangeRateList(pageNum, pageSize, pushStatus, organizationId); + } + + @ApiOperation("批量推送汇率") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List exchangeRateDTOList) { + return exchangeRateApplicationService.batchPushExchangeRate(exchangeRateDTOList); + } + + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java new file mode 100644 index 000000000..7e3893ffe --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/gwLog/GwLogApi.java @@ -0,0 +1,52 @@ +package com.mhd.oms.interfaces.facade.gwLog; + + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.gwLog.GwLogApplicationService; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.po.GwLogPO; +import com.mhd.oms.interfaces.dto.gwLog.GwLogDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + + +@Api(tags = "GW日志管理") +@RestController +@RequestMapping("/gwLogApi") +public class GwLogApi extends BaseController { + + @Resource + private GwLogApplicationService gwLogApplicationService; + + + @ApiOperation("查询GW日志") + @GetMapping("/queryList") + public TableDataInfo queryList(GwLogDTO gwLogDTO){ + startPage(); + return gwLogApplicationService.queryList(gwLogDTO); + + } + + @ApiOperation("查询GW日志") + @PostMapping("/selectByTypeAndId") + public AjaxResult selectByTypeAndId(@RequestBody GwLogDTO gwLogDTO){ + GwLogPO po = gwLogApplicationService.selectByTypeAndId(gwLogDTO); + if (po == null) + { + return AjaxResult.error(500,"该项数据未推送过/数据错误"); + } + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult.put("code",200); + ajaxResult.put("data",po); + return ajaxResult; + + } + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialInfo/MaterialInfoApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialInfo/MaterialInfoApi.java new file mode 100644 index 000000000..6e56bae38 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialInfo/MaterialInfoApi.java @@ -0,0 +1,41 @@ +package com.mhd.oms.interfaces.facade.materialInfo; + + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.materialInfo.MaterialInfoApplicationService; +import com.mhd.system.api.domain.MaterialInfoDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + + +@Api(tags = "物料信息管理") +@RestController +@RequestMapping("/materialInfoApi") +public class MaterialInfoApi extends BaseController { + + + @Resource + private MaterialInfoApplicationService materialInfoApplicationService; + + @ApiOperation("查询物料信息列表") + @GetMapping("/queryList") + public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO){ + startPage(); + TableDataInfo tableDataInfo = materialInfoApplicationService.queryList(materialInfoDTO); + return tableDataInfo; + } + + @ApiOperation("批量推送物料") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List dtoList) { + return materialInfoApplicationService.batchPush(dtoList); + } + + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/originalImportExportDocument/OriginalImportExportDocumentApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/originalImportExportDocument/OriginalImportExportDocumentApi.java new file mode 100644 index 000000000..251d65f39 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/originalImportExportDocument/OriginalImportExportDocumentApi.java @@ -0,0 +1,176 @@ +package com.mhd.oms.interfaces.facade.originalImportExportDocument; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +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.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.businessDocumentOrder.BusinessDocumentOrderApplicationService; +import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti; +import com.mhd.oms.domain.businessDocumentCargoMulti.repository.mapper.BusinessDocumentCargoMultiMapper; +import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO; +import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO; +import com.mhd.oms.interfaces.assembler.businessDocumentOrder.BusinessDocumentOrderAssembler; +import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO; +import com.mhd.oms.interfaces.dto.originalImportExportDocument.OrderWithMaterialDTO; +import com.mhd.system.api.WmsServiceFeign; +import com.mhd.system.api.domain.MaterialInfoDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Api(tags = "进出口原始单证") +@RestController +@RequestMapping("/OriginalImportExportDocumentApi") +public class OriginalImportExportDocumentApi extends BaseController { + + @Resource + BusinessDocumentCargoMultiMapper businessDocumentCargoMultiMapper; + + @Resource + private BusinessDocumentOrderApplicationService businessDocumentOrderApplicationService; + + @Resource + private BusinessDocumentOrderAssembler businessDocumentOrderAssembler; + + @Resource + private WmsServiceFeign wmsServiceFeign; + + @ApiOperation("进出口原始单证查询列表") + @GetMapping("/list1") + public TableDataInfo list1(BusinessDocumentOrderDTO businessDocumentOrderDTO, + @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { + BusinessDocumentOrderDO businessDocumentOrderDO = businessDocumentOrderAssembler.toDO(businessDocumentOrderDTO); + PageHelper.startPage(pageNo, pageSize); + List orderList = businessDocumentOrderApplicationService.queryListAndMaterial(businessDocumentOrderDO); + + Page page = (Page) orderList; + List resultList = convertToOrderWithMaterialList(orderList); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(resultList); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + @ApiOperation("删改单申请") + @PostMapping("/reviseApply") + public AjaxResult reviseApply(@RequestParam BusinessDocumentOrderDTO businessDocumentOrderDTO) { + + businessDocumentOrderApplicationService.reviseApply(businessDocumentOrderDTO); + + return null; + } + + @ApiOperation("批量推送") + @PostMapping("/batchPush") + public AjaxResult batchPush(@RequestBody List businessDocumentOrderDTOList){ + if(businessDocumentOrderDTOList.isEmpty() || businessDocumentOrderDTOList == null){ + return AjaxResult.error("没有数据需要推送"); + } + return businessDocumentOrderApplicationService.batchPushForOriginalImportExportDocument(businessDocumentOrderDTOList); + + + } + + + + + + @ApiOperation("进出口原始单证查询列表") + @GetMapping("/list") + public TableDataInfo list(BusinessDocumentOrderDTO businessDocumentOrderDTO, + @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { + BusinessDocumentOrderDO businessDocumentOrderDO = businessDocumentOrderAssembler.toDO(businessDocumentOrderDTO); + PageHelper.startPage(pageNo, pageSize); + List orderList = businessDocumentOrderApplicationService.queryListAndMaterial(businessDocumentOrderDO); + + // ✅ 批量查询货物列表并设置到订单 + fillCargoInfo(orderList); + + // ✅ 获取分页信息 + Page page = (Page) orderList; + + List resultList = convertToOrderWithMaterialList(orderList); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(resultList); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + + private void fillCargoInfo(List orderList) { + if (orderList == null || orderList.isEmpty()) { + return; + } + + // 1. 收集所有订单ID + List orderIds = orderList.stream() + .map(BusinessDocumentOrderPO::getId) + .distinct() + .collect(Collectors.toList()); + + // 2. 批量查询货物列表 + List allCargoList = businessDocumentCargoMultiMapper.selectList( + new LambdaQueryWrapper() + .in(BusinessDocumentCargoMulti::getOrderId, orderIds) + ); + + // 3. 按订单ID分组 + Map> cargoMap = allCargoList.stream() + .collect(Collectors.groupingBy(c -> Long.valueOf(c.getOrderId()))); + + // 4. 设置到每个订单 + for (BusinessDocumentOrderPO order : orderList) { + order.setBusinessDocumentCargoMultiList(cargoMap.get(order.getId())); + } + } + + private List convertToOrderWithMaterialList(List orderList) { + List resultList = new ArrayList<>(); + for (BusinessDocumentOrderPO order : orderList) { + OrderWithMaterialDTO dto = new OrderWithMaterialDTO(); + BeanUtils.copyProperties(order, dto); + + // 设置货物列表信息(多个物料ID) + List cargoList = order.getBusinessDocumentCargoMultiList(); + if (cargoList != null && !cargoList.isEmpty()) { + // 物料ID列表 + List materialIdList = cargoList.stream() + .map(BusinessDocumentCargoMulti::getMaterialBaseInfoId) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + dto.setMaterialBaseInfoIdList(materialIdList); + + // 商品类型列表 + List productTypeList = cargoList.stream() + .map(BusinessDocumentCargoMulti::getProductType) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + dto.setProductTypeList(productTypeList); + + // 取第一个货物的物料编码作为主显示 + dto.setMaterialCode(cargoList.get(0).getMaterialCode()); + } + + resultList.add(dto); + } + return resultList; + } + +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java index 58dd7b06d..cc4aee747 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java @@ -1,12 +1,18 @@ package com.mhd.oms.interfaces.facade.resevationOrder; import com.aliyun.oss.ServiceException; +import com.github.pagehelper.PageHelper; import com.mhd.common.core.utils.sms.CommonConstant; import com.mhd.common.core.utils.sms.Result; import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO; +import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO; +import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder; import com.mhd.oms.domain.reservationOrder.repository.facade.IOmsAddressMultiService; import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO; +import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO; +import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO; import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderAddDTO; import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderDTO; import com.mhd.system.api.domain.TmsTransportNote; @@ -17,6 +23,8 @@ import org.springframework.web.bind.annotation.*; import com.mhd.common.core.web.controller.BaseController; import javax.annotation.Resource; import java.util.List; +import java.util.Map; + import com.mhd.common.core.web.domain.AjaxResult; //import static com.mhd.common.core.utils.PageUtils.startPage; @@ -80,19 +88,80 @@ public class ResevationOrderApi extends BaseController{ } return result; } + + + /** + * 修改预约单 + * + * @param tmsOrderAddDTO + * @return +*/ + @ApiOperation(value = "货源表-修改预约单", notes = "货源表-修改预约单") + @PostMapping(value = "/edit") + public Result edit(@RequestBody OmsOrderAddDTO tmsOrderAddDTO) { + Result result = new Result(); + try { + // 获取当前登录用户的组织信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null && loginUser.getUserPo() != null) { + // 设置组织ID + if (loginUser.getUserPo().getOrganizationId() != null) { + tmsOrderAddDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + } + // 设置组织名称 + if (loginUser.getUserPo().getOrganizationName() != null) { + tmsOrderAddDTO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + } + // 设置上级组织ID + if (loginUser.getUserPo().getTopOrganizationId() != null) { + tmsOrderAddDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + + omsAddressMultiService.update(tmsOrderAddDTO); + + result.success("修改成功"); + result.setCode(CommonConstant.SC_OK_200); + } catch (ServiceException e) { + e.printStackTrace(); + result.error500("修改失败:"+e.getErrorMessage()); + } catch (Exception e) { + e.printStackTrace(); + result.error500("修改失败"); + } + return result; + } + @ApiOperation("获取预约单详情") + @GetMapping("/getResevationOrderInfo") + public Result getResevationOrderInfo(@RequestParam("goodsNumber") String goodsNumber) { + try { + OmsOrderDTO detail = omsAddressMultiService.getResevationOrderInfo(goodsNumber); + if (detail == null) { + return Result.error("未查询到该预约单信息"); + } + return Result.ok(detail); + } catch (Exception e) { + return Result.error("查询预约单详情失败:" + e.getMessage()); + } + } + + /** * 分页查询【预约单】列表 */ @ApiOperation("查询【预约单】列表") @GetMapping("/list") - public TableDataInfo list(OmsOrderDTO omsOrderDTO) + public TableDataInfo list(OmsOrderDTO omsOrderDTO, + @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize) { //转换实体 - startPage(); + PageHelper.startPage(pageNo, pageSize); List list = omsAddressMultiService.queryList(omsOrderDTO); return getDataTable(list); } + /** @@ -100,16 +169,12 @@ public class ResevationOrderApi extends BaseController{ */ @ApiOperation("批量确认预约单") @PostMapping("/batchConfirm") - public Result batchConfirm(@RequestBody List goodsNumbers) { + public Result batchConfirm(@RequestBody BusinessAuditDTO businessAuditDTO) { Result result = new Result<>(); try { - if (goodsNumbers == null || goodsNumbers.isEmpty()) { - result.error500("预约单号列表不能为空"); - return result; - } // 调用服务层方法 - 现在服务层直接返回Result - return omsAddressMultiService.batchConfirmReservationOrder(goodsNumbers); + return omsAddressMultiService.batchConfirmReservationOrder(businessAuditDTO); } catch (ServiceException e) { result.error500("批量确认失败: " + e.getErrorMessage()); } catch (Exception e) { @@ -139,5 +204,41 @@ public class ResevationOrderApi extends BaseController{ return result; } + /** + * 根据订单状态(orderType)统计各状态的数量 + */ + @ApiOperation("根据订单状态统计数量") + @GetMapping("/countByOrderType") + public Result> countByOrderType() { + Result> result = new Result<>(); + try { + Map countMap = omsAddressMultiService.countByOrderType(); + result.success("统计成功"); + result.setResult(countMap); + result.setCode(CommonConstant.SC_OK_200); + } catch (Exception e) { + e.printStackTrace(); + result.error500("统计失败: " + e.getMessage()); + } + return result; + } + @ApiOperation("取消预约") + @PostMapping("/cancelReserve") + public Result cancelReserve(@RequestBody List goodsNumbers) { + Result result = new Result<>(); + try { + Integer count = omsAddressMultiService.cancelReserve(goodsNumbers); + if (count > 0) { + return Result.ok("取消预约成功,共处理:" + count + "条"); + } else { + return Result.error("取消预约失败,订单不存在或已取消"); + } + + } catch (Exception e) { + e.printStackTrace(); + return Result.error("取消预约失败:" + e.getMessage()); + } + } + } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java index 3d7c0c303..fa1a59b0a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java @@ -67,9 +67,9 @@ public class SysTableConfigApi extends BaseController { @RequestParam(name="key") String key) { try { SysTableConfig config = sysTableConfigService.getByOrgIdAndKey(organizationId, key, warehouseId,shipperId); - if (config == null) { - return Result.ok("未找到对应配置"); - } +// if (config == null) { +// return Result.ok("未找到对应配置"); +// } return Result.ok(config); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/mhd_oms/src/main/resources/bootstrap.yml b/mhd_oms/src/main/resources/bootstrap.yml index 721ea37d6..d05dfce77 100644 --- a/mhd_oms/src/main/resources/bootstrap.yml +++ b/mhd_oms/src/main/resources/bootstrap.yml @@ -18,17 +18,17 @@ spring: discovery: # server-addr: 127.0.0.1:8848 # 线上测试环境配置 容器名+端口号 -# server-addr: 10.33.0.129:6010 - server-addr: 10.102.192.5:6848 - username: nacos - password: manhuoda@2023 + server-addr: 10.33.0.129:6010 +# server-addr: 10.102.192.5: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.5:6848 - username: nacos - password: manhuoda@2023 + server-addr: 10.33.0.129:6010 +# server-addr: 10.102.192.5:6848 +# username: nacos +# password: manhuoda@2023 #线上正式环境 # server-addr: 10.102.192.105:6848 # 锁定server端的配置文件(读取它的配置项) diff --git a/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml b/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml index ff5421695..d56e74b4c 100644 --- a/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml @@ -168,6 +168,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + @@ -669,6 +676,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DOCUMENT_DATE = #{documentDate} + + and DOCUMENT_DATE =]]> #{documentDateStart} + + + and DOCUMENT_DATE #{documentDateEnd} + + + and PUSH_TIME =]]> #{pushTimeStart} + + + and PUSH_TIME #{pushTimeEnd} + + + and IE_TYPE = #{ieType} + @@ -681,4 +703,531 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select DOCUMENT_PREPARER_NC_code from NGWL_TEST_USER."USER" where USER_ID = #{salesmanCodeNc} + + + + + + + + + + and o.ID = #{id} + + + + + + + + + and ORDER_SOURCE = #{orderSource} + + + AND IN_ORDER_NUMBER LIKE CONCAT('%', #{inOrderNumber}, '%') + + + + and CREATE_COMPANY_ID = #{createCompanyId} + + + and CREATE_TIME >= #{createStartTime} + + + and CREATE_TIME <= #{createEndTime} + 1 - 1/86400 + + + + + + + AND GOODS_NUMBER LIKE CONCAT('%', #{goodsNumber}, '%') + + + and LOADING_AREA_ID = #{loadingAreaId} + + + and LOADING_NAME like concat('%', #{loadingName}, '%') + + + and LOADING_ADDRESS = #{loadingAddress} + + + and LOADING_LONGITUDE = #{loadingLongitude} + + + and LOADING_LATITUDE = #{loadingLatitude} + + + and LOADING_UNIT = #{loadingUnit} + + + and FREIGHTER_NAME like concat('%', #{freighterName}, '%') + + + and LOADING_PHONE = #{loadingPhone} + + + and LOADING_DATE = #{loadingDate} + + + and UNLOAD_AREA_ID = #{unloadAreaId} + + + and UNLOAD_NAME like concat('%', #{unloadName}, '%') + + + and UNLOAD_ADDRESS = #{unloadAddress} + + + and UNLOAD_LONGITUDE = #{unloadLongitude} + + + and UNLOAD_LATITUDE = #{unloadLatitude} + + + and DISCHARGER_NAME like concat('%', #{dischargerName}, '%') + + + and UNLOAD_PHONE = #{unloadPhone} + + + and UNLOADING_DATA = #{unloadingData} + + + and GOODS_TYPE_ID = #{goodsTypeId} + + + and GOODS_TYPE = #{goodsType} + + + and GOODS_NAME_ID = #{goodsNameId} + + + and GOODS_NAME like concat('%', #{goodsName}, '%') + + + and WEIGHT_MIN = #{weightMin} + + + and WEIGHT_MAX = #{weightMax} + + + and GOODS_UNTIS_ID = #{goodsUntisId} + + + and GOODS_UNTIS = #{goodsUntis} + + + and TRANSPORTATION_MODE_ID = #{transportationModeId} + + + and TRANSPORTATION_NAME like concat('%', #{transportationName}, '%') + + + and CAR_TYPE = #{carType} + + + and CAR_TYPE_NAME like concat('%', #{carTypeName}, '%') + + + and SERVICE_REQUIRE_ID = #{serviceRequireId} + + + and SERVICE_REQUIRE = #{serviceRequire} + + + and REMARKS = #{remarks} + + + and WAYBILL_FROM = #{waybillFrom} + + + and IS_SOURCE = #{isSource} + + + and SOURCE_CLOSE_TIME = #{sourceCloseTime} + + + and EXECUTOR_ID = #{executorId} + + + and IS_DELETE = #{isDelete} + + + and LINE_TITLE_LEFT = #{lineTitleLeft} + + + and LINE_TITLE_RIGHT = #{lineTitleRight} + + + and SYS_ORG_CODE = #{sysOrgCode} + + + and IS_COMMON = #{isCommon} + + + and GOODS_TYPE_MAJOR = #{goodsTypeMajor} + + + and AUDIT_STATUS = #{auditStatus} + + + and WAYBILL_MODE = #{waybillMode} + + + and LATEST_BIDDING_TIME = #{latestBiddingTime} + + + and DELIVERY_FREIGHT = #{deliveryFreight} + + + and COLLECTED_FREIGHT = #{collectedFreight} + + + and UNCOLLECTED_FREIGHT = #{uncollectedFreight} + + + and COLLECT_LESS_FREIGHT = #{collectLessFreight} + + + and AUDIT_BY = #{auditBy} + + + and AUDIT_TIME = #{auditTime} + + + and BUSINESS_TYPE = #{businessType} + + + and TRANSPORTATION_UNIT_PRICE = #{transportationUnitPrice} + + + and RADIO_VALUE = #{radioValue} + + + and CREATER_NAME like concat('%', #{createrName}, '%') + + + and CREATER_PHONE = #{createrPhone} + + + and IS_ELECTRIC_FENCE = #{isElectricFence} + + + and WXA_QRCODE = #{wxaQrcode} + + + and APPOINT_SHIPPER_ID = #{appointShipperId} + + + and CREATE_USER_ID = #{createUserId} + + + AND APPOINT_SHIPPER LIKE CONCAT('%', #{appointShipper}, '%') + + + and IS_STATUS = #{isStatus} + + + and SIGNATURE_ADDRESS = #{signatureAddress} + + + and QR_CODE_IMG_URL = #{qrCodeImgUrl} + + + and SHIPPING_NOTE = #{shippingNote} + + + and RECEIVABLE_TYPE = #{receivableType} + + + and THIRD_PARTY_ORDER_NUMBER = #{thirdPartyOrderNumber} + + + and DISPATCH_ORDER_NUMBER = #{dispatchOrderNumber} + + + and APPOINT_DRIVER_ENTERPRISE_ID = #{appointDriverEnterpriseId} + + + and APPOINT_DRIVER_ENTERPRISE = #{appointDriverEnterprise} + + + and CANCEL_ORDER_REMARK = #{cancelOrderRemark} + + + and ORDER_DRIVER_ID = #{orderDriverId} + + + and GOODS_QUANTITY = #{goodsQuantity} + + + and GOODS_QUANTITY_UNIT_ID = #{goodsQuantityUnitId} + + + and GOODS_QUANTITY_UNIT = #{goodsQuantityUnit} + + + and BIDDING_UNIT = #{biddingUnit} + + + and ORDER_STATUS = #{orderStatus} + + + and SPLICING_ORDER_TYPE = #{splicingOrderType} + + + and SPLICING_STATUS = #{splicingStatus} + + + and MAIN_ORDER_ID = #{mainOrderId} + + + and MAIN_ORDER_NUM = #{mainOrderNum} + + + and MERGE_ORDER_ID = #{mergeOrderId} + + + and MERGE_ORDER_NUM = #{mergeOrderNum} + + + and PAYER_TYPE = #{payerType} + + + and MACHINE_NUMBER = #{machineNumber} + + + and STOCK_FLAG = #{stockFlag} + + + and INFO_FEE = #{infoFee} + + + and INFO_FEE_PAYEE_TYPE = #{infoFeePayeeType} + + + and INFO_FEE_PAYEE = #{infoFeePayee} + + + and INFO_FEE_STATUS = #{infoFeeStatus} + + + and INFO_FEE_DOCUMENT_NUMBER = #{infoFeeDocumentNumber} + + + and ORDER_SHIPPING_TYPE = #{orderShippingType} + + + and RECIPIENT_ID = #{recipientId} + + + and RECIPIENT_NAME like concat('%', #{recipientName}, '%') + + + and SETTLEMENT_STATUS = #{settlementStatus} + + + and SETTLEMENT_TIME = #{settlementTime} + + + and PAYMENT_TIME = #{paymentTime} + + + and RECONCILIATION_INNER_NUMBER = #{reconciliationInnerNumber} + + + and RECEIVE_PAYMENT_NUMBER = #{receivePaymentNumber} + + + and INVOICE_ID = #{invoiceId} + + + and IS_INVOICE = #{isInvoice} + + + and VEHICLE_TYPE_ID = #{vehicleTypeId} + + + and VEHICLE_TYPE_NAME like concat('%', #{vehicleTypeName}, '%') + + + and CARRIER = #{carrier} + + + and CARRIER_NAME like concat('%', #{carrierName}, '%') + + + and SZWL_USER_ID = #{szwlUserId} + + + and FREIGHT_UNIT_PRICE = #{freightUnitPrice} + + + and BIDDING_STATUS = #{biddingStatus} + + + and BIDDING_REMARKS = #{biddingRemarks} + + + and CARGO_INSURANCE_AMOUNT = #{cargoInsuranceAmount} + + + and DESTINATION = #{destination} + + + and FREIGHT_CHARGES = #{freightCharges} + + + and PAYER = #{payer} + + + and SALESMAN_ID = #{salesmanId} + + + and IS_DECLARE = #{isDeclare} + + + and ROUTE = #{route} + + + and CONTAINER_TYPE = #{containerType} + + + and CONTAINER_TYPE_NAME like concat('%', #{containerTypeName}, '%') + + + and CARD_TYPE = #{cardType} + + + and CARD_TYPE_NAME like concat('%', #{cardTypeName}, '%') + + + and EXTERNAL_CONTAINER_NO = #{externalContainerNo} + + + and TRANSIT_PLACE = #{transitPlace} + + + and SHIPPER = #{shipper} + + + and CUSTOMS_SHIPPER = #{customsShipper} + + + and CUSTOMS_SHIPPER_TEL = #{customsShipperTel} + + + and UNLOADING_COMPANY = #{unloadingCompany} + + + and CONTRACT_NO = #{contractNo} + + + and FREIGHT_FEE = #{freightFee} + + + and UNLOADING_FEE = #{unloadingFee} + + + and CUSTOMS_FEE = #{customsFee} + + + and SHORTAGE_FEE = #{shortageFee} + + + and MISCELLANEOUS_FEE = #{miscellaneousFee} + + + and OTHER_FEE = #{otherFee} + + + and DETENTION_FEE = #{detentionFee} + + + and TAX_RATE = #{taxRate} + + + and SETTLEMENT_CURRENCY = #{settlementCurrency} + + + and VOLUME = #{volume} + + + and DETAIL_CONTENT = #{detailContent} + + + and CUSTOMS_ROUTE = #{customsRoute} + + + and CUSTOMS_PORT = #{customsPort} + + + and CUSTOMS_CONTACT = #{customsContact} + + + and CUSTOMS_CONTACT_PHONE = #{customsContactPhone} + + + and CUSTOMS_REMARK = #{customsRemark} + + + and ORG_ID = #{orgId} + + + and GOODS_CATEGORY = #{goodsCategory} + + + + + + + + + + + + + + + + + + and ORGANIZATION_ID = #{organizationId} + + + + + + + and PUSH_STATUS = #{pushStatus} + + + and DOCUMENT_DATE = #{documentDate} + + + and DOCUMENT_DATE =]]> #{documentDateStart} + + + and DOCUMENT_DATE #{documentDateEnd} + + + and PUSH_TIME =]]> #{pushTimeStart} + + + and PUSH_TIME #{pushTimeEnd} + + + and IE_TYPE = #{ieType} + + + + diff --git a/mhd_oms/src/main/resources/mapper/erpCountry/ErpCountryMapper.xml b/mhd_oms/src/main/resources/mapper/erpCountry/ErpCountryMapper.xml new file mode 100644 index 000000000..e56558ea3 --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/erpCountry/ErpCountryMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + UPDATE ERP_COUNTRY SET DEL_FLAG = 0 WHERE ID IN + + #{id} + + + + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/erpEnterpriseUnit/ErpEnterpriseUnitMapper.xml b/mhd_oms/src/main/resources/mapper/erpEnterpriseUnit/ErpEnterpriseUnitMapper.xml new file mode 100644 index 000000000..828884083 --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/erpEnterpriseUnit/ErpEnterpriseUnitMapper.xml @@ -0,0 +1,46 @@ + + + + + + + + + UPDATE erp_enterprise_unit set del_flag = 0 where id IN + + #{id} + + + + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml b/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml new file mode 100644 index 000000000..adbd43daa --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/gwLog/GwLogMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/reservationOrder/ReservationDocumentOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationOrder/ReservationDocumentOrderMapper.xml index 9870e67fe..fc2c78f06 100644 --- a/mhd_oms/src/main/resources/mapper/reservationOrder/ReservationDocumentOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationOrder/ReservationDocumentOrderMapper.xml @@ -35,9 +35,7 @@ - - and GOODS_NUMBER = #{goodsNumber} - + and LOADING_AREA_ID = #{loadingAreaId} @@ -56,6 +54,9 @@ and LOADING_UNIT = #{loadingUnit} + + and ORGANIZATION_ID= #{organizationId} + and FREIGHTER_NAME like concat('%', #{freighterName}, '%') @@ -218,8 +219,11 @@ and CREATE_USER_ID = #{createUserId} - - and APPOINT_SHIPPER = #{appointShipper} + + and GOODS_NUMBER LIKE CONCAT('%', #{goodsNumber}, '%') + + + and APPOINT_SHIPPER LIKE CONCAT('%', #{appointShipper}, '%') and IS_STATUS = #{isStatus} diff --git a/mhd_product/src/main/resources/bootstrap.yml b/mhd_product/src/main/resources/bootstrap.yml index af8ac0130..a6edc6d14 100644 --- a/mhd_product/src/main/resources/bootstrap.yml +++ b/mhd_product/src/main/resources/bootstrap.yml @@ -19,20 +19,20 @@ spring: nacos: discovery: # 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 - username: nacos - password: manhuoda@2023 +# server-addr: 10.102.192.5:6848 +# username: nacos +# password: manhuoda@2023 #线上正式环境 # server-addr: 10.33.0.129:6010 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 - username: nacos - password: manhuoda@2023 +# server-addr: 10.102.192.5:6848 +# username: nacos +# password: manhuoda@2023 #线上正式环境 # server-addr: 10.33.0.129:6010 group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置 diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java index 8879dc1c6..53f5a8de6 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java @@ -9,6 +9,7 @@ import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.enums.DictCode; import com.mhd.common.core.utils.poi.ExcelUtil; import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.common.security.utils.SecurityUtils; import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.UserServiceFeign; @@ -20,6 +21,7 @@ import com.mhd.wms.domain.materialBarCode.service.MaterialBarCodeDomainService; import com.mhd.wms.domain.materialBarCode.repository.todo.MaterialBarCodeDO; import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo; import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService; +import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper; import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO; import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO; import com.mhd.wms.domain.materialBaseInfo.service.MaterialBaseInfoDomainService; @@ -49,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import java.io.InputStream; import java.util.ArrayList; import java.util.Date; @@ -97,6 +100,8 @@ public class MaterialBaseInfoApplicationService { @Autowired private IMaterialWarehouseControlService materialWarehouseControlService; + @Resource + private MaterialBaseInfoMapper materialBaseInfoMapper; /** * 分页查询物料基础信息列表 */ @@ -444,6 +449,8 @@ public class MaterialBaseInfoApplicationService { if (StringUtils.isBlank(row.getHsCode()) && StringUtils.isNotBlank(row.getHsCodeImport())) { row.setHsCode(row.getHsCodeImport().trim()); } + // Excel 表头错位或重复时,HS 可能被读入「物料条形码」列;与 HS 完全相同时视为误填,保留 hsCode、清空条码 + normalizeImportBarCodeWhenDuplicateOfHs(row); fillOrganizationName(row, loginUser); String shipperCode = StringUtils.defaultString(row.getShipperCode(), ""); @@ -471,18 +478,36 @@ public class MaterialBaseInfoApplicationService { fillClassifyTypeAndUnit(row); Object result = systemServiceFeign.getPackList(null, row.getPackName(), row.getOrganizationId()); + if (result == null) { + errors.append("第").append(rowNum).append("行:包装规格查询无返回,请稍后重试或检查系统服务;"); + continue; + } Map resultMap = JSON.parseObject(JSONObject.toJSONString(result), new TypeReference>() {}); List> rowsPack = extractTableDataRows(resultMap); - Map stringObjectMap = rowsPack.get(0); - if (stringObjectMap != null){ - String packCode = stringObjectMap.get("packCode") == null ? "" : String.valueOf(stringObjectMap.get("packCode")); - row.setPackCode(packCode); - String packId = stringObjectMap.get("packId") == null ? "" : String.valueOf(stringObjectMap.get("packId")); - row.setPackId(Long.valueOf(packId)); - String unitName = stringObjectMap.get("unitName") == null ? "" : String.valueOf(stringObjectMap.get("unitName")); - row.setUnitCode("EA"); - row.setUnitName(unitName); + if (CollectionUtils.isEmpty(rowsPack)) { + if (StringUtils.isNotBlank(row.getPackName())) { + errors.append("第").append(rowNum).append("行:包装规格「").append(row.getPackName()).append("」不存在或未在系统中维护,请先在主数据维护该包装;"); + } else { + errors.append("第").append(rowNum).append("行:包装规格未填写,或系统中无匹配的包装数据,请填写正确的包装规格名称;"); + } + continue; } + Map stringObjectMap = rowsPack.get(0); + if (stringObjectMap == null) { + errors.append("第").append(rowNum).append("行:包装规格查询结果为空,请检查包装主数据;"); + continue; + } + String packCode = stringObjectMap.get("packCode") == null ? "" : String.valueOf(stringObjectMap.get("packCode")); + row.setPackCode(packCode); + String packId = stringObjectMap.get("packId") == null ? "" : String.valueOf(stringObjectMap.get("packId")); + if (StringUtils.isBlank(packId) || !StringUtils.isNumeric(packId)) { + errors.append("第").append(rowNum).append("行:包装规格数据异常(缺少包装ID),请检查系统包装主数据;"); + continue; + } + row.setPackId(Long.valueOf(packId)); + String unitName = stringObjectMap.get("unitName") == null ? "" : String.valueOf(stringObjectMap.get("unitName")); + row.setUnitCode("EA"); + row.setUnitName(unitName); MaterialBaseInfoDO materialBaseInfoDO = new MaterialBaseInfoDO(); BeanUtils.copyProperties(row, materialBaseInfoDO); @@ -494,7 +519,7 @@ public class MaterialBaseInfoApplicationService { Long materialBaseInfoId = materialBaseInfoDO.getMaterialBaseInfoId(); //商品规则批次 - if (StringUtils.isNotBlank(row.getBatchRuleNameImport())){ + if (StringUtils.isNotBlank(row.getBatchRuleNameImport())) { MaterialGoodsRuleDO materialGoodsRuleDO = new MaterialGoodsRuleDO(); Object batchListByName = systemServiceFeign.getBatchListByName(row.getBatchRuleNameImport(), row.getOrganizationId()); Map batchListByNameMap = JSON.parseObject(JSONObject.toJSONString(batchListByName), new TypeReference>() {}); @@ -964,6 +989,25 @@ public class MaterialBaseInfoApplicationService { } } + /** + * 导入约定:「HS码/HS编码」与「物料条形码」为不同列。模板表头错位或两列误填相同 HS 时, + * barCode 会与 hsCode 相同;此时保留 hsCode,清空主表/子表条码,避免 HS 写入 bar_code。 + */ + private void normalizeImportBarCodeWhenDuplicateOfHs(MaterialBaseInfoDTO row) { + if (row == null) { + return; + } + if (StringUtils.isBlank(row.getBarCode())) { + row.setBarCode(null); + return; + } + row.setBarCode(row.getBarCode().trim()); + String hs = StringUtils.isNotBlank(row.getHsCode()) ? row.getHsCode().trim() : ""; + if (StringUtils.isNotBlank(hs) && row.getBarCode().equals(hs)) { + row.setBarCode(null); + } + } + private List buildImportBarCodeList(MaterialBaseInfoDTO row) { if (StringUtils.isBlank(row.getBarCode())) { return null; @@ -1109,4 +1153,32 @@ public class MaterialBaseInfoApplicationService { return orgCandidates; } + public int updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTimeDate, Long pushBy, String pushByName) { + MaterialBaseInfo materialBaseInfo = new MaterialBaseInfo(); + materialBaseInfo.setMaterialBaseInfoId(materialBaseInfoId); + materialBaseInfo.setPushStatus(pushStatus); + materialBaseInfo.setPushTime(pushTimeDate); + materialBaseInfo.setPushBy(pushBy); + materialBaseInfo.setPushByName(pushByName); + return materialBaseInfoMapper.updateById(materialBaseInfo); + } + + public TableDataInfo getBatchByIds(List materialBaseInfoIds) { + if (materialBaseInfoIds == null || materialBaseInfoIds.isEmpty()) { + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(new ArrayList<>()); + tableDataInfo.setTotal(0); + tableDataInfo.setCode(200); + return tableDataInfo; + } + + List list = materialBaseInfoMapper.selectBatchByIds(materialBaseInfoIds); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/pickingOrder/PickingOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/pickingOrder/PickingOrderApplicationService.java index fdf823e1d..6fa84ad4d 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/pickingOrder/PickingOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/pickingOrder/PickingOrderApplicationService.java @@ -24,9 +24,11 @@ import com.mhd.wms.domain.pickingMaterialDetail.service.PickingMaterialDetailDom import com.mhd.wms.domain.pickingOrder.repository.po.PickingOrderPO; import com.mhd.wms.domain.pickingOrder.repository.todo.PickingOrderDO; import com.mhd.wms.domain.pickingOrder.service.PickingOrderDomainService; +import com.mhd.wms.domain.materialGoodsRule.repository.facade.IMaterialGoodsRuleService; import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService; import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail; import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO; +import com.mhd.wms.util.ReceiptBatchDetailFilter; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -58,6 +60,8 @@ public class PickingOrderApplicationService { @Autowired private SystemServiceFeign systemServiceFeign; @Autowired + private IMaterialGoodsRuleService materialGoodsRuleService; + @Autowired private IOutMaterialDetailService outMaterialDetailService; @@ -212,11 +216,19 @@ public class PickingOrderApplicationService { if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) { List batchDetailFeignPOList = JSON.parseArray( JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class); - if (!CollectionUtils.isEmpty(batchDetailFeignPOList)) { - // 过滤isDisplay=1的属性 - List filteredList = batchDetailFeignPOList.stream() - .filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1) - .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(batchDetailFeignPOList)) { + continue; + } + // 物料未在商品规则中绑定批次模板时不返回批次属性(与收货单组装逻辑一致) + List alignedToRule = ReceiptBatchDetailFilter.filterByMaterialGoodsRule( + materialBaseInfoId, batchDetailFeignPOList, materialGoodsRuleService); + if (CollectionUtils.isEmpty(alignedToRule)) { + continue; + } + List filteredList = alignedToRule.stream() + .filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(filteredList)) { batchDetailMap.put(materialBaseInfoId, filteredList); } } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java index f8b5db3da..4acffe1ef 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java @@ -192,7 +192,7 @@ public class StockInOrderApplicationService { List stockInOrderPOS = stockInOrderDomainService.queryList(stockInOrderDO); for (StockInOrderPO stockInOrderPO : stockInOrderPOS) { Long inOrderId = stockInOrderPO.getInOrderId(); - List list = receiptOrderAccountService.list(new LambdaQueryWrapper().eq(ReceiptOrderAccount::getOrderId, inOrderId)); + List list = receiptOrderAccountService.list(new LambdaQueryWrapper().eq(ReceiptOrderAccount::getOrderId, inOrderId).eq(ReceiptOrderAccount::getInOrOut, "in")); stockInOrderPO.setReceiptOrderAccountList(list); } return stockInOrderPOS; @@ -255,9 +255,10 @@ public class StockInOrderApplicationService { if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) { for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) { receiptOrderAccount.setOrderId(inOrderId); + receiptOrderAccount.setInOrOut("in"); } r = receiptOrderAccountService.saveBatch(receiptOrderAccountList); - wholeRentSynchronizationZXF(inOrderId); + wholeRentSynchronizationZXF(inOrderId,"in"); } return r; } @@ -276,9 +277,10 @@ public class StockInOrderApplicationService { if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) { for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) { receiptOrderAccount.setOrderId(outOrderId); + receiptOrderAccount.setInOrOut("out"); } r = receiptOrderAccountService.saveBatch(receiptOrderAccountList); - wholeRentSynchronizationZXF(outOrderId); + wholeRentSynchronizationZXF(outOrderId,"out"); } return r; } @@ -286,10 +288,10 @@ public class StockInOrderApplicationService { /** * 定时任务整租推送到bms装卸费 */ - public void wholeRentSynchronizationZXF(Long busId) { - StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper().lambda().eq(StockInOrder::getInOrderId, busId),false); - StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper().lambda().eq(StockOutOrder::getOutOrderId, busId),false); - if (stockInOrder != null) { + public void wholeRentSynchronizationZXF(Long busId,String inOrOut) { + StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper().lambda().eq(StockInOrder::getInOrderId, busId).eq(StockInOrder::getDelFlag, 1),false); + StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper().lambda().eq(StockOutOrder::getOutOrderId, busId).eq(StockOutOrder::getDelFlag, 1),false); + if ("in".equals(inOrOut)) { Long shipperId = stockInOrder.getShipperId(); Long organizationId = stockInOrder.getOrganizationId(); String organizationName = stockInOrder.getOrganizationName(); @@ -297,7 +299,7 @@ public class StockInOrderApplicationService { String inOrderNumber = stockInOrder.getInOrderNumber(); String settlementCurrency = stockInOrder.getSettlementCurrency(); String salesmanId = stockInOrder.getSalesmanId(); - List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId)); + List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "in")); for (ReceiptOrderAccount account : accounts) { BigDecimal amount = account.getAmount(); String subjectCode = account.getSubjectCode(); @@ -355,7 +357,7 @@ public class StockInOrderApplicationService { bmsServiceFeign.wholeRentSynchronizationZXF(businessDataPushDTO); } } - } else if (stockOutOrder != null) { + } else if ("out".equals(inOrOut)) { Long shipperId = stockOutOrder.getShipperId(); Long organizationId = stockOutOrder.getOrganizationId(); String organizationName = stockOutOrder.getOrganizationName(); @@ -363,7 +365,7 @@ public class StockInOrderApplicationService { String inOrderNumber = stockOutOrder.getOutOrderNumber(); String settlementCurrency = stockOutOrder.getSettlementCurrency(); String salesmanId = stockOutOrder.getSalesmanId(); - List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId)); + List accounts = receiptOrderAccountService.list(new QueryWrapper().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "out")); for (ReceiptOrderAccount account : accounts) { String subjectCode = account.getSubjectCode(); String subjectName = account.getSubjectName(); diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java index 08533094a..92da35fea 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java @@ -212,7 +212,7 @@ public class StockOutOrderApplicationService { Map> accountByOrderId = Collections.emptyMap(); if (!CollectionUtils.isEmpty(orderIds)) { List accounts = receiptOrderAccountService.list( - new LambdaQueryWrapper().in(ReceiptOrderAccount::getOrderId, orderIds)); + new LambdaQueryWrapper().in(ReceiptOrderAccount::getOrderId, orderIds).eq(ReceiptOrderAccount::getInOrOut, "out")); accountByOrderId = accounts.stream().collect(Collectors.groupingBy(ReceiptOrderAccount::getOrderId)); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java index c71655d58..9e470bc5b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -4,13 +4,16 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; 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.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; +import java.util.Date; import java.util.List; @@ -204,4 +207,24 @@ public class MaterialBaseInfo extends BaseVOEntity { @TableField("copy_code") private Integer copyCode; + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty(name = "推送状态 1-未推送 2-推送中 3-推送成功 4-推送失败") + private Integer pushStatus; + @ApiModelProperty(name = "推送时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date pushTime; + @ApiModelProperty(name = "推送人") + private Long pushBy; + + @ApiModelProperty(name = "推送人名称") + private String pushByName; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/mapper/MaterialBaseInfoMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/mapper/MaterialBaseInfoMapper.java index 39fb4ae47..7a4ef0737 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/mapper/MaterialBaseInfoMapper.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/mapper/MaterialBaseInfoMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo; import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO; import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,4 +22,7 @@ public interface MaterialBaseInfoMapper extends BaseMapper public List queryList(MaterialBaseInfoDO materialBaseInfoDO); MaterialBaseInfoPO selectOneByID(Long materialBaseInfoId); + + List selectBatchByIds(@Param("materialBaseInfoIds") List materialBaseInfoIds); + } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index 8867ac844..448ea452e 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -1,6 +1,8 @@ package com.mhd.wms.domain.materialBaseInfo.repository.po; +import com.alibaba.nacos.shaded.io.grpc.Internal; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; import com.mhd.common.core.annotation.Excel; import com.mhd.common.core.handler.ListTypeHandler; import com.mhd.common.core.web.domain.BaseVOEntity; @@ -13,8 +15,10 @@ import com.mhd.wms.domain.materialWarehouseControl.repository.po.MaterialWarehou 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; @@ -249,4 +253,26 @@ public class MaterialBaseInfoPO extends BaseVOEntity { @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("推送状态 1-未推送 2推送中 3-推送成功 4-推送失败") + private Integer pushStatus; + + @ApiModelProperty("推送时间") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty(name = "推送人名称") + private String pushByName; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java index 23cbec64a..18d71d9d8 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java @@ -221,4 +221,33 @@ public class MaterialBaseInfoDO extends BaseVOEntity { @ApiModelProperty("是否抄码: 1-是 2-否") @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("推送状态") + private Integer pushStatus; + + @ApiModelProperty("推送时间起") + private String pushTimeStart; + + @ApiModelProperty("推送时间止") + private String pushTimeEnd; + + @ApiModelProperty("创建时间起") + private String createTimeStart; + + @ApiModelProperty("创建时间止") + private String createTimeEnd; + + @ApiModelProperty("更新时间起") + private String updateTimeStart; + + @ApiModelProperty("更新时间止") + private String updateTimeEnd; } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java index a333dd8a8..5a42b31a8 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java @@ -33,6 +33,8 @@ public interface MaterialInventoryMapper extends BaseMapper public List queryListByWl(MaterialInventoryDO materialInventoryDO); //查物料库存列表-货主 public List queryListByHz(MaterialInventoryDO materialInventoryDO); + //查物料库存列表-货主+物料(同一物料在不同货主下各一行) + public List queryListByHzWl(MaterialInventoryDO materialInventoryDO); /** * @description 批量增加库存 diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java index b866af172..2aa1eb87f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java @@ -77,6 +77,8 @@ public class MaterialInventoryImpl extends ServiceImpl materialBaseInfos = materialBaseInfoMapper.selectList(new QueryWrapper().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()); + MaterialBaseInfo mbi = materialBaseInfos.get(0); + outMaterialDetail.setCommodityName(mbi.getMaterialName()); + // 主数据未维护条码时不写入明细,避免误带主表 bar_code(如历史脏数据);有维护再回填 + if (StringUtils.isNotBlank(mbi.getBarCode())) { + outMaterialDetail.setBarCode(mbi.getBarCode().trim()); + } else { + outMaterialDetail.setBarCode(null); + } + outMaterialDetail.setPackName(mbi.getPackName()); + outMaterialDetail.setPackCode(mbi.getPackCode()); + outMaterialDetail.setUnitCode(mbi.getUnitCode()); + outMaterialDetail.setUnitName(mbi.getUnitName()); } outMaterialDetailList.add(outMaterialDetail); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java index 525b069a6..f2e8dd727 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java @@ -210,6 +210,7 @@ public class ReviewOrderDomainService { d.setMaterialCode(line.getMaterialCode()); d.setMaterialName(line.getMaterialName()); d.setBarCode(line.getBarCode()); + d.setSize(line.getSize()); d.setUnitCode(line.getUnitCode()); d.setUnitName(line.getUnitName()); d.setLotNo(line.getLotNo()); @@ -272,6 +273,9 @@ public class ReviewOrderDomainService { if (!StringUtils.hasText(d.getBarCode())) { d.setBarCode(outMd.getBarCode()); } + if (!StringUtils.hasText(d.getSize()) && StringUtils.hasText(outMd.getSize())) { + d.setSize(outMd.getSize()); + } if (d.getMaterialBaseInfoId() == null) { d.setMaterialBaseInfoId(outMd.getMaterialBaseInfoId()); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java index 3f7cadb60..04ee86b95 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptOrderAccount/entity/ReceiptOrderAccount.java @@ -115,4 +115,6 @@ public class ReceiptOrderAccount extends BaseVOEntity { @ApiModelProperty(value = "计算价格json") private String amountJson; + @ApiModelProperty(value = "出入库区别标识") + private String inOrOut; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java index 6430dbcb6..30a5c5291 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java @@ -42,6 +42,10 @@ public class ReviewMaterialDetail extends BaseVOEntity { private String barCode; + @ApiModelProperty("尺寸") + @TableField("SIZE") + private String size; + private String unitCode; private String unitName; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/repository/po/ReviewMaterialDetailPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/repository/po/ReviewMaterialDetailPO.java index 8eb89e324..12328c7e4 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/repository/po/ReviewMaterialDetailPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/repository/po/ReviewMaterialDetailPO.java @@ -49,6 +49,9 @@ public class ReviewMaterialDetailPO extends BaseVOEntity { @ApiModelProperty("物料条码") private String barCode; + @ApiModelProperty("尺寸") + private String size; + @ApiModelProperty("单位代码") private String unitCode; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/statementStatistics/po/ImmediateInventoryPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/statementStatistics/po/ImmediateInventoryPO.java index a3885172a..58685fd21 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/statementStatistics/po/ImmediateInventoryPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/statementStatistics/po/ImmediateInventoryPO.java @@ -134,4 +134,24 @@ public class ImmediateInventoryPO { @ApiModelProperty("LOT编号") @Excel(name = "LOT编号") private String lotNumber; + + @ApiModelProperty("库存更新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inventoryUpdateTime; + + @ApiModelProperty("拣货明细最近更新时间(本库存相关已拣货明细)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pickLastUpdateTime; + + @ApiModelProperty("复核明细最近更新时间(本库存相关复核条件内明细)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date checkLastUpdateTime; + + @ApiModelProperty("列表排序用时间(库存/拣货/复核三者最晚)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date latestChangeTime; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/service/StockOutOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/service/StockOutOrderDomainService.java index e51e44ba2..9ca8f0c1b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/service/StockOutOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockOutOrder/service/StockOutOrderDomainService.java @@ -1651,6 +1651,11 @@ public class StockOutOrderDomainService { outMaterialDetailDO.setPackCode(materialBaseInfoPO.getPackCode()); outMaterialDetailDO.setPackName(materialBaseInfoPO.getPackName()); + // 将出库数量赋值给计划数量 + if (outMaterialDetailDO.getOutboundQuantity() != null) { + outMaterialDetailDO.setQuantity(outMaterialDetailDO.getOutboundQuantity()); + } + //获取包装详情 /*AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA"); if(!"200".equals(String.valueOf(packDetailResult.get("code")))){ diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java index 04cb015d7..46be86afd 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java @@ -1477,6 +1477,10 @@ public class StockShelfOrderDomainService { break; } } + } else { + param.setBoxPalletNo(shelfMaterialDetail.getBoxPalletNo()); + param.setSheetRefNo(shelfMaterialDetail.getSheetRefNo()); + param.setBatchRefNo(shelfMaterialDetail.getBatchRefNo()); } return param; } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java index 9a6b163e4..8a6fa978d 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java @@ -264,4 +264,36 @@ public class MaterialBaseInfoDTO extends BaseVOEntity { @ApiModelProperty("是否抄码: 1-是 2-否") @Excel(name = "是否抄码: 1-是 2-否") private Integer copyCode; + + @ApiModelProperty("货物类型:0-物料 1-半成品 2-成品") + @Excel(name = "货物类型:0-物料 1-半成品 2-成品") + private Integer goodsType; + + @ApiModelProperty("毛重(kg)") + @Excel(name = "毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("推送状态") + private Integer pushStatus; + + @ApiModelProperty("推送时间起") + private String pushTimeStart; + + @ApiModelProperty("推送时间止") + private String pushTimeEnd; + + @ApiModelProperty("创建时间起") + private String createTimeStart; + + @ApiModelProperty("创建时间止") + private String createTimeEnd; + + @ApiModelProperty("更新时间起") + private String updateTimeStart; + + @ApiModelProperty("更新时间止") + private String updateTimeEnd; + + @ApiModelProperty(name = "推送人名称") + private String pushByName; } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialInventory/MaterialInventoryDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialInventory/MaterialInventoryDTO.java index 003cbdf71..28b534be9 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialInventory/MaterialInventoryDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialInventory/MaterialInventoryDTO.java @@ -162,7 +162,7 @@ public class MaterialInventoryDTO extends MaterialBaseDTO { @ApiModelProperty("箱号/卡板号") @Excel(name = "箱号/卡板号") private String boxPalletNo; - //查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部 + //查询规则 hz:货主,hzwl:货主+物料,wl:物料,kw:库位,wlkw:物料库位,all:全部(materialInventoryApi/listAll 传 hz 时后端按货主+物料分组) private String queryRule; @ApiModelProperty("净重(KG)") @@ -185,4 +185,8 @@ public class MaterialInventoryDTO extends MaterialBaseDTO { @Excel(name = "冻结数量大于0条件") private String greaterThanFreezeQuantity; + /** 为 true 时排除库存数量为 0 的行(出库分配选库存用);库存查询页不传或 false */ + @ApiModelProperty(value = "是否排除库存数量为0", example = "false") + private Boolean excludeZeroInventoryQuantity; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java index 1a50ac6ce..3cac82a3f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java @@ -1,7 +1,10 @@ package com.mhd.wms.interfaces.facadeApi.materialBaseInfo; +import cn.hutool.core.date.DateUtil; +import com.github.pagehelper.Page; import com.mhd.common.core.domain.entity.R; import com.mhd.common.core.exception.ServiceException; +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.core.web.page.TableDataInfo; @@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.util.Date; import java.util.List; /** @@ -109,10 +113,43 @@ public class MaterialBaseInfoApi extends BaseController { return materialBaseInfoApplicationService.importData(file); } + @ApiOperation("物料管理更新推送信息") + @PostMapping("/updatePushStatus") + public AjaxResult updateMaterialPushStatus(@RequestParam("materialBaseInfoId") Long materialBaseInfoId, + @RequestParam("pushStatus") Integer pushStatus, + @RequestParam(value = "pushTime",required = false) String pushTime, + @RequestParam(value = "pushBy",required = false) Long pushBy, + @RequestParam(value = "pushByName",required = false) String pushByName){ + Date pushTimeDate = null; + if (StringUtils.isNotBlank(pushTime)) { + pushTimeDate = DateUtil.parse(pushTime); + } + return toAjax(materialBaseInfoApplicationService.updatePushStatus(materialBaseInfoId, pushStatus, pushTimeDate, pushBy, pushByName)); + } + + @ApiOperation("查询物料基础信息列表") + @GetMapping("/queryList") + public TableDataInfo queryList(MaterialBaseInfoDTO materialBaseInfoDTO) + { + //转换实体 + MaterialBaseInfoDO materialBaseInfoDO = materialBaseInfoAssembler.toDO(materialBaseInfoDTO); + startPage(); + List list = materialBaseInfoApplicationService.queryList(materialBaseInfoDO); + Page page = (Page) list; + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setTotal(page.getTotal()); + tableDataInfo.setCode(200); + tableDataInfo.setData(list); + return tableDataInfo; + } - + @ApiOperation("根据物料ID列表批量查询物料") + @GetMapping("/getBatchByIds") + public TableDataInfo getBatchByIds(@RequestParam("materialBaseInfoIds") List materialBaseInfoIds) { + return materialBaseInfoApplicationService.getBatchByIds(materialBaseInfoIds); + } } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialInventory/MaterialInventoryApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialInventory/MaterialInventoryApi.java index ab891ebbb..94370ff6e 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialInventory/MaterialInventoryApi.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialInventory/MaterialInventoryApi.java @@ -48,11 +48,15 @@ public class MaterialInventoryApi extends BaseController { /** * 分页查询物料库存列表 */ - @ApiOperation("查询物料库存列表") + @ApiOperation(value = "查询物料库存列表", notes = "库存查询页不传 excludeZeroInventoryQuantity 可查出数量为0;出库分配页传 excludeZeroInventoryQuantity=true 排除库存数量为0") @GetMapping("/list") public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO, - @RequestParam(value = "customerName", required = false) String customerName) + @RequestParam(value = "customerName", required = false) String customerName, + @RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity) { + if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) { + materialInventoryDTO.setExcludeZeroInventoryQuantity(true); + } // 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配) String shipperName = null; // 保存查询到的货主名称 if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) { @@ -124,12 +128,16 @@ public class MaterialInventoryApi extends BaseController { return tableDataInfo; } - @ApiOperation("查询物料库存列表不分页") + @ApiOperation("查询物料库存列表不分页;queryRule=hz 时按货主+物料分组(同一物料在不同货主各占一行)") @GetMapping("/listAll") public TableDataInfo listAll(MaterialInventoryDTO materialInventoryDTO) { //转换实体 MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); + // 不分页列表按货主查询:需按「货主+物料」汇总;分页 /list 仍用 hz 表示仅按货主一行 + if ("hz".equals(materialInventoryDO.getQueryRule())) { + materialInventoryDO.setQueryRule("hzwl"); + } List list = materialInventoryApplicationService.queryList(materialInventoryDO); return getDataTable(list); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/statementStatistics/StatementStatisticsApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/statementStatistics/StatementStatisticsApi.java index bd3a59e68..f4b7232de 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/statementStatistics/StatementStatisticsApi.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/statementStatistics/StatementStatisticsApi.java @@ -1,8 +1,11 @@ package com.mhd.wms.interfaces.facadeApi.statementStatistics; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.mhd.common.core.constant.HttpStatus; import com.mhd.common.core.utils.PageUtils; +import com.mhd.common.core.web.page.PageDomain; +import com.mhd.common.core.web.page.TableSupport; import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.wms.application.service.statementStatistics.StatementStatisticsService; import com.mhd.wms.domain.statementStatistics.po.ImmediateInventoryPO; @@ -100,6 +103,18 @@ public class StatementStatisticsApi { PageUtils.startPage(); } + /** + * 即时库存分页:不注入 PageHelper 的 orderBy,保证仅使用 SQL 中的倒序(时间由晚到早)。 + */ + private void startPageImmediateInventory() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, "").setReasonable(reasonable); + } + /** * 响应请求分页数据 */ diff --git a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml index ce37e1502..20541de70 100644 --- a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml @@ -58,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + @@ -66,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_classify_name, a.material_type, a.material_type_name, a.pack_id, a.pack_code, a.pack_name, a.unit_code, a.unit_name, a.brand_id, a.brand_code, a.brand_name, a.shelf_life, a.weight_limit, a.volume_limit, a.material_shape, material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common, sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, a.copy_code, + a.push_status,a.push_time,a.push_by,a.goods_type,a.gross_weight, specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity from material_base_info a left join ( select material_base_info_id, sum(INVENTORY_QUANTITY) as stock_qty from MATERIAL_INVENTORY group by material_base_info_id ) b on a.material_base_info_id = b.material_base_info_id @@ -209,6 +215,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mgr.batch_id = #{batchId} and mgr.del_flag = 1 ) + + + and a.push_status = #{pushStatus} + + + and date_format(a.push_time,'%Y-%m-%d') >= #{pushTimeStart} + + + and date_format(a.push_time,'%Y-%m-%d') <= #{pushTimeEnd} + + + and date_format(a.create_time,'%Y-%m-%d') >= #{createTimeStart} + + + and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeEnd} + + + and date_format(a.update_time,'%Y-%m-%d') >= #{updateTimeStart} + + + and date_format(a.update_time,'%Y-%m-%d') <= #{updateTimeEnd} @@ -281,4 +308,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where material_base_info_id = #{materialBaseInfoId} + + + + + \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml index 980657c29..64b1b5548 100644 --- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml @@ -89,6 +89,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.in_order_number,a.lot_number + + + a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id, + a.shipper_id, a.shipper_code, a.shipper_name, + loc.warehouse_id, loc.warehouse_code, loc.warehouse_name, + loc.storage_section_id, loc.storage_code, loc.storage_name, loc.storage_location_id, loc.storage_location_code, loc.storage_location_name, a.material_base_info_id,a.material_detail_id, + a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name + ,IFNULL (sum(a.freeze_quantity), 0) freeze_quantity,a.is_able, + IFNULL (sum(a.inventory_quantity), 0) inventory_quantity, + IFNULL (sum(a.allocation_quantity), 0) allocation_quantity, + a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, + a.del_flag,a.unit, + IFNULL (sum(a.area), 0) area, + IFNULL (sum(a.NET_WEIGHT), 0) NET_WEIGHT, + IFNULL (sum(a.GROSS_WEIGHT), 0) GROSS_WEIGHT, + IFNULL (sum(a.VOLUME), 0) VOLUME, + a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4, + a.production_date, a.expiry_date, a.inventory_date, + a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name, + a.bar_code as inv_bar_code, + a.in_order_number,a.lot_number + + and a.material_inventory_id = #{materialInventoryId} @@ -183,6 +206,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.freeze_quantity = #{freezeQuantity} + + and COALESCE(a.inventory_quantity, 0) > 0 + and a.create_by_name like concat('%', #{createByName}, '%') @@ -208,6 +234,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + and mi.material_inventory_id = #{materialInventoryId} + + + and mi.organization_id = #{organizationId} + + + and mi.organization_name like concat('%', #{organizationName}, '%') + + + and mi.top_organization_id = #{topOrganizationId} + + + and mi.warehouse_id = #{warehouseId} + + + and mi.shipper_id = #{shipperId} + + + and mi.warehouse_code = #{warehouseCode} + + + and mi.warehouse_name like concat('%', #{warehouseName}, '%') + + + and mi.storage_section_id = #{storageSectionId} + + + and mi.storage_code = #{storageCode} + + + and mi.storage_name like concat('%', #{storageName}, '%') + + + and mi.storage_location_id = #{storageLocationId} + + + and mi.storage_location_code = #{storageLocationCode} + + + and mi.storage_location_name like concat('%', #{storageLocationName}, '%') + + + and mi.material_base_info_id = #{materialBaseInfoId} + + + and mi.material_detail_id, = #{materialDetailId} + + + + and (mi.container_code like concat('%', #{containerOrBatch}, '%') or mi.batch_number like concat('%', #{containerOrBatch}, '%')) + + + and (mi.batch_number like concat('%', #{batchNumber}, '%') or mi.container_code like concat('%', #{containerCode}, '%')) + + + + and mi.batch_number like concat('%', #{batchNumber}, '%') + + + and mi.container_code like concat('%', #{containerCode}, '%') + + + + + and mi.material_status_code like concat('%', #{materialStatusCode}, '%') + + + and mi.material_status_name like concat('%', #{materialStatusName}, '%') + + + and mi.container_id = #{containerId} + + + and mi.container_type like concat('%', #{containerType}, '%') + + + and mi.container_type_name like concat('%', #{containerTypeName}, '%') + + + and mi.inventory_quantity = #{inventoryQuantity} + + + and mi.allocation_quantity = #{allocationQuantity} + + + and mi.freeze_quantity = #{freezeQuantity} + + + and COALESCE(mi.inventory_quantity, 0) > 0 + + + + and mi.create_by_name like concat('%', #{createByName}, '%') + + + and mi.update_by_name like concat('%', #{updateByName}, '%') + + + and mi.del_flag = #{delFlag} + and mi.del_flag = 1 + + + and (mi.storage_location_code = #{storageInfo} or material_code = #{storageInfo} or material_name like concat('%', #{storageInfo}, '%') or bar_code = #{storageInfo}) + + + and mi.BATCH_REF_NO like concat('%', #{batchRefNo}, '%') + + + and mi.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%') + + + and mi.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%') + + + select - + from material_inventory a left join material_base_info b on a.material_base_info_id = b.material_base_info_id + inner join ( + select material_base_info_id, warehouse_id, warehouse_code, warehouse_name, + storage_section_id, storage_code, storage_name, + storage_location_id, storage_location_code, storage_location_name + from ( + select mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name, + mi.storage_section_id, mi.storage_code, mi.storage_name, + mi.storage_location_id, mi.storage_location_code, mi.storage_location_name, + row_number() over (partition by mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as wl_rn + from material_inventory mi + left join material_base_info b on mi.material_base_info_id = b.material_base_info_id + + + + + ) wl_ranked where wl_ranked.wl_rn = 1 + ) loc on loc.material_base_info_id = a.material_base_info_id - GROUP BY a.MATERIAL_BASE_INFO_ID + GROUP BY a.MATERIAL_BASE_INFO_ID, + loc.warehouse_id, loc.warehouse_code, loc.warehouse_name, + loc.storage_section_id, loc.storage_code, loc.storage_name, + loc.storage_location_id, loc.storage_location_code, loc.storage_location_name + + + + @@ -653,7 +855,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.organization_name, a.top_organization_id, a.batch_number, - a.in_order_number,a.lot_number + a.in_order_number, + a.lot_number, + a.update_time inventory_update_time, + ( + SELECT MAX(c.update_time) + FROM picking_material_detail c + LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER + left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER + WHERE + c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ) pick_last_update_time, + ( + SELECT MAX(c.update_time) + FROM OUT_MATERIAL_DETAIL c + LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER + LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER + WHERE + d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12) + AND d.DEL_FLAG = 1 + AND c.DEL_FLAG = 1 + and e.del_flag = 1 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ) check_last_update_time, + GREATEST( + IFNULL(a.update_time, '1970-01-01 00:00:00'), + IFNULL(( + SELECT MAX(c.update_time) + FROM picking_material_detail c + LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER + left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER + WHERE + c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ), '1970-01-01 00:00:00'), + IFNULL(( + SELECT MAX(c.update_time) + FROM OUT_MATERIAL_DETAIL c + LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER + LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER + WHERE + d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12) + AND d.DEL_FLAG = 1 + AND c.DEL_FLAG = 1 + and e.del_flag = 1 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ), '1970-01-01 00:00:00') + ) latest_change_time FROM material_inventory a left join material_base_info b on a.material_base_info_id=b.material_base_info_id @@ -925,6 +1186,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.freeze_quantity < #{freezeQuantityEnd} + ORDER BY GREATEST( + IFNULL(a.update_time, '1970-01-01 00:00:00'), + IFNULL(( + SELECT MAX(c.update_time) + FROM picking_material_detail c + LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER + left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER + WHERE + c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ), '1970-01-01 00:00:00'), + IFNULL(( + SELECT MAX(c.update_time) + FROM OUT_MATERIAL_DETAIL c + LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER + LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER + WHERE + d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12) + AND d.DEL_FLAG = 1 + AND c.DEL_FLAG = 1 + and e.del_flag = 1 + AND d.warehouse_id = a.warehouse_id + AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id) + AND c.material_base_info_id = a.material_base_info_id + AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID + ), '1970-01-01 00:00:00') + ) DESC, a.material_inventory_id DESC