This commit is contained in:
linfso 2024-04-28 01:19:47 +08:00
parent dcb615f0a2
commit d98f63beb0
12 changed files with 870 additions and 177 deletions

View File

@ -19,6 +19,8 @@ import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import lombok.Data;
@ -342,4 +344,9 @@ public class EmisWaybill extends BaseEntity
/* 更新网点 */
private String updateSite;
private List<EmisWaybillCargo> cargoList;
private List<EmisWaybillFeeitem> feeitemList;
private List<EmisWaybillAttachment> attachmentList;
}

View File

@ -2,7 +2,7 @@
* @Project: emis
* @Title: EmisWaybillCargo.java
* @author linfso
* @date 2024-04-27 08:16:45
* @date 2024-04-27 15:14:06
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单货物 实体类 </p>
@ -26,12 +26,11 @@ import lombok.Data;
* @ClassName EmisWaybillCargo
* @Description 运单货物
* @author linfso
* @date 2024-04-27 08:16:45
* @date 2024-04-27 15:14:06
*/
@Data
public class EmisWaybillCargo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
@ -42,8 +41,10 @@ public class EmisWaybillCargo extends BaseEntity
private String goodsCode;
/* 货物名称 */
private String goodsName;
/* 货物数量 */
/* 实际数量 */
private Integer cargoQty;
/* 异常数量 */
private Integer abnormalQty;
/* 单位 */
private String unit;
/* 重量 */
@ -68,6 +69,8 @@ public class EmisWaybillCargo extends BaseEntity
private String ingredients;
/* 厂家 */
private String manufacturer;
/* 供应商 */
private String supplier;
/* 功能 */
private String function;
/* 规格型号 */

View File

@ -2,7 +2,7 @@
* @Project: emis
* @Title: EmisWaybillFeeitem.java
* @author linfso
* @date 2024-04-24 05:22:27
* @date 2024-04-27 13:18:17
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 运单费用条目 实体类 </p>
@ -26,7 +26,7 @@ import lombok.Data;
* @ClassName EmisWaybillFeeitem
* @Description 运单费用条目
* @author linfso
* @date 2024-04-24 05:22:27
* @date 2024-04-27 13:18:17
*/
@Data
public class EmisWaybillFeeitem extends BaseEntity
@ -47,6 +47,8 @@ public class EmisWaybillFeeitem extends BaseEntity
private String currency;
/* 报价ID */
private Long quoteId;
/* 计算公式ID */
private Long exprId;
/* 排序 */
private Integer orderNum;

View File

@ -1,9 +1,20 @@
package com.xdadan.erp.emis.domain.vo;
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class Attachment {
public class Attachment extends VoBase<EmisWaybillAttachment,Attachment> implements Serializable {
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 附件类型 1-清关文件 2-揽收底单 3-签收底单 */
private String attachType;
@ -14,7 +25,54 @@ public class Attachment {
/* 文件描述 */
private String fileDesc;
/* 排序 */
private String orderNum;
private Integer orderNum;
private String remark;
@Override
public Attachment toVo(EmisWaybillAttachment dbItem) {
Attachment voItem = new Attachment();
voItem.setId(dbItem.getId());
// this.setWaybillId(dbAttachment.getWaybillId());
voItem.setAttachType(dbItem.getAttachType());
voItem.setFileName(dbItem.getFileName());
voItem.setFileUrl(dbItem.getFileUrl());
voItem.setFileDesc(dbItem.getFileDesc());
voItem.setOrderNum(dbItem.getOrderNum());
// this.setDelFlag(dbAttachment.getDelFlag());
// this.setCreateBy(dbAttachment.getCreateBy());
// this.setCreateTime(dbAttachment.getCreateTime());
// this.setUpdateBy(dbAttachment.getUpdateBy());
// this.setUpdateTime(dbAttachment.getUpdateTime());
voItem.setRemark(dbItem.getRemark());
return voItem;
}
@Override
public EmisWaybillAttachment toDb(Attachment voItem){
EmisWaybillAttachment dbItem = new EmisWaybillAttachment();
dbItem.setId(voItem.getId());
// dbAttachment.setWaybillId(this.getWaybillId());
dbItem.setAttachType(voItem.getAttachType());
dbItem.setFileName(voItem.getFileName());
dbItem.setFileUrl(voItem.getFileUrl());
dbItem.setFileDesc(voItem.getFileDesc());
dbItem.setOrderNum(voItem.getOrderNum());
// dbAttachment.setDelFlag(this.getDelFlag());
// dbAttachment.setCreateBy(this.getCreateBy());
// dbAttachment.setCreateTime(this.getCreateTime());
// dbAttachment.setUpdateBy(this.getUpdateBy());
// dbAttachment.setUpdateTime(this.getUpdateTime());
dbItem.setRemark(voItem.getRemark());
return dbItem;
}
public static List<EmisWaybillAttachment> toDBList(List<Attachment> voList){
return toDBList(voList);
}
public static List<Attachment> toVoList(List<EmisWaybillAttachment> dbList){
return toVoList(dbList);
}
}

View File

@ -1,17 +1,30 @@
package com.xdadan.erp.emis.domain.vo;
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class Cargo {
public class Cargo extends VoBase<EmisWaybillCargo,Cargo> implements Serializable {
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 货物编码 */
private String goodsCode;
/* 货物名称 */
private String goodsName;
/* 货物数量 */
private String cargoQty;
private Integer cargoQty;
/* 异常数量 */
private Integer abnormalQty;
/* 单位 */
private String unit;
/* 重量 */
@ -36,6 +49,10 @@ public class Cargo {
private String ingredients;
/* 厂家 */
private String manufacturer;
/* 供应商 */
private String supplier;
/* 规格型号 */
private String goodsModel;
/* 毛重 */
@ -46,4 +63,100 @@ public class Cargo {
private Integer orderNum;
private Integer isSave;
@Override
public Cargo toVo(EmisWaybillCargo dbItem) {
Cargo voItem = new Cargo();
voItem.setId(dbItem.getId());
// voItem.setWaybillId(dbItem.getWaybillId());
voItem.setGoodsCode(dbItem.getGoodsCode());
voItem.setGoodsName(dbItem.getGoodsName());
voItem.setCargoQty(dbItem.getCargoQty());
voItem.setAbnormalQty(dbItem.getAbnormalQty());
voItem.setUnit(dbItem.getUnit());
voItem.setWeight(dbItem.getWeight());
voItem.setPrice(dbItem.getPrice());
voItem.setCurrency(dbItem.getCurrency());
voItem.setNationArea(dbItem.getNationArea());
voItem.setTaxNo(dbItem.getTaxNo());
voItem.setHscode(dbItem.getHscode());
voItem.setBrand(dbItem.getBrand());
voItem.setMaterial(dbItem.getMaterial());
voItem.setPurpose(dbItem.getPurpose());
voItem.setIngredients(dbItem.getIngredients());
voItem.setManufacturer(dbItem.getManufacturer());
voItem.setSupplier(dbItem.getSupplier());
// voItem.setFunction(dbItem.getFunction());
voItem.setGoodsModel(dbItem.getGoodsModel());
voItem.setGrossWeight(dbItem.getGrossWeight());
voItem.setNetWeight(dbItem.getNetWeight());
// voItem.setLength(dbItem.getLength());
// voItem.setWidth(dbItem.getWidth());
// voItem.setHeight(dbItem.getHeight());
// voItem.setVolume(dbItem.getVolume());
// voItem.setBarcode(dbItem.getBarcode());
voItem.setOrderNum(dbItem.getOrderNum());
// voItem.setDelFlag(dbItem.getDelFlag());
// voItem.setCreateBy(dbItem.getCreateBy());
// voItem.setCreateTime(dbItem.getCreateTime());
// voItem.setUpdateBy(dbItem.getUpdateBy());
// voItem.setUpdateTime(dbItem.getUpdateTime());
// voItem.setRemark(dbItem.getRemark());
return voItem;
}
@Override
public EmisWaybillCargo toDb(Cargo voItem) {
EmisWaybillCargo dbItem = new EmisWaybillCargo();
// dbItem.setId(voItem.getId());
// dbItem.setWaybillId(voItem.getWaybillId());
dbItem.setGoodsCode(voItem.getGoodsCode());
dbItem.setGoodsName(voItem.getGoodsName());
dbItem.setCargoQty(voItem.getCargoQty());
dbItem.setAbnormalQty(voItem.getAbnormalQty());
dbItem.setUnit(voItem.getUnit());
dbItem.setWeight(voItem.getWeight());
dbItem.setPrice(voItem.getPrice());
dbItem.setCurrency(voItem.getCurrency());
dbItem.setNationArea(voItem.getNationArea());
dbItem.setTaxNo(voItem.getTaxNo());
dbItem.setHscode(voItem.getHscode());
dbItem.setBrand(voItem.getBrand());
dbItem.setMaterial(voItem.getMaterial());
dbItem.setPurpose(voItem.getPurpose());
dbItem.setIngredients(voItem.getIngredients());
dbItem.setManufacturer(voItem.getManufacturer());
dbItem.setSupplier(voItem.getSupplier());
// dbItem.setFunction(voItem.getFunction());
dbItem.setGoodsModel(voItem.getGoodsModel());
dbItem.setGrossWeight(voItem.getGrossWeight());
dbItem.setNetWeight(voItem.getNetWeight());
// dbItem.setLength(voItem.getLength());
// dbItem.setWidth(voItem.getWidth());
// dbItem.setHeight(voItem.getHeight());
// dbItem.setVolume(voItem.getVolume());
// dbItem.setBarcode(voItem.getBarcode());
dbItem.setOrderNum(voItem.getOrderNum());
// dbItem.setDelFlag(voItem.getDelFlag());
// dbItem.setCreateBy(voItem.getCreateBy());
// dbItem.setCreateTime(voItem.getCreateTime());
// dbItem.setUpdateBy(voItem.getUpdateBy());
// dbItem.setUpdateTime(voItem.getUpdateTime());
// dbItem.setRemark(voItem.getRemark());
return dbItem;
}
public static List<EmisWaybillCargo> toDBList(List<Cargo> voList){
return toDBList(voList);
}
public static List<Cargo> toVoList(List<EmisWaybillCargo> dbList){
return toVoList(dbList);
}
}

View File

@ -1,11 +1,15 @@
package com.xdadan.erp.emis.domain.vo;
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class FeeItem {
public class FeeItem extends VoBase<EmisWaybillFeeitem,FeeItem> {
/* 费用编码 */
private String feeCode;
@ -17,6 +21,8 @@ public class FeeItem {
private String currency;
/* 报价ID */
private Long quoteId;
/* 计算公式ID */
private Long exprId;
/* 排序 */
private Integer orderNum;
// 收费项
@ -28,4 +34,40 @@ public class FeeItem {
private String addWeight;
@Override
public FeeItem toVo(EmisWaybillFeeitem dbItem) {
FeeItem voItem = new FeeItem();
voItem.setFeeCode(dbItem.getFeeCode());
voItem.setFeeName(dbItem.getFeeName());
voItem.setFee(dbItem.getFee());
voItem.setCurrency(dbItem.getCurrency());
voItem.setQuoteId(dbItem.getQuoteId());
voItem.setExprId(dbItem.getExprId());
voItem.setOrderNum(dbItem.getOrderNum());
voItem.setRemark(dbItem.getRemark());
return voItem;
}
@Override
public EmisWaybillFeeitem toDb(FeeItem voItem) {
EmisWaybillFeeitem dbItem = new EmisWaybillFeeitem();
dbItem.setFeeCode(voItem.getFeeCode());
dbItem.setFeeName(voItem.getFeeName());
dbItem.setFee(voItem.getFee());
dbItem.setCurrency(voItem.getCurrency());
dbItem.setQuoteId(voItem.getQuoteId());
dbItem.setExprId(voItem.getExprId());
dbItem.setOrderNum(voItem.getOrderNum());
dbItem.setRemark(voItem.getRemark());
return dbItem;
}
public static List<EmisWaybillFeeitem> toDBList(List<FeeItem> voList){
return toDBList(voList);
}
public static List<FeeItem> toVoList(List<EmisWaybillFeeitem> dbList){
return toVoList(dbList);
}
}

View File

@ -1,11 +1,13 @@
package com.xdadan.erp.emis.domain.vo;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
import lombok.Data;
import java.io.Serializable;
@Data
public class Reciever implements Serializable {
public class Reciever implements Serializable {
private static final long serialVersionUID = 1L;
/* 国家 */
private String country;
@ -29,4 +31,5 @@ public class Reciever implements Serializable {
private String email;
/* 公司 */
private String company;
}

View File

@ -0,0 +1,50 @@
package com.xdadan.erp.emis.domain.vo;
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
public abstract class VoBase<DB,VO> {
public abstract VO toVo(DB dbItem);
public abstract DB toDb(VO voItem);
/**
* 转换为数据库类型
* @param voList
* @return
*/
public List<DB> toDbList(List<VO> voList){
if(!CollectionUtils.isEmpty(voList)){
List<DB> list = new ArrayList<>();
for (VO voItem: voList){
list.add(toDb(voItem));
}
return list;
}
return null;
}
/**
* 转为 vo list
* @param dbList
* @return
*/
public static List<VO> toVoList(List<DB> dbList){
if(!CollectionUtils.isEmpty(dbList)){
List<VO> list = new ArrayList<>();
for (DB dbItem: dbList){
list.add(toVo(dbItem));
}
return list;
}
return null;
}
}

View File

@ -1,6 +1,10 @@
package com.xdadan.erp.emis.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
import lombok.Data;
import java.io.Serializable;
@ -9,7 +13,7 @@ import java.util.Date;
import java.util.List;
@Data
public class WaybillOrder implements Serializable {
public class WaybillOrder implements Serializable {
private static final long serialVersionUID = 1L;
// 收件人
@ -196,4 +200,489 @@ public class WaybillOrder implements Serializable {
/* 是否给收件人发短信 */
private String blAcceptMessage;
/* 实际进仓单关联 */
private String warehouseInNo;
/* 货物图片,逗号隔开 */
private String goodsPics;
/* 预入仓代垫运费 1-是 */
private String blPrepareInFreight;
/* 预入仓代垫运费 */
private BigDecimal prepareInEstFee;
/* 预入仓实际运费 */
private BigDecimal prepareInRealFee;
/* 预入仓快递公司 */
private String prepareInExpress;
/* 预入仓快递单号 */
private String prepareInBillCode;
/* 预入仓自定义标识 */
private String prepareInRemark;
/* 预入仓供应商 */
private String prepareInSupplier;
private String remark;
/**
* 转 VO
* @param dbWaybill
* @param dbCargoList
* @param dbFeeitemList
* @param dbAttachmentList
* @return
*/
public static WaybillOrder toVo(EmisWaybill dbWaybill,
List<EmisWaybillCargo> dbCargoList,
List<EmisWaybillFeeitem> dbFeeitemList,
List<EmisWaybillAttachment> dbAttachmentList
){
WaybillOrder voItem = new WaybillOrder();
// 转换其他list
voItem.setCargoList(Cargo.toVoList(dbCargoList));
voItem.setFeeItems(FeeItem.toVoList(dbFeeitemList));
voItem.setAttachmentList(Attachment.toVoList(dbAttachmentList));
// 收件人
Reciever reciever = new Reciever();
reciever.setName(dbWaybill.getReceiveName());
reciever.setPhone(dbWaybill.getReceiveMobile());
reciever.setCountry(dbWaybill.getReceiveCountry());
reciever.setProvince(dbWaybill.getReceiveProvince());
reciever.setCity(dbWaybill.getReceiveCity());
reciever.setCounty(dbWaybill.getReceiveCounty());
reciever.setAddress(dbWaybill.getReceiveAddress());
reciever.setPostCode(dbWaybill.getReceivePostcode());
reciever.setCompany(dbWaybill.getReceiveCompany());
voItem.setReciever(reciever);
// 发件人
Sender sender = new Sender();
sender.setName(dbWaybill.getSendName());
sender.setPhone(dbWaybill.getSendMobile());
sender.setCountry(dbWaybill.getSendCountry());
sender.setProvince(dbWaybill.getSendProvince());
sender.setCity(dbWaybill.getSendCity());
sender.setCounty(dbWaybill.getSendCounty());
sender.setAddress(dbWaybill.getSendAddress());
sender.setPostCode(dbWaybill.getSendPostcode());
sender.setCompany(dbWaybill.getSendCompany());
voItem.setSender(sender);
// voItem.setId(dbWaybill.getId());
voItem.setOrderSn(dbWaybill.getOrderSn());
voItem.setCustOrderId(dbWaybill.getCustOrderId());
voItem.setBillCode(dbWaybill.getBillCode());
voItem.setBillCodeSub(dbWaybill.getBillCodeSub());
// voItem.setOrderStatus(dbWaybill.getOrderStatus());
// voItem.setWaybillStatus(dbWaybill.getWaybillStatus());
// voItem.setOrderType(dbWaybill.getOrderType());
voItem.setOrderDate(dbWaybill.getOrderDate());
voItem.setUserId(dbWaybill.getUserId());
voItem.setCustomerCode(dbWaybill.getCustomerCode());
// voItem.setCustomerName(dbWaybill.getCustomerName());
// voItem.setReceiveCustomerCode(dbWaybill.getReceiveCustomerCode());
// voItem.setReceiveCustomerName(dbWaybill.getReceiveCustomerName());
// voItem.setThirdCustomerCode(dbWaybill.getThirdCustomerCode());
// voItem.setThirdCustomerName(dbWaybill.getThirdCustomerName());
voItem.setOpenId(dbWaybill.getOpenId());
// voItem.setReceiveName(dbWaybill.getReceiveName());
// voItem.setReceiveCompany(dbWaybill.getReceiveCompany());
// voItem.setReceiveMobile(dbWaybill.getReceiveMobile());
// voItem.setReceiveTel(dbWaybill.getReceiveTel());
// voItem.setReceiveCountry(dbWaybill.getReceiveCountry());
// voItem.setReceiveProvince(dbWaybill.getReceiveProvince());
// voItem.setReceiveCity(dbWaybill.getReceiveCity());
// voItem.setReceiveCounty(dbWaybill.getReceiveCounty());
// voItem.setReceiveTown(dbWaybill.getReceiveTown());
// voItem.setReceiveAddress(dbWaybill.getReceiveAddress());
// voItem.setReceivePostcode(dbWaybill.getReceivePostcode());
// voItem.setReceivePcd(dbWaybill.getReceivePcd());
// voItem.setSendName(dbWaybill.getSendName());
// voItem.setSendCompany(dbWaybill.getSendCompany());
// voItem.setSendMobile(dbWaybill.getSendMobile());
// voItem.setSendTel(dbWaybill.getSendTel());
// voItem.setSendCountry(dbWaybill.getSendCountry());
// voItem.setSendProvince(dbWaybill.getSendProvince());
// voItem.setSendCity(dbWaybill.getSendCity());
// voItem.setSendCounty(dbWaybill.getSendCounty());
// voItem.setSendTown(dbWaybill.getSendTown());
// voItem.setSendAddress(dbWaybill.getSendAddress());
// voItem.setSendPostcode(dbWaybill.getSendPostcode());
// voItem.setSendPcd(dbWaybill.getSendPcd());
voItem.setPaymentType(dbWaybill.getPaymentType());
voItem.setCalcFeeType(dbWaybill.getCalcFeeType());
voItem.setCustNo(dbWaybill.getCustNo());
voItem.setTransLine(dbWaybill.getTransLineType());
voItem.setProductType(dbWaybill.getProductType());
// voItem.setTimeType(dbWaybill.getTimeType());
// voItem.setMeterType(dbWaybill.getMeterType());
voItem.setCustomsClear(dbWaybill.getCustomsClear());
voItem.setCustomsEclaration(dbWaybill.getCustomsEclaration());
// voItem.setEstimateDate(dbWaybill.getEstimateDate());
voItem.setPackType(dbWaybill.getPackType());
voItem.setDispatchMethod(dbWaybill.getDispatchMethod());
voItem.setPickupMethod(dbWaybill.getPickupMethod());
voItem.setPickStartDate(dbWaybill.getPickStartDate());
voItem.setPickFinishDate(dbWaybill.getPickFinishDate());
// voItem.setPickFailReason(dbWaybill.getPickFailReason());
voItem.setIntoWarehouseCode(dbWaybill.getIntoWarehouseCode());
voItem.setIntoWarehouseName(dbWaybill.getIntoWarehouseName());
voItem.setIntoWarehouseAddress(dbWaybill.getIntoWarehouseAddress());
voItem.setIntoWarehouseContact(dbWaybill.getIntoWarehouseContact());
voItem.setIntoWarehousePhone(dbWaybill.getIntoWarehousePhone());
voItem.setIntoWarehouseBillCode(dbWaybill.getIntoWarehouseBillCode());
voItem.setWarehouseInNo(dbWaybill.getWarehouseInNo());
voItem.setCustomerDeliveryBeginTime(dbWaybill.getCustomerDeliveryBeginTime());
// voItem.setCustomerDeliveryEndTime(dbWaybill.getCustomerDeliveryEndTime());
voItem.setGoodsType(dbWaybill.getGoodsType());
voItem.setGoodsInfo(dbWaybill.getGoodsInfo());
voItem.setGoodsPics(dbWaybill.getGoodsPics());
voItem.setBlPrepareInFreight(dbWaybill.getBlPrepareInFreight());
voItem.setPrepareInEstFee(dbWaybill.getPrepareInEstFee());
voItem.setPrepareInRealFee(dbWaybill.getPrepareInRealFee());
voItem.setPrepareInExpress(dbWaybill.getPrepareInExpress());
voItem.setPrepareInBillCode(dbWaybill.getPrepareInBillCode());
voItem.setPrepareInRemark(dbWaybill.getPrepareInRemark());
voItem.setPrepareInSupplier(dbWaybill.getPrepareInSupplier());
voItem.setTotalWeight(dbWaybill.getTotalWeight());
voItem.setTotalVolume(dbWaybill.getTotalVolume());
voItem.setParcelQty(dbWaybill.getParcelQty());
voItem.setBillWeight(dbWaybill.getBillWeight());
voItem.setVolumeWeight(dbWaybill.getVolumeWeight());
voItem.setCurrency(dbWaybill.getCurrency());
voItem.setSettlementWeight(dbWaybill.getSettlementWeight());
voItem.setFeeWeight(dbWaybill.getFeeWeight());
voItem.setFreight(dbWaybill.getFreight());
voItem.setBlOverLong(dbWaybill.getBlOverLong());
// voItem.setBlBill(dbWaybill.getBlBill());
// voItem.setBlBillText(dbWaybill.getBlBillText());
voItem.setBlOverWeight(dbWaybill.getBlOverWeight());
voItem.setOverWeightNumber(dbWaybill.getOverWeightNumber());
voItem.setFeeRemaker(dbWaybill.getFeeRemaker());
// voItem.setThirdCode(dbWaybill.getThirdCode());
voItem.setRealValue(dbWaybill.getRealValue());
// voItem.setBlInsure(dbWaybill.getBlInsure());
// voItem.setInsureValue(dbWaybill.getInsureValue());
// voItem.setInsureValueCurrency(dbWaybill.getInsureValueCurrency());
// voItem.setInsureFeeCurrency(dbWaybill.getInsureFeeCurrency());
// voItem.setInsureFee(dbWaybill.getInsureFee());
// voItem.setInsureRemark(dbWaybill.getInsureRemark());
// voItem.setInsureSiteCode(dbWaybill.getInsureSiteCode());
// voItem.setInsureDate(dbWaybill.getInsureDate());
// voItem.setBlPrint(dbWaybill.getBlPrint());
// voItem.setPrintManCode(dbWaybill.getPrintManCode());
// voItem.setPrintSite(dbWaybill.getPrintSite());
// voItem.setPrintDate(dbWaybill.getPrintDate());
// voItem.setPrintCount(dbWaybill.getPrintCount());
voItem.setBlDispFd(dbWaybill.getBlDispFd());
voItem.setTransferCode(dbWaybill.getTransferCode());
voItem.setTransferBillcode(dbWaybill.getTransferBillcode());
voItem.setDispFdDate(dbWaybill.getDispFdDate());
// voItem.setDispFdReason(dbWaybill.getDispFdReason());
// voItem.setCurrentSiteCode(dbWaybill.getCurrentSiteCode());
// voItem.setNextSiteCode(dbWaybill.getNextSiteCode());
// voItem.setLastSiteCode(dbWaybill.getLastSiteCode());
// voItem.setRegisterSiteCode(dbWaybill.getRegisterSiteCode());
// voItem.setRegisterDate(dbWaybill.getRegisterDate());
// voItem.setRegisterManCode(dbWaybill.getRegisterManCode());
voItem.setTakePieceEmployeeCode(dbWaybill.getTakePieceEmployeeCode());
voItem.setSendSiteCode(dbWaybill.getSendSiteCode());
// voItem.setSendDate(dbWaybill.getSendDate());
// voItem.setDispatchManCode(dbWaybill.getDispatchManCode());
// voItem.setDispatchDate(dbWaybill.getDispatchDate());
// voItem.setDispatchSiteCode(dbWaybill.getDispatchSiteCode());
// voItem.setProduceBillDate(dbWaybill.getProduceBillDate());
// voItem.setProduceBillSiteCode(dbWaybill.getProduceBillSiteCode());
// voItem.setProduceBillManCode(dbWaybill.getProduceBillManCode());
voItem.setDestinationCode(dbWaybill.getDestinationCode());
voItem.setDestinationProvince(dbWaybill.getDestinationProvince());
voItem.setDestinationCity(dbWaybill.getDestinationCity());
voItem.setDestinationCounty(dbWaybill.getDestinationCounty());
voItem.setDispatchUnderlingSiteCode(dbWaybill.getDispatchUnderlingSiteCode());
voItem.setDestinationCenterCode(dbWaybill.getDestinationCenterCode());
voItem.setMarketManCode(dbWaybill.getMarketManCode());
voItem.setPayee(dbWaybill.getPayee());
voItem.setSalesmen(dbWaybill.getSalesmen());
voItem.setOperateEmployeeCode(dbWaybill.getOperateEmployeeCode());
// voItem.setBlIsQuestion(dbWaybill.getBlIsQuestion());
// voItem.setProblemCause(dbWaybill.getProblemCause());
voItem.setBlMessage(dbWaybill.getBlMessage());
voItem.setBlAcceptMessage(dbWaybill.getBlAcceptMessage());
// voItem.setBlGenSubbill(dbWaybill.getBlGenSubbill());
// voItem.setSignMan(dbWaybill.getSignMan());
// voItem.setSignManCode(dbWaybill.getSignManCode());
// voItem.setSignSiteCode(dbWaybill.getSignSiteCode());
// voItem.setSignDate(dbWaybill.getSignDate());
// voItem.setBillPicSendRmk(dbWaybill.getBillPicSendRmk());
// voItem.setBillPicDispatchRmk(dbWaybill.getBillPicDispatchRmk());
// voItem.setTimezoneOffset(dbWaybill.getTimezoneOffset());
// voItem.setDelFlag(dbWaybill.getDelFlag());
// voItem.setCreateBy(dbWaybill.getCreateBy());
// voItem.setCreateTime(dbWaybill.getCreateTime());
// voItem.setUpdateBy(dbWaybill.getUpdateBy());
// voItem.setUpdateTime(dbWaybill.getUpdateTime());
voItem.setRemark(dbWaybill.getRemark());
// voItem.setCreateSite(dbWaybill.getCreateSite());
// voItem.setUpdateSite(dbWaybill.getUpdateSite());
return voItem;
}
/**
* 转为数据库类型值
* @return
*/
public static EmisWaybill toDb(){
EmisWaybill dbWaybill = new EmisWaybill();
// 设置货物信息
dbWaybill.setCargoList(Cargo.toDBList(this.getCargoList()));
dbWaybill.setFeeitemList(FeeItem.toDBList(this.getFeeItems()));
dbWaybill.setAttachmentList(Attachment.toDBList(this.getAttachmentList()));
dbWaybill.setOrderSn(this.getOrderSn());
dbWaybill.setCustOrderId(this.getCustOrderId());
dbWaybill.setBillCode(this.getBillCode());
dbWaybill.setBillCodeSub(this.getBillCodeSub());
// dbWaybill.setOrderStatus(this.getOrderStatus());
// dbWaybill.setWaybillStatus(this.getWaybillStatus());
// dbWaybill.setOrderType(this.getOrderType());
dbWaybill.setOrderDate(this.getOrderDate());
dbWaybill.setUserId(this.getUserId());
dbWaybill.setCustomerCode(this.getCustomerCode());
// dbWaybill.setCustomerName(this.getCustomerName());
// dbWaybill.setReceiveCustomerCode(this.getReceiveCustomerCode());
// dbWaybill.setReceiveCustomerName(this.getReceiveCustomerName());
// dbWaybill.setThirdCustomerCode(this.getThirdCustomerCode());
// dbWaybill.setThirdCustomerName(this.getThirdCustomerName());
dbWaybill.setOpenId(this.getOpenId());
if(this.getReciever() != null){
Reciever reciever = this.getReciever();
dbWaybill.setReceiveName(reciever.getName());
dbWaybill.setReceiveMobile(reciever.getPhone());
dbWaybill.setReceiveCountry(reciever.getCountry());
dbWaybill.setReceiveProvince(reciever.getProvince());
dbWaybill.setReceiveCity(reciever.getCity());
dbWaybill.setReceiveCounty(reciever.getCounty());
dbWaybill.setReceiveAddress(reciever.getAddress());
dbWaybill.setReceivePostcode(reciever.getPostCode());
dbWaybill.setReceiveCompany(reciever.getCompany());
}
// dbWaybill.setReceiveName(this.getReceiveName());
// dbWaybill.setReceiveCompany(this.getReceiveCompany());
// dbWaybill.setReceiveMobile(this.getReceiveMobile());
// dbWaybill.setReceiveTel(this.getReceiveTel());
// dbWaybill.setReceiveCountry(this.getReceiveCountry());
// dbWaybill.setReceiveProvince(this.getReceiveProvince());
// dbWaybill.setReceiveCity(this.getReceiveCity());
// dbWaybill.setReceiveCounty(this.getReceiveCounty());
// dbWaybill.setReceiveTown(this.getReceiveTown());
// dbWaybill.setReceiveAddress(this.getReceiveAddress());
// dbWaybill.setReceivePostcode(this.getReceivePostcode());
// dbWaybill.setReceivePcd(this.getReceivePcd());
if(this.getSender() != null){
Sender sender = this.getSender();
dbWaybill.setSendName(sender.getName());
dbWaybill.setSendMobile(sender.getPhone());
dbWaybill.setSendCountry(sender.getCountry());
dbWaybill.setSendProvince(sender.getProvince());
dbWaybill.setSendCity(sender.getCity());
dbWaybill.setSendCounty(sender.getCounty());
dbWaybill.setSendAddress(sender.getAddress());
dbWaybill.setSendPostcode(sender.getPostCode());
dbWaybill.setSendCompany(sender.getCompany());
}
// dbWaybill.setSendName(this.getSendName());
// dbWaybill.setSendCompany(this.getSendCompany());
// dbWaybill.setSendMobile(this.getSendMobile());
// dbWaybill.setSendTel(this.getSendTel());
// dbWaybill.setSendCountry(this.getSendCountry());
// dbWaybill.setSendProvince(this.getSendProvince());
// dbWaybill.setSendCity(this.getSendCity());
// dbWaybill.setSendCounty(this.getSendCounty());
// dbWaybill.setSendTown(this.getSendTown());
// dbWaybill.setSendAddress(this.getSendAddress());
// dbWaybill.setSendPostcode(this.getSendPostcode());
// dbWaybill.setSendPcd(this.getSendPcd());
dbWaybill.setPaymentType(this.getPaymentType());
dbWaybill.setCalcFeeType(this.getCalcFeeType());
dbWaybill.setCustNo(this.getCustNo());
dbWaybill.setTransLineType(this.getTransLine());
dbWaybill.setProductType(this.getProductType());
// dbWaybill.setTimeType(this.getTimeType());
// dbWaybill.setMeterType(this.getMeterType());
dbWaybill.setCustomsClear(this.getCustomsClear());
dbWaybill.setCustomsEclaration(this.getCustomsEclaration());
// dbWaybill.setEstimateDate(this.getEstimateDate());
dbWaybill.setPackType(this.getPackType());
dbWaybill.setDispatchMethod(this.getDispatchMethod());
dbWaybill.setPickupMethod(this.getPickupMethod());
dbWaybill.setPickStartDate(this.getPickStartDate());
dbWaybill.setPickFinishDate(this.getPickFinishDate());
// dbWaybill.setPickFailReason(this.getPickFailReason());
dbWaybill.setIntoWarehouseCode(this.getIntoWarehouseCode());
dbWaybill.setIntoWarehouseName(this.getIntoWarehouseName());
dbWaybill.setIntoWarehouseAddress(this.getIntoWarehouseAddress());
dbWaybill.setIntoWarehouseContact(this.getIntoWarehouseContact());
dbWaybill.setIntoWarehousePhone(this.getIntoWarehousePhone());
dbWaybill.setIntoWarehouseBillCode(this.getIntoWarehouseBillCode());
dbWaybill.setWarehouseInNo(this.getWarehouseInNo());
dbWaybill.setCustomerDeliveryBeginTime(this.getCustomerDeliveryBeginTime());
// dbWaybill.setCustomerDeliveryEndTime(this.getCustomerDeliveryEndTime());
dbWaybill.setGoodsType(this.getGoodsType());
dbWaybill.setGoodsInfo(this.getGoodsInfo());
dbWaybill.setGoodsPics(this.getGoodsPics());
dbWaybill.setBlPrepareInFreight(this.getBlPrepareInFreight());
dbWaybill.setPrepareInEstFee(this.getPrepareInEstFee());
dbWaybill.setPrepareInRealFee(this.getPrepareInRealFee());
dbWaybill.setPrepareInExpress(this.getPrepareInExpress());
dbWaybill.setPrepareInBillCode(this.getPrepareInBillCode());
dbWaybill.setPrepareInRemark(this.getPrepareInRemark());
dbWaybill.setPrepareInSupplier(this.getPrepareInSupplier());
dbWaybill.setTotalWeight(this.getTotalWeight());
dbWaybill.setTotalVolume(this.getTotalVolume());
dbWaybill.setParcelQty(this.getParcelQty());
dbWaybill.setBillWeight(this.getBillWeight());
dbWaybill.setVolumeWeight(this.getVolumeWeight());
dbWaybill.setCurrency(this.getCurrency());
dbWaybill.setSettlementWeight(this.getSettlementWeight());
dbWaybill.setFeeWeight(this.getFeeWeight());
dbWaybill.setFreight(this.getFreight());
dbWaybill.setBlOverLong(this.getBlOverLong());
// dbWaybill.setBlBill(this.getBlBill());
// dbWaybill.setBlBillText(this.getBlBillText());
dbWaybill.setBlOverWeight(this.getBlOverWeight());
dbWaybill.setOverWeightNumber(this.getOverWeightNumber());
dbWaybill.setFeeRemaker(this.getFeeRemaker());
// dbWaybill.setThirdCode(this.getThirdCode());
dbWaybill.setRealValue(this.getRealValue());
// dbWaybill.setBlInsure(this.getBlInsure());
// dbWaybill.setInsureValue(this.getInsureValue());
// dbWaybill.setInsureValueCurrency(this.getInsureValueCurrency());
// dbWaybill.setInsureFeeCurrency(this.getInsureFeeCurrency());
// dbWaybill.setInsureFee(this.getInsureFee());
// dbWaybill.setInsureRemark(this.getInsureRemark());
// dbWaybill.setInsureSiteCode(this.getInsureSiteCode());
// dbWaybill.setInsureDate(this.getInsureDate());
// dbWaybill.setBlPrint(this.getBlPrint());
// dbWaybill.setPrintManCode(this.getPrintManCode());
// dbWaybill.setPrintSite(this.getPrintSite());
// dbWaybill.setPrintDate(this.getPrintDate());
// dbWaybill.setPrintCount(this.getPrintCount());
dbWaybill.setBlDispFd(this.getBlDispFd());
dbWaybill.setTransferCode(this.getTransferCode());
dbWaybill.setTransferBillcode(this.getTransferBillcode());
dbWaybill.setDispFdDate(this.getDispFdDate());
// dbWaybill.setDispFdReason(this.getDispFdReason());
// dbWaybill.setCurrentSiteCode(this.getCurrentSiteCode());
// dbWaybill.setNextSiteCode(this.getNextSiteCode());
// dbWaybill.setLastSiteCode(this.getLastSiteCode());
// dbWaybill.setRegisterSiteCode(this.getRegisterSiteCode());
// dbWaybill.setRegisterDate(this.getRegisterDate());
// dbWaybill.setRegisterManCode(this.getRegisterManCode());
dbWaybill.setTakePieceEmployeeCode(this.getTakePieceEmployeeCode());
dbWaybill.setSendSiteCode(this.getSendSiteCode());
// dbWaybill.setSendDate(this.getSendDate());
// dbWaybill.setDispatchManCode(this.getDispatchManCode());
// dbWaybill.setDispatchDate(this.getDispatchDate());
// dbWaybill.setDispatchSiteCode(this.getDispatchSiteCode());
// dbWaybill.setProduceBillDate(this.getProduceBillDate());
// dbWaybill.setProduceBillSiteCode(this.getProduceBillSiteCode());
// dbWaybill.setProduceBillManCode(this.getProduceBillManCode());
dbWaybill.setDestinationCode(this.getDestinationCode());
dbWaybill.setDestinationProvince(this.getDestinationProvince());
dbWaybill.setDestinationCity(this.getDestinationCity());
dbWaybill.setDestinationCounty(this.getDestinationCounty());
dbWaybill.setDispatchUnderlingSiteCode(this.getDispatchUnderlingSiteCode());
dbWaybill.setDestinationCenterCode(this.getDestinationCenterCode());
dbWaybill.setMarketManCode(this.getMarketManCode());
dbWaybill.setPayee(this.getPayee());
dbWaybill.setSalesmen(this.getSalesmen());
dbWaybill.setOperateEmployeeCode(this.getOperateEmployeeCode());
// dbWaybill.setBlIsQuestion(this.getBlIsQuestion());
// dbWaybill.setProblemCause(this.getProblemCause());
dbWaybill.setBlMessage(this.getBlMessage());
dbWaybill.setBlAcceptMessage(this.getBlAcceptMessage());
// dbWaybill.setBlGenSubbill(this.getBlGenSubbill());
// dbWaybill.setSignMan(this.getSignMan());
// dbWaybill.setSignManCode(this.getSignManCode());
// dbWaybill.setSignSiteCode(this.getSignSiteCode());
// dbWaybill.setSignDate(this.getSignDate());
// dbWaybill.setBillPicSendRmk(this.getBillPicSendRmk());
// dbWaybill.setBillPicDispatchRmk(this.getBillPicDispatchRmk());
// dbWaybill.setTimezoneOffset(this.getTimezoneOffset());
// dbWaybill.setDelFlag(this.getDelFlag());
// dbWaybill.setCreateBy(this.getCreateBy());
// dbWaybill.setCreateTime(this.getCreateTime());
// dbWaybill.setUpdateBy(this.getUpdateBy());
// dbWaybill.setUpdateTime(this.getUpdateTime());
dbWaybill.setRemark(this.getRemark());
// dbWaybill.setCreateSite(this.getCreateSite());
// dbWaybill.setUpdateSite(this.getUpdateSite());
return dbWaybill;
}
}

View File

@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.mapper.EmisWaybillMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/**
* 运单列表Service业务层处理
@ -165,87 +166,33 @@ public class EmisWaybillServiceImpl implements IEmisWaybillService
@Override
public WaybillOrder getWaybillDetail(String billCode){
EmisWaybill emisWaybill = this.selectEmisWaybillByBillCode(billCode);
if(emisWaybill==null){
EmisWaybill dbEmisWaybill = this.selectEmisWaybillByBillCode(billCode);
if(dbEmisWaybill==null){
return null;
}
WaybillOrder waybillOrder = new WaybillOrder();
// 忽略复制过程中出现的错误
CopyOptions options = CopyOptions.create().setIgnoreError(true);
// 基础信息
BeanUtil.copyProperties(emisWaybill,waybillOrder,options);
// 收件人
Reciever reciever = new Reciever();
reciever.setName(emisWaybill.getReceiveName());
reciever.setPhone(emisWaybill.getReceiveMobile());
reciever.setCountry(emisWaybill.getReceiveCountry());
reciever.setProvince(emisWaybill.getReceiveProvince());
reciever.setCity(emisWaybill.getReceiveCity());
reciever.setCounty(emisWaybill.getReceiveCounty());
reciever.setAddress(emisWaybill.getReceiveAddress());
reciever.setPostCode(emisWaybill.getReceivePostcode());
reciever.setCompany(emisWaybill.getReceiveCompany());
waybillOrder.setReciever(reciever);
// 发件人
Sender sender = new Sender();
sender.setName(emisWaybill.getSendName());
sender.setPhone(emisWaybill.getSendMobile());
sender.setCountry(emisWaybill.getSendCountry());
sender.setProvince(emisWaybill.getSendProvince());
sender.setCity(emisWaybill.getSendCity());
sender.setCounty(emisWaybill.getSendCounty());
sender.setAddress(emisWaybill.getSendAddress());
sender.setPostCode(emisWaybill.getSendPostcode());
sender.setCompany(emisWaybill.getSendCompany());
waybillOrder.setSender(sender);
// 收费项 // 查询收费项
List<FeeItem> feeItems = new ArrayList<>();
EmisWaybillFeeitem queryFeeitem = new EmisWaybillFeeitem();
queryFeeitem.setWaybillId(emisWaybill.getId());
List<EmisWaybillFeeitem> listFeeItem=emisWaybillFeeitemMapper.selectEmisWaybillFeeitemList(queryFeeitem);
for (EmisWaybillFeeitem feeItem:listFeeItem) {
FeeItem item = new FeeItem();
BeanUtil.copyProperties(feeItem,item,options);
feeItems.add(item);
}
waybillOrder.setFeeItems(feeItems);
queryFeeitem.setWaybillId(dbEmisWaybill.getId());
List<EmisWaybillFeeitem> dbFeeItemList=emisWaybillFeeitemMapper.selectEmisWaybillFeeitemList(queryFeeitem);
// 货物清单
List<Cargo> cargoList = new ArrayList<>();
EmisWaybillCargo queryCargo = new EmisWaybillCargo();
queryCargo.setWaybillId(emisWaybill.getId());
List<EmisWaybillCargo> listCargo=emisWaybillCargoMapper.selectEmisWaybillCargoList(queryCargo);
for (EmisWaybillCargo cargoItem:listCargo) {
Cargo item = new Cargo();
BeanUtil.copyProperties(cargoItem,item,options);
cargoList.add(item);
}
queryCargo.setWaybillId(dbEmisWaybill.getId());
List<EmisWaybillCargo> dbCargoList=emisWaybillCargoMapper.selectEmisWaybillCargoList(queryCargo);
waybillOrder.setCargoList(cargoList);
// 附件清单
List<Attachment> attachmentList = new ArrayList<>();
EmisWaybillAttachment queryAttachment = new EmisWaybillAttachment();
queryAttachment.setWaybillId(emisWaybill.getId());
List<EmisWaybillAttachment> listAttachment=emisWaybillAttachmentMapper.selectEmisWaybillAttachmentList(queryAttachment);
for (EmisWaybillAttachment attachmentItem:listAttachment) {
Attachment item = new Attachment();
BeanUtil.copyProperties(attachmentItem,item,options);
attachmentList.add(item);
}
waybillOrder.setAttachmentList(attachmentList);
queryAttachment.setWaybillId(dbEmisWaybill.getId());
List<EmisWaybillAttachment> dbAttachmentList=emisWaybillAttachmentMapper.selectEmisWaybillAttachmentList(queryAttachment);
return waybillOrder;
return WaybillOrder.toVo(dbEmisWaybill,dbCargoList,dbFeeItemList,dbAttachmentList);
}
/**
* 下单接口
* @param waybillOrder
@ -256,133 +203,97 @@ public class EmisWaybillServiceImpl implements IEmisWaybillService
public int realSubmitOrder(WaybillOrder waybillOrder) throws Exception {
boolean isNew = true;
EmisWaybill emisWaybillOld = null;
// 查询是更新还是新增
EmisWaybill emisWaybill =null;
if( !StringUtils.isEmpty(waybillOrder.getBillCode()) ){
emisWaybill = this.selectEmisWaybillByBillCode(waybillOrder.getBillCode());
if(emisWaybill!=null){
emisWaybillOld = this.selectEmisWaybillByBillCode(waybillOrder.getBillCode());
if(emisWaybillOld!=null){
isNew=false;
}
}
if( !StringUtils.isEmpty(waybillOrder.getOrderSn()) ){
emisWaybill = this.selectEmisWaybillByOrderSn(waybillOrder.getOrderSn());
if(emisWaybill!=null){
emisWaybillOld = this.selectEmisWaybillByOrderSn(waybillOrder.getOrderSn());
if(emisWaybillOld!=null){
isNew=false;
}
}
// 新增
if(isNew){
emisWaybill = new EmisWaybill();
}else{
// 判断运单状态,如果已锁账,则不允许修改
// 下单超过 24小时
if( "1".equals(emisWaybill.getBlBill()) || isOutTime(emisWaybill.getCreateTime()) ) {
throw new Exception("已锁账,不允许修改");
}
// 判断运单状态,如果已锁账,则不允许修改
// 下单超过 24小时
if( "1".equals(emisWaybillOld.getBlBill()) || isOutTime(emisWaybillOld.getCreateTime()) ) {
throw new Exception("已锁账,不允许修改");
}
EmisWaybill emisWaybillNew = WaybillOrder.toDb();
if (StringUtils.isEmpty(waybillOrder.getOrderSn())) {
// 新增
if(isNew){
// 设置订单
Snowflake snowflake = Singleton.get(Snowflake.class, 1, 1, true);
Long orderId = snowflake.nextId();
String orderSn = "TAO" + orderId.toString();
emisWaybill.setOrderSn(orderSn);
}
emisWaybillNew.setOrderSn(orderSn);
// 收发件人信息
if(waybillOrder.getReciever() != null){
Reciever reciever = waybillOrder.getReciever();
emisWaybill.setReceiveName(reciever.getName());
emisWaybill.setReceiveMobile(reciever.getPhone());
emisWaybill.setReceiveCountry(reciever.getCountry());
emisWaybill.setReceiveProvince(reciever.getProvince());
emisWaybill.setReceiveCity(reciever.getCity());
emisWaybill.setReceiveCounty(reciever.getCounty());
emisWaybill.setReceiveAddress(reciever.getAddress());
emisWaybill.setReceivePostcode(reciever.getPostCode());
emisWaybill.setReceiveCompany(reciever.getCompany());
}
emisWaybillMapper.insertEmisWaybill(emisWaybillNew);
// 产生主键插入其他数据
if(waybillOrder.getSender() != null){
Sender sender = waybillOrder.getSender();
emisWaybill.setSendName(sender.getName());
emisWaybill.setSendMobile(sender.getPhone());
emisWaybill.setSendCountry(sender.getCountry());
emisWaybill.setSendProvince(sender.getProvince());
emisWaybill.setSendCity(sender.getCity());
emisWaybill.setSendCounty(sender.getCounty());
emisWaybill.setSendAddress(sender.getAddress());
emisWaybill.setSendPostcode(sender.getPostCode());
emisWaybill.setSendCompany(sender.getCompany());
}
// private List<EmisWaybillCargo> cargoList;
// private List<EmisWaybillFeeitem> feeitemList;
// private List<EmisWaybillAttachment> attachmentList;
// 基础数据
// .setIgnoreNullValue(true) // 忽略源对象属性为空的情况
CopyOptions options = CopyOptions.create()
.setIgnoreError(true); // 忽略复制过程中出现的错误
// 插入费用
List<EmisWaybillFeeitem> feeitemList=emisWaybillNew.getFeeitemList();
if(!CollectionUtils.isEmpty(feeitemList)){
for (EmisWaybillFeeitem feeItem:feeitemList) {
feeItem.setWaybillId(emisWaybillNew.getId());
emisWaybillFeeitemMapper.insertEmisWaybillFeeitem(feeItem);
}
}
BeanUtil.copyProperties(waybillOrder,emisWaybill,options);
// 插入商品信息
if(!CollectionUtil.isNotEmpty(emisWaybillNew.getCargoList() )){
List<EmisWaybillCargo> cargoList=emisWaybillNew.getCargoList();
for (EmisWaybillCargo cargoItem:cargoList) {
cargoItem.setWaybillId(emisWaybillNew.getId());
emisWaybillCargoMapper.insertEmisWaybillCargo(cargoItem);
}
}
// 插入附件信息
if(!CollectionUtil.isNotEmpty(emisWaybillNew.getAttachmentList() )){
List<EmisWaybillAttachment> attachmentList=emisWaybillNew.getAttachmentList();
for (EmisWaybillAttachment attachmentItem:attachmentList) {
attachmentItem.setWaybillId(emisWaybillNew.getId());
emisWaybillAttachmentMapper.insertEmisWaybillAttachment(attachmentItem);
}
}
if(isNew) {
// 插入主单
emisWaybillMapper.insertEmisWaybill(emisWaybill);
}else{
emisWaybillMapper.updateEmisWaybill(emisWaybill);
}
// 插入费用
if(!CollectionUtil.isNotEmpty(waybillOrder.getFeeItems() )){
List<FeeItem> feeItems=waybillOrder.getFeeItems();
for (FeeItem feeItem:feeItems) {
EmisWaybillFeeitem item = new EmisWaybillFeeitem();
BeanUtil.copyProperties(item,feeItem,options);
item.setWaybillId(emisWaybill.getId());
emisWaybillFeeitemMapper.insertEmisWaybillFeeitem(item);
}
}
// 插入商品信息
if(!CollectionUtil.isNotEmpty(waybillOrder.getCargoList() )){
List<Cargo> cargoList=waybillOrder.getCargoList();
for (Cargo cargoItem:cargoList) {
EmisWaybillCargo item = new EmisWaybillCargo();
BeanUtil.copyProperties(item,cargoItem,options);
item.setWaybillId(emisWaybill.getId());
emisWaybillCargoMapper.insertEmisWaybillCargo(item);
}
}
// 插入附件信息
if(!CollectionUtil.isNotEmpty(waybillOrder.getAttachmentList() )){
List<Attachment> attachmentList=waybillOrder.getAttachmentList();
for (Attachment attachmentItem:attachmentList) {
EmisWaybillAttachment item = new EmisWaybillAttachment();
BeanUtil.copyProperties(item,attachmentItem,options);
item.setWaybillId(emisWaybill.getId());
emisWaybillAttachmentMapper.insertEmisWaybillAttachment(item);
}
emisWaybillNew.setId(emisWaybillOld.getId());
emisWaybillMapper.updateEmisWaybill(emisWaybillNew);
}
return 1;
}
public static void main(String[] args) {
EmisWaybill emisWaybill =new EmisWaybill();
emisWaybill.setBillCode("T123123");
WaybillOrder waybillOrder = new WaybillOrder();
// 忽略复制过程中出现的错误
CopyOptions options = CopyOptions.create().setIgnoreError(true);
// 基础信息
BeanUtil.copyProperties(emisWaybill,waybillOrder,options);
System.out.println(waybillOrder.toString());
// EmisWaybill emisWaybill =new EmisWaybill();
// emisWaybill.setBillCode("T123123");
//
// // 忽略复制过程中出现的错误
// CopyOptions options = CopyOptions.create().setIgnoreError(true);
//
// // 基础信息
// BeanUtil.copyProperties(emisWaybill,waybillOrder,options);
//
// System.out.println(waybillOrder.toString());
}

View File

@ -10,6 +10,7 @@
<result property="goodsCode" column="goods_code" />
<result property="goodsName" column="goods_name" />
<result property="cargoQty" column="cargo_qty" />
<result property="abnormalQty" column="abnormal_qty" />
<result property="unit" column="unit" />
<result property="weight" column="weight" />
<result property="price" column="price" />
@ -22,6 +23,7 @@
<result property="purpose" column="purpose" />
<result property="ingredients" column="ingredients" />
<result property="manufacturer" column="manufacturer" />
<result property="supplier" column="supplier" />
<result property="function" column="function" />
<result property="goodsModel" column="goods_model" />
<result property="grossWeight" column="gross_weight" />
@ -41,7 +43,7 @@
</resultMap>
<sql id="selectEmisWaybillCargoVo">
select id, waybill_id, goods_code, goods_name, cargo_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_cargo
select id, waybill_id, goods_code, goods_name, cargo_qty, abnormal_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, supplier, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_cargo
</sql>
<select id="selectEmisWaybillCargoList" parameterType="EmisWaybillCargo" resultMap="EmisWaybillCargoResult">
@ -52,6 +54,7 @@
<if test="goodsCode != null and goodsCode != ''"> and goods_code like concat('%', #{goodsCode}, '%')</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="cargoQty != null "> and cargo_qty like concat('%', #{cargoQty}, '%')</if>
<if test="abnormalQty != null "> and abnormal_qty = #{abnormalQty}</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="weight != null "> and weight like concat('%', #{weight}, '%')</if>
<if test="price != null "> and price like concat('%', #{price}, '%')</if>
@ -64,6 +67,7 @@
<if test="purpose != null and purpose != ''"> and purpose like concat('%', #{purpose}, '%')</if>
<if test="ingredients != null and ingredients != ''"> and ingredients like concat('%', #{ingredients}, '%')</if>
<if test="manufacturer != null and manufacturer != ''"> and manufacturer like concat('%', #{manufacturer}, '%')</if>
<if test="supplier != null and supplier != ''"> and supplier like concat('%', #{supplier}, '%')</if>
<if test="function != null and function != ''"> and function like concat('%', #{function}, '%')</if>
<if test="goodsModel != null and goodsModel != ''"> and goods_model like concat('%', #{goodsModel}, '%')</if>
<if test="grossWeight != null "> and gross_weight like concat('%', #{grossWeight}, '%')</if>
@ -85,7 +89,7 @@
</select>
<select id="selectEmisWaybillCargoById" parameterType="Long" resultMap="EmisWaybillCargoResult">
select id, waybill_id, goods_code, goods_name, cargo_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark
select id, waybill_id, goods_code, goods_name, cargo_qty, abnormal_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, supplier, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_cargo a
where a.id = #{id}
</select>
@ -98,6 +102,7 @@
<if test="goodsCode != null and goodsCode != ''">goods_code,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="cargoQty != null">cargo_qty,</if>
<if test="abnormalQty != null">abnormal_qty,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="weight != null">weight,</if>
<if test="price != null">price,</if>
@ -110,6 +115,7 @@
<if test="purpose != null and purpose != ''">purpose,</if>
<if test="ingredients != null and ingredients != ''">ingredients,</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
<if test="supplier != null and supplier != ''">supplier,</if>
<if test="function != null and function != ''">function,</if>
<if test="goodsModel != null and goodsModel != ''">goods_model,</if>
<if test="grossWeight != null">gross_weight,</if>
@ -133,6 +139,7 @@
<if test="goodsCode != null and goodsCode != ''">#{goodsCode},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="cargoQty != null">#{cargoQty},</if>
<if test="abnormalQty != null">#{abnormalQty},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="weight != null">#{weight},</if>
<if test="price != null">#{price},</if>
@ -145,6 +152,7 @@
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="ingredients != null and ingredients != ''">#{ingredients},</if>
<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
<if test="supplier != null and supplier != ''">#{supplier},</if>
<if test="function != null and function != ''">#{function},</if>
<if test="goodsModel != null and goodsModel != ''">#{goodsModel},</if>
<if test="grossWeight != null">#{grossWeight},</if>
@ -171,6 +179,7 @@
<if test="goodsCode != null and goodsCode != ''">goods_code = #{goodsCode},</if>
<if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
<if test="cargoQty != null">cargo_qty = #{cargoQty},</if>
<if test="abnormalQty != null">abnormal_qty = #{abnormalQty},</if>
<if test="unit != null and unit != ''">unit = #{unit},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="price != null">price = #{price},</if>
@ -183,6 +192,7 @@
<if test="purpose != null and purpose != ''">purpose = #{purpose},</if>
<if test="ingredients != null and ingredients != ''">ingredients = #{ingredients},</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
<if test="supplier != null and supplier != ''">supplier = #{supplier},</if>
<if test="function != null and function != ''">function = #{function},</if>
<if test="goodsModel != null and goodsModel != ''">goods_model = #{goodsModel},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>

View File

@ -12,6 +12,7 @@
<result property="fee" column="fee" />
<result property="currency" column="currency" />
<result property="quoteId" column="quote_id" />
<result property="exprId" column="expr_id" />
<result property="orderNum" column="order_num" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
@ -22,7 +23,7 @@
</resultMap>
<sql id="selectEmisWaybillFeeitemVo">
select id, waybill_id, fee_code, fee_name, fee, currency, quote_id, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_feeitem
select id, waybill_id, fee_code, fee_name, fee, currency, quote_id, expr_id, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_feeitem
</sql>
<select id="selectEmisWaybillFeeitemList" parameterType="EmisWaybillFeeitem" resultMap="EmisWaybillFeeitemResult">
@ -35,6 +36,7 @@
<if test="fee != null "> and fee like concat('%', #{fee}, '%')</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="quoteId != null "> and quote_id = #{quoteId}</if>
<if test="exprId != null "> and expr_id = #{exprId}</if>
<if test="orderNum != null "> and order_num like concat('%', #{orderNum}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
@ -47,7 +49,7 @@
</select>
<select id="selectEmisWaybillFeeitemById" parameterType="Long" resultMap="EmisWaybillFeeitemResult">
select id, waybill_id, fee_code, fee_name, fee, currency, quote_id, order_num, del_flag, create_by, create_time, update_by, update_time, remark
select id, waybill_id, fee_code, fee_name, fee, currency, quote_id, expr_id, order_num, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_feeitem a
where a.id = #{id}
</select>
@ -62,6 +64,7 @@
<if test="fee != null">fee,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="quoteId != null">quote_id,</if>
<if test="exprId != null">expr_id,</if>
<if test="orderNum != null">order_num,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
@ -78,6 +81,7 @@
<if test="fee != null">#{fee},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="quoteId != null">#{quoteId},</if>
<if test="exprId != null">#{exprId},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
@ -97,6 +101,7 @@
<if test="fee != null">fee = #{fee},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="quoteId != null">quote_id = #{quoteId},</if>
<if test="exprId != null">expr_id = #{exprId},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>