Commit d31ce086 authored by ZeGang Z Si's avatar ZeGang Z Si

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents ca50112f 6eb6dfe5
......@@ -135,6 +135,19 @@ public class DateUtils {
return period;
}
/**
* 将yyyymm 字符串转换为区间格式 yyyyMM
*
* @param dateStr
* @return
*/
public static Integer strToPeriod2(String dateStr) {
dateStr = dateStr.replace(" ","");
Integer period = Integer.valueOf(dateStr);
return period;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd
*
......@@ -175,6 +188,19 @@ public class DateUtils {
return strtodate;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd
*
* @param strDate
* @return
*/
public static Date strToDate4(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/**
* 得到现在时间
*
......
......@@ -8,7 +8,9 @@ public enum EnumImportType {
AdjustmentTable(4),
CashFlow(5),
CoupaPurchasingReport(6),
InvoiceData(7)
InvoiceData(7),
CertifiedInvoicesList(8),
InvoiceRecord(9)
;
private Integer code;
......
......@@ -164,6 +164,39 @@ public class DataImportController extends BaseController {
}
}
@ResponseBody
@RequestMapping(value = "IRExcelFile", method = RequestMethod.POST)
public OperationResultDto importIRExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
List<String> orgList = (List<String>)JSONArray.parse(orgIds);
return dataImportService.importIRExcelFile(file,orgList, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importIRExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "CILExcelFile", method = RequestMethod.POST)
public OperationResultDto importCILExcelFile(@RequestParam MultipartFile file,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
return dataImportService.importCILExcelFile(file, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importCILExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "displayImportLog", method = RequestMethod.GET)
public List<DataImportLogDto> displayImportLog(@RequestParam Integer type) {
......
......@@ -55,6 +55,30 @@ public class DataPreviewController extends BaseController {
return dataPreviewSerivceImpl.getBSDataForDisplay(param);
}
@PostMapping("getIRDataForDisplay")
public PageInfo<InvoiceRecordDto> getIRDataForDisplay(@RequestBody InvoiceRecordParam param) {
logger.debug(String.format("发票记录表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getIRDataForDisplay(param);
}
@PostMapping("getRLITDataForDisplay")
public PageInfo<RedLetterInfoTableDto> getRLITDataForDisplay(@RequestBody RedLetterInfoTableParam param) {
logger.debug(String.format("红字信息表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getRLITDataForDisplay(param);
}
@PostMapping("getCPRDataForDisplay")
public PageInfo<CoupaPurchasingReportDto> getCPRDataForDisplay(@RequestBody CoupaPurchasingReportParam param) {
logger.debug(String.format("Coupa发票报告表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getCPRDataForDisplay(param);
}
@PostMapping("getCILDataForDisplay")
public PageInfo<CertifiedInvoicesListDto> getCILDataForDisplay(@RequestBody CertifiedInvoicesListParam param) {
logger.debug(String.format("已认证发票清单查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getCILDataForDisplay(param);
}
@RequestMapping(value = "exportCFData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCFQueryData(@RequestBody CashFlowParam param, HttpServletResponse response) {
logger.debug("enter downloadCFQueryData");
......
......@@ -278,6 +278,10 @@ public class TemplateController extends BaseController implements ServletContext
return EnumImportType.CoupaPurchasingReport.name();
}else if(EnumImportType.InvoiceData.getCode().equals(fileType)){
return EnumImportType.InvoiceData.name();
}else if(EnumImportType.CertifiedInvoicesList.getCode().equals(fileType)){
return EnumImportType.CertifiedInvoicesList.name();
}else if(EnumImportType.InvoiceRecord.getCode().equals(fileType)){
return EnumImportType.InvoiceRecord.name();
}else if(EnumImportType.Undefined.getCode().equals(fileType)){
return EnumImportType.Undefined.name();
}
......
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CertifiedInvoicesListParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
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 getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CoupaPurchasingReportParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
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 getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class InvoiceRecordParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
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 getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class RedLetterInfoTableParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
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 getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto.dd;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -14,6 +17,7 @@ public class CashFlowDto implements Serializable {
*
* @mbg.generated
*/
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
/**
......
......@@ -44,19 +44,29 @@ public class DataPreviewSerivceImpl extends BaseService {
@Resource
private CashFlowMapper cashFlowMapper;
@Resource
private InvoiceRecordMapper invoiceRecordMapper;
@Resource
private RedLetterInfoTableMapper redLetterInfoTableMapper;
@Resource
private CoupaPurchasingReportMapper coupaPurchasingReportMapper;
@Resource
private CertifiedInvoicesListMapper certifiedInvoicesListMapper;
@Resource
private OrganizationMapper organizationMapper;
public PageInfo<TrialBalanceDto> getTBDataForDisplay(TrialBalanceParam param) {
TrialBalanceCondition condition = new TrialBalanceCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
TrialBalanceCondition condition = beanUtil.copyProperties(param, new TrialBalanceCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<TrialBalance> trialBalances = trialBalanceMapper.selectByCondition(condition);
List<TrialBalanceDto> trialBalanceDtos = Lists.newArrayList();
trialBalances.forEach(tb -> {
......@@ -65,18 +75,19 @@ public class DataPreviewSerivceImpl extends BaseService {
trialBalanceDtos.add(trialBalanceDto);
});
return new PageInfo<>(trialBalanceDtos);
PageInfo<TrialBalanceDto> pageInfo =new PageInfo<>(trialBalanceDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<ProfitLossStatementDto> getPLDataForDisplay(ProfitLossStatementParam param) {
ProfitLossStatementCondition condition = new ProfitLossStatementCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
ProfitLossStatementCondition condition = beanUtil.copyProperties(param, new ProfitLossStatementCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<ProfitLossStatement> profitLossStatements = profitLossStatementMapper.selectByCondition(condition);
List<ProfitLossStatementDto> profitLossDtos = Lists.newArrayList();
profitLossStatements.forEach(pl -> {
......@@ -85,7 +96,11 @@ public class DataPreviewSerivceImpl extends BaseService {
profitLossDtos.add(profitLossDto);
});
return new PageInfo<>(profitLossDtos);
PageInfo<ProfitLossStatementDto> pageInfo =new PageInfo<>(profitLossDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<CashFlowDto> getCFDataForDisplay(CashFlowParam param) {
......@@ -146,13 +161,10 @@ public class DataPreviewSerivceImpl extends BaseService {
public PageInfo<JournalEntryDto> getJEDataForDisplay(JournalEntryParam param) {
JournalEntryCondition condition = new JournalEntryCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
JournalEntryCondition condition = beanUtil.copyProperties(param, new JournalEntryCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<JournalEntry> journalEntrys = journalEntryMapper.selectByCondition(condition);
List<JournalEntryDto> journalEntryDtos = Lists.newArrayList();
journalEntrys.forEach(je -> {
......@@ -161,18 +173,19 @@ public class DataPreviewSerivceImpl extends BaseService {
journalEntryDtos.add(journalEntryDto);
});
return new PageInfo<>(journalEntryDtos);
PageInfo<JournalEntryDto> pageInfo =new PageInfo<>(journalEntryDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<BalanceSheetDto> getBSDataForDisplay(BalanceSheetParam param) {
BalanceSheetCondition condition = new BalanceSheetCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
BalanceSheetCondition condition = beanUtil.copyProperties(param, new BalanceSheetCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<BalanceSheet> balanceSheets = balanceSheetMapper.selectByCondition(condition);
List<BalanceSheetDto> balanceSheetDtos = Lists.newArrayList();
balanceSheets.forEach(bs -> {
......@@ -181,7 +194,95 @@ public class DataPreviewSerivceImpl extends BaseService {
balanceSheetDtos.add(balanceSheetDto);
});
return new PageInfo<>(balanceSheetDtos);
PageInfo<BalanceSheetDto> pageInfo =new PageInfo<>(balanceSheetDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<InvoiceRecordDto> getIRDataForDisplay(InvoiceRecordParam param) {
InvoiceRecordCondition condition = beanUtil.copyProperties(param, new InvoiceRecordCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<InvoiceRecord> invoiceRecords = invoiceRecordMapper.selectByCondition(condition);
List<InvoiceRecordDto> invoiceRecordDtos = Lists.newArrayList();
invoiceRecords.forEach(bs -> {
InvoiceRecordDto balanceSheetDto = beanUtil.copyProperties(bs, new InvoiceRecordDto());
invoiceRecordDtos.add(balanceSheetDto);
});
PageInfo<InvoiceRecordDto> pageInfo =new PageInfo<>(invoiceRecordDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<RedLetterInfoTableDto> getRLITDataForDisplay(RedLetterInfoTableParam param) {
RedLetterInfoTableCondition condition = beanUtil.copyProperties(param, new RedLetterInfoTableCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<RedLetterInfoTable> redLetterInfoTables = redLetterInfoTableMapper.selectByCondition(condition);
List<RedLetterInfoTableDto> redLetterInfoDtos = Lists.newArrayList();
redLetterInfoTables.forEach(bs -> {
RedLetterInfoTableDto redLetterInfoDto = beanUtil.copyProperties(bs, new RedLetterInfoTableDto());
redLetterInfoDtos.add(redLetterInfoDto);
});
PageInfo<RedLetterInfoTableDto> pageInfo =new PageInfo<>(redLetterInfoDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<CoupaPurchasingReportDto> getCPRDataForDisplay(CoupaPurchasingReportParam param) {
CoupaPurchasingReportCondition condition = beanUtil.copyProperties(param, new CoupaPurchasingReportCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<CoupaPurchasingReport> coupaPurchasingReports = coupaPurchasingReportMapper.selectByCondition(condition);
List<CoupaPurchasingReportDto> coupaPurchasingReportDtos = Lists.newArrayList();
coupaPurchasingReports.forEach(cpr -> {
CoupaPurchasingReportDto coupaPurchasingReportDto = beanUtil.copyProperties(cpr, new CoupaPurchasingReportDto());
coupaPurchasingReportDtos.add(coupaPurchasingReportDto);
});
PageInfo<CoupaPurchasingReportDto> pageInfo =new PageInfo<>(coupaPurchasingReportDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public PageInfo<CertifiedInvoicesListDto> getCILDataForDisplay(CertifiedInvoicesListParam param) {
CertifiedInvoicesListCondition condition = beanUtil.copyProperties(param, new CertifiedInvoicesListCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<CertifiedInvoicesList> certifiedInvoicesLists = certifiedInvoicesListMapper.selectByCondition(condition);
List<CertifiedInvoicesListDto> certifiedInvoicesListDtos = Lists.newArrayList();
certifiedInvoicesLists.forEach(cil -> {
CertifiedInvoicesListDto CertifiedInvoicesListDto = beanUtil.copyProperties(cil, new CertifiedInvoicesListDto());
certifiedInvoicesListDtos.add(CertifiedInvoicesListDto);
});
PageInfo<CertifiedInvoicesListDto> pageInfo =new PageInfo<>(certifiedInvoicesListDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public int getTBDownloadFilePath(TrialBalanceParam param, OutputStream os) {
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.CertifiedInvoicesListCondition;
import pwc.taxtech.atms.vat.entity.CertifiedInvoicesList;
import pwc.taxtech.atms.vat.entity.CertifiedInvoicesListExample;
@Mapper
public interface CertifiedInvoicesListMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
long countByExample(CertifiedInvoicesListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int deleteByExample(CertifiedInvoicesListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int insert(CertifiedInvoicesList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int insertSelective(CertifiedInvoicesList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
List<CertifiedInvoicesList> selectByExampleWithRowbounds(CertifiedInvoicesListExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
List<CertifiedInvoicesList> selectByExample(CertifiedInvoicesListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
CertifiedInvoicesList selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CertifiedInvoicesList record, @Param("example") CertifiedInvoicesListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int updateByExample(@Param("record") CertifiedInvoicesList record, @Param("example") CertifiedInvoicesListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CertifiedInvoicesList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table certified_invoices_list
*
* @mbg.generated
*/
int updateByPrimaryKey(CertifiedInvoicesList record);
int insertBatch(List<CertifiedInvoicesList> cils);
List<CertifiedInvoicesList> selectByCondition(@Param("cilCondition") CertifiedInvoicesListCondition condition);
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(bsCondition.orgId)">
AND organization_id= #{bsCondition.orgId,jdbcType=INTEGER}
AND organization_id= #{bsCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="bsCondition.periodStart!=null">
AND period &gt;= #{bsCondition.periodStart,jdbcType=INTEGER}
......
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