Commit b9fcb4da authored by Ken you's avatar Ken you

add ebs JournalEntry api ---Ken

parent 68f705b9
...@@ -415,14 +415,6 @@ ...@@ -415,14 +415,6 @@
<artifactId>jxls-core</artifactId> <artifactId>jxls-core</artifactId>
<version>1.0.6</version> <version>1.0.6</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.0</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<profiles> <profiles>
......
package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import java.util.Collections;
import java.util.List;
@RestController
@RequestMapping("/ebs/api/v1/dd")
public class EbsApiController {
private static final Logger logger= LoggerFactory.getLogger(EbsApiController.class);
@RequestMapping(value = "/queryRemoteServerThenUpdateJE", method = RequestMethod.POST)
public ApiResultDto queryRemoteServerThenUpdateJE(@RequestBody List<JEqueryDto> items) {
if (items!=null&&!items.isEmpty()) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(queryRemoteServerThenUpdateJE(items));
} catch (Exception e) {
logger.error("queryRemoteServerThenUpdateJE error.", e);
}
return ApiResultDto.fail();
}
}
package pwc.taxtech.atms.dto.ebsdto;
import java.math.BigDecimal;
import java.util.Date;
public class JEqueryDto {
/**
* Database Column Remarks:
* 唯一编号 系统唯一编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.id
*
* @mbg.generated
*/
private Long id;
/**
* Database Column Remarks:
* 机构编号 对应机构编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.organization_id
*
* @mbg.generated
*/
private String organizationId;
/**
* Database Column Remarks:
* 项目ID
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.project_id
*
* @mbg.generated
*/
private String projectId;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.date
*
* @mbg.generated
*/
private Date date;
/**
* Database Column Remarks:
* 来源 GL
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 账套ID
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.ledger_id
*
* @mbg.generated
*/
private String ledgerId;
/**
* Database Column Remarks:
* 账套名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.ledger_name
*
* @mbg.generated
*/
private String ledgerName;
/**
* Database Column Remarks:
* 账套币种
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.currency_code
*
* @mbg.generated
*/
private String currencyCode;
/**
* Database Column Remarks:
* 关账标识 Y/N
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.status
*
* @mbg.generated
*/
private String status;
/**
* Database Column Remarks:
* 日记账头ID
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.header_id
*
* @mbg.generated
*/
private String headerId;
/**
* Database Column Remarks:
* 日记账行号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.line_num
*
* @mbg.generated
*/
private String lineNum;
/**
* Database Column Remarks:
* 审批状态
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.approval_status
*
* @mbg.generated
*/
private String approvalStatus;
/**
* Database Column Remarks:
* 过账
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.posted_status
*
* @mbg.generated
*/
private String postedStatus;
/**
* Database Column Remarks:
* 会计期间 yyyymm
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.period
*
* @mbg.generated
*/
private Integer period;
/**
* Database Column Remarks:
* 凭证日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.accounting_date
*
* @mbg.generated
*/
private Date accountingDate;
/**
* Database Column Remarks:
* 日记账来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.journal_source
*
* @mbg.generated
*/
private String journalSource;
/**
* Database Column Remarks:
* 日记账类别
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.category
*
* @mbg.generated
*/
private String category;
/**
* Database Column Remarks:
* 日记账名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.name
*
* @mbg.generated
*/
private String name;
/**
* Database Column Remarks:
* 凭证编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.voucher_num
*
* @mbg.generated
*/
private String voucherNum;
/**
* Database Column Remarks:
* 摘要
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.description
*
* @mbg.generated
*/
private String description;
/**
* Database Column Remarks:
* 主体代码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment1
*
* @mbg.generated
*/
private String segment1;
/**
* Database Column Remarks:
* 成本中心
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment2
*
* @mbg.generated
*/
private String segment2;
/**
* Database Column Remarks:
* 科目代码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment3
*
* @mbg.generated
*/
private String segment3;
/**
* Database Column Remarks:
* 辅助科目
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment4
*
* @mbg.generated
*/
private String segment4;
/**
* Database Column Remarks:
* 利润中心
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment5
*
* @mbg.generated
*/
private String segment5;
/**
* Database Column Remarks:
* 产品
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment6
*
* @mbg.generated
*/
private String segment6;
/**
* Database Column Remarks:
* 项目
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment7
*
* @mbg.generated
*/
private String segment7;
/**
* Database Column Remarks:
* 公司间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment8
*
* @mbg.generated
*/
private String segment8;
/**
* Database Column Remarks:
* 备用1
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment9
*
* @mbg.generated
*/
private String segment9;
/**
* Database Column Remarks:
* 备用2
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment10
*
* @mbg.generated
*/
private String segment10;
/**
* Database Column Remarks:
* 主体说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment1_name
*
* @mbg.generated
*/
private String segment1Name;
/**
* Database Column Remarks:
* 成本中心说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment2_name
*
* @mbg.generated
*/
private String segment2Name;
/**
* Database Column Remarks:
* 科目说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment3_name
*
* @mbg.generated
*/
private String segment3Name;
/**
* Database Column Remarks:
* 辅助科目说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment4_name
*
* @mbg.generated
*/
private String segment4Name;
/**
* Database Column Remarks:
* 利润中心说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment5_name
*
* @mbg.generated
*/
private String segment5Name;
/**
* Database Column Remarks:
* 产品说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment6_name
*
* @mbg.generated
*/
private String segment6Name;
/**
* Database Column Remarks:
* 项目说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment7_name
*
* @mbg.generated
*/
private String segment7Name;
/**
* Database Column Remarks:
* 公司间说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment8_name
*
* @mbg.generated
*/
private String segment8Name;
/**
* Database Column Remarks:
* 备用1说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment9_name
*
* @mbg.generated
*/
private String segment9Name;
/**
* Database Column Remarks:
* 备用2说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.segment10_name
*
* @mbg.generated
*/
private String segment10Name;
/**
* Database Column Remarks:
* 币种
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.journal_currency_code
*
* @mbg.generated
*/
private String journalCurrencyCode;
/**
* Database Column Remarks:
* 本位币币种
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.sob_currency_code
*
* @mbg.generated
*/
private String sobCurrencyCode;
/**
* Database Column Remarks:
* 借方金额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.accounted_dr
*
* @mbg.generated
*/
private BigDecimal accountedDr;
/**
* Database Column Remarks:
* 贷方金额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.accounted_cr
*
* @mbg.generated
*/
private BigDecimal accountedCr;
/**
* Database Column Remarks:
* 本位币借方金额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.entered_dr
*
* @mbg.generated
*/
private BigDecimal enteredDr;
/**
* Database Column Remarks:
* 本位币贷方金额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.entered_cr
*
* @mbg.generated
*/
private BigDecimal enteredCr;
/**
* Database Column Remarks:
* 现金流量表项
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.cf_item
*
* @mbg.generated
*/
private String cfItem;
/**
* Database Column Remarks:
* 城市
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute1
*
* @mbg.generated
*/
private String attribute1;
/**
* Database Column Remarks:
* 交易日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute2
*
* @mbg.generated
*/
private Date attribute2;
/**
* Database Column Remarks:
* 对方银行账号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute3
*
* @mbg.generated
*/
private String attribute3;
/**
* Database Column Remarks:
* 银行流水号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute4
*
* @mbg.generated
*/
private String attribute4;
/**
* Database Column Remarks:
* 供应商编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute5
*
* @mbg.generated
*/
private String attribute5;
/**
* Database Column Remarks:
* 交易单号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute6
*
* @mbg.generated
*/
private String attribute6;
/**
* Database Column Remarks:
* 供应商名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute7
*
* @mbg.generated
*/
private String attribute7;
/**
* Database Column Remarks:
* 接收编码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute8
*
* @mbg.generated
*/
private String attribute8;
/**
* Database Column Remarks:
* 制单人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute9
*
* @mbg.generated
*/
private String attribute9;
/**
* Database Column Remarks:
* 审核人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute10
*
* @mbg.generated
*/
private String attribute10;
/**
* Database Column Remarks:
* 成本中心部门描述1
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute11
*
* @mbg.generated
*/
private String attribute11;
/**
* Database Column Remarks:
* 成本中心部门描述2
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute12
*
* @mbg.generated
*/
private String attribute12;
/**
* Database Column Remarks:
* 成本中心部门描述3
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute13
*
* @mbg.generated
*/
private String attribute13;
/**
* Database Column Remarks:
* 成本中心部门描述4
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute14
*
* @mbg.generated
*/
private String attribute14;
/**
* Database Column Remarks:
* 成本中心部门描述5
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute15
*
* @mbg.generated
*/
private String attribute15;
/**
* Database Column Remarks:
* 成本中心部门描述6
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.attribute16
*
* @mbg.generated
*/
private String attribute16;
/**
* Database Column Remarks:
* 创建人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.created_by
*
* @mbg.generated
*/
private String createdBy;
/**
* Database Column Remarks:
* 创建日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.created_date
*
* @mbg.generated
*/
private Date createdDate;
/**
* Database Column Remarks:
* 最后更新人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.late_updated_by
*
* @mbg.generated
*/
private String lateUpdatedBy;
/**
* Database Column Remarks:
* 最后更新日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.late_updated_date
*
* @mbg.generated
*/
private Date lateUpdatedDate;
/**
* Database Column Remarks:
* 创建时间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
* Database Column Remarks:
* 更新时间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column journal_entry.update_time
*
* @mbg.generated
*/
private Date updateTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getLedgerId() {
return ledgerId;
}
public void setLedgerId(String ledgerId) {
this.ledgerId = ledgerId;
}
public String getLedgerName() {
return ledgerName;
}
public void setLedgerName(String ledgerName) {
this.ledgerName = ledgerName;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getHeaderId() {
return headerId;
}
public void setHeaderId(String headerId) {
this.headerId = headerId;
}
public String getLineNum() {
return lineNum;
}
public void setLineNum(String lineNum) {
this.lineNum = lineNum;
}
public String getApprovalStatus() {
return approvalStatus;
}
public void setApprovalStatus(String approvalStatus) {
this.approvalStatus = approvalStatus;
}
public String getPostedStatus() {
return postedStatus;
}
public void setPostedStatus(String postedStatus) {
this.postedStatus = postedStatus;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public Date getAccountingDate() {
return accountingDate;
}
public void setAccountingDate(Date accountingDate) {
this.accountingDate = accountingDate;
}
public String getJournalSource() {
return journalSource;
}
public void setJournalSource(String journalSource) {
this.journalSource = journalSource;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getVoucherNum() {
return voucherNum;
}
public void setVoucherNum(String voucherNum) {
this.voucherNum = voucherNum;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSegment1() {
return segment1;
}
public void setSegment1(String segment1) {
this.segment1 = segment1;
}
public String getSegment2() {
return segment2;
}
public void setSegment2(String segment2) {
this.segment2 = segment2;
}
public String getSegment3() {
return segment3;
}
public void setSegment3(String segment3) {
this.segment3 = segment3;
}
public String getSegment4() {
return segment4;
}
public void setSegment4(String segment4) {
this.segment4 = segment4;
}
public String getSegment5() {
return segment5;
}
public void setSegment5(String segment5) {
this.segment5 = segment5;
}
public String getSegment6() {
return segment6;
}
public void setSegment6(String segment6) {
this.segment6 = segment6;
}
public String getSegment7() {
return segment7;
}
public void setSegment7(String segment7) {
this.segment7 = segment7;
}
public String getSegment8() {
return segment8;
}
public void setSegment8(String segment8) {
this.segment8 = segment8;
}
public String getSegment9() {
return segment9;
}
public void setSegment9(String segment9) {
this.segment9 = segment9;
}
public String getSegment10() {
return segment10;
}
public void setSegment10(String segment10) {
this.segment10 = segment10;
}
public String getSegment1Name() {
return segment1Name;
}
public void setSegment1Name(String segment1Name) {
this.segment1Name = segment1Name;
}
public String getSegment2Name() {
return segment2Name;
}
public void setSegment2Name(String segment2Name) {
this.segment2Name = segment2Name;
}
public String getSegment3Name() {
return segment3Name;
}
public void setSegment3Name(String segment3Name) {
this.segment3Name = segment3Name;
}
public String getSegment4Name() {
return segment4Name;
}
public void setSegment4Name(String segment4Name) {
this.segment4Name = segment4Name;
}
public String getSegment5Name() {
return segment5Name;
}
public void setSegment5Name(String segment5Name) {
this.segment5Name = segment5Name;
}
public String getSegment6Name() {
return segment6Name;
}
public void setSegment6Name(String segment6Name) {
this.segment6Name = segment6Name;
}
public String getSegment7Name() {
return segment7Name;
}
public void setSegment7Name(String segment7Name) {
this.segment7Name = segment7Name;
}
public String getSegment8Name() {
return segment8Name;
}
public void setSegment8Name(String segment8Name) {
this.segment8Name = segment8Name;
}
public String getSegment9Name() {
return segment9Name;
}
public void setSegment9Name(String segment9Name) {
this.segment9Name = segment9Name;
}
public String getSegment10Name() {
return segment10Name;
}
public void setSegment10Name(String segment10Name) {
this.segment10Name = segment10Name;
}
public String getJournalCurrencyCode() {
return journalCurrencyCode;
}
public void setJournalCurrencyCode(String journalCurrencyCode) {
this.journalCurrencyCode = journalCurrencyCode;
}
public String getSobCurrencyCode() {
return sobCurrencyCode;
}
public void setSobCurrencyCode(String sobCurrencyCode) {
this.sobCurrencyCode = sobCurrencyCode;
}
public BigDecimal getAccountedDr() {
return accountedDr;
}
public void setAccountedDr(BigDecimal accountedDr) {
this.accountedDr = accountedDr;
}
public BigDecimal getAccountedCr() {
return accountedCr;
}
public void setAccountedCr(BigDecimal accountedCr) {
this.accountedCr = accountedCr;
}
public BigDecimal getEnteredDr() {
return enteredDr;
}
public void setEnteredDr(BigDecimal enteredDr) {
this.enteredDr = enteredDr;
}
public BigDecimal getEnteredCr() {
return enteredCr;
}
public void setEnteredCr(BigDecimal enteredCr) {
this.enteredCr = enteredCr;
}
public String getCfItem() {
return cfItem;
}
public void setCfItem(String cfItem) {
this.cfItem = cfItem;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public Date getAttribute2() {
return attribute2;
}
public void setAttribute2(Date attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
public String getAttribute6() {
return attribute6;
}
public void setAttribute6(String attribute6) {
this.attribute6 = attribute6;
}
public String getAttribute7() {
return attribute7;
}
public void setAttribute7(String attribute7) {
this.attribute7 = attribute7;
}
public String getAttribute8() {
return attribute8;
}
public void setAttribute8(String attribute8) {
this.attribute8 = attribute8;
}
public String getAttribute9() {
return attribute9;
}
public void setAttribute9(String attribute9) {
this.attribute9 = attribute9;
}
public String getAttribute10() {
return attribute10;
}
public void setAttribute10(String attribute10) {
this.attribute10 = attribute10;
}
public String getAttribute11() {
return attribute11;
}
public void setAttribute11(String attribute11) {
this.attribute11 = attribute11;
}
public String getAttribute12() {
return attribute12;
}
public void setAttribute12(String attribute12) {
this.attribute12 = attribute12;
}
public String getAttribute13() {
return attribute13;
}
public void setAttribute13(String attribute13) {
this.attribute13 = attribute13;
}
public String getAttribute14() {
return attribute14;
}
public void setAttribute14(String attribute14) {
this.attribute14 = attribute14;
}
public String getAttribute15() {
return attribute15;
}
public void setAttribute15(String attribute15) {
this.attribute15 = attribute15;
}
public String getAttribute16() {
return attribute16;
}
public void setAttribute16(String attribute16) {
this.attribute16 = attribute16;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public String getLateUpdatedBy() {
return lateUpdatedBy;
}
public void setLateUpdatedBy(String lateUpdatedBy) {
this.lateUpdatedBy = lateUpdatedBy;
}
public Date getLateUpdatedDate() {
return lateUpdatedDate;
}
public void setLateUpdatedDate(Date lateUpdatedDate) {
this.lateUpdatedDate = lateUpdatedDate;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
package pwc.taxtech.atms.dto.vatdto.excelheader; package pwc.taxtech.atms.dto.vatdto.excelheader;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CashFlowHeader { public class CashFlowHeader {
private String companyNameCn; private String companyNameCn;
private String companyNameEn; private String companyNameEn;
...@@ -13,4 +8,60 @@ public class CashFlowHeader { ...@@ -13,4 +8,60 @@ public class CashFlowHeader {
private String ledgerName; private String ledgerName;
private String ledgerCurrencyCode; private String ledgerCurrencyCode;
private String status; private String status;
public String getCompanyNameCn() {
return companyNameCn;
}
public void setCompanyNameCn(String companyNameCn) {
this.companyNameCn = companyNameCn;
}
public String getCompanyNameEn() {
return companyNameEn;
}
public void setCompanyNameEn(String companyNameEn) {
this.companyNameEn = companyNameEn;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getLedgerName() {
return ledgerName;
}
public void setLedgerName(String ledgerName) {
this.ledgerName = ledgerName;
}
public String getLedgerCurrencyCode() {
return ledgerCurrencyCode;
}
public void setLedgerCurrencyCode(String ledgerCurrencyCode) {
this.ledgerCurrencyCode = ledgerCurrencyCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
} }
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import java.util.List;
public interface EbsApiService {
/**
* EBS 日记账同步更新
* @param items
*/
void queryRemoteServerThenUpdateJE(List<JEqueryDto> items);
}
package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import pwc.taxtech.atms.service.EbsApiService;
import pwc.taxtech.atms.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.entity.JournalEntry;
import pwc.taxtech.atms.vat.entity.JournalEntryExample;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Optional;
@Service
public class EbsApiServiceImpl implements EbsApiService {
@Resource
private JournalEntryMapper journalEntryMapper;
@Resource
private DistributedIdService distributedIdService;
@Resource
private BeanUtil beanUtil;
private static final Logger logger= LoggerFactory.getLogger(EbsApiServiceImpl.class);
@Override
public void queryRemoteServerThenUpdateJE(List<JEqueryDto> items) {
long start=System.currentTimeMillis();
logger.debug("start queryRemoteServerThenUpdateJE");
//判断数据是否存在
if(items.size()==0){
logger.error("empty EBS JE response, skip processing");
return;
}
logger.debug("requestJEItems:"+ JSON.toJSONString(items));
for(JEqueryDto a:items){
try {
processJE(a);
}catch (Exception e){
logger.error("break loop as catch:" + e, e);
}
}
logger.debug("end queryRemoteServerThenUpdateJE,took [{}] ms",System.currentTimeMillis()-start);
}
private void processJE(JEqueryDto item){
JournalEntryExample journalEntryExample=new JournalEntryExample();
journalEntryExample.createCriteria().andHeaderIdEqualTo(item.getHeaderId()).andLineNumEqualTo(item.getLineNum());
List<JournalEntry> journalEntryList=journalEntryMapper.selectByExample(journalEntryExample);
//唯一则更新否则插入
JournalEntry journalEntry=new JournalEntry();
if(journalEntryList.size()==1){
logger.info("exit and update journalEntry headerId:{},lineNum:{}", item.getHeaderId(),item.getLineNum());
journalEntry=journalEntryList.get(0);
populateFieldsJE(item,journalEntry);
journalEntryMapper.updateByPrimaryKey(journalEntry);
}else{
logger.info("miss and insert journalEntry headerId:{},lineNum:{}", item.getHeaderId(),item.getLineNum());
populateFieldsJE(item,journalEntry);
journalEntry.setId(distributedIdService.nextId());
journalEntry.setCreatedBy("");
journalEntry.setCreatedDate(new Date());
journalEntry.setCreateTime(new Date());
journalEntryMapper.insertSelective(journalEntry);
}
}
private void populateFieldsJE(JEqueryDto item,JournalEntry result){
result.setOrganizationId(trimLimit(item.getOrganizationId(),128));
result.setProjectId(trimLimit(item.getProjectId(),128));
result.setDate(item.getDate());
result.setSource(trimLimit(item.getSource(),20));
result.setLedgerId(trimLimit(item.getLedgerId(),128));
result.setLedgerName(trimLimit(item.getLedgerName(),300));
result.setCurrencyCode(trimLimit(item.getCurrencyCode(),20));
result.setStatus(trimLimit(item.getStatus(),10));
result.setHeaderId(trimLimit(item.getHeaderId(),128));
result.setLineNum(trimLimit(item.getLineNum(),300));
result.setApprovalStatus(trimLimit(item.getApprovalStatus(),20));
result.setPostedStatus(trimLimit(item.getPostedStatus(),20));
result.setPeriod(StringUtils.isBlank(item.getPeriod().toString())?0:item.getPeriod());
result.setAccountingDate(item.getAccountingDate());
result.setJournalSource(trimLimit(item.getJournalSource(),20));
result.setCategory(trimLimit(item.getCategory(),50));
result.setName(trimLimit(item.getName(),300));
result.setVoucherNum(trimLimit(item.getVoucherNum(),128));
result.setDescription(trimLimit(item.getDescription(),500));
result.setSegment1(trimLimit(item.getSegment1(),300));
result.setSegment2(trimLimit(item.getSegment2(),300));
result.setSegment3(trimLimit(item.getSegment3(),300));
result.setSegment4(trimLimit(item.getSegment4(),300));
result.setSegment5(trimLimit(item.getSegment5(),300));
result.setSegment6(trimLimit(item.getSegment6(),300));
result.setSegment7(trimLimit(item.getSegment7(),300));
result.setSegment8(trimLimit(item.getSegment8(),300));
result.setSegment9(trimLimit(item.getSegment9(),300));
result.setSegment10(trimLimit(item.getSegment10(),300));
result.setSegment1Name(trimLimit(item.getSegment1Name(),300));
result.setSegment2Name(trimLimit(item.getSegment2Name(),300));
result.setSegment3Name(trimLimit(item.getSegment3Name(),300));
result.setSegment4Name(trimLimit(item.getSegment4Name(),300));
result.setSegment5Name(trimLimit(item.getSegment5Name(),300));
result.setSegment6Name(trimLimit(item.getSegment6Name(),300));
result.setSegment7Name(trimLimit(item.getSegment7Name(),300));
result.setSegment8Name(trimLimit(item.getSegment8Name(),300));
result.setSegment9Name(trimLimit(item.getSegment9Name(),300));
result.setSegment10Name(trimLimit(item.getSegment10Name(),300));
result.setJournalCurrencyCode(trimLimit(item.getJournalCurrencyCode(),20));
result.setSobCurrencyCode(trimLimit(item.getSobCurrencyCode(),20));
result.setAccountedDr(Optional.ofNullable(item.getAccountedDr()).map(x->x.setScale(4, RoundingMode.HALF_UP)).orElse(BigDecimal.ZERO));
result.setAccountedCr(Optional.ofNullable(item.getAccountedCr()).map(x->x.setScale(4, RoundingMode.HALF_UP)).orElse(BigDecimal.ZERO));
result.setEnteredDr(Optional.ofNullable(item.getEnteredDr()).map(x->x.setScale(4, RoundingMode.HALF_UP)).orElse(BigDecimal.ZERO));
result.setEnteredCr(Optional.ofNullable(item.getEnteredCr()).map(x->x.setScale(4, RoundingMode.HALF_UP)).orElse(BigDecimal.ZERO));
result.setCfItem(trimLimit(item.getCfItem(),50));
result.setAttribute1(trimLimit(item.getAttribute1(),300));
result.setAttribute2(item.getAttribute2());
result.setAttribute3(trimLimit(item.getAttribute3(),300));
result.setAttribute4(trimLimit(item.getAttribute4(),300));
result.setAttribute5(trimLimit(item.getAttribute5(),300));
result.setAttribute6(trimLimit(item.getAttribute6(),300));
result.setAttribute7(trimLimit(item.getAttribute7(),300));
result.setAttribute8(trimLimit(item.getAttribute8(),300));
result.setAttribute9(trimLimit(item.getAttribute9(),300));
result.setAttribute10(trimLimit(item.getAttribute10(),300));
result.setAttribute11(trimLimit(item.getAttribute11(),300));
result.setAttribute12(trimLimit(item.getAttribute12(),300));
result.setAttribute13(trimLimit(item.getAttribute13(),300));
result.setAttribute14(trimLimit(item.getAttribute14(),300));
result.setAttribute15(trimLimit(item.getAttribute15(),300));
result.setAttribute16(trimLimit(item.getAttribute16(),300));
result.setLateUpdatedBy("");
result.setLateUpdatedDate(new Date());
result.setUpdateTime(new Date());
}
/** Trim字符串,并限定字符串的长度. 如果是输入值是空指针,会返回空字符串 */
public String trimLimit(String str, int limit) {
if (Strings.isBlank(str)) {
return "";
}
String tmp = str.trim();
String result = cutString(tmp, limit);
if (result == null)
result = "";
return result;
}
/** 限定字符串的长度. */
public String cutString(String s, int length) {
if (Lang.isEmpty(length) || Lang.isEmpty(s))
return "";
else if (s.length() <= length)
return s;
else
return s.substring(0, length);
}
}
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