md
This commit is contained in:
parent
cce84cf2aa
commit
2ee0da8581
@ -1,15 +1,13 @@
|
|||||||
package com.xdadan.erp.emis.domain.vo;
|
package com.xdadan.erp.emis.domain.vo;
|
||||||
|
|
||||||
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
|
import com.xdadan.erp.emis.domain.EmisWaybillAttachment;
|
||||||
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class Attachment extends VoBase<EmisWaybillAttachment,Attachment> implements Serializable {
|
public class Attachment extends VoBase<EmisWaybillAttachment,Attachment> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -49,6 +47,7 @@ public class Attachment extends VoBase<EmisWaybillAttachment,Attachment> impleme
|
|||||||
return voItem;
|
return voItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmisWaybillAttachment toDb(Attachment voItem){
|
public EmisWaybillAttachment toDb(Attachment voItem){
|
||||||
EmisWaybillAttachment dbItem = new EmisWaybillAttachment();
|
EmisWaybillAttachment dbItem = new EmisWaybillAttachment();
|
||||||
@ -68,11 +67,11 @@ public class Attachment extends VoBase<EmisWaybillAttachment,Attachment> impleme
|
|||||||
return dbItem;
|
return dbItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<EmisWaybillAttachment> toDBList(List<Attachment> voList){
|
public List<EmisWaybillAttachment> cvtToDbList(List<Attachment> voList){
|
||||||
return toDBList(voList);
|
return toDbList(voList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Attachment> toVoList(List<EmisWaybillAttachment> dbList){
|
public List<Attachment> cvtToVoList(List<EmisWaybillAttachment> dbList){
|
||||||
return toVoList(dbList);
|
return toVoList(dbList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,11 +152,11 @@ public class Cargo extends VoBase<EmisWaybillCargo,Cargo> implements Serializabl
|
|||||||
return dbItem;
|
return dbItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<EmisWaybillCargo> toDBList(List<Cargo> voList){
|
public List<EmisWaybillCargo> cvtToDbList(List<Cargo> voList){
|
||||||
return toDBList(voList);
|
return toDbList(voList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Cargo> toVoList(List<EmisWaybillCargo> dbList){
|
public List<Cargo> cvtToVoList(List<EmisWaybillCargo> dbList){
|
||||||
return toVoList(dbList);
|
return toVoList(dbList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package com.xdadan.erp.emis.domain.vo;
|
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 com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -63,11 +61,11 @@ public class FeeItem extends VoBase<EmisWaybillFeeitem,FeeItem> {
|
|||||||
return dbItem;
|
return dbItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<EmisWaybillFeeitem> toDBList(List<FeeItem> voList){
|
public List<EmisWaybillFeeitem> cvtToDbList(List<FeeItem> voList){
|
||||||
return toDBList(voList);
|
return toDbList(voList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<FeeItem> toVoList(List<EmisWaybillFeeitem> dbList){
|
public List<FeeItem> cvtToVoList(List<EmisWaybillFeeitem> dbList){
|
||||||
return toVoList(dbList);
|
return toVoList(dbList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,21 @@
|
|||||||
package com.xdadan.erp.emis.domain.vo;
|
package com.xdadan.erp.emis.domain.vo;
|
||||||
|
|
||||||
import com.xdadan.erp.emis.domain.EmisWaybillCargo;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class VoBase<DB,VO> {
|
public abstract class VoBase<DB,VO> {
|
||||||
|
public abstract VO toVo(DB dbItem);
|
||||||
|
public abstract DB toDb(VO voItem);
|
||||||
|
|
||||||
public abstract VO toVo(DB dbItem);
|
|
||||||
public abstract DB toDb(VO voItem);
|
|
||||||
/**
|
/**
|
||||||
* 转换为数据库类型
|
* 转换为数据库类型
|
||||||
* @param voList
|
* @param voList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<DB> toDbList(List<VO> voList){
|
public List<DB> toDbList(List<VO> voList){
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(voList)){
|
if(!CollectionUtils.isEmpty(voList)){
|
||||||
List<DB> list = new ArrayList<>();
|
List<DB> list = new ArrayList<>();
|
||||||
for (VO voItem: voList){
|
for (VO voItem: voList){
|
||||||
@ -34,7 +33,7 @@ public abstract class VoBase<DB,VO> {
|
|||||||
* @param dbList
|
* @param dbList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<VO> toVoList(List<DB> dbList){
|
public List<VO> toVoList(List<DB> dbList){
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(dbList)){
|
if(!CollectionUtils.isEmpty(dbList)){
|
||||||
List<VO> list = new ArrayList<>();
|
List<VO> list = new ArrayList<>();
|
||||||
@ -47,4 +46,5 @@ public abstract class VoBase<DB,VO> {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -238,10 +238,14 @@ public class WaybillOrder implements Serializable {
|
|||||||
|
|
||||||
WaybillOrder voItem = new WaybillOrder();
|
WaybillOrder voItem = new WaybillOrder();
|
||||||
|
|
||||||
|
Cargo cargoCvt = new Cargo();
|
||||||
|
FeeItem feeItemCvt = new FeeItem();
|
||||||
|
Attachment attachmentCvt = new Attachment();
|
||||||
|
|
||||||
// 转换其他list
|
// 转换其他list
|
||||||
voItem.setCargoList(Cargo.toVoList(dbCargoList));
|
voItem.setCargoList(cargoCvt.cvtToVoList(dbCargoList));
|
||||||
voItem.setFeeItems(FeeItem.toVoList(dbFeeitemList));
|
voItem.setFeeItems(feeItemCvt.cvtToVoList(dbFeeitemList));
|
||||||
voItem.setAttachmentList(Attachment.toVoList(dbAttachmentList));
|
voItem.setAttachmentList(attachmentCvt.cvtToVoList(dbAttachmentList));
|
||||||
|
|
||||||
// 收件人
|
// 收件人
|
||||||
Reciever reciever = new Reciever();
|
Reciever reciever = new Reciever();
|
||||||
@ -468,13 +472,16 @@ public class WaybillOrder implements Serializable {
|
|||||||
* 转为数据库类型值
|
* 转为数据库类型值
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static EmisWaybill toDb(){
|
public EmisWaybill toDb(){
|
||||||
EmisWaybill dbWaybill = new EmisWaybill();
|
EmisWaybill dbWaybill = new EmisWaybill();
|
||||||
|
|
||||||
|
Cargo cargoCvt = new Cargo();
|
||||||
|
FeeItem feeItemCvt = new FeeItem();
|
||||||
|
Attachment attachmentCvt = new Attachment();
|
||||||
// 设置货物信息
|
// 设置货物信息
|
||||||
dbWaybill.setCargoList(Cargo.toDBList(this.getCargoList()));
|
dbWaybill.setCargoList(cargoCvt.cvtToDbList(this.getCargoList()));
|
||||||
dbWaybill.setFeeitemList(FeeItem.toDBList(this.getFeeItems()));
|
dbWaybill.setFeeitemList(feeItemCvt.cvtToDbList(this.getFeeItems()));
|
||||||
dbWaybill.setAttachmentList(Attachment.toDBList(this.getAttachmentList()));
|
dbWaybill.setAttachmentList(attachmentCvt.cvtToDbList(this.getAttachmentList()));
|
||||||
|
|
||||||
dbWaybill.setOrderSn(this.getOrderSn());
|
dbWaybill.setOrderSn(this.getOrderSn());
|
||||||
dbWaybill.setCustOrderId(this.getCustOrderId());
|
dbWaybill.setCustOrderId(this.getCustOrderId());
|
||||||
|
|||||||
@ -226,7 +226,7 @@ public class EmisWaybillServiceImpl implements IEmisWaybillService
|
|||||||
throw new Exception("已锁账,不允许修改");
|
throw new Exception("已锁账,不允许修改");
|
||||||
}
|
}
|
||||||
|
|
||||||
EmisWaybill emisWaybillNew = WaybillOrder.toDb();
|
EmisWaybill emisWaybillNew = waybillOrder.toDb();
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
if(isNew){
|
if(isNew){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user