Commit 2915dfd0 authored by neo's avatar neo

[bugfix] extracte voucherDto from voucher

parent ec9e35df
package pwc.taxtech.atms.dto.vatdto; package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.vat.entity.Voucher;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
...@@ -396,4 +398,29 @@ public class VoucherDto { ...@@ -396,4 +398,29 @@ public class VoucherDto {
public void setAuditCount(int auditCount) { public void setAuditCount(int auditCount) {
this.auditCount = auditCount; this.auditCount = auditCount;
} }
public VoucherDto extractFromVoucher(Voucher v) {
setVoucherID(v.getVoucherID());
setvID(v.getVID());
setDate(v.getDate());
setGroup(v.getGroup());
setPeriod(v.getPeriod());
setCustomerCode(v.getCustomerCode());
setCustomerName(v.getCustomerName());
setSummary(v.getSummary());
setAcctCode(v.getAcctCode());
setDebit(v.getDebit());
setCredit(v.getCredit());
setAttach(v.getAttach());
if (v.getItemID() != null)
setItemID(Long.parseLong(v.getItemID()));
setCreatedTime(v.getCreateTime());
setOriginalPeriod(v.getOriginalPeriod());
setStatus(v.getStatus());
setStdCode(v.getStdCode());
setMappingReason(v.getMappingReason());
setMappingUser(Integer.valueOf(v.getMappingUser()));
setMappingTime(v.getMappingTime());
return this;
}
} }
...@@ -92,16 +92,7 @@ public class JournalEntryImportServiceImpl { ...@@ -92,16 +92,7 @@ public class JournalEntryImportServiceImpl {
for (Voucher voucher : pageResultList) { for (Voucher voucher : pageResultList) {
if (voucher.getMonthID() == null && MonthID == 1) voucher.setMonthID(0); if (voucher.getMonthID() == null && MonthID == 1) voucher.setMonthID(0);
if (voucher.getSummary() == null && Summary == 1) voucher.setSummary(""); if (voucher.getSummary() == null && Summary == 1) voucher.setSummary("");
qResult.getList().add(new VoucherDto().extractFromVoucher(voucher));
VoucherDto voucherDto = new VoucherDto();
try {
FieldsMapper.map(voucher, voucherDto);
} catch (ClassNotFoundException e) {//TODO replace exception filter (neo)
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
qResult.getList().add(voucherDto);
} }
return qResult; return qResult;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment