Commit 93bb3af0 authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents e7c526d4 864f1c9f
...@@ -73,8 +73,12 @@ public class POIUtil { ...@@ -73,8 +73,12 @@ public class POIUtil {
if (null != cell.getCellComment()) { if (null != cell.getCellComment()) {
targetCell.setCellComment(cell.getCellComment()); targetCell.setCellComment(cell.getCellComment());
} }
if (null != cell.getCellStyle()) { if (null != cell.getCellStyle() && targetCell.getCellStyle() != null ) {
try{
targetCell.getCellStyle().cloneStyleFrom(cell.getCellStyle()); targetCell.getCellStyle().cloneStyleFrom(cell.getCellStyle());
}catch (Exception e){
//e.printStackTrace();
}
} }
if (null != cell.getHyperlink()) { if (null != cell.getHyperlink()) {
targetCell.setHyperlink(cell.getHyperlink()); targetCell.setHyperlink(cell.getHyperlink());
......
...@@ -9,6 +9,16 @@ public class FileServiceConfig { ...@@ -9,6 +9,16 @@ public class FileServiceConfig {
private String serverUrl; private String serverUrl;
@Value("${file.server.upload}") @Value("${file.server.upload}")
private String uploadUrl; private String uploadUrl;
@Value("${file_upload_post_url}")
private String upload_post_url;
public String getUpload_post_url() {
return upload_post_url;
}
public void setUpload_post_url(String upload_post_url) {
this.upload_post_url = upload_post_url;
}
public String getServerUrl() { public String getServerUrl() {
return serverUrl; return serverUrl;
......
...@@ -17,5 +17,6 @@ public class ErrorMessageCN { ...@@ -17,5 +17,6 @@ public class ErrorMessageCN {
public static final String OrgStructureNameExist = "层级名称已存在!"; public static final String OrgStructureNameExist = "层级名称已存在!";
public static final String NoLedgerID = "该机构未同步主数据账套ID!"; public static final String NoLedgerID = "该机构未同步主数据账套ID!";
public static final String NoCompanyCode = "该机构缺少机构代码字段!"; public static final String NoCompanyCode = "该机构缺少机构代码字段!";
public static final String ErrorFileFormat="文件样式错误";
} }
...@@ -41,10 +41,15 @@ public class FileUploadUtil implements ApplicationContextAware { ...@@ -41,10 +41,15 @@ public class FileUploadUtil implements ApplicationContextAware {
return upload( file, false); return upload( file, false);
} }
public static String serverPath(){ public static String serverPath(boolean newUrl){
config = (FileServiceConfig)applicationContext.getBean("fileServiceConfig"); config = (FileServiceConfig)applicationContext.getBean("fileServiceConfig");
if(newUrl)
return config.getUpload_post_url();
return config.getServerUrl() + config.getUploadUrl(); return config.getServerUrl() + config.getUploadUrl();
} }
public static String serverPath(){
return serverPath(true);
}
/** /**
* 上传模板 * 上传模板
* *
......
...@@ -61,7 +61,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -61,7 +61,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static ProfitLossStatementMapper profitLossStatementMapper; public static ProfitLossStatementMapper profitLossStatementMapper;
public static RevenueTypeMappingMapper revenueTypeMappingMapper; public static RevenueTypeMappingMapper revenueTypeMappingMapper;
public static InvoiceRecordMapper invoiceRecordMapper; public static InvoiceRecordMapper invoiceRecordMapper;
public static CertifiedInvoicesListMapper certifiedInvoicesListMapper;
...@@ -146,7 +146,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -146,7 +146,7 @@ public class SpringContextUtil implements ApplicationContextAware {
balanceSheetMapper = webApplicationContext.getBean(BalanceSheetMapper.class); balanceSheetMapper = webApplicationContext.getBean(BalanceSheetMapper.class);
revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class); revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class);
invoiceRecordMapper = webApplicationContext.getBean(InvoiceRecordMapper.class); invoiceRecordMapper = webApplicationContext.getBean(InvoiceRecordMapper.class);
certifiedInvoicesListMapper = webApplicationContext.getBean(CertifiedInvoicesListMapper.class);
/* map.put("balance_sheet", balanceMapper); /* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper); map.put("profit_loss_statement",profitLossStatementMapper);
map.put("cash_flow", cashFlowMapper); map.put("cash_flow", cashFlowMapper);
......
...@@ -156,4 +156,6 @@ public final class Constant { ...@@ -156,4 +156,6 @@ public final class Constant {
this.segment6 = segment6; this.segment6 = segment6;
} }
} }
} }
\ No newline at end of file
package pwc.taxtech.atms.constant;
/**
* @ClassName TemplateHeaderCheck
* Description TODO
* @Author pwc kevin
* @Date 3/28/2019 12:17 PM
* Version 1.0
**/
public class TemplateHeaderCheck {
public static String[] sjfhse = {
"公司名称", "增值税返还", "城建税返还", "教育费附加返还", "地方教育费附加返还", "个人所得税返还"
};
public static String[] gszse = {
"公司名称", "城建税", "教育费附加", "地方教育费附加", "员工个税", "司机个税", "印花税"
};
//业务线GMV
public static String[] ywxgmv = {
"业务线", "订单环比", "GMV环比", "B端补贴率", "B端环比", "C端补贴率", "C端环比"
};
//职工人数
public static String[] zgrs = {
"公司简称", "正式员工", "实习生", "外包", "合计"
};
//司机人数
public static String[] sjrs = {
"司機類型", "合计"
};
}
...@@ -87,7 +87,9 @@ public class AnalysisController extends BaseController { ...@@ -87,7 +87,9 @@ public class AnalysisController extends BaseController {
} }
return analysisServiceImpl.importDomesitcExcelFile(file,period, type); return analysisServiceImpl.importDomesitcExcelFile(file,period, type);
} catch (ServiceException e) { } catch (ServiceException e) {
return OperationResultDto.error(e.getMessage()); String message = e.getMessage();
String[] split = message.split(":");
return OperationResultDto.error(split[1]);
} catch (Exception e) { } catch (Exception e) {
logger.error("importDomesitcExcelFile error.", e); logger.error("importDomesitcExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError); return OperationResultDto.error(ErrorMessage.SystemError);
......
...@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dpo.PagingDto; import pwc.taxtech.atms.dpo.PagingDto;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.dataimport.DataImportAllParam; import pwc.taxtech.atms.dto.dataimport.DataImportAllParam;
...@@ -13,6 +14,8 @@ import pwc.taxtech.atms.dto.dataimport.DataProcessParam; ...@@ -13,6 +14,8 @@ import pwc.taxtech.atms.dto.dataimport.DataProcessParam;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto; import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto; import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam; import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.DataImportService; import pwc.taxtech.atms.service.impl.DataImportService;
import pwc.taxtech.atms.service.impl.DidiFileUploadService; import pwc.taxtech.atms.service.impl.DidiFileUploadService;
...@@ -126,6 +129,7 @@ public class DataImportController extends BaseController { ...@@ -126,6 +129,7 @@ public class DataImportController extends BaseController {
} }
} }
@ResponseBody @ResponseBody
@RequestMapping(value = "CFExcelFile", method = RequestMethod.POST) @RequestMapping(value = "CFExcelFile", method = RequestMethod.POST)
public OperationResultDto importCFExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) { public OperationResultDto importCFExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) {
......
...@@ -95,7 +95,7 @@ public class OrganizationController { ...@@ -95,7 +95,7 @@ public class OrganizationController {
public @ResponseBody public @ResponseBody
List<OrgSelectDto> getOrgSimpleList() { List<OrgSelectDto> getOrgSimpleList() {
logger.info("GET /api/v1/org/getOrgListByUserId"); logger.info("GET /api/v1/org/getOrgListByUserId");
return organizationService.getOrgSimpleList(); return organizationService.getMyOrgList();
} }
// @ApiOperation(value = "纳税人识别号唯一性验证") // @ApiOperation(value = "纳税人识别号唯一性验证")
......
...@@ -7,15 +7,16 @@ import org.springframework.http.ResponseEntity; ...@@ -7,15 +7,16 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.constant.enums.EnumServiceType; import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dpo.ReportDto; import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.vatdto.*; import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig; import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.vat.entity.PeriodJob; import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.vat.entity.PwcReportAttach; import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount; import pwc.taxtech.atms.service.impl.DataImportService;
import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl; import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import java.util.List; import java.util.List;
...@@ -82,6 +83,48 @@ public class ReportController { ...@@ -82,6 +83,48 @@ public class ReportController {
return reportService.getCellData(reportId, from); return reportService.getCellData(reportId, from);
} }
private static OperationResultDto<ReportDataDto> operationResultDto = null;
@RequestMapping(value = "reportEbitData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDataDto> reportEbitData(@RequestBody RequestParameterDto requestParameterDto) {
/*OperationResultDto resultDto = new OperationResultDto();
*//* if (requestParameterDto.getProjectId() == null || requestParameterDto.getReportId() == null) {
resultDto.setResult(false);
return resultDto;
}*/
operationResultDto = reportService.getCellData(Long.parseLong(requestParameterDto.getReportId()), requestParameterDto.getOrgId(),requestParameterDto.getPeriod());
return operationResultDto;
}
@Autowired
private ProjectMapper projectMapper;
private String getProjId(String orgId, Integer tmsPeriod) {
ProjectExample pExample = new ProjectExample();
pExample.createCriteria().andOrganizationIdEqualTo(orgId).andYearEqualTo(tmsPeriod / 100);
List<Project> pList = projectMapper.selectByExample(pExample);
if (!pList.isEmpty()) {
return pList.get(0).getId();
}
return "";
}
public static void main(String[] args) {
System.out.println(201833 % 100);
}
private DataImportService dataImportService;
@RequestMapping(value = "saveAndRefresh", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<EbitDataDto> saveAndRefresh(@RequestParam(value ="orgId") String orgId, @RequestParam(value ="period") Integer period, @RequestParam(value = "specialConsiderations", defaultValue = "0") Integer specialConsiderations, @RequestParam(value = "ebitRate", defaultValue = "1") String ebitRate) {
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto.setData(reportService.loadEbitData(orgId, period, specialConsiderations, ebitRate));
reportService.saveDatasource(orgId, period, specialConsiderations, ebitRate, operationResultDto);
return operationResultDto;
}
@RequestMapping(value = "report/{templateId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "report/{templateId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period, @RequestHeader String from) { public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period, @RequestHeader String from) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
...@@ -93,6 +136,11 @@ public class ReportController { ...@@ -93,6 +136,11 @@ public class ReportController {
return reportService.getReportByTemplate(templateId, period, from); return reportService.getReportByTemplate(templateId, period, from);
} }
@RequestMapping(value = "getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(@PathVariable Long reportTemplateId, public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(@PathVariable Long reportTemplateId,
@PathVariable Integer period, @PathVariable Integer period,
...@@ -157,25 +205,57 @@ public class ReportController { ...@@ -157,25 +205,57 @@ public class ReportController {
@RequestMapping(value = "doUpload", method = RequestMethod.POST) @RequestMapping(value = "doUpload", method = RequestMethod.POST)
public OperationResultDto doUploadAttach(@RequestParam("fileName") String fileName, MultipartFile file, String remarks, @RequestParam("activeCol")Long activeCol, @RequestParam("activeRow")Long activeRow, @RequestParam("activeTemplateId")String activeTemplateId){ public OperationResultDto doUploadAttach(@RequestParam("fileName") String fileName, MultipartFile file, String remarks, @RequestParam("activeCol") Long activeCol, @RequestParam("activeRow") Long activeRow, @RequestParam("activeTemplateId") String activeTemplateId) {
System.out.println(activeCol + "----" + activeRow + "-----" + activeTemplateId); System.out.println(activeCol + "----" + activeRow + "-----" + activeTemplateId);
OperationResultDto operationResultDto = reportService.doUploadAttach(file, remarks); OperationResultDto operationResultDto = reportService.doUploadAttach(file, remarks);
if(!"error".equals(operationResultDto.getResultMsg())){//上传成功绑定 if (!"error".equals(operationResultDto.getResultMsg())) {//上传成功绑定
reportService.bindPwcAttach(activeCol, activeRow, activeTemplateId, (FileDto) operationResultDto.getData()); reportService.bindPwcAttach(activeCol, activeRow, activeTemplateId, (FileDto) operationResultDto.getData());
} }
return operationResultDto; return operationResultDto;
} }
@RequestMapping("loadAttachList") @RequestMapping("loadAttachList")
public List<PwcReportAttach> loadAttachList(@RequestBody ReportAttachDto reportAttachDto){ public List<PwcReportAttach> loadAttachList(@RequestBody ReportAttachDto reportAttachDto) {
System.out.println("sdsdfsd");
return reportService.loadAttachList(reportAttachDto); return reportService.loadAttachList(reportAttachDto);
} }
@RequestMapping("deleteAttach") @RequestMapping("deleteAttach")
public OperationResultDto deleteAttach(Long id){ public OperationResultDto deleteAttach(Long id) {
return reportService.deleteAttach(id); return reportService.deleteAttach(id);
} }
@Autowired
private OrganizationMapper organizationMapper;
@RequestMapping("getOrgLists")
public OperationResultDto getOrgLists() {
OperationResultDto operationResultDto = new OperationResultDto();
OrganizationExample organizationExample = new OrganizationExample();
operationResultDto.setData(organizationMapper.selectByExample(organizationExample));
return operationResultDto;
}
@RequestMapping(value = "getReportByTemplateEbit/{templateId}/{period}/{orgId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<PeriodReportDto> getReportByTemplateEbit(@PathVariable String templateId, @PathVariable Integer period, @PathVariable String orgId) {
OperationResultDto resultDto = new OperationResultDto();
if (templateId == null || period == null || period == 0) {
resultDto.setResult(false);
resultDto.setResultMsg("templateId or period is invalid");
return resultDto;
}
return reportService.getReportByTemplateEbit(Long.parseLong(templateId), period % 100, getProjId(orgId, period));
}
/**
*批量导出利润表
*/
@RequestMapping("manyExport")
public OperationResultDto manyExport(@RequestBody RequestParameterDto requestParameterDto){
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto.setResult(null);
return operationResultDto;
}
} }
\ No newline at end of file
...@@ -108,6 +108,7 @@ public class TaxDocumentController { ...@@ -108,6 +108,7 @@ public class TaxDocumentController {
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1")); response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
OutputStream ouputStream = response.getOutputStream(); OutputStream ouputStream = response.getOutputStream();
ExcelUtil.exportExcel(headers, TaxDocument, ouputStream); ExcelUtil.exportExcel(headers, TaxDocument, ouputStream);
ouputStream.close();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -19,11 +19,14 @@ import pwc.taxtech.atms.common.util.MyAsserts; ...@@ -19,11 +19,14 @@ import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.EnumAnalysisImportType; import pwc.taxtech.atms.constant.enums.EnumAnalysisImportType;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.constant.enums.EnumImportType; import pwc.taxtech.atms.constant.enums.EnumImportType;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dpo.TemplateUniqDto; import pwc.taxtech.atms.dpo.TemplateUniqDto;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto; import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.entity.Template; import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.exception.BadParameterException; import pwc.taxtech.atms.exception.BadParameterException;
...@@ -184,16 +187,110 @@ public class TemplateController extends BaseController { ...@@ -184,16 +187,110 @@ public class TemplateController extends BaseController {
} }
} }
@Autowired
private ProjectMapper projectMapper;
private String getProjId(String orgId, Integer tmsPeriod) {
ProjectExample pExample = new ProjectExample();
pExample.createCriteria().andOrganizationIdEqualTo(orgId).andYearEqualTo(tmsPeriod/100);
List<Project> pList = projectMapper.selectByExample(pExample);
if(!pList.isEmpty()){
return pList.get(0).getId();
}
return "";
}
@RequestMapping(value = "getPeriodTemplateJson", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) @RequestMapping(value = "getPeriodTemplateJson", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public @ResponseBody public @ResponseBody
void getPeriodTemplateBlob(@RequestParam(name = "templateId") Long templateId, void getPeriodTemplateBlob(@RequestParam(name = "templateId") Long templateId,
@RequestParam(name = "period") Integer period, @RequestParam(name = "period", required = false) Integer period,
@RequestParam(name = "projectId") String projectId, @RequestParam(name = "projectId", required = false) String projectId,
HttpServletResponse response) throws URISyntaxException { HttpServletResponse response) throws URISyntaxException {
String filePath;
File templateFile;
InputStream inputStream = null;
List<PeriodTemplate> templates = null;
if(period == null || projectId == null){
templates = templateService.getTemplates(templateId);
}else{
templates = templateService.getPeriodTemplates(templateId,period,projectId);
}
MyAsserts.assertNotEmpty(templates, new NotFoundException());
PeriodTemplate template = templates.get(0);
String templatePath = template.getPath();
MyAsserts.assertNotEmpty(templatePath, new NotFoundException());
filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
templateFile = new File(tempPath + templatePath);
OutputStream out = null;
try {
//如果是系统报表就取本地文件夹,如果不是就取FTP
if (template.getIsSystemType()) {
inputStream = new BufferedInputStream(new FileInputStream(templateFile));
} else {
if (templatePath.indexOf("/") <= 0) {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(templatePath));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
templatePath = uploadDetail.getList().get(0).getViewHttpUrl();
}
}
inputStream = httpFileService.getUserTemplate(templatePath);
}
//客户端保存的文件名
String customFileName = "template_" + DateTime.now().toString("yyyyMMddHHmmss") + ".xlsx";
response.setHeader("Content-Disposition", String.format("inline; filename=\"" + customFileName + "\""));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// int len = 0;
// byte[] buffer = new byte[1024];
// out = response.getOutputStream();
// while ((len = inputStream.read(buffer)) > 0) {
// out.write(buffer, 0, len);
// }
out = response.getOutputStream();
IOUtils.copy(handleFomularView(inputStream), out);
out.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
logger.error("Error downloading template file template.xlsx", e);
throw new ApplicationException("Error downloading template file template.xlsx", e);
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
out = null;
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
inputStream = null;
}
}
}
@RequestMapping(value = "getPeriodTemplateJsonOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public @ResponseBody
void getPeriodTemplateJsonOrg(@RequestParam(name = "templateId") Long templateId,
@RequestParam(name = "period") Integer period,
@RequestParam(name = "orgId") String orgId,
HttpServletResponse response) throws URISyntaxException {
String projectId = null;
if(orgId != null)
projectId = getProjId(orgId, period);
projectId = "1942295d-6fe6-4aa7-b2e7-b66a5772697c";
String filePath; String filePath;
File templateFile; File templateFile;
InputStream inputStream = null; InputStream inputStream = null;
period = 0;
List<PeriodTemplate> templates = templateService.getPeriodTemplates(templateId,period,projectId); List<PeriodTemplate> templates = templateService.getPeriodTemplates(templateId,period,projectId);
MyAsserts.assertNotEmpty(templates, new NotFoundException()); MyAsserts.assertNotEmpty(templates, new NotFoundException());
PeriodTemplate template = templates.get(0); PeriodTemplate template = templates.get(0);
......
...@@ -141,6 +141,24 @@ public class TemplateGroupController { ...@@ -141,6 +141,24 @@ public class TemplateGroupController {
return OperationResultDto.error(ErrorMessage.SystemError); return OperationResultDto.error(ErrorMessage.SystemError);
} }
@ResponseBody
@RequestMapping(value = "ebitTemplateImport", method = RequestMethod.POST)
public OperationResultDto ebitTemplateImport(@RequestParam("file") MultipartFile file,
@RequestParam("orgId") String orgId,
@RequestParam("period") Integer period) {
try {
templateGroupService.ebitTemplateImport(file, orgId,period);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("ebitTemplateImport error.", e);
}
return OperationResultDto.error(ErrorMessage.SystemError);
}
@ResponseBody @ResponseBody
// @ApiOperation(value = "模板另存为") // @ApiOperation(value = "模板另存为")
@RequestMapping(value = "addTemplateGroup", method = RequestMethod.POST) @RequestMapping(value = "addTemplateGroup", method = RequestMethod.POST)
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.vat.entity.EbitCellData;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table TAX_ADMIN.PERIOD_REPORT
*
* @mbg.generated do_not_delete_during_merge
*/
public class PeriodReportDto implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.ID
*
* @mbg.generated
*/
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private List<EbitCellData> cellDataList;
public List<EbitCellData> getCellDataList() {
return cellDataList;
}
public void setCellDataList(List<EbitCellData> cellDataList) {
this.cellDataList = cellDataList;
}
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
private Long templateId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.PERIOD
*
* @mbg.generated
*/
private Integer period;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.PROJECT_ID
*
* @mbg.generated
*/
private String projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.CREATE_BY
*
* @mbg.generated
*/
private String createBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.CREATE_TIME
*
* @mbg.generated
*/
private Date createTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.UPDATE_BY
*
* @mbg.generated
*/
private String updateBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_REPORT.UPDATE_TIME
*
* @mbg.generated
*/
private Date updateTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_ADMIN.PERIOD_REPORT
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_REPORT.ID
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.ID
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_REPORT.ID
*
* @param id the value for TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.TEMPLATE_ID
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
public Long getTemplateId() {
return templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_REPORT.TEMPLATE_ID
*
* @param templateId the value for TAX_ADMIN.PERIOD_REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_REPORT.PERIOD
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.PERIOD
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_REPORT.PERIOD
*
* @param period the value for TAX_ADMIN.PERIOD_REPORT.PERIOD
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_REPORT.PROJECT_ID
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.PROJECT_ID
*
* @param projectId the value for TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.CREATE_BY
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.CREATE_BY
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_REPORT.CREATE_BY
*
* @param createBy the value for TAX_ADMIN.PERIOD_REPORT.CREATE_BY
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_REPORT.CREATE_TIME
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.CREATE_TIME
*
* @param createTime the value for TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.UPDATE_BY
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.UPDATE_BY
*
* @mbg.generated
*/
public String getUpdateBy() {
return updateBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_REPORT.UPDATE_BY
*
* @param updateBy the value for TAX_ADMIN.PERIOD_REPORT.UPDATE_BY
*
* @mbg.generated
*/
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_REPORT.UPDATE_TIME
*
* @return the value of TAX_ADMIN.PERIOD_REPORT.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 TAX_ADMIN.PERIOD_REPORT.UPDATE_TIME
*
* @param updateTime the value for TAX_ADMIN.PERIOD_REPORT.UPDATE_TIME
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_REPORT
*
* @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(", templateId=").append(templateId);
sb.append(", period=").append(period);
sb.append(", projectId=").append(projectId);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.dto;
import java.io.Serializable;
/**
* @ClassName RequestParameterDto
* Description TODO
* @Author pwc kevin
* @Date 3/27/2019 6:38 PM
* Version 1.0
* 请求参数封装
**/
public class RequestParameterDto implements Serializable {
private String reportId;
private String orgId;
private Integer period;
private String templateId;
private String projectId;
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
@Override
public String toString() {
return "RequestParameterDto{" +
"reportId='" + reportId + '\'' +
", orgId='" + orgId + '\'' +
", period=" + period +
", templateId='" + templateId + '\'' +
", projectId='" + projectId + '\'' +
'}';
}
}
...@@ -13,18 +13,21 @@ import java.util.Map; ...@@ -13,18 +13,21 @@ import java.util.Map;
public class TableRule { public class TableRule {
public static Map<String, String> map = new HashMap<String, String>(); public static Map<String, String> map = new HashMap<String, String>();
static { static {
map.put("EBSZCFZB", "balance_sheet"); map.put("EBSZCFZB", "balance_sheet_prc");
map.put("EBSLRB", "profit_loss_statement"); map.put("EBSLRB", "profit_loss_statement_prc");
map.put("EBSXJLLB", "cash_flow"); map.put("EBSXJLLB", "cash_flow");
map.put("RGDRZCFZB", "balance_sheet_manual"); map.put("RGDRZCFZB", "balance_sheet_prc_manual");
map.put("RGDRLRB", "profit_loss_statement_manual"); map.put("RGDRLRB", "profit_loss_statement_prc_manual");
map.put("RGDRXJLLB", "cash_flow_manual"); map.put("RGDRXJLLB", "cash_flow_manual");
map.put("HZXXB", "red_letter_info_table");
map.put("ZXZCFZB", "balance_sheet_final"); map.put("ZXZCFZB", "balance_sheet_final");
map.put("ZXLLB", "profit_loss_statement_final"); map.put("ZXLLB", "profit_loss_statement_final");
map.put("ZXXJLLB", "cash_flow_final"); map.put("ZXXJLLB", "cash_flow_final");
map.put("HZXXB", "red_letter_info_table");
map.put("CITZCFZB", "cit_balance_sheet_prc_adjust"); map.put("CITZCFZB", "cit_balance_sheet_prc_adjust");
map.put("CITLRB", "cit_profit_prc_adjust"); map.put("CITLRB", "cit_profit_prc_adjust");
map.put("CIT_TBAM", "cit_tbam"); map.put("CIT_TBAM", "cit_tbam");
......
...@@ -23,6 +23,17 @@ public class DidiFileIUploadParam implements Serializable { ...@@ -23,6 +23,17 @@ public class DidiFileIUploadParam implements Serializable {
private List<Integer> uploadYears; private List<Integer> uploadYears;
//是否转换url为本地url
private boolean isParseUrl = true;
public boolean isParseUrl() {
return isParseUrl;
}
public void setParseUrl(boolean parseUrl) {
isParseUrl = parseUrl;
}
public List<String> getBizSources() { public List<String> getBizSources() {
return bizSources; return bizSources;
} }
......
package pwc.taxtech.atms.dto.vatdto;
import java.math.BigDecimal;
/**
* @ClassName EbitDataDto
* Description TODO
* @Author pwc kevin
* @Date 3/26/2019 11:00 AM
* Version 1.0
**/
public class EbitDataDto {
private BigDecimal ebitSubtraction; // 1. EBIT(考虑资产减值损失)
private BigDecimal specialFactors; //考虑特殊因素
private double ebitRate;// ebit比率 默认1%(可更改)
private BigDecimal transactionAmount; //关联交易金额
private String sixAddTax; //6%增值税
private BigDecimal totalAmountTax;// 价税合计金额
private String specialConsiderations;//特殊因素考虑
public String getSpecialConsiderations() {
return specialConsiderations;
}
public void setSpecialConsiderations(String specialConsiderations) {
this.specialConsiderations = specialConsiderations;
}
public BigDecimal getEbitSubtraction() {
return ebitSubtraction;
}
public void setEbitSubtraction(BigDecimal ebitSubtraction) {
this.ebitSubtraction = ebitSubtraction;
}
public BigDecimal getSpecialFactors() {
return specialFactors;
}
public void setSpecialFactors(BigDecimal specialFactors) {
this.specialFactors = specialFactors;
}
public double getEbitRate() {
return ebitRate;
}
public void setEbitRate(double ebitRate) {
this.ebitRate = ebitRate;
}
public BigDecimal getTransactionAmount() {
return transactionAmount;
}
public void setTransactionAmount(BigDecimal transactionAmount) {
this.transactionAmount = transactionAmount;
}
public String getSixAddTax() {
return sixAddTax;
}
public void setSixAddTax(String sixAddTax) {
this.sixAddTax = sixAddTax;
}
public BigDecimal getTotalAmountTax() {
return totalAmountTax;
}
public void setTotalAmountTax(BigDecimal totalAmountTax) {
this.totalAmountTax = totalAmountTax;
}
@Override
public String toString() {
return "EbitDataDto{" +
"ebitSubtraction=" + ebitSubtraction +
", specialFactors=" + specialFactors +
", ebitRate='" + ebitRate + '\'' +
", transactionAmount=" + transactionAmount +
", sixAddTax='" + sixAddTax + '\'' +
", totalAmountTax=" + totalAmountTax +
'}';
}
}
...@@ -8,6 +8,15 @@ public class ReportDataDto { ...@@ -8,6 +8,15 @@ public class ReportDataDto {
private List<CellDataDto> cellData; private List<CellDataDto> cellData;
private List<PeriodFormulaBlock> formulaBlocks; private List<PeriodFormulaBlock> formulaBlocks;
private List<DataSourceDtoExtend> manualDataSources; private List<DataSourceDtoExtend> manualDataSources;
private EbitDataDto ebitData;
public EbitDataDto getEbitData() {
return ebitData;
}
public void setEbitData(EbitDataDto ebitData) {
this.ebitData = ebitData;
}
public List<CellDataDto> getCellData() { public List<CellDataDto> getCellData() {
return this.cellData; return this.cellData;
......
...@@ -23,4 +23,5 @@ public class Exceptions { ...@@ -23,4 +23,5 @@ public class Exceptions {
public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty"); public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty");
public static final ApiException NOT_FOUND_INSTANCE_EXCEPTION = new NotFoundException("not found instance"); public static final ApiException NOT_FOUND_INSTANCE_EXCEPTION = new NotFoundException("not found instance");
public static final FormulaException parameterError = new FormulaException("formula parameter is error"); public static final FormulaException parameterError = new FormulaException("formula parameter is error");
public static final FormulaException IMPORT_TEMPLATE_HEADER_ERROR = new FormulaException("导入模板不匹配");
} }
...@@ -1881,11 +1881,12 @@ public class DataImportService extends BaseService { ...@@ -1881,11 +1881,12 @@ public class DataImportService extends BaseService {
String effectiveDateTo = param.getEffectiveDateTo(); String effectiveDateTo = param.getEffectiveDateTo();
List<Future> resList = Lists.newArrayList(); List<Future> resList = Lists.newArrayList();
List<Integer> dataTypes = param.getDataTypes(); List<Integer> dataTypes = param.getDataTypes();
String operator = authUserHelper.getCurrentAuditor().get();
dataTypes.forEach(type -> { dataTypes.forEach(type -> {
orgs.forEach(o -> { orgs.forEach(o -> {
try { try {
Callable callEbs = new CallEbsThread(type, o,ebsCallUrl,dataImportLogMapper,authUserHelper, Callable callEbs = new CallEbsThread(type, o,ebsCallUrl,dataImportLogMapper,authUserHelper,
idService,dtsTokenService,period, effectiveDateFrom, effectiveDateTo); idService,dtsTokenService,period, effectiveDateFrom, effectiveDateTo, operator);
executorService.submit(callEbs); executorService.submit(callEbs);
// resList.add(future); // resList.add(future);
} catch (RejectedExecutionException rje) { } catch (RejectedExecutionException rje) {
...@@ -2004,10 +2005,11 @@ public class DataImportService extends BaseService { ...@@ -2004,10 +2005,11 @@ public class DataImportService extends BaseService {
private String effectiveDateFrom; private String effectiveDateFrom;
private String effectiveDateTo; private String effectiveDateTo;
private String operator;
CallEbsThread(int type, Organization org, String ebsCallUrl, DataImportLogMapper dataImportLogMapper, CallEbsThread(int type, Organization org, String ebsCallUrl, DataImportLogMapper dataImportLogMapper,
AuthUserHelper authUserHelper, DistributedIdService idService, DtsTokenService dtsTokenService, AuthUserHelper authUserHelper, DistributedIdService idService, DtsTokenService dtsTokenService,
String period,String effectiveDateFrom, String effectiveDateTo) { String period,String effectiveDateFrom, String effectiveDateTo, String operator) {
this.type = type; this.type = type;
this.org = org; this.org = org;
this.period = period; this.period = period;
...@@ -2018,6 +2020,7 @@ public class DataImportService extends BaseService { ...@@ -2018,6 +2020,7 @@ public class DataImportService extends BaseService {
this.dataImportLogMapper = dataImportLogMapper; this.dataImportLogMapper = dataImportLogMapper;
this.effectiveDateFrom = effectiveDateFrom; this.effectiveDateFrom = effectiveDateFrom;
this.effectiveDateTo = effectiveDateTo; this.effectiveDateTo = effectiveDateTo;
this.operator = operator;
} }
@Override @Override
...@@ -2038,7 +2041,7 @@ public class DataImportService extends BaseService { ...@@ -2038,7 +2041,7 @@ public class DataImportService extends BaseService {
log.setType(EnumImportType.ExtractFinancialData.getCode()); log.setType(EnumImportType.ExtractFinancialData.getCode());
log.setFileType(EnumEbsExtractType.getNameByCode(type)); log.setFileType(EnumEbsExtractType.getNameByCode(type));
log.setPeriodStatus("EBS抽取"); log.setPeriodStatus("EBS抽取");
log.setOperator(authUserHelper.getCurrentAuditor().get()); log.setOperator(operator);
try { try {
if (StringUtils.isEmpty(org.getEnterpriseAccountCode())) { if (StringUtils.isEmpty(org.getEnterpriseAccountCode())) {
log.setId(idService.nextId()); log.setId(idService.nextId());
......
...@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Auther: Gary J Li * @Auther: Gary J Li
...@@ -98,7 +99,7 @@ public class DataPreviewSerivceImpl extends BaseService { ...@@ -98,7 +99,7 @@ public class DataPreviewSerivceImpl extends BaseService {
ProfitLossStatementCondition condition = beanUtil.copyProperties(param, new ProfitLossStatementCondition()); ProfitLossStatementCondition condition = beanUtil.copyProperties(param, new ProfitLossStatementCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize()); Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<ProfitLossStatement> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition); List<ProfitLossStatementPrc> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition);
List<ProfitLossStatementDto> profitLossDtos = Lists.newArrayList(); List<ProfitLossStatementDto> profitLossDtos = Lists.newArrayList();
profitLossStatements.forEach(pl -> { profitLossStatements.forEach(pl -> {
...@@ -196,10 +197,10 @@ public class DataPreviewSerivceImpl extends BaseService { ...@@ -196,10 +197,10 @@ public class DataPreviewSerivceImpl extends BaseService {
BalanceSheetCondition condition = beanUtil.copyProperties(param, new BalanceSheetCondition()); BalanceSheetCondition condition = beanUtil.copyProperties(param, new BalanceSheetCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize()); Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<BalanceSheet> balanceSheets = balanceSheetPrcMapper.selectByCondition(condition); List<BalanceSheetPrc> bsPrcList = balanceSheetPrcMapper.selectByCondition(condition);
List<BalanceSheetDto> balanceSheetDtos = Lists.newArrayList(); List<BalanceSheetDto> balanceSheetDtos = Lists.newArrayList();
balanceSheets.forEach(bs -> { bsPrcList.forEach(bs -> {
BalanceSheetDto balanceSheetDto = new BalanceSheetDto(); BalanceSheetDto balanceSheetDto = new BalanceSheetDto();
beanUtil.copyProperties(bs, balanceSheetDto); beanUtil.copyProperties(bs, balanceSheetDto);
balanceSheetDtos.add(balanceSheetDto); balanceSheetDtos.add(balanceSheetDto);
...@@ -343,7 +344,7 @@ public class DataPreviewSerivceImpl extends BaseService { ...@@ -343,7 +344,7 @@ public class DataPreviewSerivceImpl extends BaseService {
ProfitLossStatementCondition condition = new ProfitLossStatementCondition(); ProfitLossStatementCondition condition = new ProfitLossStatementCondition();
beanUtil.copyProperties(param, condition); beanUtil.copyProperties(param, condition);
List<ProfitLossStatement> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition); List<ProfitLossStatementPrc> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition);
Map<String, String> header = generalPLHeader(); Map<String, String> header = generalPLHeader();
List<ProfitLossStatementExportDto> cellList = new ArrayList<>(); List<ProfitLossStatementExportDto> cellList = new ArrayList<>();
profitLossStatements.forEach(pl -> { profitLossStatements.forEach(pl -> {
...@@ -384,7 +385,7 @@ public class DataPreviewSerivceImpl extends BaseService { ...@@ -384,7 +385,7 @@ public class DataPreviewSerivceImpl extends BaseService {
try { try {
BalanceSheetCondition condition = new BalanceSheetCondition(); BalanceSheetCondition condition = new BalanceSheetCondition();
beanUtil.copyProperties(param, condition); beanUtil.copyProperties(param, condition);
List<BalanceSheet> balanceSheets = balanceSheetPrcMapper.selectByCondition(condition); List<BalanceSheetPrc> balanceSheets = balanceSheetPrcMapper.selectByCondition(condition);
Map<String, String> header = generalBSHeader(); Map<String, String> header = generalBSHeader();
List<BalanceSheetExportDto> cellList = new ArrayList<>(); List<BalanceSheetExportDto> cellList = new ArrayList<>();
balanceSheets.forEach(bs -> { balanceSheets.forEach(bs -> {
......
...@@ -35,6 +35,7 @@ import pwc.taxtech.atms.vat.entity.FileUploadLog; ...@@ -35,6 +35,7 @@ import pwc.taxtech.atms.vat.entity.FileUploadLog;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
...@@ -74,6 +75,10 @@ public class DidiFileUploadService extends BaseService { ...@@ -74,6 +75,10 @@ public class DidiFileUploadService extends BaseService {
private static final String PROXY_PORT = "11007"; private static final String PROXY_PORT = "11007";
public FileUpload getFileUpload(String uid){
return fileUploadMapper.selectByPrimaryKey(uid);
}
public FileUpload uploadFile(MultipartFile file, String fileName, String bizSource) throws ServiceException { public FileUpload uploadFile(MultipartFile file, String fileName, String bizSource) throws ServiceException {
CloseableHttpClient httpClient = null; CloseableHttpClient httpClient = null;
String requestKey = CommonUtils.getUUID(); String requestKey = CommonUtils.getUUID();
...@@ -86,7 +91,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -86,7 +91,7 @@ public class DidiFileUploadService extends BaseService {
httpClient = HttpClients.createDefault(); httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl); HttpPost httpPost = new HttpPost(requestUrl);
String md5Str = getFileMD5String(file); String md5Str = getFileMD5String(file);
ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName) ? file.getOriginalFilename() : fileName); ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName) ? URLEncoder.encode(file.getOriginalFilename(), "UTF-8") : URLEncoder.encode(fileName, "UTF-8"));
StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain")); StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build(); HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build();
httpPost.setEntity(httpEntity); httpPost.setEntity(httpEntity);
...@@ -134,7 +139,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -134,7 +139,7 @@ public class DidiFileUploadService extends BaseService {
try { try {
httpClient = HttpClients.createDefault(); httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl); HttpPost httpPost = new HttpPost(requestUrl);
ByteArrayBody byteBody = new ByteArrayBody(bytes, ContentType.MULTIPART_FORM_DATA, fileName); ByteArrayBody byteBody = new ByteArrayBody(bytes, ContentType.MULTIPART_FORM_DATA, URLEncoder.encode(fileName, "UTF-8"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).build(); HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).build();
httpPost.setEntity(httpEntity); httpPost.setEntity(httpEntity);
HttpResponse httpResponse = httpClient.execute(httpPost); HttpResponse httpResponse = httpClient.execute(httpPost);
...@@ -192,6 +197,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -192,6 +197,7 @@ public class DidiFileUploadService extends BaseService {
} }
public PageInfo<DidiFileUploadDetailResult> queryPage(DidiFileIUploadParam param) { public PageInfo<DidiFileUploadDetailResult> queryPage(DidiFileIUploadParam param) {
Page page = null; Page page = null;
if (param.getPageInfo() != null && param.getPageInfo().getPageSize() != null && param.getPageInfo().getPageIndex() != null) { if (param.getPageInfo() != null && param.getPageInfo().getPageSize() != null && param.getPageInfo().getPageIndex() != null) {
...@@ -219,7 +225,11 @@ public class DidiFileUploadService extends BaseService { ...@@ -219,7 +225,11 @@ public class DidiFileUploadService extends BaseService {
} }
refreshViewUrl(param); refreshViewUrl(param);
PageInfo<DidiFileUploadDetailResult> pageInfo = new PageInfo<>(fileUploadMapper.selectByExample(example).stream() PageInfo<DidiFileUploadDetailResult> pageInfo = new PageInfo<>(fileUploadMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DidiFileUploadDetailResult())).collect(Collectors.toList())); .map(o -> {
DidiFileUploadDetailResult item = new DidiFileUploadDetailResult();
beanUtil.copyProperties(o, item);
return item;
}).collect(Collectors.toList()));
if (page != null) { if (page != null) {
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
} }
......
...@@ -352,15 +352,18 @@ public class TaxDocumentServiceImpl { ...@@ -352,15 +352,18 @@ public class TaxDocumentServiceImpl {
TaxDocumentExample.Criteria criteria = example.createCriteria(); TaxDocumentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(ids); criteria.andIdIn(ids);
TaxDocument taxDocument = taxDocumentMapper.selectByExample(example).get(0); TaxDocument taxDocument = taxDocumentMapper.selectByExample(example).get(0);
String urlPath = taxDocument.getFilePositionUrl(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(taxDocument.getFileUploadId()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
String urlPath = uploadDetail.getList().get(0).getViewHttpUrl();
//如果url为null或空字符串而抛出异常 //如果url为null或空字符串而抛出异常
if (StringUtils.isBlank(urlPath)) { if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + taxDocument.getId()); throw new RuntimeException("文件url为空,id为:" + taxDocument.getId());
} }
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同 //文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(taxDocument.getFileName()) String fileName = StringUtils.isBlank(uploadDetail.getList().get(0).getFileName())
? "未知文件(请修改后缀名).xlsx" ? "未知文件(请修改后缀名).xlsx"
: taxDocument.getFileOriginalName();//设置输出流信息 : uploadDetail.getList().get(0).getFileName();//设置输出流信息
try { try {
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
...@@ -476,15 +479,20 @@ public class TaxDocumentServiceImpl { ...@@ -476,15 +479,20 @@ public class TaxDocumentServiceImpl {
criteria.andIdIn(ids); criteria.andIdIn(ids);
//查询出根据条件过滤后需要下载的附件数据信息 //查询出根据条件过滤后需要下载的附件数据信息
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example); List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(taxDocuments.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
//新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n) //新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n)
List<String> fileNameList = new ArrayList<>(); List<String> fileNameList = new ArrayList<>();
for (TaxDocument item : taxDocuments) { for (DidiFileUploadDetailResult item : uploadDetail.getList()) {
//文件url //文件url
String urlPath = item.getFilePositionUrl(); String urlPath = item.getViewHttpUrl();
//如果url为null或空字符串而抛出异常 // //如果url为null或空字符串而抛出异常
if (StringUtils.isBlank(urlPath)) { // if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId()); // throw new RuntimeException("文件url为空,id为:" + item.getId());
} // }
//检查文件名是否有重复 //检查文件名是否有重复
int fileNameRepeatTimes = 0; int fileNameRepeatTimes = 0;
if (fileNameList.size()>0){ if (fileNameList.size()>0){
......
...@@ -123,6 +123,12 @@ public class TemplateServiceImpl extends AbstractService { ...@@ -123,6 +123,12 @@ public class TemplateServiceImpl extends AbstractService {
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(period); example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(period);
return periodTemplateMapper.selectByExample(example); return periodTemplateMapper.selectByExample(example);
} }
public List<PeriodTemplate> getTemplates(Long templateId){
PeriodTemplateExample example = new PeriodTemplateExample();
example.createCriteria().andTemplateIdEqualTo(templateId);
return periodTemplateMapper.selectByExample(example);
}
public String getTemplatePath(Long templateId) { public String getTemplatePath(Long templateId) {
String result = ""; String result = "";
......
...@@ -771,4 +771,12 @@ public class ExcelUtil { ...@@ -771,4 +771,12 @@ public class ExcelUtil {
} }
} }
//验证表头
public static void checkHeader (Sheet sheet, String[] headerArr, Exception exception) throws Exception {
for(int i =0; i< headerArr.length; i++){
if(!(headerArr[i].trim().equals(sheet.getRow(0).getCell(i).toString().trim()))){
throw exception;
}
}
}
} }
...@@ -6,12 +6,9 @@ import org.springframework.stereotype.Service; ...@@ -6,12 +6,9 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.invoice.InputInvoiceMapper; import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.vat.entity.InputInvoice; import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.entity.InputInvoiceExample; import pwc.taxtech.atms.vat.entity.InputInvoiceExample;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class InputInvoiceDao { public class InputInvoiceDao {
...@@ -25,16 +22,19 @@ public class InputInvoiceDao { ...@@ -25,16 +22,19 @@ public class InputInvoiceDao {
if (period != null) { if (period != null) {
Calendar date = Calendar.getInstance(); Calendar date = Calendar.getInstance();
String year = String.valueOf(date.get(Calendar.YEAR)); String year = String.valueOf(date.get(Calendar.YEAR));
//认证期间
criteria.andRZSQEqualTo(year + (period > 9 ? period.toString() : "0" + period.toString())); criteria.andRZSQEqualTo(year + (period > 9 ? period.toString() : "0" + period.toString()));
} }
if (invoiceType != null) { if (invoiceType != null) {
//发票类型
criteria.andFPLXEqualTo(String.valueOf(invoiceType)); criteria.andFPLXEqualTo(String.valueOf(invoiceType));
// criteria1.andFPLXEqualTo(String.valueOf(invoiceType)); // criteria1.andFPLXEqualTo(String.valueOf(invoiceType));
} }
if (StringUtils.isNotBlank(notPass)) { if (StringUtils.isNotBlank(notPass)) {
String unPass = "2"; String unPass = "2";
//认证结果
criteria.andRZJGEqualTo(unPass); criteria.andRZJGEqualTo(unPass);
// criteria1.andRZJGEqualTo(unPass); // criteria1.andRZJGEqualTo(unPass);
} else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) { } else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) {
...@@ -43,6 +43,7 @@ public class InputInvoiceDao { ...@@ -43,6 +43,7 @@ public class InputInvoiceDao {
// criteria1.andRZJGEqualTo(pass); // criteria1.andRZJGEqualTo(pass);
// example.or(criteria1); // example.or(criteria1);
} }
//发票状态
criteria.andFPZTNotEqualTo("1"); // 过滤作废状态 criteria.andFPZTNotEqualTo("1"); // 过滤作废状态
// List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> { // List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> {
......
...@@ -24,6 +24,7 @@ import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext; ...@@ -24,6 +24,7 @@ import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -151,7 +152,6 @@ public class FormulaAgent { ...@@ -151,7 +152,6 @@ public class FormulaAgent {
} }
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) { public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
/* /*
...@@ -184,11 +184,11 @@ public class FormulaAgent { ...@@ -184,11 +184,11 @@ public class FormulaAgent {
String sql = ""; String sql = "";
//统一判断年度 //统一判断年度
year = formulaContext.getYear() + year; year = formulaContext.getYear() + year;
if(getSql){ if (getSql) {
tableName = tableName.toLowerCase(); tableName = tableName.toLowerCase();
sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue; sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue;
return sql + " and project_id = '" + formulaContext.getProjectId() + "'"; return sql + " and project_id = '" + formulaContext.getProjectId() + "'";
}else{ } else {
sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue; sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
} }
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period)); String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
...@@ -237,8 +237,16 @@ public class FormulaAgent { ...@@ -237,8 +237,16 @@ public class FormulaAgent {
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) { public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
Map<String, Object> stringObjectMap = new HashMap<>();
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext)); try {
stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
if (stringObjectMap.get(getField) != null) {
return new BigDecimal(stringObjectMap.get(getField).toString());
}
} catch (Exception e) {
e.printStackTrace();
return new BigDecimal(0);
}
/* for (int i = 0, j = stringObjectMap.size(); i < j; i++) { /* for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) { if (i == 1) {
if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){ if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
...@@ -256,28 +264,26 @@ public class FormulaAgent { ...@@ -256,28 +264,26 @@ public class FormulaAgent {
} }
} }
*/ */
if(stringObjectMap.get(getField) != null ){
return new BigDecimal(stringObjectMap.get(getField).toString());
}
return new BigDecimal(0); return new BigDecimal(0);
} }
/** /**
* 获取期末余额 * 获取期末余额
* @author zhikai.z.wei *
* @param subjectType * @param subjectType
* @param subjectCode * @param subjectCode
* @param year * @param year
* @param period * @param period
* @param formulaContext * @param formulaContext
* @return * @return
* @author zhikai.z.wei
*/ */
public BigDecimal getQMYE(Integer subjectType, String subjectCode, Integer year, Integer period, FormulaContext formulaContext){ public BigDecimal getQMYE(Integer subjectType, String subjectCode, Integer year, Integer period, FormulaContext formulaContext) {
Project project = projectMapper.selectByPrimaryKey(formulaContext.getProjectId()); Project project = projectMapper.selectByPrimaryKey(formulaContext.getProjectId());
CitTbamExample citTbamExample = new CitTbamExample(); CitTbamExample citTbamExample = new CitTbamExample();
citTbamExample.createCriteria().andAccountCodeEqualTo(subjectCode).andPeriodEqualTo(year+ project.getYear()); citTbamExample.createCriteria().andAccountCodeEqualTo(subjectCode).andPeriodEqualTo(year + project.getYear());
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample); List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
if(citTbams == null || citTbams.isEmpty()){ if (citTbams == null || citTbams.isEmpty()) {
return new BigDecimal(0.0); return new BigDecimal(0.0);
} }
return citTbams.get(0).getEndingBalance(); return citTbams.get(0).getEndingBalance();
......
package pwc.taxtech.atms.vat.service.impl.report.functions; package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval; import org.apache.poi.ss.formula.eval.StringEval;
...@@ -61,21 +62,6 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -61,21 +62,6 @@ public class BB extends FunctionBase implements FreeRefFunction {
BigDecimal cellValue = BigDecimal.ZERO; BigDecimal cellValue = BigDecimal.ZERO;
try { try {
List<CellTemplatePerGroupDto> cellTemplateDataList;
if (curPeriod.getCurYear() != formulaContext.getYear()) {
Project project = agent.getFixedProject(formulaContext.getProjectId(), curPeriod.getCurYear());
MyAsserts.assertNotNull(project, Exceptions.PROJECT_NOT_FOUND);
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
project.getId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
} else {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
nullCellDto.fixedWithGroup(cellTemplateData);
// todo: fix datasource name by templateList(neo)
if (bo.getPeriod().intValue() == 99) { if (bo.getPeriod().intValue() == 99) {
dataSource.clear(); dataSource.clear();
BigDecimal returnEval = defaultBigDecimal; BigDecimal returnEval = defaultBigDecimal;
...@@ -83,7 +69,7 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -83,7 +69,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
return defaultBigDecimal; return defaultBigDecimal;
} }
//如果是当年取到当期截至,往年取12期 //如果是当年取到当期截至,往年取12期
for (int p = 1; p < (curPeriod.getCurYear()==formulaContext.getYear()?formulaContext.getPeriod():12); p++) { for (int p = 1; p <= (curPeriod.getCurYear()==formulaContext.getYear()?formulaContext.getPeriod():12); p++) {
try { try {
returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo)); returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo));
} catch (Exception e) { } catch (Exception e) {
...@@ -92,33 +78,45 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -92,33 +78,45 @@ public class BB extends FunctionBase implements FreeRefFunction {
} }
} }
} }
return returnEval; return returnEval;
} }
List<CellTemplatePerGroupDto> cellTemplateDataList;
if (curPeriod.getCurYear() != formulaContext.getYear()) {
Project project = agent.getFixedProject(formulaContext.getProjectId(), curPeriod.getCurYear());
// MyAsserts.assertNotNull(project, Exceptions.PROJECT_NOT_FOUND);
if(project == null){
return cellValue;
}
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
project.getId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
} else {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
}
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
nullCellDto.fixedWithGroup(cellTemplateData);
//当年当期
if (bo.getPeriod().intValue() == 0 && bo.getYear().intValue() == 0) { if (bo.getPeriod().intValue() == 0 && bo.getYear().intValue() == 0) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode()); int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1, cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1,
Long.parseLong(cellTemplateData.getCellTemplateId())); Long.parseLong(cellTemplateData.getCellTemplateId()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData); nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue); nullCellDto.setAmount(cellValue);
return cellValue; return cellValue;
} }
PeriodCellData cellData = null; PeriodCellData cellData = null;
String projectId = agent.getPastProjectId(curPeriod.getCurYear(), String projectId = agent.getPastProjectId(curPeriod.getCurYear(),
formulaContext.getOrganizationId()); formulaContext.getOrganizationId());
MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY); MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY);
cellData = agent.getCellData(cellTemplateData.getReportTemplateId(), cellData = agent.getCellData(cellTemplateData.getReportTemplateId(),
cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod(), formulaContext.getProjectId()); cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod(), formulaContext.getProjectId());
List<PeriodDataSource> dss = agent.queryManualDataSource(Long.parseLong(cellTemplateData.getCellTemplateId()), List<PeriodDataSource> dss = agent.queryManualDataSource(Long.parseLong(cellTemplateData.getCellTemplateId()),
formulaContext.getProjectId(), bo.getPeriod()); formulaContext.getProjectId(), bo.getPeriod());
nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData); nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData);
if (cellData.getData() == null && !dss.isEmpty()) { if (cellData.getData() == null && !dss.isEmpty()) {
cellValue = dss.get(0).getAmount(); cellValue = dss.get(0).getAmount();
} else if (cellData.getData() != null && dss.isEmpty()) { } else if (cellData.getData() != null && dss.isEmpty()) {
...@@ -128,14 +126,12 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -128,14 +126,12 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue = dss.get(0).getAmount().add(new BigDecimal(cellData.getData()).setScale(4, cellValue = dss.get(0).getAmount().add(new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN)); BigDecimal.ROUND_HALF_DOWN));
} else throw Exceptions.BB_CELL_DATA_NULL; } else throw Exceptions.BB_CELL_DATA_NULL;
nullCellDto.setAmount(cellValue); nullCellDto.setAmount(cellValue);
if (rootBo != null) { if (rootBo != null) {
rootBo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId())); rootBo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId()));
} else { } else {
bo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId())); bo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId()));
} }
LOGGER.debug("cell static value "); LOGGER.debug("cell static value ");
return cellValue; return cellValue;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -251,9 +251,11 @@ public class FunctionBase { ...@@ -251,9 +251,11 @@ public class FunctionBase {
return bigDecimal; return bigDecimal;
} }
} catch (Exception e) { } catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace(); e.printStackTrace();
if (!dss.isEmpty()){
return dss.get(0).getAmount();}
else {return new BigDecimal(0);}
} }
}else{ }else{
try { try {
...@@ -264,9 +266,10 @@ public class FunctionBase { ...@@ -264,9 +266,10 @@ public class FunctionBase {
return bigDecimal; return bigDecimal;
} }
} catch (Exception e) { } catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace(); e.printStackTrace();
if (!dss.isEmpty()){
return dss.get(0).getAmount();}
else {return new BigDecimal(0);}
} }
} }
......
...@@ -4,24 +4,19 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; ...@@ -4,24 +4,19 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType; import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto; import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.entity.InputInvoice; import pwc.taxtech.atms.vat.entity.CertifiedInvoicesList;
import pwc.taxtech.atms.vat.entity.CertifiedInvoicesListExample;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/// <summary> /// <summary>
...@@ -84,24 +79,24 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -84,24 +79,24 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
calendar.add(Calendar.YEAR, 1); calendar.add(Calendar.YEAR, 1);
Date endDate = calendar.getTime(); Date endDate = calendar.getTime();
List<InputInvoice> inputInvoices; List<CertifiedInvoicesList> inputInvoices;
if (authenticationType == 1 && formulaContext.getIsYear()) { if (authenticationType == 1 && formulaContext.getIsYear()) {
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType, inputInvoices = getInvoice(null, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} else if (authenticationType == 1) { } else if (authenticationType == 1) {
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, inputInvoices =getInvoice(period, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 2 && formulaContext.getIsYear()) { else if (authenticationType == 2 && formulaContext.getIsYear()) {
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType, inputInvoices = getInvoice(null, invoiceType,
null, null, Constant.InputInvoiceCertificationResult.NotPass); null, null, Constant.InputInvoiceCertificationResult.NotPass);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 0 || authenticationType == 2) { else if (authenticationType == 0 || authenticationType == 2) {
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null, inputInvoices =getInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass); null, Constant.InputInvoiceCertificationResult.NotPass);
} else { } else {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
...@@ -118,7 +113,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -118,7 +113,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
endDate = calendar.getTime(); endDate = calendar.getTime();
Date finalEndDate = endDate; Date finalEndDate = endDate;
inputInvoices = inputInvoices.stream() inputInvoices = inputInvoices.stream()
.filter(a -> DateUtils.strToDate(a.getRZSJ()).before(finalEndDate)) .filter(a -> a.getCertifiedDate().before(finalEndDate))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else if (certificationPeriod != 99) { } else if (certificationPeriod != 99) {
calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1); calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1);
...@@ -129,26 +124,26 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -129,26 +124,26 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
Date finalEndDate1 = endDate; Date finalEndDate1 = endDate;
Date finalStartDate = startDate; Date finalStartDate = startDate;
inputInvoices = inputInvoices.stream() inputInvoices = inputInvoices.stream()
.filter(a -> strToDate(a.getRZSQ()).after(finalStartDate) .filter(a -> a.getCertifiedDate().after(finalStartDate)
&& strToDate(a.getRZSQ()).before(finalEndDate1)) && a.getCertifiedDate().before(finalEndDate1))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>(); List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (InputInvoice x : inputInvoices) { for (CertifiedInvoicesList x : inputInvoices) {
InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto(); InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto();
inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(new BigDecimal(x.getHJJE()), KeyValueConfigResultType.Accounting, inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getAmount(), KeyValueConfigResultType.Accounting,
null, formulaContext)); null, formulaContext));
inputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode()); inputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
inputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(new BigDecimal(x.getHJSE()), KeyValueConfigResultType.Accounting, inputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(x.getTaxAmount(), KeyValueConfigResultType.Accounting,
null, formulaContext)); null, formulaContext));
inputInvoiceDataSourceDto.setCertificationDate(DateUtils.strToDate(x.getRZSJ())); inputInvoiceDataSourceDto.setCertificationDate(x.getCertifiedDate());
inputInvoiceDataSourceDto.setInvoiceCode(x.getFPDM()); inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getFPHM()); inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNum());
inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getFPLX())); inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getInvoiceType()));
inputInvoiceDataSourceDto.setPeriod(period); inputInvoiceDataSourceDto.setPeriod(period);
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getXFSH()); inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSalesTaxNum());
inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource); inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
inputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode()); inputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(inputInvoiceDataSourceDto); dataSource.add(inputInvoiceDataSourceDto);
...@@ -199,4 +194,40 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -199,4 +194,40 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
return strtodate; return strtodate;
} }
public List<CertifiedInvoicesList> getInvoice(Integer period, String invoiceType, String checkPass, String scanPass, String notPass) {
CertifiedInvoicesListExample example = new CertifiedInvoicesListExample();
CertifiedInvoicesListExample.Criteria criteria = example.createCriteria();
if (period != null) {
Calendar date = Calendar.getInstance();
String year = String.valueOf(date.get(Calendar.YEAR));
//认证期间
criteria.andPeriodEqualTo(Integer.valueOf(year + (period > 9 ? period.toString() : "0" + period.toString())));
}
if (invoiceType != null) {
//发票类型
criteria.andInvoiceTypeEqualTo(String.valueOf(invoiceType));
// criteria1.andFPLXEqualTo(String.valueOf(invoiceType));
}
// if (StringUtils.isNotBlank(notPass)) {
// String unPass = "2";
// //认证结果
// criteria.andRZJGEqualTo(unPass);
//// criteria1.andRZJGEqualTo(unPass);
// } else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) {
// String pass = "1";
// criteria.andRZJGEqualTo(pass);
//// criteria1.andRZJGEqualTo(pass);
//// example.or(criteria1);
// }
//发票状态
criteria.andInvoiceTypeEqualTo("1"); // 过滤作废状态
// List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> {
// return x.getRZSQ().endsWith("-" + (period.intValue() > 9 ? period.toString() : "0" + period.toString()));
// }).collect(Collectors.toList());
return SpringContextUtil.certifiedInvoicesListMapper.selectByExample(example);
}
} }
...@@ -61,16 +61,17 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -61,16 +61,17 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
@Override @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
parameterCheck(args, ec);
BigDecimal cellValue = BigDecimal.ZERO;
List<Object> dataSource = new ArrayList<>(); List<Object> dataSource = new ArrayList<>();
BigDecimal cellValue = BigDecimal.ZERO;
String filter = null;
String filterValue = null;
try {
parameterCheck(args, ec);
Map map = new HashMap<String, String>(); Map map = new HashMap<String, String>();
ReportCellTableSUMIFDataSourceDto reportCellTableSUMIFDataSourceDto = new ReportCellTableSUMIFDataSourceDto(); ReportCellTableSUMIFDataSourceDto reportCellTableSUMIFDataSourceDto = new ReportCellTableSUMIFDataSourceDto();
reportCellTableSUMIFDataSourceDto.insertData(ec, formulaContext); reportCellTableSUMIFDataSourceDto.insertData(ec, formulaContext);
String filter = null;
String filterValue = null;
dataSource.add(reportCellTableSUMIFDataSourceDto); dataSource.add(reportCellTableSUMIFDataSourceDto);
try {
tableName = resolverString(args, ec, 0); tableName = resolverString(args, ec, 0);
getField = resolverString(args, ec, 1); getField = resolverString(args, ec, 1);
filter= resolverString(args, ec, 2); filter= resolverString(args, ec, 2);
...@@ -95,13 +96,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -95,13 +96,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
cellValue, formulaContext.getPeriod(), cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(), formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(),
formulaContext.getProjectId(), selectShow(tableName), FormulaAgent._buildSql(getField,tableName,filter,filterValue,period,formulaContext,year, boo, true)); formulaContext.getProjectId(), selectShow(tableName), FormulaAgent._buildSql(getField,tableName,filter,filterValue,period,formulaContext,year, boo, true));
} catch (Exception e) {
e.printStackTrace();
}
try {
saveFormulaBlock(formulaContext.getPeriod(), ec, saveFormulaBlock(formulaContext.getPeriod(), ec,
new RSUMIFParasBo().getExpression(args, ec), cellValue, dataSourceId, formulaContext.getProjectId()); new RSUMIFParasBo().getExpression(args, ec), cellValue, dataSourceId, formulaContext.getProjectId());
} catch (EvaluationException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
......
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java"> <javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java">
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" /> <property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator> </javaClientGenerator>
<table tableName="invoice_record" domainObjectName="InvoiceRecord"> <!--<table tableName="ebit_cell_data" domainObjectName="EbitCellData">-->
<property name="useActualColumnNames" value="false"/> <!--<property name="useActualColumnNames" value="false"/>-->
<property name="ignoreQualifiersAtRuntime" value="true"/> <!--<property name="ignoreQualifiersAtRuntime" value="true"/>-->
</table> <!--</table>-->
<!-- <!--
...@@ -546,14 +546,14 @@ ...@@ -546,14 +546,14 @@
<table tableName="period_cell_comment" domainObjectName="PeriodCellComment"> <table tableName="period_cell_comment" domainObjectName="PeriodCellComment">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>-->
<table tableName="period_cell_data" domainObjectName="PeriodCellData"> <table tableName="period_cell_data" domainObjectName="PeriodCellData">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
<table tableName="period_cell_data_source" domainObjectName="PeriodCellDataSource"> <!--<table tableName="period_cell_data_source" domainObjectName="PeriodCellDataSource">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
......
package pwc.taxtech.atms.dpo; package pwc.taxtech.atms.dpo;
import pwc.taxtech.atms.vat.entity.EbitCellData;
import java.util.Date; import java.util.Date;
import java.util.List;
public class ReportDto { public class ReportDto {
private String id; private String id;
...@@ -14,6 +17,15 @@ public class ReportDto { ...@@ -14,6 +17,15 @@ public class ReportDto {
private String updater; private String updater;
private Date updateTime; private Date updateTime;
private Integer reportType; private Integer reportType;
private List<EbitCellData> cellDataList;
public List<EbitCellData> getCellDataList() {
return cellDataList;
}
public void setCellDataList(List<EbitCellData> cellDataList) {
this.cellDataList = cellDataList;
}
public Integer getReportType() { public Integer getReportType() {
return reportType; return reportType;
......
...@@ -108,7 +108,7 @@ public interface BalanceSheetPrcMapper extends MyVatMapper { ...@@ -108,7 +108,7 @@ public interface BalanceSheetPrcMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(BalanceSheetPrc record); int updateByPrimaryKey(BalanceSheetPrc record);
List<BalanceSheet> selectByCondition(@Param("bsCondition") BalanceSheetCondition condition); List<BalanceSheetPrc> selectByCondition(@Param("bsCondition") BalanceSheetCondition condition);
int insertBatch(List<BalanceSheet> bls); int insertBatch(List<BalanceSheet> bls);
} }
\ No newline at end of file
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.entity.EbitCellData;
import pwc.taxtech.atms.vat.entity.EbitCellDataExample;
import pwc.taxtech.atms.vat.entity.ProfitLossStatement;
@Mapper
public interface EbitCellDataMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
long countByExample(EbitCellDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int deleteByExample(EbitCellDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int insert(EbitCellData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int insertSelective(EbitCellData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
List<EbitCellData> selectByExampleWithRowbounds(EbitCellDataExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
List<EbitCellData> selectByExample(EbitCellDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
EbitCellData selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") EbitCellData record, @Param("example") EbitCellDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int updateByExample(@Param("record") EbitCellData record, @Param("example") EbitCellDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(EbitCellData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_cell_data
*
* @mbg.generated
*/
int updateByPrimaryKey(EbitCellData record);
int insertBatch(List<EbitCellData> pls);
}
\ No newline at end of file
...@@ -107,7 +107,7 @@ public interface ProfitLossStatementFinalMapper extends MyVatMapper { ...@@ -107,7 +107,7 @@ public interface ProfitLossStatementFinalMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(ProfitLossStatement record); int updateByPrimaryKey(ProfitLossStatement record);
List<ProfitLossStatement> selectByCondition(@Param("plCondition") ProfitLossStatementCondition condition); List<ProfitLossStatement> selectByCondition(@Param("plCondition") ProfitLossStatementExample condition);
int insertBatch(List<ProfitLossStatement> pls); int insertBatch(List<ProfitLossStatement> pls);
} }
\ No newline at end of file
...@@ -108,7 +108,7 @@ public interface ProfitLossStatementPrcMapper extends MyVatMapper { ...@@ -108,7 +108,7 @@ public interface ProfitLossStatementPrcMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(ProfitLossStatementPrc record); int updateByPrimaryKey(ProfitLossStatementPrc record);
List<ProfitLossStatement> selectByCondition(@Param("plCondition") ProfitLossStatementCondition condition); List<ProfitLossStatementPrc> selectByCondition(@Param("plCondition") ProfitLossStatementCondition condition);
int insertBatch(List<ProfitLossStatement> pls); int insertBatch(List<ProfitLossStatement> pls);
} }
\ No newline at end of file
...@@ -121,4 +121,9 @@ public interface TrialBalanceFinalMapper extends MyVatMapper { ...@@ -121,4 +121,9 @@ public interface TrialBalanceFinalMapper extends MyVatMapper {
@Param("projectId") String projectId, @Param("projectId") String projectId,
@Param("period") Integer period, @Param("period") Integer period,
@Param("queryDate") String queryDate); @Param("queryDate") String queryDate);
int generateFinalData(@Param("projectId") String projectId,
@Param("period") Integer period,
@Param("lastProjectId") String lastProjectId,
@Param("lastPeriod") Integer lastPeriod);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.entity; package pwc.taxtech.atms.vat.entity;
import pwc.taxtech.atms.entity.BaseEntity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -10,7 +12,7 @@ import java.util.Date; ...@@ -10,7 +12,7 @@ import java.util.Date;
* *
* @mbg.generated do_not_delete_during_merge * @mbg.generated do_not_delete_during_merge
*/ */
public class PeriodCellData implements Serializable { public class PeriodCellData extends BaseEntity implements Serializable {
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
...@@ -119,6 +121,24 @@ public class PeriodCellData implements Serializable { ...@@ -119,6 +121,24 @@ public class PeriodCellData implements Serializable {
*/ */
private String keyinData; private String keyinData;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column period_cell_data.validate_formula_exp
*
* @mbg.generated
*/
private String validateFormulaExp;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column period_cell_data.validate_result
*
* @mbg.generated
*/
private String validateResult;
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table period_cell_data * This field corresponds to the database table period_cell_data
...@@ -415,6 +435,54 @@ public class PeriodCellData implements Serializable { ...@@ -415,6 +435,54 @@ public class PeriodCellData implements Serializable {
this.keyinData = keyinData == null ? null : keyinData.trim(); this.keyinData = keyinData == null ? null : keyinData.trim();
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column period_cell_data.validate_formula_exp
*
* @return the value of period_cell_data.validate_formula_exp
*
* @mbg.generated
*/
public String getValidateFormulaExp() {
return validateFormulaExp;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column period_cell_data.validate_formula_exp
*
* @param validateFormulaExp the value for period_cell_data.validate_formula_exp
*
* @mbg.generated
*/
public void setValidateFormulaExp(String validateFormulaExp) {
this.validateFormulaExp = validateFormulaExp == null ? null : validateFormulaExp.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column period_cell_data.validate_result
*
* @return the value of period_cell_data.validate_result
*
* @mbg.generated
*/
public String getValidateResult() {
return validateResult;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column period_cell_data.validate_result
*
* @param validateResult the value for period_cell_data.validate_result
*
* @mbg.generated
*/
public void setValidateResult(String validateResult) {
this.validateResult = validateResult == null ? null : validateResult.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table period_cell_data * This method corresponds to the database table period_cell_data
...@@ -439,6 +507,8 @@ public class PeriodCellData implements Serializable { ...@@ -439,6 +507,8 @@ public class PeriodCellData implements Serializable {
sb.append(", projectId=").append(projectId); sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period); sb.append(", period=").append(period);
sb.append(", keyinData=").append(keyinData); sb.append(", keyinData=").append(keyinData);
sb.append(", validateFormulaExp=").append(validateFormulaExp);
sb.append(", validateResult=").append(validateResult);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
......
...@@ -974,6 +974,146 @@ public class PeriodCellDataExample { ...@@ -974,6 +974,146 @@ public class PeriodCellDataExample {
addCriterion("keyin_data not between", value1, value2, "keyinData"); addCriterion("keyin_data not between", value1, value2, "keyinData");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andValidateFormulaExpIsNull() {
addCriterion("validate_formula_exp is null");
return (Criteria) this;
}
public Criteria andValidateFormulaExpIsNotNull() {
addCriterion("validate_formula_exp is not null");
return (Criteria) this;
}
public Criteria andValidateFormulaExpEqualTo(String value) {
addCriterion("validate_formula_exp =", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpNotEqualTo(String value) {
addCriterion("validate_formula_exp <>", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpGreaterThan(String value) {
addCriterion("validate_formula_exp >", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpGreaterThanOrEqualTo(String value) {
addCriterion("validate_formula_exp >=", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpLessThan(String value) {
addCriterion("validate_formula_exp <", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpLessThanOrEqualTo(String value) {
addCriterion("validate_formula_exp <=", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpLike(String value) {
addCriterion("validate_formula_exp like", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpNotLike(String value) {
addCriterion("validate_formula_exp not like", value, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpIn(List<String> values) {
addCriterion("validate_formula_exp in", values, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpNotIn(List<String> values) {
addCriterion("validate_formula_exp not in", values, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpBetween(String value1, String value2) {
addCriterion("validate_formula_exp between", value1, value2, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateFormulaExpNotBetween(String value1, String value2) {
addCriterion("validate_formula_exp not between", value1, value2, "validateFormulaExp");
return (Criteria) this;
}
public Criteria andValidateResultIsNull() {
addCriterion("validate_result is null");
return (Criteria) this;
}
public Criteria andValidateResultIsNotNull() {
addCriterion("validate_result is not null");
return (Criteria) this;
}
public Criteria andValidateResultEqualTo(String value) {
addCriterion("validate_result =", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultNotEqualTo(String value) {
addCriterion("validate_result <>", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultGreaterThan(String value) {
addCriterion("validate_result >", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultGreaterThanOrEqualTo(String value) {
addCriterion("validate_result >=", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultLessThan(String value) {
addCriterion("validate_result <", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultLessThanOrEqualTo(String value) {
addCriterion("validate_result <=", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultLike(String value) {
addCriterion("validate_result like", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultNotLike(String value) {
addCriterion("validate_result not like", value, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultIn(List<String> values) {
addCriterion("validate_result in", values, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultNotIn(List<String> values) {
addCriterion("validate_result not in", values, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultBetween(String value1, String value2) {
addCriterion("validate_result between", value1, value2, "validateResult");
return (Criteria) this;
}
public Criteria andValidateResultNotBetween(String value1, String value2) {
addCriterion("validate_result not between", value1, value2, "validateResult");
return (Criteria) this;
}
} }
/** /**
......
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.entity; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
...@@ -18,7 +19,17 @@ public class PeriodReport implements Serializable { ...@@ -18,7 +19,17 @@ public class PeriodReport implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Long id; private Long id;
private List<EbitCellData> cellDataList;
public List<EbitCellData> getCellDataList() {
return cellDataList;
}
public void setCellDataList(List<EbitCellData> cellDataList) {
this.cellDataList = cellDataList;
}
/** /**
* *
......
...@@ -1696,6 +1696,7 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui. ...@@ -1696,6 +1696,7 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui.
} }
}, },
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis), resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
deepStateRedirect: false,
sticky: true sticky: true
}); });
......
...@@ -2131,7 +2131,7 @@ ...@@ -2131,7 +2131,7 @@
"StartDateMao": "开始日期:", "StartDateMao": "开始日期:",
"EndDateMao": "结束日期:", "EndDateMao": "结束日期:",
"SelectedOrganization": "选择机构", "SelectedOrganization": "选择机构",
"SelectedDataType": "选择数据类型", "SelectedDataType": "数据类型",
"DataProcessLog": "数据处理校验记录", "DataProcessLog": "数据处理校验记录",
"DataProcessLogTitle": "数据处理校验记录", "DataProcessLogTitle": "数据处理校验记录",
...@@ -2288,6 +2288,9 @@ ...@@ -2288,6 +2288,9 @@
"DriverType": "司机类型", "DriverType": "司机类型",
"FileExportSuccess": "文件下载成功!", "FileExportSuccess": "文件下载成功!",
"FileExportFailed": "文件下载失败!", "FileExportFailed": "文件下载失败!",
"singleExport": "单体导出",
"manyExport":"批量导出",
"saveAndRefresh" : "保存并刷新",
"uploadProfileTable": "上传利润表",
"~MustBeEndOneApp": "我必须是最后一个!" "~MustBeEndOneApp": "我必须是最后一个!"
} }
\ No newline at end of file
This diff is collapsed.
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