一般贸易推送,保存详情数据
This commit is contained in:
+36
@@ -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.setSpecificationModel(material.getSpecificationModel());
|
||||
docRecord.setDeclarationUnit(material.getDeclarationUnit());
|
||||
docRecord.setCurrency(material.getCurrency());
|
||||
docRecord.setUnitPrice(material.getUnitPrice());
|
||||
docRecord.setNetWeight(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);
|
||||
|
||||
+77
@@ -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 specificationModel;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
private String declarationUnit;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal cargoNum;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("净重(kg)")
|
||||
private BigDecimal netWeight;
|
||||
|
||||
@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;
|
||||
}
|
||||
+9
@@ -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<DocumentPushMaterialRecord> {
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mhd.oms.domain.documentPushMaterialRecord.repository.mapper.DocumentPushMaterialRecordMapper">
|
||||
|
||||
<resultMap type="com.mhd.oms.domain.documentPushMaterialRecord.entity.DocumentPushMaterialRecord" id="DocumentPushMaterialRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="materialBaseInfoId" column="material_base_info_id" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="specificationModel" column="specification_model" />
|
||||
<result property="declarationUnit" column="declaration_unit" />
|
||||
<result property="cargoNum" column="cargo_num" />
|
||||
<result property="currency" column="currency" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="netWeight" column="net_weight" />
|
||||
<result property="grossWeight" column="gross_weight" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
<result property="pushTime" column="push_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user