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 91f2f8a11..e18484e8d 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.33.0.109: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 03d48d2f4..e34bb9cd4 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 @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.concurrent.CompletableFuture; -@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class) +@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.4:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class) public interface OmsServiceFeign { 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 ba9a45148..e4a817238 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 @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; -@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.33.0.129:8014",configuration = FeignAutoConfiguration.class) +@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.102.192.30:8014",configuration = FeignAutoConfiguration.class) public interface WlhyServiceFeign { /** 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 9a459adc1..8625bcd8e 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 @@ -20,7 +20,7 @@ import java.util.Map; * @description: TODO * @date 2024/5/10 8:58 **/ -@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.33.0.109:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class) +@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.102.192.3:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class) public interface WmsServiceFeign { /** @@ -115,4 +115,10 @@ public interface WmsServiceFeign { @RequestParam(value = "pushTime",required = false) String pushTime, @RequestParam(value = "pushBy",required = false) Long pushBy, @RequestParam(value = "pushByName",required = false) String pushByName); + + /** + * 根据物料ID列表批量查询物料信息 + */ + @GetMapping("/materialBaseInfoApi/getBatchByIds") + public TableDataInfo getBatchByIds(@RequestParam("materialBaseInfoIds") List materialBaseInfoIds); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java index 48d76d01e..dfac7337f 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/YmsServiceFeign.java @@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; -@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.33.0.99:8018", configuration = FeignAutoConfiguration.class) +@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.4:8018", configuration = FeignAutoConfiguration.class) public interface YmsServiceFeign { /** 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 a62144e1f..55ab7572a 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 @@ -90,6 +90,15 @@ public class RemoteWmsFallbackFactory implements FallbackFactory updateMaterialPushStatus(Long materialBaseInfoId, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { return AjaxResult.error(cause.getMessage()); } + + @Override + public TableDataInfo getBatchByIds(List materialBaseInfoIds) { + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(new ArrayList<>()); + tableDataInfo.setTotal(0); + tableDataInfo.setCode(500); + return tableDataInfo; + } }; } } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java index d74bff3cc..8d7aae772 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java @@ -23,6 +23,8 @@ import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder; import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper; import com.mhd.oms.domain.gwLog.entity.GwLog; import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.domain.documentPushMaterialRecord.entity.DocumentPushMaterialRecord; +import com.mhd.oms.domain.documentPushMaterialRecord.repository.mapper.DocumentPushMaterialRecordMapper; import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO; import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO; import com.mhd.system.api.model.LoginUser; @@ -88,6 +90,9 @@ public class BusinessDocumentOrderApplicationService { @Resource private ExecuteOrderMapper executeOrderMapper; + @Resource + private DocumentPushMaterialRecordMapper documentPushMaterialRecordMapper; + /** * 分页查询【请填写功能名称】列表 */ @@ -328,6 +333,37 @@ public class BusinessDocumentOrderApplicationService { if (dataCode != null && dataCode == 200) { gwLog.setStatus(2); updatePushStatus(order.getId(), 3, new Date(), String.valueOf(pushBy), pushByName); + // 推送成功,保存单证推送物料快照 + try { + Date now = new Date(); + for (BusinessDocumentCargoMulti cargo : cargoList) { + DocumentPushMaterialRecord docRecord = new DocumentPushMaterialRecord(); + docRecord.setOrderId(order.getId()); + docRecord.setMaterialBaseInfoId(cargo.getMaterialBaseInfoId()); + if (cargo.getMaterialBaseInfoId() != null) { + MaterialBaseInfoPO material = reservationStockInOrderMapper.getinfo(cargo.getMaterialBaseInfoId()); + if (material != null) { + docRecord.setMaterialCode(material.getMaterialCode()); + docRecord.setMaterialName(material.getMaterialName()); + docRecord.setGoodsType(material.getGoodsType()); + docRecord.setPackName(material.getPackName()); + docRecord.setDeclarationUnit(material.getDeclarationUnit()); + docRecord.setCurrency(material.getCurrency()); + docRecord.setUnitPrice(material.getUnitPrice()); + docRecord.setWeightLimit(material.getWeightLimit()); + docRecord.setGrossWeight(material.getGrossWeight()); + } + } + docRecord.setPushTime(now); + docRecord.setDelFlag(1); + docRecord.setCreateBy(String.valueOf(pushBy)); + docRecord.setCreateTime(now); + docRecord.setUpdateTime(now); + documentPushMaterialRecordMapper.insert(docRecord); + } + } catch (Exception e) { + log.error("保存单证推送物料快照失败: orderId={}", order.getId(), e); + } successCount++; } else { gwLog.setStatus(3); @@ -399,9 +435,12 @@ public class BusinessDocumentOrderApplicationService { int failCount = 0; StringBuilder failMsg = new StringBuilder(); + // 从数据库查询单证信息,获取运输业务单号 + BusinessDocumentOrder order = businessDocumentOrderMapper.selectById(businessDocumentOrderDTO.getId()); + // 构建单个对象 Map item = new HashMap<>(); - item.put("erpBillNo", String.valueOf(businessDocumentOrderDTO.getId())); + item.put("erpBillNo", order != null ? order.getGoodsNumber() : businessDocumentOrderDTO.getGoodsNumber()); item.put("operateType", String.valueOf(businessDocumentOrderDTO.getReviseApplyType())); item.put("appMan", businessDocumentOrderDTO.getReviseApplyBy()); item.put("appMess", businessDocumentOrderDTO.getReviseApplyReason()); 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 index 15f15da38..3d48174d1 100644 --- 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 @@ -2,6 +2,7 @@ package com.mhd.oms.application.service.materialInfo; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.web.domain.AjaxResult; @@ -9,6 +10,9 @@ 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.materialPushRecord.entity.MaterialPushRecord; +import com.mhd.oms.domain.materialPushRecord.repository.mapper.MaterialPushRecordMapper; +import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper; import com.mhd.system.api.WmsServiceFeign; import com.mhd.system.api.domain.MaterialInfoDTO; @@ -45,6 +49,9 @@ public class MaterialInfoApplicationService { @Resource private BusinessDocumentOrderMapper businessDocumentOrderMapper; + @Resource + private MaterialPushRecordMapper materialPushRecordMapper; + private final WmsServiceFeign wmsServiceFeign; public MaterialInfoApplicationService(WmsServiceFeign wmsServiceFeign) { @@ -88,6 +95,7 @@ public class MaterialInfoApplicationService { int successCount = 0; int failCount = 0; StringBuilder failMsg = new StringBuilder(); + List successIds = new ArrayList<>(); for (MaterialInfoDTO dto : dtoList) { Map item = new HashMap<>(); @@ -147,6 +155,7 @@ public class MaterialInfoApplicationService { gwLog.setStatus(2); updatePushStatus(dto.getMaterialBaseInfoId(), 3, new Date(), pushBy, pushByName); successCount++; + successIds.add(dto.getMaterialBaseInfoId()); } else { gwLog.setStatus(3); gwLog.setErrorMsg(responseString); @@ -181,6 +190,39 @@ public class MaterialInfoApplicationService { } } + // 推送成功后,保存物料快照到物料推送记录表 + if (!successIds.isEmpty()) { + try { + Date now = new Date(); + TableDataInfo wmsResult = wmsServiceFeign.getBatchByIds(successIds); + if (wmsResult != null && wmsResult.getData() != null) { + List materialList = JSONArray.parseArray( + JSONObject.toJSONString(wmsResult.getData()), MaterialBaseInfoPO.class); + for (MaterialBaseInfoPO material : materialList) { + MaterialPushRecord record = new MaterialPushRecord(); + record.setMaterialBaseInfoId(material.getMaterialBaseInfoId()); + record.setMaterialCode(material.getMaterialCode()); + record.setMaterialName(material.getMaterialName()); + record.setGoodsType(material.getGoodsType()); + record.setPackName(material.getPackName()); + record.setDeclarationUnit(material.getDeclarationUnit()); + record.setCurrency(material.getCurrency()); + record.setUnitPrice(material.getUnitPrice()); + record.setWeightLimit(material.getWeightLimit()); + record.setGrossWeight(material.getGrossWeight()); + record.setPushTime(now); + record.setDelFlag(1); + record.setCreateBy(String.valueOf(pushBy)); + record.setCreateTime(now); + record.setUpdateTime(now); + materialPushRecordMapper.insert(record); + } + } + } catch (Exception e) { + log.error("保存物料推送快照失败: {}", e.getMessage()); + } + } + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; if (failCount > 0) { resultMsg += "[" + failMsg.toString() + "]"; diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/entity/DocumentPushMaterialRecord.java b/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/entity/DocumentPushMaterialRecord.java new file mode 100644 index 000000000..de05502d3 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/entity/DocumentPushMaterialRecord.java @@ -0,0 +1,77 @@ +package com.mhd.oms.domain.documentPushMaterialRecord.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel(value = "单证推送物料记录对象") +@TableName("document_push_material_record") +public class DocumentPushMaterialRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("单证ID") + private Long orderId; + + @ApiModelProperty("物料ID") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + private String materialName; + + @ApiModelProperty("规格型号") + private String packName; + + @ApiModelProperty("申报单位") + private String declarationUnit; + + @ApiModelProperty("数量") + private BigDecimal cargoNum; + + @ApiModelProperty("币制") + private String currency; + + @ApiModelProperty("单价") + private BigDecimal unitPrice; + + @ApiModelProperty("净重(kg)") + private BigDecimal weightLimit; + + @ApiModelProperty("毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("商品类型(0物料,1半成品,2成品)") + private Integer goodsType; + + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("删除标志(1-正常,2-删除)") + private Integer delFlag; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新人") + private String updateBy; + + @ApiModelProperty("更新时间") + private Date updateTime; +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/repository/mapper/DocumentPushMaterialRecordMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/repository/mapper/DocumentPushMaterialRecordMapper.java new file mode 100644 index 000000000..0200ad48a --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/documentPushMaterialRecord/repository/mapper/DocumentPushMaterialRecordMapper.java @@ -0,0 +1,9 @@ +package com.mhd.oms.domain.documentPushMaterialRecord.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.documentPushMaterialRecord.entity.DocumentPushMaterialRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DocumentPushMaterialRecordMapper extends BaseMapper { +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/entity/MaterialPushRecord.java b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/entity/MaterialPushRecord.java new file mode 100644 index 000000000..01196e594 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/entity/MaterialPushRecord.java @@ -0,0 +1,77 @@ +package com.mhd.oms.domain.materialPushRecord.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 物料推送记录表 + */ +@Data +@ApiModel(value = "物料推送记录对象") +@TableName("material_push_record") +public class MaterialPushRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("物料ID") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + private String materialName; + + @ApiModelProperty("规格型号") + private String packName; + + @ApiModelProperty("申报单位") + private String declarationUnit; + + @ApiModelProperty("数量") + private BigDecimal cargoNum; + + @ApiModelProperty("币制") + private String currency; + + @ApiModelProperty("单价") + private BigDecimal unitPrice; + + @ApiModelProperty("净重(kg)") + private BigDecimal weightLimit; + + @ApiModelProperty("毛重(kg)") + private BigDecimal grossWeight; + + @ApiModelProperty("商品类型(0物料,1半成品,2成品)") + private Integer goodsType; + + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("删除标志(1-正常,2-删除)") + private Integer delFlag; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("更新人") + private String updateBy; + + @ApiModelProperty("更新时间") + private Date updateTime; +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/repository/mapper/MaterialPushRecordMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/repository/mapper/MaterialPushRecordMapper.java new file mode 100644 index 000000000..cf0e9007e --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/repository/mapper/MaterialPushRecordMapper.java @@ -0,0 +1,9 @@ +package com.mhd.oms.domain.materialPushRecord.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.materialPushRecord.entity.MaterialPushRecord; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MaterialPushRecordMapper extends BaseMapper { +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/service/MaterialPushRecordService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/service/MaterialPushRecordService.java new file mode 100644 index 000000000..94999e8c1 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/materialPushRecord/service/MaterialPushRecordService.java @@ -0,0 +1,109 @@ +package com.mhd.oms.domain.materialPushRecord.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.domain.materialPushRecord.entity.MaterialPushRecord; +import com.mhd.oms.domain.materialPushRecord.repository.mapper.MaterialPushRecordMapper; +import com.mhd.oms.domain.documentPushMaterialRecord.entity.DocumentPushMaterialRecord; +import com.mhd.oms.domain.documentPushMaterialRecord.repository.mapper.DocumentPushMaterialRecordMapper; +import com.mhd.system.api.WmsServiceFeign; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Service +@Slf4j +public class MaterialPushRecordService { + + @Resource + private MaterialPushRecordMapper materialPushRecordMapper; + + @Resource + private WmsServiceFeign wmsServiceFeign; + + @Resource + private DocumentPushMaterialRecordMapper documentPushMaterialRecordMapper; + + /** + * 按物料ID列表查询物料数据 + * 先按orderId查单证推送快照,没有再查物料推送快照,最后调WMS + */ + public TableDataInfo getBatchByIds(List materialBaseInfoIds, Long orderId) { + if (materialBaseInfoIds == null || materialBaseInfoIds.isEmpty()) { + TableDataInfo emptyResult = new TableDataInfo(); + emptyResult.setData(new ArrayList<>()); + emptyResult.setTotal(0); + emptyResult.setCode(200); + return emptyResult; + } + + // 1. 先按orderId查单证推送物料记录表 + List docRecords = documentPushMaterialRecordMapper.selectList( + new LambdaQueryWrapper() + .eq(DocumentPushMaterialRecord::getOrderId, orderId) + .eq(DocumentPushMaterialRecord::getDelFlag, 1)); + if (docRecords != null && !docRecords.isEmpty()) { + // 有单证推送数据,按物料ID去重取最新一条,并检查是否覆盖所有请求的物料ID + Map latestMap = new HashMap<>(); + for (DocumentPushMaterialRecord r : docRecords) { + Long mid = r.getMaterialBaseInfoId(); + if (mid == null) continue; + DocumentPushMaterialRecord old = latestMap.get(mid); + if (old == null || (r.getPushTime() != null && old.getPushTime() == null) + || (r.getPushTime() != null && old.getPushTime() != null && r.getPushTime().after(old.getPushTime()))) { + latestMap.put(mid, r); + } + } + // 检查是否所有请求的物料ID都查到了 + if (latestMap.keySet().containsAll(materialBaseInfoIds)) { + List resultList = new ArrayList<>(latestMap.values()); + TableDataInfo result = new TableDataInfo(); + result.setData(resultList); + result.setTotal(resultList.size()); + result.setCode(200); + return result; + } + } + + // 2. 查物料推送记录表 + List pushRecords = materialPushRecordMapper.selectList( + new LambdaQueryWrapper() + .in(MaterialPushRecord::getMaterialBaseInfoId, materialBaseInfoIds) + .eq(MaterialPushRecord::getDelFlag, 1)); + if (pushRecords != null && !pushRecords.isEmpty()) { + // 按物料ID去重取最新一条 + Map latestMap = new HashMap<>(); + for (MaterialPushRecord r : pushRecords) { + Long mid = r.getMaterialBaseInfoId(); + if (mid == null) continue; + MaterialPushRecord old = latestMap.get(mid); + if (old == null || (r.getPushTime() != null && old.getPushTime() == null) + || (r.getPushTime() != null && old.getPushTime() != null && r.getPushTime().after(old.getPushTime()))) { + latestMap.put(mid, r); + } + } + if (latestMap.keySet().containsAll(materialBaseInfoIds)) { + TableDataInfo result = new TableDataInfo(); + result.setData(new ArrayList<>(latestMap.values())); + result.setTotal(latestMap.size()); + result.setCode(200); + return result; + } + } + + // 3. 都没有全命中,调WMS查全部实时数据 + try { + return wmsServiceFeign.getBatchByIds(materialBaseInfoIds); + } catch (Exception e) { + log.error("调用WMS查询物料信息失败: {}", e.getMessage()); + TableDataInfo errorResult = new TableDataInfo(); + errorResult.setData(new ArrayList<>()); + errorResult.setTotal(0); + errorResult.setCode(500); + return errorResult; + } + } +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/entity/ReservationInMaterialDetail.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/entity/ReservationInMaterialDetail.java index ce8a63faf..ddd677c15 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/entity/ReservationInMaterialDetail.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/entity/ReservationInMaterialDetail.java @@ -377,4 +377,20 @@ public class ReservationInMaterialDetail extends BaseVOEntity { private Date drinkDate; @ApiModelProperty("火险保费") private BigDecimal fireInsureFee; + + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/po/ReservationInMaterialDetailPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/po/ReservationInMaterialDetailPO.java index ca8cf216c..c3203fdf1 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/po/ReservationInMaterialDetailPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/po/ReservationInMaterialDetailPO.java @@ -479,4 +479,20 @@ public class ReservationInMaterialDetailPO extends ReservationStockInOrderBasePO private String lotNumber; @ApiModelProperty("火险保费") private BigDecimal fireInsureFee; + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String khdm; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDO.java index f568ed286..a694c322c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDO.java @@ -444,4 +444,19 @@ public class ReservationInMaterialDetailDO extends ReservationStockInOrderBaseDO private BigDecimal unitPrice; @ApiModelProperty("火险保费") private BigDecimal fireInsureFee; + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDTO.java index e7ca37b47..35d6b5ce2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/todo/ReservationInMaterialDetailDTO.java @@ -451,4 +451,19 @@ public class ReservationInMaterialDetailDTO extends BaseVOEntity { private String productionDate; @ApiModelProperty("火险保费") private BigDecimal fireInsureFee; + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/entity/ReservationOutMaterialDetail.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/entity/ReservationOutMaterialDetail.java index ef73ae7a6..d0191d560 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/entity/ReservationOutMaterialDetail.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/entity/ReservationOutMaterialDetail.java @@ -498,4 +498,24 @@ public class ReservationOutMaterialDetail extends BaseVOEntity { @ApiModelProperty("库存数量") @Excel(name = "库存数量") private BigDecimal stockQuantity; + + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String opWhLocGw; + private String warehouseGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/po/ReservationOutMaterialDetailPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/po/ReservationOutMaterialDetailPO.java index a3c926c62..8a33c427c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/po/ReservationOutMaterialDetailPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/po/ReservationOutMaterialDetailPO.java @@ -586,5 +586,21 @@ public class ReservationOutMaterialDetailPO extends ReservationStockOutOrderBase @ApiModelProperty("单价") @Excel(name = "单价") private BigDecimal unitPrice; - + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String khdm; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDO.java index 8cc93faf3..2bb863e47 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDO.java @@ -532,4 +532,20 @@ public class ReservationOutMaterialDetailDO extends BaseVOEntity { @ApiModelProperty("调整后面积") @Excel(name = "调整后面积") private BigDecimal adjustedArea; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDTO.java index 9c8ec924d..16c980536 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/todo/ReservationOutMaterialDetailDTO.java @@ -524,4 +524,20 @@ public class ReservationOutMaterialDetailDTO extends BaseVOEntity { @ApiModelProperty("调整后面积") @Excel(name = "调整后面积") private BigDecimal adjustedArea; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java index 2fbb11196..a6196e0d2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java @@ -55,4 +55,6 @@ public interface ReservationStockInOrderMapper extends BaseMapper materialDetailList = info.getMaterialDetailList(); + if (materialDetailList != null && !materialDetailList.isEmpty()) { + for (ReservationInMaterialDetailPO materialDetail : materialDetailList) { + materialDetail.setKhdm(userNcCode); + } + info.setMaterialDetailList(materialDetailList); + } + return info; } @@ -2006,9 +2016,14 @@ public class ReservationStockInOrderApplicationService { String[] split = lotNo.split("-"); if (split.length == 2) { gwInDetail.setLineNum(split[1]); + reservationInMaterialDetail.setLineNumGw(split[1]); } else { - gwInDetail.setLineNum(""); + gwInDetail.setLineNum("1"); + reservationInMaterialDetail.setLineNumGw("1"); } + } else { + gwInDetail.setLineNum("1"); + reservationInMaterialDetail.setLineNumGw("1"); } gwInDetail.setItemName(reservationInMaterialDetail.getMaterialName()); MaterialBaseInfoPO materialBaseInfoPO = reservationStockInOrderMapper.getinfo(materialBaseInfoId); @@ -2023,8 +2038,16 @@ public class ReservationStockInOrderApplicationService { if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0&&quantity.compareTo(BigDecimal.ZERO) != 0) { BigDecimal Amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); gwInDetail.setAmount(Amount); + reservationInMaterialDetail.setAmountGw(Amount); } + reservationInMaterialDetail.setQtyGw(quantity); + reservationInMaterialDetail.setSpecGw(materialBaseInfoPO.getSpecificationModel()); + reservationInMaterialDetail.setUnitGw(materialBaseInfoPO.getDeclarationUnit()); + reservationInMaterialDetail.setErpPriceGw(unitPrice); + reservationInMaterialDetail.setErpCurrGw(materialBaseInfoPO.getCurrency()); + reservationInMaterialDetailMapper.updateById(reservationInMaterialDetail); orderList.add(gwInDetail); + } gwStockInOrder.setOrderList(orderList); List list = new LinkedList<>(); @@ -2047,9 +2070,16 @@ public class ReservationStockInOrderApplicationService { gwLogMapper.insert(gwLog); updatePushStatus(id, 2, new Date(), pushBy,pushByName); - + String ncUrl = reservationStockInOrderMapper.getNcUrl("gw", organizationName, organizationId); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } +// HttpPost customsHttpPost = new HttpPost(url); + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(list), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -2060,8 +2090,10 @@ public class ReservationStockInOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLog.setResponseBody(responseString); - - if (response.getStatusLine().getStatusCode() == 200) { +// 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); + if (response.getStatusLine().getStatusCode() == 200&&code == 200) { gwLog.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java index 0ca311ffd..c819e15ff 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java @@ -504,4 +504,5 @@ public class ReservationStockOutOrderPO extends BaseVOEntity { @ApiModelProperty("车次") @Excel(name = "车次") private Integer trainNo; + private String khdm; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java index 7b57c1956..e34203385 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java @@ -549,12 +549,20 @@ public class ReservationStockOutOrderDO extends BaseVOEntity { @ApiModelProperty(value = "推送时间起") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date pushTimeStart; + private Date pushTimeFrom; @ApiModelProperty(value = "推送时间止") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date pushTimeEnd; + private Date pushTimeTo; + @ApiModelProperty(value = "推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTimeFrom; + @ApiModelProperty(value = "推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTimeTo; private String xfStatus; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java index 3c5fc2885..11f0aa94b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java @@ -532,13 +532,21 @@ public class ReservationStockOutOrderDTO extends ReservationStockOutOrderBaseDTO @ApiModelProperty(value = "推送时间起") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date pushTimeStart; + private Date pushTimeFrom; @ApiModelProperty(value = "推送时间止") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date pushTimeEnd; + private Date pushTimeTo; + @ApiModelProperty(value = "推送时间起") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTimeFrom; + @ApiModelProperty(value = "推送时间止") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTimeTo; @ApiModelProperty(name = "出库时间查询条件开始日期") private String outboundDateStart; diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java index 827444137..d3f318eb7 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java @@ -114,7 +114,7 @@ public class ReservationStockOutOrderApplicationService { @Autowired private ReservationStockInOrderMapper reservationStockInOrderMapper; - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String PUSH_API_URL = "http://10.102.192.15/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "save_order_e"; private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; @@ -294,11 +294,18 @@ public class ReservationStockOutOrderApplicationService { public ReservationStockOutOrderPO getInfoChildren(Long outOrderId) { ReservationStockOutOrderPO stockOutOrderPO = stockOutOrderDomainService.getInfoChildren(outOrderId); - + String userNcCode = reservationStockInOrderMapper.getUserNcCode(stockOutOrderPO.getShipperId()); if (stockOutOrderPO == null || CollectionUtils.isEmpty(stockOutOrderPO.getMaterialDetailList())) { return stockOutOrderPO; } - + stockOutOrderPO.setKhdm(userNcCode); + List materialDetailList = stockOutOrderPO.getMaterialDetailList(); + if (CollectionUtils.isEmpty(materialDetailList)) { + for (ReservationOutMaterialDetailPO reservationOutMaterialDetailPO : materialDetailList) { + reservationOutMaterialDetailPO.setKhdm(userNcCode); + } + stockOutOrderPO.setMaterialDetailList(materialDetailList); + } List detailList = stockOutOrderPO.getMaterialDetailList(); String outOrderNumber = stockOutOrderPO.getOutOrderNumber(); for (ReservationOutMaterialDetailPO reservationOutMaterialDetailPO : detailList) { @@ -1319,7 +1326,7 @@ public class ReservationStockOutOrderApplicationService { Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; - + String ncUrl = reservationStockInOrderMapper.getNcUrl("gw", organizationName, organizationId); int successCount = 0; int failCount = 0; StringBuilder failMsg = new StringBuilder(); @@ -1371,11 +1378,14 @@ public class ReservationStockOutOrderApplicationService { String[] split = lotNo.split("-"); if (split.length == 2) { item.put("lineNum", split[1]); + detail.setLineNumGw(split[1]); } else { item.put("lineNum", 1); + detail.setLineNumGw("1"); } } else { item.put("lineNum", 1); + detail.setLineNumGw("1"); } item.put("qty", detail.getQuantity()); @@ -1392,9 +1402,15 @@ public class ReservationStockOutOrderApplicationService { // 计算金额 BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice(); BigDecimal quantity = detail.getQuantity(); + detail.setQtyGw(quantity); + detail.setErpPriceGw(unitPrice); + detail.setErpCurrGw(materialBaseInfoPO.getCurrency()); + detail.setUnitGw(materialBaseInfoPO.getDeclarationUnit()); + detail.setSpecGw(materialBaseInfoPO.getSpecificationModel()); if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0 && quantity.compareTo(BigDecimal.ZERO) != 0) { BigDecimal amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); item.put("amount", amount); + detail.setAmountGw(amount); } } } @@ -1409,12 +1425,15 @@ public class ReservationStockOutOrderApplicationService { if (inOrderNumber != null) { item.put("orderINo", inOrderNumber); + detail.setInOrderNumberGw(inOrderNumber); } if (warehouseCode != null) { item.put("warehouse", warehouseCode); + detail.setWarehouseGw(warehouseCode); } if (opWhLoc != null) { item.put("opWhLoc", opWhLoc); + detail.setOpWhLocGw(opWhLoc); } // billI = 入库单号 if (inOrderNumber != null) { @@ -1425,15 +1444,19 @@ public class ReservationStockOutOrderApplicationService { if (split.length == 2) { item.put("orderIRow", split[1]); item.put("billIRow", split[1]); + detail.setInLineNumGw(split[1]); } else { item.put("orderIRow", 1); item.put("billIRow", 1); + detail.setInLineNumGw("1"); } } else { item.put("orderIRow", 1); item.put("billIRow", 1); + detail.setInLineNumGw("1"); } } + reservationOutMaterialDetailMapper.updateById(detail); orderList.add(item); } order.put("orderList", orderList); @@ -1460,7 +1483,14 @@ public class ReservationStockOutOrderApplicationService { updatePushStatus(id, 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } +// HttpPost customsHttpPost = new HttpPost(url); + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -1471,8 +1501,10 @@ public class ReservationStockOutOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLog.setResponseBody(responseString); - - if (response.getStatusLine().getStatusCode() == 200) { + // 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); + if (response.getStatusLine().getStatusCode() == 200&&code ==200) { gwLog.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialPushRecord/MaterialPushRecordApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialPushRecord/MaterialPushRecordApi.java new file mode 100644 index 000000000..2d034c3de --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/materialPushRecord/MaterialPushRecordApi.java @@ -0,0 +1,26 @@ +package com.mhd.oms.interfaces.facade.materialPushRecord; + +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.oms.domain.materialPushRecord.service.MaterialPushRecordService; +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("/materialPushRecordApi") +public class MaterialPushRecordApi { + + @Resource + private MaterialPushRecordService materialPushRecordService; + + @ApiOperation("批量查询物料推送数据(先按orderId查单证推送快照,再按物料id查推送快照,最后调WMS)") + @GetMapping("/getBatchByIds") + public AjaxResult getBatchByIds(@RequestParam("materialBaseInfoIds") List materialBaseInfoIds, + @RequestParam("orderId") Long orderId) { + return AjaxResult.success(materialPushRecordService.getBatchByIds(materialBaseInfoIds, orderId)); + } +} 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 index 6e2ef50a1..d408c8a10 100644 --- 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 @@ -95,6 +95,20 @@ public class OriginalImportExportDocumentApi extends BaseController { @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { BusinessDocumentOrderDO businessDocumentOrderDO = businessDocumentOrderAssembler.toDO(businessDocumentOrderDTO); + // 时区处理:前端传的日期是东八区,Spring按UTC解析,加8小时对齐数据库时区 + long tzOffset = 8 * 60 * 60 * 1000L; + if (businessDocumentOrderDO.getDocumentDateStart() != null) { + businessDocumentOrderDO.setDocumentDateStart(new Date(businessDocumentOrderDO.getDocumentDateStart().getTime() + tzOffset)); + } + if (businessDocumentOrderDO.getDocumentDateEnd() != null) { + businessDocumentOrderDO.setDocumentDateEnd(new Date(businessDocumentOrderDO.getDocumentDateEnd().getTime() + tzOffset)); + } + if (businessDocumentOrderDO.getPushTimeStart() != null) { + businessDocumentOrderDO.setPushTimeStart(new Date(businessDocumentOrderDO.getPushTimeStart().getTime() + tzOffset)); + } + if (businessDocumentOrderDO.getPushTimeEnd() != null) { + businessDocumentOrderDO.setPushTimeEnd(new Date(businessDocumentOrderDO.getPushTimeEnd().getTime() + tzOffset)); + } PageHelper.startPage(pageNo, pageSize); List orderList = businessDocumentOrderApplicationService.queryListAndMaterial(businessDocumentOrderDO); diff --git a/mhd_oms/src/main/resources/bootstrap.yml b/mhd_oms/src/main/resources/bootstrap.yml index b605d0078..ee058f0f6 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.31:6848 -# username: nacos -# password: manhuoda@2023 +# server-addr: 10.33.0.129:6010 + server-addr: 10.102.192.30:6848 + username: nacos + password: manhuoda@2023 config: # server-addr: 127.0.0.1:8848 # 线上测试环境配置 容器名+端口号 - server-addr: 10.33.0.129:6010 -# server-addr: 10.102.192.31:6848 -# username: nacos -# password: manhuoda@2023 +# server-addr: 10.33.0.129:6010 + server-addr: 10.102.192.30:6848 + username: nacos + password: manhuoda@2023 #线上正式环境 # server-addr: 10.102.192.105:6848 # 锁定server端的配置文件(读取它的配置项) @@ -40,6 +40,6 @@ spring: # GW推送配置 gw: push: - url: http://10.33.0.100/nagu-erp-api/transfer/pushData + url: http://10.102.192.15/nagu-erp-api/transfer/pushData verify-key1: FuDjK3iuftzwf8kWJ44DDZJ9icZmL9Ee4Valv8Qz6VfsdW60fNEzNSEtrKlUr6OI verify-key2: ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml b/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml index a4059ad3e..bee4d0123 100644 --- a/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/businessDocumentOrder/BusinessDocumentOrderMapper.xml @@ -696,7 +696,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bdo.PUSH_TIME =]]> #{pushTimeStart} - and bdo.PUSH_TIME #{pushTimeEnd} + and bdo.PUSH_TIME #{pushTimeEnd} + 1 - 1/86400 and bdo.IE_TYPE = #{ieType} @@ -1252,7 +1252,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and PUSH_TIME =]]> #{pushTimeStart} - and PUSH_TIME #{pushTimeEnd} + and PUSH_TIME #{pushTimeEnd} + 1 - 1/86400 and IE_TYPE = #{ieType} @@ -1260,6 +1260,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and REVISE_APPLY_TYPE = #{reviseApplyType} + + and REVISE_APPLY_STATUS = #{reviseApplyStatus} + diff --git a/mhd_oms/src/main/resources/mapper/documentPushMaterialRecord/DocumentPushMaterialRecordMapper.xml b/mhd_oms/src/main/resources/mapper/documentPushMaterialRecord/DocumentPushMaterialRecordMapper.xml new file mode 100644 index 000000000..0a8c78170 --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/documentPushMaterialRecord/DocumentPushMaterialRecordMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mhd_oms/src/main/resources/mapper/materialPushRecord/MaterialPushRecordMapper.xml b/mhd_oms/src/main/resources/mapper/materialPushRecord/MaterialPushRecordMapper.xml new file mode 100644 index 000000000..56084525e --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/materialPushRecord/MaterialPushRecordMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mhd_oms/src/main/resources/mapper/reservationInMaterialDetail/ReservationInMaterialDetailMapper.xml b/mhd_oms/src/main/resources/mapper/reservationInMaterialDetail/ReservationInMaterialDetailMapper.xml index 734a29625..0c4473956 100644 --- a/mhd_oms/src/main/resources/mapper/reservationInMaterialDetail/ReservationInMaterialDetailMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationInMaterialDetail/ReservationInMaterialDetailMapper.xml @@ -90,6 +90,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + @@ -116,6 +123,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.SPECIFICATION_MODEL, a.SKU_CODE, a.INVOICE_NO, a.LITER, a.DIMENSIONS, a.DECLARATION_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO, a.ORIGIN_COUNTRY, a.BOX_PALLET_NO, a.CURRENCY, a.UNIT, a.DECLARED_QUANTITY, a.BOX_COUNT, a.PIECE_COUNT, a.INBOUND_QUANTITY, a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_PRICE, + a.line_num_gw, + a.spec_gw, + a.unit_gw, + a.qty_gw, + a.erp_curr_gw, + a.erp_price_gw, + a.amount_gw, + a.in_order_number_gw, + a.in_line_num_gw, a.PRODUCTION_DATE, a.EXPIRY_DATE, a.INVENTORY_DATE, a.EXT_ATTR_1, a.EXT_ATTR_2, a.EXT_ATTR_3, a.EXT_ATTR_4 ,CASE WHEN (a.quantity - a.receipt_quantity) < 0 THEN 0 diff --git a/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml b/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml index 74f4c16ac..f63d86c9e 100644 --- a/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml @@ -94,6 +94,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + @@ -145,7 +154,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.INVENTORY_DATE, a.EXT_ATTR_3, a.EXT_ATTR_4, - a.INVENTORY_QUANTITY + a.INVENTORY_QUANTITY, + a.line_num_gw, + a.spec_gw, + a.unit_gw, + a.qty_gw, + a.erp_curr_gw, + a.erp_price_gw, + a.amount_gw, + a.in_order_number_gw, + a.in_line_num_gw diff --git a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml index 948753d7f..1f315b9af 100644 --- a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml @@ -429,11 +429,17 @@ and a.create_time DATEADD(DAY, 1, #{createTimeEnd}) - - and PUSH_TIME =]]> #{pushTimeStart} + + and a.PUSH_TIME =]]> #{pushTimeFrom} - - and PUSH_TIME #{pushTimeEnd} + + and a.PUSH_TIME #{pushTimeTo} + + + and a.create_time =]]> #{createTimeFrom} + + + and a.create_time #{createTimeTo} and a.PUSH_STATUS = #{pushStatus} @@ -616,5 +622,11 @@ - + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml index 8cc70cf7f..fa77182c2 100644 --- a/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationStockOutOrder/ReservationStockOutOrderMapper.xml @@ -309,11 +309,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.NEED_DECLARE_FLAG = #{needDeclareFlag} - - and PUSH_TIME =]]> #{pushTimeStart} + + and a.PUSH_TIME =]]> #{pushTimeFrom} - - and PUSH_TIME #{pushTimeEnd} + + and a.PUSH_TIME #{pushTimeTo} + + + and a.create_time =]]> #{createTimeFrom} + + + and a.create_time #{createTimeTo} and a.PUSH_STATUS = #{pushStatus} 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 978179bc3..d0c1d6e14 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 @@ -22,11 +22,15 @@ import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; import com.mhd.system.api.model.LoginUser; import com.mhd.wms.application.service.materialBaseInfo.MaterialBaseInfoApplicationService; +import com.mhd.wms.domain.customsDeclarationDetail.repository.facade.ICustomsDeclarationDetailService; +import com.mhd.wms.domain.customsDeclarationDetail.repository.todo.CustomsDeclarationDetailDO; import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO; import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail; import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService; import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO; +import com.mhd.wms.domain.pickingMaterialDetail.entity.PickingMaterialDetail; import com.mhd.wms.domain.pickingMaterialDetail.repository.facade.IPickingMaterialDetailService; +import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper; import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingMaterialDetailPO; import com.mhd.wms.domain.pickingMaterialDetail.repository.todo.PickingMaterialDetailDO; import com.mhd.wms.domain.pickingMaterialDetail.service.PickingMaterialDetailDomainService; @@ -93,9 +97,12 @@ public class PickingOrderApplicationService { private IPickingMaterialDetailService pickingMaterialDetailService; @Autowired private IInMaterialDetailService inMaterialDetailService; + @Autowired + private ICustomsDeclarationDetailService customsDeclarationDetailService; + @Autowired + private PickingMaterialDetailMapper pickingMaterialDetailMapper; - - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String PUSH_API_URL = "http://10.102.192.15/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "save_qnBill_e"; private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; @@ -724,17 +731,18 @@ public class PickingOrderApplicationService { public AjaxResult batchPush(List idList) { + if (idList == null || idList.isEmpty()) { return AjaxResult.error("没有数据需要推送"); } LoginUser loginUser = SecurityUtils.getLoginUser(); Long pushBy = loginUser != null ? loginUser.getUserid() : null; - String pushByName = loginUser != null ? loginUser.getUsername() : null; + String pushByName = loginUser != null ? loginUser.getUserPo().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; - + String ncUrl = pickingMaterialDetailMapper.getNcUrl("gw", organizationName, organizationId); int successCount = 0; int failCount = 0; StringBuilder failMsg = new StringBuilder(); @@ -775,7 +783,13 @@ public class PickingOrderApplicationService { customsBodyList.add(customsParam); CloseableHttpClient customsHttpClient = HttpClients.createDefault(); - HttpPost customsHttpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } + HttpPost customsHttpPost = new HttpPost(url); StringEntity customsPostingString = new StringEntity(JSONObject.toJSONString(customsBodyList), "UTF-8"); customsHttpPost.setEntity(customsPostingString); customsHttpPost.setHeader("Content-type", "application/json"); @@ -784,7 +798,7 @@ public class PickingOrderApplicationService { CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost); String customsResponseString = EntityUtils.toString(customsResponse.getEntity()); - + log.info("customsResponseString:{}", customsResponseString); if (customsResponse.getStatusLine().getStatusCode() == 200) { JSONObject customsJson = JSONObject.parseObject(customsResponseString); JSONArray customsData = customsJson.getJSONArray("data"); @@ -803,6 +817,19 @@ public class PickingOrderApplicationService { log.error("调用报关回写接口失败: pickingOrderNumber={}", pickingOrder.getPickingOrderNumber(), e); } + // ========== 写入报关明细表 ========== + if (StringUtils.isNotBlank(bondInvtNo)) { + CustomsDeclarationDetailDO detailDO = new CustomsDeclarationDetailDO(); + detailDO.setDocumentNumber(pickingOrder.getPickingOrderNumber()); + detailDO.setBondInvtNo(bondInvtNo); + detailDO.setInvtRow(invtRow); + detailDO.setInOrderNumber(pickingOrder.getOrderNumber()); + detailDO.setOrganizationId(pickingOrder.getOrganizationId()); + detailDO.setOrganizationName(pickingOrder.getOrganizationName()); + detailDO.setTopOrganizationId(pickingOrder.getTopOrganizationId()); + customsDeclarationDetailService.insert(detailDO); + } + // 3. 构建主单 Map order = new HashMap<>(); // etpsPreentNo: 入库单号 - 取拣货明细中的入库单号(第一个) @@ -817,6 +844,8 @@ public class PickingOrderApplicationService { List> qnBillList = new ArrayList<>(); int gNo = 1; for (OutMaterialDetail detail : outMaterialDetailList) { + PickingMaterialDetail pickingMaterialDetail = pickingMaterialDetailService.getOne(new LambdaQueryWrapper() + .eq(PickingMaterialDetail::getOutUniqueId, detail.getUniqueId())); Map item = new HashMap<>(); item.put("etpsPreentNo", detail.getOutOrderNumber() != null ? detail.getOutOrderNumber() : ""); String lotNo = detail.getLotNo(); @@ -824,11 +853,14 @@ public class PickingOrderApplicationService { String[] split = lotNo.split("-"); if (split.length == 2) { item.put("gNo", split[1]); + pickingMaterialDetail.setLineNumGw(split[1]); } else { - item.put("gNo", ""); // 出仓订单行号 + item.put("gNo", "1"); // 出仓订单行号 + pickingMaterialDetail.setLineNumGw("1"); } } else { - item.put("gNo", ""); // 出仓订单行号 + item.put("gNo", "1"); // 出仓订单行号 + pickingMaterialDetail.setLineNumGw("1"); } @@ -845,7 +877,12 @@ public class PickingOrderApplicationService { if (unitPrice != null && pickingQty != null && unitPrice.compareTo(BigDecimal.ZERO) != 0) { BigDecimal totalAmt = unitPrice.multiply(pickingQty).setScale(2, BigDecimal.ROUND_HALF_UP); item.put("dclTotalAmt", totalAmt); + pickingMaterialDetail.setAmountGw(totalAmt); } + pickingMaterialDetail.setErpCurrGw(materialInfo.getCurrency() != null ? materialInfo.getCurrency() : ""); +// detail.setSpecGw(materialInfo.getSpecification() != null ? materialInfo.getSpecification() : ""); + pickingMaterialDetail.setErpPriceGw(materialInfo.getUnitPrice()); + pickingMaterialDetail.setQtyGw(pickingQty); } } @@ -856,12 +893,14 @@ public class PickingOrderApplicationService { if (split.length == 2) { item.put("orderRow", split[1]);// 出仓订单行号 } else { - item.put("orderRow", ""); // 出仓订单行号 + item.put("orderRow", "1"); // 出仓订单行号 } } else { - item.put("orderRow", ""); // 出仓订单行号 + item.put("orderRow", "1"); // 出仓订单行号 } if (bondInvtNo != null && invtRow != null) { + pickingMaterialDetail.setBondInvtNoGw(bondInvtNo); + pickingMaterialDetail.setInvtRowGw(invtRow.toString()); item.put("bondInvtNo", "BONDINV202603300001"); // 原进口核注清单号 item.put("invtRow", 1); // 原进口核注清单行号 } else { @@ -872,7 +911,9 @@ public class PickingOrderApplicationService { item.put("seatNo", detail.getStorageLocationCode() != null ? detail.getStorageLocationCode() : ""); // 库位 item.put("whNoIn", detail.getWarehouseCode() != null ? detail.getWarehouseCode() : ""); item.put("seatNoIn", detail.getStorageLocationCode() != null ? detail.getStorageLocationCode() : ""); - + pickingMaterialDetail.setWarehouseGw(detail.getWarehouseCode()); + pickingMaterialDetail.setOpWhLocGw(detail.getStorageLocationCode()); + pickingMaterialDetailService.updateById(pickingMaterialDetail); qnBillList.add(item); } order.put("qnBillList", qnBillList); @@ -912,7 +953,14 @@ public class PickingOrderApplicationService { updatePushStatus(id, 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } +// HttpPost customsHttpPost = new HttpPost(url); + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -923,8 +971,10 @@ public class PickingOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLogDTO.setResponseBody(responseString); - - if (response.getStatusLine().getStatusCode() == 200) { + // 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); + if (response.getStatusLine().getStatusCode() == 200&&code==200) { gwLogDTO.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; 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 066886cc0..f3054e140 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 @@ -37,6 +37,7 @@ import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo; import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService; import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO; import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO; +import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper; import com.mhd.wms.domain.receiptOrderAccount.entity.ReceiptOrderAccount; import com.mhd.wms.domain.receiptOrderAccount.repository.facade.IReceiptOrderAccountService; import com.mhd.wms.domain.stockInOrder.entity.StockInOrder; @@ -113,7 +114,9 @@ public class StockInOrderApplicationService { private IInMaterialDetailService inMaterialDetailService; @Autowired private StockOutOrderMapper stockOutOrderMapper; - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + @Autowired + private PickingMaterialDetailMapper pickingMaterialDetailMapper; + private static final String PUSH_API_URL = "http://10.102.192.15/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "save_order_i"; private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; @@ -481,7 +484,19 @@ public class StockInOrderApplicationService { */ public StockInOrderPO getInfo(Long inOrderId) { - return stockInOrderDomainService.getInfo(inOrderId); + StockInOrderPO info = stockInOrderDomainService.getInfo(inOrderId); + String userNcCode = stockOutOrderMapper.getUserNcCode(info.getShipperId()); + info.setKhdm(userNcCode); + List materialDetailList = info.getMaterialDetailList(); + if (materialDetailList != null && !materialDetailList.isEmpty()) { + for (InMaterialDetailPO inMaterialDetailPO : materialDetailList) { + // TODO: 设置物料详情信息 + inMaterialDetailPO.setKhdm(userNcCode); + } + info.setMaterialDetailList(materialDetailList); + } + + return info; } @@ -2304,7 +2319,7 @@ public class StockInOrderApplicationService { LoginUser loginUser = SecurityUtils.getLoginUser(); Long pushBy = loginUser != null ? loginUser.getUserid() : null; - String pushByName = loginUser != null ? loginUser.getUsername() : null; + String pushByName = loginUser != null ? loginUser.getUserPo().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; @@ -2338,11 +2353,14 @@ public class StockInOrderApplicationService { String[] split = lotNo.split("-"); if (split.length == 2) { gwInDetail.setLineNum(Integer.valueOf(split[1])); + reservationInMaterialDetail.setLineNumGw(split[1]); } else { gwInDetail.setLineNum(index); + reservationInMaterialDetail.setLineNumGw("1"); } } else { gwInDetail.setLineNum(index); + reservationInMaterialDetail.setLineNumGw("1"); } index++; gwInDetail.setItemName(reservationInMaterialDetail.getMaterialName()); @@ -2358,7 +2376,14 @@ public class StockInOrderApplicationService { if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0&&quantity.compareTo(BigDecimal.ZERO) != 0) { BigDecimal Amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); gwInDetail.setAmount(Amount); + reservationInMaterialDetail.setAmountGw(Amount); } + reservationInMaterialDetail.setErpCurrGw(materialBaseInfoPO.getCurrency()); + reservationInMaterialDetail.setErpPriceGw(materialBaseInfoPO.getUnitPrice()); + reservationInMaterialDetail.setSpecGw(materialBaseInfoPO.getSpecificationModel()); + reservationInMaterialDetail.setQtyGw(reservationInMaterialDetail.getQuantity()); + reservationInMaterialDetail.setUnitGw(materialBaseInfoPO.getDeclarationUnit()); + inMaterialDetailService.updateById(reservationInMaterialDetail); orderList.add(gwInDetail); } gwStockInOrder.setOrderList(orderList); @@ -2392,9 +2417,16 @@ public class StockInOrderApplicationService { } updatePushStatus(id, 2, new Date(), pushBy,pushByName); - + String ncUrl = pickingMaterialDetailMapper.getNcUrl("gw", organizationName, organizationId); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } +// HttpPost customsHttpPost = new HttpPost(url); + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(gwStockInOrderList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -2405,8 +2437,11 @@ public class StockInOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLogDTO.setResponseBody(responseString); + // 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); - if (response.getStatusLine().getStatusCode() == 200) { + if (response.getStatusLine().getStatusCode() == 200&&code == 200) { gwLogDTO.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; 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 ede21b749..26b17212a 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 @@ -44,6 +44,7 @@ import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAg import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO; import com.mhd.wms.domain.outMaterialDetail.service.OutMaterialDetailDomainService; import com.mhd.wms.domain.pickingMaterialDetail.repository.facade.IPickingMaterialDetailService; +import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper; import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingAggByOutOrderRow; import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingMaterialDetailPO; import com.mhd.wms.domain.stockInOrder.entity.StockInOrder; @@ -115,7 +116,9 @@ public class StockOutOrderApplicationService { private IMaterialBaseInfoService materialBaseInfoService; @Autowired private StockOutOrderMapper stockOutOrderMapper; - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + @Autowired + private PickingMaterialDetailMapper pickingMaterialDetailMapper; + private static final String PUSH_API_URL = "http://10.102.192.15/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "save_order_e"; private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; @@ -330,13 +333,19 @@ public class StockOutOrderApplicationService { public StockOutOrderPO getInfoChildren(Long outOrderId) { StockOutOrderPO stockOutOrderPO = stockOutOrderDomainService.getInfoChildren(outOrderId); - + String userNcCode = stockOutOrderMapper.getUserNcCode(stockOutOrderPO.getShipperId()); + stockOutOrderPO.setKhdm(userNcCode); if (stockOutOrderPO == null || CollectionUtils.isEmpty(stockOutOrderPO.getMaterialDetailList())) { return stockOutOrderPO; } List detailList = stockOutOrderPO.getMaterialDetailList(); - + if (detailList == null || detailList.isEmpty()) { + for (OutMaterialDetailPO outMaterialDetailPO : detailList) { + outMaterialDetailPO.setKhdm(userNcCode); + } + } + stockOutOrderPO.setMaterialDetailList(detailList); // 性能优化:批量获取批次属性,避免N+1查询问题 // 1. 收集所有唯一的materialBaseInfoId Set materialBaseInfoIdSet = detailList.stream() @@ -1515,7 +1524,7 @@ public class StockOutOrderApplicationService { LoginUser loginUser = SecurityUtils.getLoginUser(); Long pushBy = loginUser != null ? loginUser.getUserid() : null; - String pushByName = loginUser != null ? loginUser.getUsername() : null; + String pushByName = loginUser != null ? loginUser.getUserPo().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; @@ -1572,11 +1581,14 @@ public class StockOutOrderApplicationService { String[] split = lotNo.split("-"); if (split.length == 2) { item.put("lineNum", split[1]); + detail.setLineNumGw(split[1]); } else { item.put("lineNum", index); + detail.setLineNumGw(String.valueOf(index)); } } else { item.put("lineNum", index); + detail.setLineNumGw(String.valueOf(index)); } item.put("itemNo", detail.getMaterialCode() != null ? detail.getMaterialCode().toString() : ""); item.put("itemName", detail.getMaterialName() != null ? detail.getMaterialName() : ""); @@ -1596,7 +1608,13 @@ public class StockOutOrderApplicationService { if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0 && quantity.compareTo(BigDecimal.ZERO) != 0) { BigDecimal amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); item.put("amount", amount); + detail.setAmountGw(amount); } + detail.setErpCurrGw(materialBaseInfoPO.getCurrency()); + detail.setErpPriceGw(materialBaseInfoPO.getUnitPrice()); + detail.setSpecGw(materialBaseInfoPO.getSpecificationModel()); + detail.setUnitGw(materialBaseInfoPO.getDeclarationUnit()); + detail.setQtyGw(detail.getQuantity()); } } @@ -1610,12 +1628,15 @@ public class StockOutOrderApplicationService { String inLotNo = materialInventory.getLotNumber(); if (inOrderNumber != null) { item.put("orderINo", inOrderNumber); + detail.setInOrderNumberGw(inOrderNumber); } if (warehouseCode != null) { item.put("warehouse", warehouseCode); + detail.setWarehouseGw(warehouseCode); } if (storageLocationCode != null) { item.put("opWhLoc", storageLocationCode); + detail.setOpWhLocGw(storageLocationCode); } // billI = 入库单号 if (inOrderNumber != null) { @@ -1626,15 +1647,19 @@ public class StockOutOrderApplicationService { if (split.length == 2) { item.put("orderIRow", split[1]); item.put("billIRow", split[1]); + detail.setInLineNumGw(split[1]); } else { item.put("orderIRow", index); item.put("billIRow", index); + detail.setInLineNumGw(String.valueOf(index)); } } else { item.put("orderIRow", index); item.put("billIRow", index); + detail.setInLineNumGw(String.valueOf(index)); } } + outMaterialDetailService.updateById(detail); orderList.add(item); index++; } @@ -1669,9 +1694,15 @@ public class StockOutOrderApplicationService { log.error("保存Gwlog失败:{}",e.getMessage()); } updatePushStatus(id, 2, new Date(), pushBy,pushByName); - + String ncUrl = pickingMaterialDetailMapper.getNcUrl("gw", organizationName, organizationId); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -1682,8 +1713,10 @@ public class StockOutOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLogDTO.setResponseBody(responseString); - - if (response.getStatusLine().getStatusCode() == 200) { + // 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); + if (response.getStatusLine().getStatusCode() == 200&&code==200) { gwLogDTO.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockShelfOrder/StockShelfOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockShelfOrder/StockShelfOrderApplicationService.java index 894d71b88..ddeae57b0 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockShelfOrder/StockShelfOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockShelfOrder/StockShelfOrderApplicationService.java @@ -24,6 +24,7 @@ import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; import com.mhd.system.api.model.LoginUser; import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService; import com.mhd.wms.domain.inventoryAdjustmentRecord.entity.InventoryAdjustmentRecord; +import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper; import com.mhd.wms.domain.receiptMaterialDetail.repository.po.ReceiptMaterialDetailPO; import com.mhd.wms.domain.receiptMaterialDetail.repository.todo.ReceiptMaterialDetailDO; import com.mhd.wms.domain.receiptMaterialDetail.service.ReceiptMaterialDetailDomainService; @@ -126,7 +127,9 @@ public class StockShelfOrderApplicationService { private IShelfMaterialDetailService shelfMaterialDetailService; @Autowired private IStockShelfOrderService stockShelfOrderService; - private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + @Autowired + private PickingMaterialDetailMapper pickingMaterialDetailMapper; + private static final String PUSH_API_URL = "http://10.102.192.15/nagu-erp-api/transfer/pushData"; private static final String API_NAME = "save_qnBill_i"; private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD"; @@ -2648,11 +2651,11 @@ public class StockShelfOrderApplicationService { LoginUser loginUser = SecurityUtils.getLoginUser(); Long pushBy = loginUser != null ? loginUser.getUserid() : null; - String pushByName = loginUser != null ? loginUser.getUsername() : null; + String pushByName = loginUser != null ? loginUser.getUserPo().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; - + String ncUrl = pickingMaterialDetailMapper.getNcUrl("gw", organizationName, organizationId); int successCount = 0; int failCount = 0; StringBuilder failMsg = new StringBuilder(); @@ -2703,7 +2706,14 @@ public class StockShelfOrderApplicationService { customsBodyList.add(customsParam); CloseableHttpClient customsHttpClient = HttpClients.createDefault(); - HttpPost customsHttpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } + HttpPost customsHttpPost = new HttpPost(url); +// HttpPost customsHttpPost = new HttpPost(PUSH_API_URL); StringEntity customsPostingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(customsBodyList), "UTF-8"); customsHttpPost.setEntity(customsPostingString); customsHttpPost.setHeader("Content-type", "application/json"); @@ -2712,7 +2722,7 @@ public class StockShelfOrderApplicationService { CloseableHttpResponse customsResponse = customsHttpClient.execute(customsHttpPost); String customsResponseString = EntityUtils.toString(customsResponse.getEntity()); - + log.info("customsResponseString:{}", customsResponseString); if (customsResponse.getStatusLine().getStatusCode() == 200) { com.alibaba.fastjson.JSONObject customsJson = com.alibaba.fastjson.JSONObject.parseObject(customsResponseString); com.alibaba.fastjson.JSONArray customsData = customsJson.getJSONArray("data"); @@ -2755,6 +2765,7 @@ public class StockShelfOrderApplicationService { List> detailItems = new ArrayList<>(); int index = 1; for (ShelfMaterialDetailPO shelfMaterialDetail : shelfMaterialDetails) { + ShelfMaterialDetail detail = shelfMaterialDetailService.getById(shelfMaterialDetail.getMaterialDetailId()); Map detailItem = new HashMap<>(); //入库单号 @@ -2765,11 +2776,14 @@ public class StockShelfOrderApplicationService { String[] split = lotNumber.split("-"); if (split.length == 2) { detailItem.put("gNo", split[1]); + detail.setLineNumGw(split[1]); } else { detailItem.put("gNo", index++); + detail.setLineNumGw(String.valueOf(index++)); } } else { detailItem.put("gNo", index++); + detail.setLineNumGw(String.valueOf(index++)); } MaterialBaseInfo materialBaseIn = materialBaseInfoMapper.selectById(materialBaseInfoId); if (materialBaseIn != null) { @@ -2783,6 +2797,7 @@ public class StockShelfOrderApplicationService { BigDecimal totalAmount = shelvesQuantity.multiply(materialBaseIn.getUnitPrice()); //申报总价 detailItem.put("dclTotalAmt", totalAmount); + detail.setAmountGw(totalAmount); } //申报数量 detailItem.put("dclQty", shelvesQuantity); @@ -2790,7 +2805,11 @@ public class StockShelfOrderApplicationService { com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail inMaterialDetail = inMaterialDetailService.getOne(new LambdaQueryWrapper().eq(com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail::getMaterialBaseInfoId, materialBaseIn.getMaterialBaseInfoId()).eq(com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail::getInOrderNumber, stockShelfOrder.getInOrderNumber())); detailItem.put("dclCurrcd", materialBaseIn.getCurrency()); } - + detail.setQtyGw(shelvesQuantity); + detail.setUnitGw(materialBaseIn.getDeclarationUnit()); + detail.setErpCurrGw(materialBaseIn.getCurrency()); + detail.setUnitGw(materialBaseIn.getDeclarationUnit()); + detail.setSpecGw(materialBaseIn.getSpecificationModel()); } //入仓订单号 detailItem.put("orderNo", stockShelfOrder.getInOrderNumber()); @@ -2814,6 +2833,7 @@ public class StockShelfOrderApplicationService { //库位 detailItem.put("seatNo", shelfMaterialDetail.getStorageLocationCode()); detailItems.add(detailItem); + shelfMaterialDetailService.updateById(detail); // Fixed method call } item.put("qnBillList", detailItems); List> bodyList = new ArrayList<>(); @@ -2848,7 +2868,13 @@ public class StockShelfOrderApplicationService { updatePushStatus(id, 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(PUSH_API_URL); + String url = ""; + if (ncUrl != null) { + url = ncUrl; + } else { + url = PUSH_API_URL; + } + HttpPost httpPost = new HttpPost(url); StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); @@ -2859,8 +2885,10 @@ public class StockShelfOrderApplicationService { CloseableHttpResponse response = httpClient.execute(httpPost); String responseString = EntityUtils.toString(response.getEntity()); gwLogDTO.setResponseBody(responseString); - - if (response.getStatusLine().getStatusCode() == 200) { +// 直接转Map + Map map = JSON.parseObject(responseString); + Integer code = (Integer) map.get("code"); + if (response.getStatusLine().getStatusCode() == 200&&code == 200) { gwLogDTO.setStatus(2); updatePushStatus(id, 3, new Date(), pushBy,pushByName); successCount++; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/entity/InMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/entity/InMaterialDetail.java index e60f886cd..dbd947f6c 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/entity/InMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/entity/InMaterialDetail.java @@ -398,4 +398,20 @@ public class InMaterialDetail extends BaseVOEntity { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") private Date drinkDate; + + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/po/InMaterialDetailPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/po/InMaterialDetailPO.java index 240f20d7f..3b4b83ccb 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/po/InMaterialDetailPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/po/InMaterialDetailPO.java @@ -423,4 +423,20 @@ public class InMaterialDetailPO extends StockInOrderBasePO { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") private Date drinkDate; + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String khdm; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/todo/InMaterialDetailDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/todo/InMaterialDetailDO.java index 328d3fd79..13f27b4b4 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/todo/InMaterialDetailDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inMaterialDetail/repository/todo/InMaterialDetailDO.java @@ -389,4 +389,19 @@ public class InMaterialDetailDO extends StockInOrderBaseDO { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") private Date drinkDate; + + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/entity/OutMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/entity/OutMaterialDetail.java index 2f3c3b558..1a5115a0f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/entity/OutMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/entity/OutMaterialDetail.java @@ -506,4 +506,26 @@ public class OutMaterialDetail extends BaseVOEntity { @ApiModelProperty("抄码总重量") @Excel(name = "抄码总重量") private BigDecimal copyTotalWeight; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String opWhLocGw; + private String warehouseGw; + private String invtRowGw; + private String bondInvtNoGw; + private String whNoGw; + private String seatNoGw; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/po/OutMaterialDetailPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/po/OutMaterialDetailPO.java index e0ed28f67..982a283eb 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/po/OutMaterialDetailPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/po/OutMaterialDetailPO.java @@ -545,4 +545,27 @@ public class OutMaterialDetailPO extends StockOutOrderBaseDO { @ApiModelProperty("重量列表(抄码商品使用)") private List weightList; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String opWhLocGw; + private String warehouseGw; + private String invtRowGw; + private String bondInvtNoGw; + private String whNoGw; + private String seatNoGw; + private String khdm; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java index a86d4a466..1dd1cc9aa 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java @@ -498,4 +498,26 @@ public class OutMaterialDetailDO extends BaseVOEntity { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date productionDate; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String opWhLocGw; + private String warehouseGw; + private String invtRowGw; + private String bondInvtNoGw; + private String whNoGw; + private String seatNoGw; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java index 7c00a6e67..667c63419 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java @@ -299,4 +299,26 @@ public class PickingMaterialDetail extends BaseVOEntity { @ApiModelProperty("入库单号") @Excel(name = "入库单号") private String inOrderNumber; + //订单行号 + private String lineNumGw; + //物料规格 + private String specGw; + //计量单位 + private String unitGw; + //数量 + private BigDecimal qtyGw; + //企业币制 + private String erpCurrGw; + //企业单价 + private BigDecimal erpPriceGw; + //申报总价 + private BigDecimal amountGw; + private String inOrderNumberGw; + private String inLineNumGw; + private String opWhLocGw; + private String warehouseGw; + private String invtRowGw; + private String bondInvtNoGw; + private String whNoGw; + private String seatNoGw; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/mapper/PickingMaterialDetailMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/mapper/PickingMaterialDetailMapper.java index 29bf0b13d..b7e5450bc 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/mapper/PickingMaterialDetailMapper.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/mapper/PickingMaterialDetailMapper.java @@ -72,4 +72,6 @@ public interface PickingMaterialDetailMapper extends BaseMapper + + + + + + + + @@ -149,7 +157,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.EXT_ATTR_4, a.COPY_TOTAL_WEIGHT, a.COPY_CODE_REFERENCE_IDS, - a.INVENTORY_QUANTITY + a.INVENTORY_QUANTITY, + a.line_num_gw, + a.spec_gw, + a.unit_gw, + a.qty_gw, + a.erp_curr_gw, + a.erp_price_gw, + a.amount_gw, + a.in_order_number_gw, + a.in_line_num_gw diff --git a/mhd_wms/src/main/resources/mapper/inMaterialDetail/InMaterialDetailMapper.xml b/mhd_wms/src/main/resources/mapper/inMaterialDetail/InMaterialDetailMapper.xml index bb0ce7cb0..6cefc6155 100644 --- a/mhd_wms/src/main/resources/mapper/inMaterialDetail/InMaterialDetailMapper.xml +++ b/mhd_wms/src/main/resources/mapper/inMaterialDetail/InMaterialDetailMapper.xml @@ -89,6 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + @@ -115,6 +122,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.SPECIFICATION_MODEL, a.SKU_CODE, a.INVOICE_NO, a.LITER, a.DIMENSIONS, a.DECLARATION_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO, a.ORIGIN_COUNTRY, a.BOX_PALLET_NO, a.CURRENCY, a.UNIT, a.DECLARED_QUANTITY, a.BOX_COUNT, a.PIECE_COUNT, a.INBOUND_QUANTITY, a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_PRICE, + a.line_num_gw, + a.spec_gw, + a.unit_gw, + a.qty_gw, + a.erp_curr_gw, + a.erp_price_gw, + a.amount_gw, + a.in_order_number_gw, + a.in_line_num_gw, a.PRODUCTION_DATE, a.EXPIRY_DATE, a.INVENTORY_DATE, a.EXT_ATTR_1, a.EXT_ATTR_2, a.EXT_ATTR_3, a.EXT_ATTR_4,a.DRINK_DATE, a.OMS_IN_MATERIAL_DETAIL ,CASE diff --git a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml index 11bcd9ca1..6560adecd 100644 --- a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml +++ b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml @@ -66,6 +66,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + @@ -84,7 +99,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.COPY_CODE_REFERENCE_IDS, a.picked_copy_code_reference_ids, omd.in_order_number, omd.lot_no as lot_number, - a.lot_No,a.in_order_number + a.lot_No,a.in_order_number, + a.line_num_gw, + a.spec_gw, + a.unit_gw, + a.qty_gw, + a.erp_curr_gw, + a.erp_price_gw, + a.amount_gw, + a.in_order_number_gw, + a.in_line_num_gw, + a.op_wh_loc_gw, + a.warehouse_gw, + a.invt_row_gw, + a.bond_invt_no_gw, + a.wh_no_gw, + a.seat_no_gw @@ -315,4 +345,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pmd.update_by = #{updateBy}, pmd.update_by_name = #{updateByName}, pmd.update_time = #{updateTime} WHERE pmd.out_unique_id = #{outUniqueId} AND pmd.del_flag = 1 + + \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml b/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml index bda2d57ca..19ef51784 100644 --- a/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml @@ -37,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -46,7 +47,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IFNULL((SELECT SUM(b.picking_quantity) FROM picking_material_detail b WHERE b.picking_order_number = a.picking_order_number AND b.del_flag = 1), 0) AS picking_quantity, a.picking_material_quantity, a.abnormal, a.task_distribution, 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.out_order_number, a.business_order_no, a.order_type_code, a.order_type_name, a.priority_level_code, a.priority_level_name - ,a.push_status,a.push_time,a.push_by,a.push_by_name + ,a.push_status,a.push_time,a.push_by,a.push_by_name, + (SELECT m.goods_type FROM PICKING_MATERIAL_DETAIL d + JOIN material_base_info m ON d.material_base_info_id = m.material_base_info_id + WHERE d.PICKING_ORDER_NUMBER = a.PICKING_ORDER_NUMBER + LIMIT 1) AS goods_type @@ -117,11 +122,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and b.need_declare_flag = #{needDeclareFlag} - - and PUSH_TIME =]]> #{pushTimeStart} + + and a.PUSH_TIME =]]> #{pushTimeFrom} - - and PUSH_TIME #{pushTimeEnd} + + and a.PUSH_TIME #{pushTimeTo} + + + and a.create_time =]]> #{createTimeFrom} + + + and a.create_time #{createTimeTo} and a.PUSH_STATUS = #{pushStatus} diff --git a/mhd_wms/src/main/resources/mapper/shelfMaterialDetail/ShelfMaterialDetailMapper.xml b/mhd_wms/src/main/resources/mapper/shelfMaterialDetail/ShelfMaterialDetailMapper.xml index e641df613..a4c0cdc5d 100644 --- a/mhd_wms/src/main/resources/mapper/shelfMaterialDetail/ShelfMaterialDetailMapper.xml +++ b/mhd_wms/src/main/resources/mapper/shelfMaterialDetail/ShelfMaterialDetailMapper.xml @@ -77,6 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + @@ -85,7 +92,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CASE WHEN pack_detail_id IS NULL OR TRIM(pack_detail_id) = '' THEN NULL ELSE CAST(pack_detail_id AS BIGINT) - END as pack_detail_id, unit_code, unit_name, unit_number, material_warehouse_control_id, serial_number_manage, quality_inspection_manage, quality_inspection_stage, quality_inspection_rule, quality_inspection_ratio, quality_inspection_term, quality_inspection_results, allow_overcharge, overcharge_ratio, batch_number, material_status_code, material_status_name, distribute_rule_id, distribute_rule_code, distribute_rule_name, container_id, container_code, container_type, container_type_name, warehouse_id, warehouse_code, warehouse_name, storage_section_id, storage_code, storage_name, storage_location_id, storage_location_code, storage_location_name, level, parent_unique_id, in_unique_id, receipt_unique_id, allow_modify, remark, batch_ref_no, sheet_ref_no, box_pallet_no, ext_attr_1, ext_attr_2, production_date, expiry_date, inventory_date, ext_attr_3, ext_attr_4, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag,total_net_weight,total_gross_weight,total_volume,total_area,in_order_number,lot_number,pallet_number,copy_batch,copy_quantity,copy_details from shelf_material_detail + END as pack_detail_id, unit_code, + line_num_gw, + spec_gw, + unit_gw, + qty_gw, + erp_curr_gw, + erp_price_gw, + amount_gw, + in_order_number_gw, + in_line_num_gw, + unit_name, unit_number, material_warehouse_control_id, serial_number_manage, quality_inspection_manage, quality_inspection_stage, quality_inspection_rule, quality_inspection_ratio, quality_inspection_term, quality_inspection_results, allow_overcharge, overcharge_ratio, batch_number, material_status_code, material_status_name, distribute_rule_id, distribute_rule_code, distribute_rule_name, container_id, container_code, container_type, container_type_name, warehouse_id, warehouse_code, warehouse_name, storage_section_id, storage_code, storage_name, storage_location_id, storage_location_code, storage_location_name, level, parent_unique_id, in_unique_id, receipt_unique_id, allow_modify, remark, batch_ref_no, sheet_ref_no, box_pallet_no, ext_attr_1, ext_attr_2, production_date, expiry_date, inventory_date, ext_attr_3, ext_attr_4, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag,total_net_weight,total_gross_weight,total_volume,total_area,in_order_number,lot_number,pallet_number,copy_batch,copy_quantity,copy_details from shelf_material_detail diff --git a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml index 78455c712..a1a04ed25 100644 --- a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml @@ -418,6 +418,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeEnd} + + and a.PUSH_TIME =]]> #{pushTimeFrom} + + + and a.PUSH_TIME #{pushTimeTo} + + + and a.create_time =]]> #{createTimeFrom} + + + and a.create_time #{createTimeTo} + + + and a.PUSH_STATUS = #{pushStatus} + and exists ( diff --git a/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml index 3a2da9f3b..c090be1c8 100644 --- a/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml @@ -312,6 +312,21 @@ and date_format(a.audit_time,'%Y-%m-%d') <= #{auditTimeEnd} + + and a.create_time =]]> #{createTimeFrom} + + + and a.create_time #{createTimeTo} + + + and a.PUSH_TIME =]]> #{pushTimeFrom} + + + and a.PUSH_TIME #{pushTimeTo} + + + and a.PUSH_STATUS = #{pushStatus} + and exists ( diff --git a/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml index dea1de001..83f0b1861 100644 --- a/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml @@ -110,11 +110,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeEnd} - - and PUSH_TIME =]]> #{pushTimeStart} + + and a.create_time =]]> #{createTimeFrom} - - and PUSH_TIME #{pushTimeEnd} + + and a.create_time #{createTimeTo} + + + and a.PUSH_TIME =]]> #{pushTimeFrom} + + + and a.PUSH_TIME #{pushTimeTo} and a.PUSH_STATUS = #{pushStatus} diff --git a/sql/oms20260513.sql b/sql/oms20260513.sql index 8f4716f3a..20bec1855 100644 --- a/sql/oms20260513.sql +++ b/sql/oms20260513.sql @@ -178,3 +178,89 @@ on column NGWL_TEST_OMS.BUSINESS_DOCUMENT_ORDER.REVISE_APPLY_TIME is '删改单 +-- 物料推送记录表 +CREATE TABLE NGWL_TEST_OMS.MATERIAL_PUSH_RECORD ( + ID BIGINT IDENTITY(1,1) NOT NULL, + MATERIAL_BASE_INFO_ID BIGINT, + MATERIAL_CODE VARCHAR(100), + MATERIAL_NAME VARCHAR(255), + SPECIFICATION_MODEL VARCHAR(255), + DECLARATION_UNIT VARCHAR(100), + CARGO_NUM DECIMAL(20,4), + CURRENCY VARCHAR(10), + UNIT_PRICE DECIMAL(20,4), + NET_WEIGHT DECIMAL(20,4), + GROSS_WEIGHT DECIMAL(20,4), + GOODS_TYPE INT, + PUSH_TIME DATETIME, + DEL_FLAG INT DEFAULT 1, + CREATE_BY VARCHAR(100), + CREATE_TIME DATETIME, + UPDATE_BY VARCHAR(100), + UPDATE_TIME DATETIME, + PRIMARY KEY (ID) +); + +COMMENT ON TABLE NGWL_TEST_OMS.MATERIAL_PUSH_RECORD IS '物料推送记录表'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.MATERIAL_BASE_INFO_ID IS '物料ID'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.MATERIAL_CODE IS '物料编码'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.MATERIAL_NAME IS '物料名称'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.SPECIFICATION_MODEL IS '规格型号'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.DECLARATION_UNIT IS '申报单位'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.CARGO_NUM IS '数量'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.CURRENCY IS '币制'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.UNIT_PRICE IS '单价'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.NET_WEIGHT IS '净重(kg)'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.GROSS_WEIGHT IS '毛重(kg)'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.GOODS_TYPE IS '商品类型(0物料,1半成品,2成品)'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.PUSH_TIME IS '推送时间'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.DEL_FLAG IS '删除标志(1-正常,2-删除)'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.CREATE_BY IS '创建人'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.CREATE_TIME IS '创建时间'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.UPDATE_BY IS '更新人'; + COMMENT ON COLUMN NGWL_TEST_OMS.MATERIAL_PUSH_RECORD.UPDATE_TIME IS '更新时间'; + + + +CREATE TABLE NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD ( + ID BIGINT IDENTITY(1,1) NOT NULL, + ORDER_ID BIGINT, + MATERIAL_BASE_INFO_ID BIGINT, + MATERIAL_CODE VARCHAR(100), + MATERIAL_NAME VARCHAR(255), + SPECIFICATION_MODEL VARCHAR(255), + DECLARATION_UNIT VARCHAR(100), + CARGO_NUM DECIMAL(20,4), + CURRENCY VARCHAR(10), + UNIT_PRICE DECIMAL(20,4), + NET_WEIGHT DECIMAL(20,4), + GROSS_WEIGHT DECIMAL(20,4), + GOODS_TYPE INT, + PUSH_TIME DATETIME, + DEL_FLAG INT DEFAULT 1, + CREATE_BY VARCHAR(100), + CREATE_TIME DATETIME, + UPDATE_BY VARCHAR(100), + UPDATE_TIME DATETIME, + PRIMARY KEY (ID) +); + +COMMENT ON TABLE NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD IS '单证推送物料记录表'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.ORDER_ID IS '单证ID'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.MATERIAL_BASE_INFO_ID IS '物料ID'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.MATERIAL_CODE IS '物料编码'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.MATERIAL_NAME IS '物料名称'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.SPECIFICATION_MODEL IS '规格型号'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.DECLARATION_UNIT IS '申报单位'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.CARGO_NUM IS '数量'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.CURRENCY IS '币制'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.UNIT_PRICE IS '单价'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.NET_WEIGHT IS '净重(kg)'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.GROSS_WEIGHT IS '毛重(kg)'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.GOODS_TYPE IS '商品类型(0物料,1半成品,2成品)'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.PUSH_TIME IS '推送时间'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.DEL_FLAG IS '删除标志(1-正常,2-删除)'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.CREATE_BY IS '创建人'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.CREATE_TIME IS '创建时间'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.UPDATE_BY IS '更新人'; + COMMENT ON COLUMN NGWL_TEST_OMS.DOCUMENT_PUSH_MATERIAL_RECORD.UPDATE_TIME IS '更新时间'; \ No newline at end of file