Commit f6962817 authored by chase's avatar chase

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

parents 4b212884 2e39bfb5
......@@ -11,6 +11,7 @@ public class ErrorMessage {
public static final String NoSelectSheet = "NoSelectSheet";
public static final String DIDNOTSELECTPERIOD = "You should select period!";
public static final String ImportFailed = "ImportFailed!";
public static final String ExportFailed = "ExportFailed!";
......
......@@ -135,6 +135,17 @@ public class DateUtils {
return period;
}
/**
* 将yyyy- 等字符串转换为区间格式 yyyy
* @param dateStr
* @return
*/
public static Integer strToPeriodY(String dateStr) {
dateStr = dateStr.replace(" ","");
Integer period = Integer.valueOf(dateStr.substring(0, 4));
return period;
}
/**
* 将yyyymm 字符串转换为区间格式 yyyyMM
......
package pwc.taxtech.atms.constant;
/**
* @Auther: Gary J Li
* @Date: 27/02/2019 20:47
* @Description:
*/
public final class ExportTemplatePathConstant {
public static final String INVOICES_RECORD = "/vat_excel_template/invoice_record.xlsx";
public static final String CASH_FLOW = "/vat_excel_template/cash_flow.xlsx";
public static final String CERTIFIED_INVOICES_LIST = "/vat_excel_template/certified_invoices_list.xlsx";
public static final String RED_LETTER_INFO_TAB = "/vat_excel_template/red_letter_info_tab.xlsx";
public static final String COUPA_PURCHASING_REPORT = "/vat_excel_template/coupa_purchasing_report.xlsx";
public static final String INVOICE_DATA = "/vat_excel_template/invoice_data.xlsx";
}
package pwc.taxtech.atms.constant.enums;
public enum EnumCitImportType {
Undefined(0),
JournalAdjust(1),
TrialBalance (2),
DraftAccountMapping (3),
BalanceSheetPrcAdjust (4),
ProfitPrcAdjust (5),
EAMAssetsDisposal (6),
SalaryAdvance (7)
;
private Integer code;
EnumCitImportType(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
public static EnumCitImportType valueOf(Integer value) {
for (EnumCitImportType item : EnumCitImportType.values()) {
if (item.getCode().equals(value)) {
return item;
}
}
return null;
}
}
package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.CitAssetGroupResult;
import pwc.taxtech.atms.entity.CitAssetsList;
import pwc.taxtech.atms.service.impl.AssetListServiceImpl;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* @Description 资产相关Controller
* @Author zhikai.z.wei
*/
@RestController
@RequestMapping("/api/v1/asset/")
public class AssetListController {
private static Logger logger = LoggerFactory.getLogger(AssetListController.class);
@Autowired
private AssetListServiceImpl assetListService;
/**
*
* @return
*/
@RequestMapping(value = "/getAssetListData", method = RequestMethod.GET)
public @ResponseBody
ApiResultDto getAssetListData(){
logger.info("获取所有资产清单");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData("");
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
apiResultDto.setData("");
return apiResultDto;
}
}
/**
* 根据资产类别(固定资产、长期待摊、无形资产)查询出结果
* @param assetType
* @return
*/
@RequestMapping(value = "/getAssetResultList", method = RequestMethod.GET)
public @ResponseBody ApiResultDto getAssetResultList(Integer assetType, @RequestParam String projectId, @RequestParam Integer taxAccountCompare){
logger.info("根据资产类别获取资产清单");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetListService.getAssetResultList(assetType,projectId,taxAccountCompare));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
*
* @return
*/
@RequestMapping(value = "/getAssetGroupResultData", method = RequestMethod.GET)
public @ResponseBody ApiResultDto getAssetGroupResultData(@RequestParam String projectId){
logger.info("获取资产类别");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 获取资产一级分类
* @return
*/
@RequestMapping(value = "/getAssetGroupListData", method = RequestMethod.GET)
public @ResponseBody ApiResultDto getAssetGroupListData(){
logger.info("获取资产一级分类");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetListService.getAssetGroupListData());
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 获取资产二级分类
* @return
*/
@RequestMapping(value = "/getAssetDetailGroupListData", method = RequestMethod.GET)
public @ResponseBody ApiResultDto getAssetDetailGroupListData(){
logger.info("根据资产二级分类");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetListService.getAssetDetailGroupListData());
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 当保留差异全选或全反选选项变化时进行批量修改
* @param assetType
* @param projectId
* @param isRetain
* @return
*/
@RequestMapping(value="batchUpdateIsRetain",method = RequestMethod.POST)
public ApiResultDto batchUpdateIsRetain(Integer assetType, @RequestParam String projectId, @RequestParam Integer isRetain){
assetListService.batchUpdateIsRetain(assetType,projectId, isRetain);
return null;
}
/**
* 保存资产分类(当对资产类别进行二级分类匹配完成后点击确定按钮所走的方法)
* @param assetGroupResults
* @param saveGroupType
* @param projectId
* @return
*/
@RequestMapping(value="saveAssetGroupInfo",method = RequestMethod.POST)
public ApiResultDto saveAssetGroupInfo(@RequestBody List<CitAssetGroupResult> assetGroupResults,
@RequestParam Integer saveGroupType,
@RequestParam String projectId){
return assetListService.saveAssetGroupInfo(assetGroupResults, saveGroupType, projectId);
}
/**
* 当资产清单Grid编辑进行保存所走的方法
* @param citAssetsLists
* @param projectId
* @return
*/
@RequestMapping(value="updateAssetResultList",method = RequestMethod.POST)
public ApiResultDto updateAssetResultList(@RequestBody List<CitAssetsList> citAssetsLists,
@RequestParam String projectId){
ApiResultDto apiResultDto = new ApiResultDto();
assetListService.updateAssetResultList(citAssetsLists,projectId);
apiResultDto.setCode(1);
apiResultDto.setMessage("资产修改成功");
return apiResultDto;
}
/**
* CIT资产文件导入
* @return
*/
@RequestMapping(value = "/assetsImport", method = RequestMethod.POST)
public @ResponseBody
ApiResultDto assetsImport(@RequestParam MultipartFile file,
@RequestParam String filename,
@RequestParam String tempFileName,
@RequestParam String projectId){
logger.info("CIT资产导入");
ApiResultDto apiResultDto = new ApiResultDto();
try{
if (file == null || file.getSize() <= 0) {
apiResultDto.setCode(-1);
apiResultDto.setMessage("没有获取到文件");
logger.warn("没有获取到文件");
return apiResultDto;
}
logger.debug("file name: " + file.getOriginalFilename());
InputStream input = null;
try {
input = file.getInputStream();
//调用资产导入业务逻辑
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId);
//判断是否导入成功,若成功获取资产类别并返回页面
if(assetsImportResult.getResult() != null && !assetsImportResult.getResult()){
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
}
} catch (IOException e) {
apiResultDto.setCode(-2);
apiResultDto.setMessage("获取文件流失败");
logger.warn("获取文件流失败");
return apiResultDto;
}
apiResultDto.setCode(1);
apiResultDto.setMessage("资产导入成功");
return apiResultDto;
}catch (Exception e){
logger.error("资产导入失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("资产导入失败");
return apiResultDto;
}
}
}
package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.AssetDetailGroupDto;
import pwc.taxtech.atms.dto.AssetDetailGroupStringDto;
import pwc.taxtech.atms.entity.AssetDetailGroup;
import pwc.taxtech.atms.entity.AssetGroup;
import pwc.taxtech.atms.service.impl.AssetGroupServiceImpl;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description 资产相关Controller
* @Author zhikai.z.wei
*/
@RestController
@RequestMapping("/api/v1/asset/")
public class AssetMappingController {
private static Logger logger = LoggerFactory.getLogger(AssetMappingController.class);
@Autowired
private AssetGroupServiceImpl assetGroupService;
/**
* 获取各种资产(固定资产、长期待摊、无形资产)二级分类
* @return ApiResultDto
*/
@RequestMapping(value="getAllAssetDetailGroup",method= RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ApiResultDto getAllAssetDetailGroup(){
ApiResultDto apiResultDto = new ApiResultDto();
try{
Map<String, List> assetsMap = new HashMap<String, List>();
logger.info("获取各种类型资产二级分类");
//获取资产一级分类相关数据
List<AssetGroup> allAssetGroup = assetGroupService.getAllAssetGroup();
//获取固定资产
// List<AssetDetailGroup> fixedAssetDetailGroups = assetGroupService.getAllFixedAssetDetailGroup();
//获取长期待摊
List<AssetDetailGroup> longTermPendingDetailGroups = assetGroupService.getAllLongTermPendingDetailGroup();
//获取无形资产
List<AssetDetailGroup> intangibleAssetDetailGroups = assetGroupService.getAllIntangibleAssetsDetailGroup();
assetsMap.put("allAssetGroup",allAssetGroup);
// assetsMap.put("1",fixedAssetDetailGroups);
assetsMap.put("2",longTermPendingDetailGroups);
assetsMap.put("3",intangibleAssetDetailGroups);
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(assetsMap);
logger.info("获取资产二级分类成功");
return apiResultDto;
}catch(Exception e){
logger.error("获取资产二级分类失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 获取固定资产二级分类
* @return ApiResultDtoaddAssetDetailGroup
*/
@RequestMapping(value="getFixedAssetDetailGroup",method= RequestMethod.POST)
public @ResponseBody
ApiResultDto getAllFixedAssetDetailGroup(@RequestBody AssetDetailGroupDto assetDetailGroupDto){
logger.info("获取固定资产二级分类,参数:"+assetDetailGroupDto);
ApiResultDto apiResultDto = new ApiResultDto();
try{
PageInfo<AssetDetailGroupStringDto> detailGroups = assetGroupService.getAllFixedAssetDetailGroup(assetDetailGroupDto);
Long countAssetByType = assetGroupService.countAssetByType(assetDetailGroupDto.getAssetGroupType());
Map map = new HashMap();
map.put("detailGroup",detailGroups);
map.put("totalItem",countAssetByType);
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(map);
logger.info("获取固定资产二级分类成功");
return apiResultDto;
}catch(Exception e){
logger.error("获取固定资产二级分类失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 新增资产二级分类
* @return
*/
@RequestMapping(value="addAssetDetailGroup",method = RequestMethod.POST)
public ApiResultDto addAssetDetailGroup(@RequestBody AssetDetailGroupDto assetDetailGroupDto){
logger.info("新增资产二级分类");
ApiResultDto apiResultDto = new ApiResultDto();
if(assetDetailGroupDto ==null ){
apiResultDto.setCode(0);
apiResultDto.setMessage("传参为空!");
return apiResultDto;
}
try{
assetDetailGroupDto.setAssetGroupId(assetGroupService.getAssetGroupByType(assetDetailGroupDto.getAssetGroupType()).get(0).getId());
int i = assetGroupService.addFixedAssetDetailGroup(assetDetailGroupDto);
apiResultDto.setCode(1);
apiResultDto.setMessage("新增成功");
apiResultDto.setData(i);
return apiResultDto;
}catch(Exception e){
logger.error("新增固定资产二级分类失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("新增失败");
return apiResultDto;
}
}
/**
* 编辑固定资产二级分类
* @return
*/
@RequestMapping(value="editAssetDetailGroup",method= RequestMethod.POST)
public ApiResultDto editAssetDetailGroup(@RequestBody AssetDetailGroupDto assetDetailGroupDto){
logger.info("编辑资产二级分类");
ApiResultDto apiResultDto = new ApiResultDto();
try{
int i = assetGroupService.editFixedAssetDetailGroup(assetDetailGroupDto);
apiResultDto.setCode(1);
apiResultDto.setMessage("编辑成功");
apiResultDto.setData(i);
return apiResultDto;
}catch(Exception e){
logger.error("编辑资产二级分类失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("编辑失败");
return apiResultDto;
}
}
/**
* 删除固定资产二级分类
* @return
*/
@RequestMapping(value="deleteAssetDetailGroup",method= RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ApiResultDto deleteAssetDetailGroup(Long id){
logger.info("删除资产二级分类");
ApiResultDto apiResultDto = new ApiResultDto();
try{
int i = assetGroupService.deleteFixedAssetDetailGroup(id);
apiResultDto.setCode(1);
apiResultDto.setMessage("删除成功");
apiResultDto.setData(i);
return apiResultDto;
}catch(Exception e){
logger.error("删除资产二级分类失败,错误信息如下:");
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("删除失败");
return apiResultDto;
}
}
}
package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl;
import java.io.InputStream;
import java.util.List;
import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust;
/**
* @Description 资产相关Controller
* @Author zhikai.z.wei
*/
@RestController
@RequestMapping("/api/v1/citImport/")
public class CitImportExcelController {
private static Logger logger = LoggerFactory.getLogger(CitImportExcelController.class);
@Autowired
private CitImportExcelServiceImpl citImportExcelService;
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate,
@RequestParam Integer importType,
@RequestParam Integer importFileType){
logger.info("CIT调整版日记账导入");
OperationResultDto opeResultDto = new OperationResultDto();
try{
if (file == null || file.getSize() <= 0) {
opeResultDto.setResult(false);
opeResultDto.setResultMsg("没有获取到文件");
logger.warn("没有获取到文件");
return opeResultDto;
}
logger.debug("file name: " + file.getOriginalFilename());
List<String> orgList = (List<String>) JSONArray.parse(orgIds);
opeResultDto = citImportExcelService.citImportExcel(file, orgList, file.getOriginalFilename(), periodDate, importType, importFileType);
return opeResultDto;
}catch (Exception e){
logger.error("资产导入失败,错误信息如下:");
e.printStackTrace();
opeResultDto.setResult(false);
opeResultDto.setResultMsg("资产导入失败");
return opeResultDto;
}
}
/**
* CIT调整版日记账导入
* @return
*/
// @RequestMapping(value = "/journalAdjustImport", method = RequestMethod.POST)
// public @ResponseBody
// ApiResultDto journalAdjustImport(@RequestParam MultipartFile file,@RequestParam String periodDate,@RequestParam Integer importType){
// logger.info("CIT调整版日记账导入");
// ApiResultDto apiResultDto = new ApiResultDto();
// try{
// if (file == null || file.getSize() <= 0) {
// apiResultDto.setCode(-1);
// apiResultDto.setMessage("没有获取到文件");
// logger.warn("没有获取到文件");
// return apiResultDto;
// }
// logger.debug("file name: " + file.getOriginalFilename());
// InputStream input = null;
//
// input = file.getInputStream();
// //调用资产导入业务逻辑
// citImportExcelService.importJournalAdjust(input, file.getOriginalFilename(), periodDate, importType);
//
// apiResultDto.setCode(1);
// apiResultDto.setMessage("资产导入成功");
// return apiResultDto;
// }catch (Exception e){
// logger.error("资产导入失败,错误信息如下:");
// e.printStackTrace();
// apiResultDto.setCode(0);
// apiResultDto.setMessage("资产导入失败");
// return apiResultDto;
// }
// }
/**
* 获取导入的调整日记账版本
* @return
*/
@RequestMapping(value = "/getJournalAdjust", method = RequestMethod.GET)
public ApiResultDto getJournalAdjust(){
logger.info("获取CIT调整版日记账");
ApiResultDto apiResultDto = new ApiResultDto();
apiResultDto.setCode(1);
apiResultDto.setData(citImportExcelService.getJournalAdjust());
return apiResultDto;
}
/**
* 根据导入类型获取导入记录
* @param type
* @return
*/
@RequestMapping(value = "/getCitDataImportLog", method = RequestMethod.GET)
public ApiResultDto getCitDataImportLog(Integer type){
logger.info("获取CIT调整版日记账");
ApiResultDto apiResultDto = new ApiResultDto();
apiResultDto.setCode(1);
apiResultDto.setData(citImportExcelService.getCitDataImportLog(type));
return apiResultDto;
}
}
......@@ -9,6 +9,7 @@ import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dpo.PagingDto;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.dataimport.DataImportParam;
import pwc.taxtech.atms.dto.dataimport.DataProcessParam;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
......@@ -218,6 +219,12 @@ public class DataImportController extends BaseController {
return new CamelPagingResultDto<>(dataImportService.displayImportLog(param));
}
@ResponseBody
@RequestMapping(value = "displayProcessLog", method = RequestMethod.POST)
public CamelPagingResultDto<DataValidateLogDto> displayProcessLog(@RequestBody DataProcessParam param) {
return new CamelPagingResultDto<>(dataImportService.displayProcessLog(param));
}
@ResponseBody
@RequestMapping(value = "callExtractFinancialData", method = RequestMethod.POST)
public OperationResultDto callExtractFinancialData(@RequestBody DataExtractParam dataExtractParam) {
......
......@@ -187,4 +187,42 @@ public class DataPreviewController extends BaseController {
logger.error(String.format("下载科目余额表-生成文件异常:%s",e.getMessage()));
}
}
@RequestMapping(value = "exportIRData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadIRQueryData(@RequestBody InvoiceRecordParam param, HttpServletResponse response) {
logger.debug("enter downloadIRQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportInvoiceRecordList(response, param, fileName);
}
@RequestMapping(value = "exportCILData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCILQueryData(@RequestBody CertifiedInvoicesListParam param, HttpServletResponse response) {
logger.debug("enter downloadCILQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportCILList(response, param, fileName);
}
@RequestMapping(value = "exportRLITData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadRLITQueryData(@RequestBody RedLetterInfoTableParam param, HttpServletResponse response) {
logger.debug("enter downloadRLITQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportRLITList(response, param, fileName);
}
@RequestMapping(value = "exportCPRData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCPRQueryData(@RequestBody CoupaPurchasingReportParam param, HttpServletResponse response) {
logger.debug("enter downloadCPRQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportCPRList(response, param, fileName);
}
@RequestMapping(value = "exportIDData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadIDQueryData(@RequestBody InvoiceDataParam param, HttpServletResponse response) {
logger.debug("enter downloadIDQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportIDList(response, param, fileName);
}
}
......@@ -13,6 +13,7 @@ import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ServletContextAware;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.constant.enums.EnumImportType;
import pwc.taxtech.atms.dpo.TemplateUniqDto;
import pwc.taxtech.atms.dto.*;
......@@ -44,7 +46,7 @@ import java.util.List;
@RestController
@RequestMapping(value = "api/v1/template")
public class TemplateController extends BaseController implements ServletContextAware {
public class TemplateController extends BaseController{
private ServletContext servletContext;
......@@ -238,16 +240,19 @@ public class TemplateController extends BaseController implements ServletContext
}
@RequestMapping(value = "file/downloadTemplate", method = RequestMethod.GET)
public void fileDownload(@RequestParam Integer fileType,HttpServletResponse response){
public void fileDownload(@RequestParam Integer fileType, @RequestParam(required=false) Integer serviceType, HttpServletResponse response){
//获取网站部署路径(通过ServletContext对象),用于确定下载文件位置,从而实现下载
String path = servletContext.getRealPath("/")+"\\WEB-INF\\classes";
String fileName = getFileName(fileType);
String fileName = "";
if(serviceType == null){
fileName = getFileName(fileType);
}else{
fileName = getCitFileName(fileType);
}
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName="+fileName+".xlsx");
ServletOutputStream out;
File file = new File(path + "\\document\\DataImport\\" + fileName+".xlsx");
try {
FileInputStream inputStream = new FileInputStream(file);
InputStream inputStream = this.getClass().getResourceAsStream("/document/DataImport/" + fileName+".xlsx");
out = response.getOutputStream();
int b = 0;
byte[] buffer = new byte[512];
......@@ -288,9 +293,23 @@ public class TemplateController extends BaseController implements ServletContext
return null;
}
@Override
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
private String getCitFileName(Integer fileType) {
if(EnumCitImportType.JournalAdjust.getCode().equals(fileType)){
return EnumCitImportType.JournalAdjust.name();
}else if(EnumCitImportType.TrialBalance.getCode().equals(fileType)){
return EnumCitImportType.TrialBalance.name();
}else if(EnumCitImportType.DraftAccountMapping.getCode().equals(fileType)){
return EnumCitImportType.DraftAccountMapping.name();
}else if(EnumCitImportType.BalanceSheetPrcAdjust.getCode().equals(fileType)){
return EnumCitImportType.BalanceSheetPrcAdjust.name();
}else if(EnumCitImportType.ProfitPrcAdjust.getCode().equals(fileType)){
return EnumCitImportType.ProfitPrcAdjust.name();
}else if(EnumCitImportType.EAMAssetsDisposal.getCode().equals(fileType)){
return EnumCitImportType.EAMAssetsDisposal.name();
}else if(EnumCitImportType.SalaryAdvance.getCode().equals(fileType)){
return EnumCitImportType.SalaryAdvance.name();
}
return null;
}
}
......@@ -156,4 +156,17 @@ public class TemplateGroupController {
return OperationResultDto.error(ErrorMessage.SystemError);
}
@RequestMapping(value = "withoutTemplate", method = RequestMethod.POST)
public @ResponseBody OperationResultDto withoutTemplate(@RequestBody TemplateGroupDto templateGroupDto) {
try {
templateGroupService.addTemplateGroupWithoutTemplate(templateGroupDto);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("withoutTemplate error.", e);
}
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
package pwc.taxtech.atms.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.util.Date;
/**
* AssetDetailGroupDto AssetDetailGroup页面Dto
*
* @author zhikai.z.wei
* @date 2019/1/25
*/
public class AssetDetailGroupDto implements Serializable{
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
@JsonSerialize(using = PwCIdSerialize.class)
private Long assetGroupId;
private String detailGroupName;
private Integer assetGroupType;
private Integer groupYear;
private Date createTime;
private Date updateTime;
private Integer detailGroupType;
private String keyValues;
/**
*
* 扩展属性,当前页码
*
*/
private Integer pageIndex;
/**
*
* 扩展属性,当前页所展示的数量
*
*/
private Integer pageSize;
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
@JsonSerialize(using = PwCIdSerialize.class)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAssetGroupId() {
return assetGroupId;
}
public void setAssetGroupId(Long assetGroupId) {
this.assetGroupId = assetGroupId;
}
public String getDetailGroupName() {
return detailGroupName;
}
public void setDetailGroupName(String detailGroupName) {
this.detailGroupName = detailGroupName == null ? null : detailGroupName.trim();
}
public Integer getAssetGroupType() {
return assetGroupType;
}
public void setAssetGroupType(Integer assetGroupType) {
this.assetGroupType = assetGroupType;
}
public Integer getGroupYear() {
return groupYear;
}
public void setGroupYear(Integer groupYear) {
this.groupYear = groupYear;
}
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;
}
public Integer getDetailGroupType() {
return detailGroupType;
}
public void setDetailGroupType(Integer detailGroupType) {
this.detailGroupType = detailGroupType;
}
public String getKeyValues() {
return keyValues;
}
public void setKeyValues(String keyValues) {
this.keyValues = keyValues == null ? null : keyValues.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", assetGroupId=").append(assetGroupId);
sb.append(", detailGroupName=").append(detailGroupName);
sb.append(", assetGroupType=").append(assetGroupType);
sb.append(", groupYear=").append(groupYear);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", detailGroupType=").append(detailGroupType);
sb.append(", keyValues=").append(keyValues);
sb.append("]");
return sb.toString();
}
}
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.util.Date;
/**
* AssetDetailGroupDto AssetDetailGroup页面Dto
*
* @author zhikai.z.wei
* @date 2019/1/25
*/
public class AssetDetailGroupStringDto implements Serializable{
private String id;
private String assetGroupId;
private String detailGroupName;
private Integer assetGroupType;
private Integer groupYear;
private Date createTime;
private Date updateTime;
private Integer detailGroupType;
private String keyValues;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAssetGroupId() {
return assetGroupId;
}
public void setAssetGroupId(String assetGroupId) {
this.assetGroupId = assetGroupId;
}
/**
*
* 扩展属性,当前页码
*
*/
private Integer pageIndex;
/**
*
* 扩展属性,当前页所展示的数量
*
*/
private Integer pageSize;
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public String getDetailGroupName() {
return detailGroupName;
}
public void setDetailGroupName(String detailGroupName) {
this.detailGroupName = detailGroupName == null ? null : detailGroupName.trim();
}
public Integer getAssetGroupType() {
return assetGroupType;
}
public void setAssetGroupType(Integer assetGroupType) {
this.assetGroupType = assetGroupType;
}
public Integer getGroupYear() {
return groupYear;
}
public void setGroupYear(Integer groupYear) {
this.groupYear = groupYear;
}
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;
}
public Integer getDetailGroupType() {
return detailGroupType;
}
public void setDetailGroupType(Integer detailGroupType) {
this.detailGroupType = detailGroupType;
}
public String getKeyValues() {
return keyValues;
}
public void setKeyValues(String keyValues) {
this.keyValues = keyValues == null ? null : keyValues.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", assetGroupId=").append(assetGroupId);
sb.append(", detailGroupName=").append(detailGroupName);
sb.append(", assetGroupType=").append(assetGroupType);
sb.append(", groupYear=").append(groupYear);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", detailGroupType=").append(detailGroupType);
sb.append(", keyValues=").append(keyValues);
sb.append("]");
return sb.toString();
}
}
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.entity.BaseEntity;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table asset_group
*
* @mbg.generated do_not_delete_during_merge
*/
public class AssetGroupDto implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column asset_group.id
*
* @mbg.generated
*/
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
/**
* Database Column Remarks:
* 资产分类一级分类名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column asset_group.asset_group_name
*
* @mbg.generated
*/
private String assetGroupName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column asset_group.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column asset_group.update_time
*
* @mbg.generated
*/
private Date updateTime;
/**
* Database Column Remarks:
* 资产一级分类的类型代码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column asset_group.asset_group_type
*
* @mbg.generated
*/
private Integer assetGroupType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table asset_group
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column asset_group.id
*
* @return the value of asset_group.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column asset_group.id
*
* @param id the value for asset_group.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column asset_group.asset_group_name
*
* @return the value of asset_group.asset_group_name
*
* @mbg.generated
*/
public String getAssetGroupName() {
return assetGroupName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column asset_group.asset_group_name
*
* @param assetGroupName the value for asset_group.asset_group_name
*
* @mbg.generated
*/
public void setAssetGroupName(String assetGroupName) {
this.assetGroupName = assetGroupName == null ? null : assetGroupName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column asset_group.create_time
*
* @return the value of asset_group.create_time
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column asset_group.create_time
*
* @param createTime the value for asset_group.create_time
*
* @mbg.generated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column asset_group.update_time
*
* @return the value of asset_group.update_time
*
* @mbg.generated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column asset_group.update_time
*
* @param updateTime the value for asset_group.update_time
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column asset_group.asset_group_type
*
* @return the value of asset_group.asset_group_type
*
* @mbg.generated
*/
public Integer getAssetGroupType() {
return assetGroupType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column asset_group.asset_group_type
*
* @param assetGroupType the value for asset_group.asset_group_type
*
* @mbg.generated
*/
public void setAssetGroupType(Integer assetGroupType) {
this.assetGroupType = assetGroupType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table asset_group
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", assetGroupName=").append(assetGroupName);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", assetGroupType=").append(assetGroupType);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.dto.dataimport;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
public class DataProcessParam {
private CamelPagingDto pageInfo;
//后续添加查询条件
public CamelPagingDto getPageInfo() {
return this.pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
......@@ -48,6 +48,17 @@ public class OrganizationAccountingRateDto implements Serializable {
*/
private Integer period;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 汇率类型
......@@ -216,6 +227,30 @@ public class OrganizationAccountingRateDto implements Serializable {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.source
*
* @return the value of organization_accounting_rate.source
*
* @mbg.generated
*/
public String getSource() {
return source;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.source
*
* @param source the value for organization_accounting_rate.source
*
* @mbg.generated
*/
public void setSource(String source) {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.convertion_type
......@@ -423,6 +458,7 @@ public class OrganizationAccountingRateDto implements Serializable {
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", source=").append(source);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
sb.append(", currencyTo=").append(currencyTo);
......
......@@ -20,6 +20,28 @@ public class CashFlowDto implements Serializable {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
/**
* Database Column Remarks:
* 机构id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.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 cash_flow.project_id
*
* @mbg.generated
*/
private String projectId;
/**
* Database Column Remarks:
* 数据日期
......@@ -42,6 +64,17 @@ public class CashFlowDto implements Serializable {
*/
private String source;
/**
* Database Column Remarks:
* 税务系统期间 yyyyMM
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.tms_period
*
* @mbg.generated
*/
private Integer tmsPeriod;
/**
* Database Column Remarks:
* 期间 YYYY-MM
......@@ -91,7 +124,7 @@ public class CashFlowDto implements Serializable {
* 账套币种
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.edger_currency_code
* This field corresponds to the database column cash_flow.ledger_currency_code
*
* @mbg.generated
*/
......@@ -133,7 +166,7 @@ public class CashFlowDto implements Serializable {
/**
* Database Column Remarks:
* 频度(固定值M,
仅期间(月度含13期)报表数据)
仅期间(月度含13期)报表数据)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.frequency
......@@ -236,6 +269,54 @@ public class CashFlowDto implements Serializable {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.organization_id
*
* @return the value of cash_flow.organization_id
*
* @mbg.generated
*/
public String getOrganizationId() {
return organizationId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cash_flow.organization_id
*
* @param organizationId the value for cash_flow.organization_id
*
* @mbg.generated
*/
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId == null ? null : organizationId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.project_id
*
* @return the value of cash_flow.project_id
*
* @mbg.generated
*/
public String getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cash_flow.project_id
*
* @param projectId the value for cash_flow.project_id
*
* @mbg.generated
*/
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.date
......@@ -284,6 +365,30 @@ public class CashFlowDto implements Serializable {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.tms_period
*
* @return the value of cash_flow.tms_period
*
* @mbg.generated
*/
public Integer getTmsPeriod() {
return tmsPeriod;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cash_flow.tms_period
*
* @param tmsPeriod the value for cash_flow.tms_period
*
* @mbg.generated
*/
public void setTmsPeriod(Integer tmsPeriod) {
this.tmsPeriod = tmsPeriod;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.period
......@@ -382,9 +487,9 @@ public class CashFlowDto implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cash_flow.edger_currency_code
* This method returns the value of the database column cash_flow.ledger_currency_code
*
* @return the value of cash_flow.edger_currency_code
* @return the value of cash_flow.ledger_currency_code
*
* @mbg.generated
*/
......@@ -394,9 +499,9 @@ public class CashFlowDto implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cash_flow.edger_currency_code
* This method sets the value of the database column cash_flow.ledger_currency_code
*
* @param ledgerCurrencyCode the value for cash_flow.edger_currency_code
* @param ledgerCurrencyCode the value for cash_flow.ledger_currency_code
*
* @mbg.generated
*/
......@@ -657,8 +762,11 @@ public class CashFlowDto implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", projectId=").append(projectId);
sb.append(", date=").append(date);
sb.append(", source=").append(source);
sb.append(", tmsPeriod=").append(tmsPeriod);
sb.append(", period=").append(period);
sb.append(", status=").append(status);
sb.append(", ledgerId=").append(ledgerId);
......
......@@ -212,6 +212,9 @@ public class JournalEntryExportDto {
@ExcelCell(index=64)
private Date lateUpdatedDate;
@ExcelCell(index=65)
private Integer tmsPeriod;
private Date createTime;
private Date updateTime;
......
package pwc.taxtech.atms.dto.vatdto.excelheader;
public class CertifiedInvoicesListHeader {
private String taxPayerNumber;
private Integer period;
private String unit;
public String getTaxPayerNumber() {
return taxPayerNumber;
}
public void setTaxPayerNumber(String taxPayerNumber) {
this.taxPayerNumber = taxPayerNumber;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
package pwc.taxtech.atms.dto.vatdto.excelheader;
public class InvoiceDataHeader {
private String taxPayerNumber;
private Integer period;
public String getTaxPayerNumber() {
return taxPayerNumber;
}
public void setTaxPayerNumber(String taxPayerNumber) {
this.taxPayerNumber = taxPayerNumber;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
}
......@@ -144,6 +144,12 @@ public class MenuServiceImpl {
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0822");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0823");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0824");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0825");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0826");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0827");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0828");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0829");
menuIds.add("a9b1cd87-89ef-4dae-b798-b19e9bbe0830");
menuIds.add("b8c74ee9-e5d7-467b-8565-e77efe6a499f");
// List<MenuDto> menus = getMenus(moduleId).stream().filter(x -> permissionNames.contains(x.getName())).collect(Collectors.toList());
return menuIds;
......
This diff is collapsed.
This diff is collapsed.
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