Commit 69146937 authored by neo's avatar neo

[DEV] deltete CompanyBalanceDto and reference

parent 56492875
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto;
import pwc.taxtech.atms.dto.vat.QueryImportType;
import pwc.taxtech.atms.dto.vatdto.QueryImportType;
import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.service.ProjectInfoService;
......
......@@ -7,27 +7,41 @@ import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vat.ClearTableDto;
import pwc.taxtech.atms.dto.vat.ImportBalanceDto;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.service.DataImportService;
import pwc.taxtech.atms.dto.vatdto.BalanceSubTotalDto;
import pwc.taxtech.atms.dto.vatdto.BalanceWithSubTotalsResultDto;
import pwc.taxtech.atms.dto.vatdto.ClearTableDto;
import pwc.taxtech.atms.dto.vatdto.ImportBalanceDto;
import pwc.taxtech.atms.dto.vatdto.JsonParentCodesLookup;
import pwc.taxtech.atms.dto.vatdto.JsonTrialBalanceTreeNode;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceFilter;
import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountDto;
import pwc.taxtech.atms.service.ICitTBDataImportService;
import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.service.impl.DataImportServiceImpl;
import pwc.taxtech.atms.utils.NPOIHelper;
import pwc.taxtech.atms.vat.dao.DataImportModel;
import pwc.taxtech.atms.vat.service.TBDataImportService;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;
import javax.ws.rs.core.Response;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static pwc.taxtech.atms.constant.Constant.DEFAULT_HAS_HEADER;
......@@ -46,7 +60,7 @@ public class TBDataImportController {
@Autowired
private ICitTBDataImportService citTbDataImport;
@Autowired
private DataImportService dataImportService;
private DataImportServiceImpl dataImportService;
@Autowired
private IdentityService identityService;
@Autowired
......@@ -457,7 +471,7 @@ public class TBDataImportController {
DataImportModel dataImportModel;
String fullFilePath = fileUploadAdapter.getLastFilePathByFileName(tempFileName);
if (fullFilePath != null) {
try(FileInputStream fis = new FileInputStream(new File(fullFilePath));) {
try (FileInputStream fis = new FileInputStream(new File(fullFilePath));) {
dataImportModel = NPOIHelper.renderTBDataTableFromExcel(fis, selectedSheetIndex, HEADER_ROW_INDEX,
DEFAULT_HAS_HEADER, topRowNumber);
dataImportModel.setSelectedSheetIndex(selectedSheetIndex);
......
package pwc.taxtech.atms.dto.vat;
public class CompanyBalanceDto {
private String balanceId;
private Integer periodId;
private String acctCode;
private String customerCode;
private Integer begDebitBal;
private Integer begCreditBal;
private Integer begBal;
private Integer endBal;
private Integer endDebitBal;
private Integer endCreditBal;
private Integer debitBal;
private Integer creditBal;
private Integer monthId;
public String getBalanceId() {
return balanceId;
}
public void setBalanceId(String balanceId) {
this.balanceId = balanceId;
}
public Integer getPeriodId() {
return periodId;
}
public void setPeriodId(Integer periodId) {
this.periodId = periodId;
}
public String getAcctCode() {
return acctCode;
}
public void setAcctCode(String acctCode) {
this.acctCode = acctCode;
}
public String getCustomerCode() {
return customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public Integer getBegDebitBal() {
return begDebitBal;
}
public void setBegDebitBal(Integer begDebitBal) {
this.begDebitBal = begDebitBal;
}
public Integer getBegCreditBal() {
return begCreditBal;
}
public void setBegCreditBal(Integer begCreditBal) {
this.begCreditBal = begCreditBal;
}
public Integer getBegBal() {
return begBal;
}
public void setBegBal(Integer begBal) {
this.begBal = begBal;
}
public Integer getEndBal() {
return endBal;
}
public void setEndBal(Integer endBal) {
this.endBal = endBal;
}
public Integer getEndDebitBal() {
return endDebitBal;
}
public void setEndDebitBal(Integer endDebitBal) {
this.endDebitBal = endDebitBal;
}
public Integer getEndCreditBal() {
return endCreditBal;
}
public void setEndCreditBal(Integer endCreditBal) {
this.endCreditBal = endCreditBal;
}
public Integer getDebitBal() {
return debitBal;
}
public void setDebitBal(Integer debitBal) {
this.debitBal = debitBal;
}
public Integer getCreditBal() {
return creditBal;
}
public void setCreditBal(Integer creditBal) {
this.creditBal = creditBal;
}
public Integer getMonthId() {
return monthId;
}
public void setMonthId(Integer monthId) {
this.monthId = monthId;
}
}
package pwc.taxtech.atms.dto.vat;
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.vat.entity.CompanyBalance;
import java.util.List;
public class ImportBalanceDto {
private List<CompanyBalanceDto> balanceList;
private List<CompanyBalance> balanceList;
private Integer importType;
private Integer serviceTypeId;
private List<Integer> periods;
public List<CompanyBalanceDto> getBalanceList() {
public List<CompanyBalance> getBalanceList() {
return balanceList;
}
public void setBalanceList(List<CompanyBalanceDto> balanceList) {
public void setBalanceList(List<CompanyBalance> balanceList) {
this.balanceList = balanceList;
}
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vat.CompanyBalanceDto;
import java.util.List;
public interface DataImportService {
OperationResultDto importTrialBalance(List<CompanyBalanceDto> balanceList, Integer importType, Integer serviceTypeId, String id);
}
......@@ -11,11 +11,9 @@ import pwc.taxtech.atms.dao.EnterpriseAccountMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.DataImportedStatusDto;
import pwc.taxtech.atms.dto.vat.CompanyBalanceDto;
import pwc.taxtech.atms.entitiy.EnterpriseAccountExample;
import pwc.taxtech.atms.entitiy.Project;
import pwc.taxtech.atms.entitiy.ProjectExample;
import pwc.taxtech.atms.service.DataImportService;
import pwc.taxtech.atms.vat.dao.CompanyBalanceMapper;
import pwc.taxtech.atms.vat.entity.CompanyBalance;
import pwc.taxtech.atms.vat.entity.CompanyBalanceExample;
......@@ -24,7 +22,7 @@ import java.util.Date;
import java.util.List;
@Service
public class DataImportServiceImpl implements DataImportService {
public class DataImportServiceImpl {
private static final String PROJECT_DB_NAME = "test_db";//TODO:fixed use init db
private static final String COMPANY_BALANCE_TABLE = "CompanyBalance";
......@@ -43,8 +41,7 @@ public class DataImportServiceImpl implements DataImportService {
@Autowired
private EnterpriseAccountMapper enterpriseAccountMapper;
@Override
public OperationResultDto importTrialBalance(List<CompanyBalanceDto> balanceList, Integer importType,
public OperationResultDto importTrialBalance(List<CompanyBalance> balanceList, Integer importType,
Integer serviceTypeId, String userID) {
OperationResultDto result = new OperationResultDto();
if (serviceTypeId == ServiceType.VAT.getCode().intValue()) {
......@@ -71,7 +68,7 @@ public class DataImportServiceImpl implements DataImportService {
Boolean isSuccess = refreshTrialBalance(period, serviceTypeId, userID);
result.setResult(isSuccess);
}else if(serviceTypeId == ServiceType.CIT.getCode()){//TODO import cit (neo)
} else if (serviceTypeId == ServiceType.CIT.getCode()) {//TODO import cit (neo)
}
......
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