Commit 39048226 authored by neo's avatar neo

[DEV] add importController and ProjectInfoController and reference dto

parent a90665b8
......@@ -3,11 +3,15 @@ package pwc.taxtech.atms.controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto;
import pwc.taxtech.atms.dto.vat.QueryImportType;
import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.service.ProjectInfoService;
import java.util.List;
......@@ -17,19 +21,30 @@ import java.util.List;
public class ProjectInfoController {
@Autowired
private ProjectInfoService projectInfoService;
@Autowired
private IdentityService identityService;
@ApiOperation(value = "isProjectImportedData", notes = "")
@RequestMapping(value = "isProjectImportedData/{projectId}/{serviceType}/{importTypeId}", method = RequestMethod.GET)
public @ResponseBody
OperationResultDto<Boolean> isProjectImportedData(@PathVariable String projectId, @PathVariable Integer serviceType,
@PathVariable Integer importTypeId) {
return projectInfoService.isProjectImportedData(projectId, serviceType, importTypeId);
@PathVariable Integer importTypeId) {
return projectInfoService.isProjectImportedData(projectId, serviceType, importTypeId);
}
@ApiOperation(value = "isProjectImportedData", notes = "")
@RequestMapping(value = "isProjectImportedData/{projectId}/{importTypeId}", method = RequestMethod.GET)
public @ResponseBody
OperationResultDto<Boolean> isProjectImportedData(@PathVariable String projectId, @PathVariable Integer importTypeId) {
return projectInfoService.isProjectImportedData(projectId, importTypeId);
return projectInfoService.isProjectImportedData(projectId, importTypeId);
}
@ApiOperation(value = "getProjectImportType", notes = "")
@RequestMapping(value = "getProjectImportType", method = RequestMethod.GET)
public OperationResultDto<List<PeriodInfoDto>> getProjectImportType(@RequestBody QueryImportType queryImportType) {
return projectInfoService.getProjectImportType(queryImportType.getProjectId(), queryImportType.getPeriods(),
queryImportType.getServiceTypeId()
, identityService.getIdentityUser().getID());
}
}
\ No newline at end of file
package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
......@@ -10,6 +11,14 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dto.vatdto.*;
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.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceFilter;
import pwc.taxtech.atms.service.DataImportService;
import pwc.taxtech.atms.service.ICitTBDataImportService;
import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.vat.service.TBDataImportService;
import java.math.BigDecimal;
......@@ -23,6 +32,13 @@ public class TBDataImportController {
@Autowired
TBDataImportService tbDataImportService;
@Autowired
private ICitTBDataImportService citTbDataImport;
@Autowired
private DataImportService dataImportService;
@Autowired
private IdentityService identityService;
@RequestMapping(value = "GetBalanceDataForDisplay", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String getBalanceDataForDisplay(@RequestBody JSONObject param) {
......@@ -357,5 +373,19 @@ public class TBDataImportController {
return balanceList;
}
@ApiOperation(value = "clearTableByPeriods", notes = "")
@RequestMapping(value = "clearTableByPeriods", method = RequestMethod.POST)
public OperationResultDto<Boolean> clearTableByPeriods(@RequestBody ClearTableDto clearTb) {
return citTbDataImport.clearTableByPeriods(clearTb.getPeriods());
}
@ApiOperation(value = "ImportBalance", notes = "")
@RequestMapping(value = "ImportBalance", method = RequestMethod.POST)
public OperationResultDto importBalanceList(@RequestBody ImportBalanceDto importDto) {
return dataImportService.importTrialBalance(importDto.getBalanceList(), importDto.getImportType(),
importDto.getServiceTypeId(),
identityService.getIdentityUser().getID()
);
}
}
package pwc.taxtech.atms.dto.taxadmin;
public class PeriodInfoDto {
private String iD;
private String projectID;
private Integer period;
private Integer status;
private String creatorID;
private String projectInfo;
private Integer importType;
private Integer serviceType;
public String getiD() {
return iD;
}
public void setiD(String iD) {
this.iD = iD;
}
public String getProjectID() {
return projectID;
}
public void setProjectID(String projectID) {
this.projectID = projectID;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getCreatorID() {
return creatorID;
}
public void setCreatorID(String creatorID) {
this.creatorID = creatorID;
}
public String getProjectInfo() {
return projectInfo;
}
public void setProjectInfo(String projectInfo) {
this.projectInfo = projectInfo;
}
public Integer getImportType() {
return importType;
}
public void setImportType(Integer importType) {
this.importType = importType;
}
public Integer getServiceType() {
return serviceType;
}
public void setServiceType(Integer serviceType) {
this.serviceType = serviceType;
}
}
package pwc.taxtech.atms.dto.vat;
import java.util.List;
public class ClearTableDto {
private List<Integer> periods;
public List<Integer> getPeriods() {
return periods;
}
public void setPeriods(List<Integer> periods) {
this.periods = periods;
}
}
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;
import java.util.List;
public class ImportBalanceDto {
private List<CompanyBalanceDto> balanceList;
private Integer importType;
private Integer serviceTypeId;
private List<Integer> periods;
public List<CompanyBalanceDto> getBalanceList() {
return balanceList;
}
public void setBalanceList(List<CompanyBalanceDto> balanceList) {
this.balanceList = balanceList;
}
public Integer getImportType() {
return importType;
}
public void setImportType(Integer importType) {
this.importType = importType;
}
public Integer getServiceTypeId() {
return serviceTypeId;
}
public void setServiceTypeId(Integer serviceTypeId) {
this.serviceTypeId = serviceTypeId;
}
public List<Integer> getPeriods() {
return periods;
}
public void setPeriods(List<Integer> periods) {
this.periods = periods;
}
}
package pwc.taxtech.atms.dto.vat;
import java.util.List;
public class QueryImportType {
private Integer serviceTypeId;
private List<Integer> periods;
private String projectId;
private Integer importTypeId;
public Integer getServiceTypeId() {
return serviceTypeId;
}
public void setServiceTypeId(Integer serviceTypeId) {
this.serviceTypeId = serviceTypeId;
}
public List<Integer> getPeriods() {
return periods;
}
public void setPeriods(List<Integer> periods) {
this.periods = periods;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public Integer getImportTypeId() {
return importTypeId;
}
public void setImportTypeId(Integer importTypeId) {
this.importTypeId = importTypeId;
}
}
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);
}
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto;
import java.util.List;
public interface ICitTBDataImportService {
OperationResultDto<Boolean> clearTableByPeriods(List<Integer> periods);
}
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto;
import java.util.List;
public interface ProjectInfoService {
OperationResultDto<Boolean> isProjectImportedData(String projectId, Integer serviceType, Integer importTypeId);
OperationResultDto<Boolean> isProjectImportedData(String projectId, Integer importTypeId);
OperationResultDto<List<PeriodInfoDto>> getProjectImportType(String projectId, List<Integer> periods, Integer serviceTypeId, String id);
}
......@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dao.PeriodInfoMapper;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.PeriodInfoDto;
import pwc.taxtech.atms.entitiy.PeriodInfo;
import pwc.taxtech.atms.entitiy.PeriodInfoExample;
import pwc.taxtech.atms.service.ProjectInfoService;
......@@ -46,4 +47,9 @@ public class ProjectInfoServiceImpl implements ProjectInfoService {
public OperationResultDto<Boolean> isProjectImportedData(String projectId, Integer importTypeId) {
return isProjectImportedData(projectId,importTypeId);
}
@Override
public OperationResultDto<List<PeriodInfoDto>> getProjectImportType(String projectId, List<Integer> periods, Integer serviceTypeId, String id) {
return null;
}
}
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