Commit 76ffda90 authored by eddie.woo's avatar eddie.woo

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

parents b582ad6b b31299b6
...@@ -49,6 +49,11 @@ ...@@ -49,6 +49,11 @@
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-jdbc</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId> <artifactId>spring-aspects</artifactId>
......
...@@ -26,6 +26,10 @@ public class MyAsserts { ...@@ -26,6 +26,10 @@ public class MyAsserts {
if (obj == null || obj.isEmpty()) throw exception; if (obj == null || obj.isEmpty()) throw exception;
} }
public static void assertEmpty(String obj, ApiException exception) {
if (obj != null && !obj.isEmpty()) throw exception;
}
public static void assertNotEmpty(String obj, FormulaException exception) { public static void assertNotEmpty(String obj, FormulaException exception) {
if (obj == null || obj.isEmpty()) throw exception; if (obj == null || obj.isEmpty()) throw exception;
} }
...@@ -33,4 +37,8 @@ public class MyAsserts { ...@@ -33,4 +37,8 @@ public class MyAsserts {
public static void assertNotEmpty(Collection obj, ApiException exception) { public static void assertNotEmpty(Collection obj, ApiException exception) {
if (obj == null || obj.isEmpty()) throw exception; if (obj == null || obj.isEmpty()) throw exception;
} }
public static void assertEmpty(Collection obj, ApiException exception) {
if (obj != null && !obj.isEmpty()) throw exception;
}
} }
...@@ -58,6 +58,13 @@ public final class Constant { ...@@ -58,6 +58,13 @@ public final class Constant {
public static final String OUTPUT_KPZT_NO="0"; public static final String OUTPUT_KPZT_NO="0";
public static final String OUTPUT_KPZT_YES="2"; public static final String OUTPUT_KPZT_YES="2";
public static final String APPROVAL_COMMITTED="committed";
public static final String APPROVAL_AGREED="agreed";
public static final String APPROVAL_DISAGREED="disagreed";
public static final String ASSIGNEE_MANAGER="manager";
public static final String ASSIGNEE_ACCOUNTANT="accountant";
public static class DataSourceName { public static class DataSourceName {
public static final String KeyValueDataSource = "KeyValueDataSource"; public static final String KeyValueDataSource = "KeyValueDataSource";
public static final String InputInvoiceDataSource = "IncomeDataSource"; public static final String InputInvoiceDataSource = "IncomeDataSource";
......
...@@ -4,22 +4,20 @@ import org.activiti.engine.RepositoryService; ...@@ -4,22 +4,20 @@ import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.dto.approval.ApprovalDto; import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask; import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping(value = "/api/v1/approval") @RequestMapping(value = "/api/v1/approval")
...@@ -30,8 +28,11 @@ public class ApprovalController { ...@@ -30,8 +28,11 @@ public class ApprovalController {
@Autowired @Autowired
TaskService taskService; TaskService taskService;
@Autowired @Autowired
ApprovalService approvalService;
@Autowired
RepositoryService repositoryService; RepositoryService repositoryService;
@ResponseBody @ResponseBody
@RequestMapping(value = "/deploy", method = RequestMethod.POST) @RequestMapping(value = "/deploy", method = RequestMethod.POST)
public ResponseEntity deploy() { public ResponseEntity deploy() {
...@@ -42,47 +43,24 @@ public class ApprovalController { ...@@ -42,47 +43,24 @@ public class ApprovalController {
@ResponseBody @ResponseBody
@RequestMapping(value = "/commit", method = RequestMethod.POST) @RequestMapping(value = "/commit", method = RequestMethod.POST)
public ApprovalDto approval(@RequestBody ApprovalDto dto) { public ApprovalDto approval(@RequestBody ApprovalDto dto) {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("approvalProcess"); MyAsserts.assertNotEmpty(dto.getProjectId(), Exceptions.EMPTY_PROJECT_PARAM);
dto.setInstaceId(pi.getId()); MyAsserts.assertNotEmpty(dto.getPeriodDate(), Exceptions.EMPTY_PRIODDATE_PARAM);
mocoInsert(dto); approvalService.startInstanceAndAssignee(dto);
return dto; return dto;
} }
@ResponseBody @ResponseBody
@RequestMapping(value = "/tasks/{assignee}") @RequestMapping(value = "/tasks/{assignee}")
public List<ApprovalTask> data(@PathVariable String assignee) { public List<ApprovalTask> data(@PathVariable String assignee) {//accountant manager
List<Task> tasks = taskService.createTaskQuery().taskAssignee(assignee).list(); return approvalService.getTask(assignee);
List<ApprovalTask> list = new ArrayList<>();
for (Task task : tasks) {
ApprovalTask t = new ApprovalTask();
list.add(t.copyfrom(task));
}
return list;
} }
@ResponseBody @ResponseBody
@RequestMapping(value = "/check/{taskId}") @RequestMapping(value = "/check/{taskId}")
public String check(@PathVariable String taskId, @RequestParam(required = false) Integer committed, public void check(@PathVariable String taskId, @RequestParam String decide) {//only for manager role
@RequestParam(required = false) Integer decide) { approvalService.checkTask(taskId, decide);
Map<String, Object> map = new HashMap<>();
if (committed != null && (committed == 0 || committed == 1)) {
map.put("committed", committed);
taskService.complete(taskId, map);
if (committed == 1) mocoHasCommittedAndOver();
} else if (decide != null && (decide == 0 || decide == 1)) {
map.put("decide", decide);
taskService.complete(taskId, map);
if (decide == 1) mocoAggreAndOver();
else mocoDisAggreAndOver();
}
return taskId;
} }
private void mocoHasCommitted() {
}
@RequestMapping(value = "/show/{procDefId}")//获取流程图 @RequestMapping(value = "/show/{procDefId}")//获取流程图
public void showImg(@PathVariable String procDefId, HttpServletResponse response) { public void showImg(@PathVariable String procDefId, HttpServletResponse response) {
try { try {
......
package pwc.taxtech.atms.controller;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.ExcelDataServiceImpl;
@RestController
@RequestMapping(value = "api/v1/excelData")
public class ExcelDataController {
private static final Logger logger = LoggerFactory.getLogger(ExcelDataController.class);
@Autowired
private ExcelDataServiceImpl excelDataService;
@ResponseBody
@ApiOperation(value = "导入报表数据")
@RequestMapping(value = "importExcelDataFile", method = RequestMethod.POST)
public OperationResultDto parseExcelData(@RequestParam MultipartFile file,
@RequestParam Long templateID,
@RequestParam String projectID){
try {
excelDataService.parseExcelData(file, templateID, projectID);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importTemplateExcelFile error.", e);
}
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
...@@ -121,13 +121,13 @@ public class TemplateGroupController { ...@@ -121,13 +121,13 @@ public class TemplateGroupController {
@ApiOperation(value = "导入报表") @ApiOperation(value = "导入报表")
@RequestMapping(value = "importTemplateExcelFile", method = RequestMethod.POST) @RequestMapping(value = "importTemplateExcelFile", method = RequestMethod.POST)
public OperationResultDto importTemplateExcelFile(@RequestParam MultipartFile file, public OperationResultDto importTemplateExcelFile(@RequestParam MultipartFile file,
@RequestParam Long templateGroupId, @RequestParam Long templateGroupID,
@RequestParam String sheetList, @RequestParam String sheetList,
@RequestParam String tempFileName, @RequestParam String tempFileName,
@RequestParam String reportType, @RequestParam String reportType,
@RequestParam String filename) { @RequestParam String filename) {
try { try {
templateGroupService.importTemplateExcelFile(file, templateGroupId, reportType, sheetList); templateGroupService.importTemplateExcelFile(file, templateGroupID, reportType, sheetList);
return OperationResultDto.success(); return OperationResultDto.success();
} catch (ServiceException e) { } catch (ServiceException e) {
return OperationResultDto.error(e.getMessage()); return OperationResultDto.error(e.getMessage());
......
...@@ -9,7 +9,7 @@ public class ApprovalDto { ...@@ -9,7 +9,7 @@ public class ApprovalDto {
private String projectId; private String projectId;
private Long reportId; private Long reportId;
private String periodDate; private String periodDate;
private String instaceId; private String instanceId;
private String status;//committed,agreed,disagreed private String status;//committed,agreed,disagreed
@Override @Override
...@@ -18,8 +18,16 @@ public class ApprovalDto { ...@@ -18,8 +18,16 @@ public class ApprovalDto {
"projectId='" + projectId + '\'' + "projectId='" + projectId + '\'' +
", reportId=" + reportId + ", reportId=" + reportId +
", period=" + periodDate + ", period=" + periodDate +
", instaceId='" + instaceId + '\'' + ", instaceId='" + instanceId + '\'' +
", status='" + status + '\'' + ", status='" + status + '\'' +
'}'; '}';
} }
public Integer getPeriod() {
return Integer.parseInt(periodDate.split("\\.")[1]);
}
public Integer getYear(){
return Integer.parseInt(periodDate.split("\\.")[0]);
}
} }
package pwc.taxtech.atms.exception;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
public class AlreadyExistsException extends ApiException {
public AlreadyExistsException() {
super();
}
public AlreadyExistsException(String message) {
super(message);
}
public AlreadyExistsException(String message, Throwable cause) {
super(message, cause);
}
public AlreadyExistsException(Throwable cause) {
super(cause);
}
@Override
public <Object> ResponseEntity handle() {
return ResponseEntity.status(HttpStatus.CONFLICT).build();
}
}
...@@ -3,6 +3,22 @@ package pwc.taxtech.atms.exception; ...@@ -3,6 +3,22 @@ package pwc.taxtech.atms.exception;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
public class BadParameterException extends ApiException { public class BadParameterException extends ApiException {
public BadParameterException() {
super();
}
public BadParameterException(String message) {
super(message);
}
public BadParameterException(String message, Throwable cause) {
super(message, cause);
}
public BadParameterException(Throwable cause) {
super(cause);
}
@Override @Override
public <Object> ResponseEntity handle() { public <Object> ResponseEntity handle() {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
......
...@@ -7,4 +7,8 @@ public class Exceptions { ...@@ -7,4 +7,8 @@ public class Exceptions {
public static final FormulaException BB_CELL_DATA_EMPTY = new FormulaException("cell data is empty"); public static final FormulaException BB_CELL_DATA_EMPTY = new FormulaException("cell data is empty");
public static final FormulaException PROJECT_EMPTY = new FormulaException("project is empty"); public static final FormulaException PROJECT_EMPTY = new FormulaException("project is empty");
public static final FormulaException BAD_BBVO_PARAMS = new FormulaException("bad params for bb fromular express data"); public static final FormulaException BAD_BBVO_PARAMS = new FormulaException("bad params for bb fromular express data");
} public static final ApiException EMPTY_PROJECT_PARAM = new BadParameterException("project is empty");
public static final ApiException EMPTY_PRIODDATE_PARAM = new BadParameterException("period data is empty");
public static final ApiException NOT_FOUND_REPORT_EXCEPTION = new NotFoundException("not found report");
public static final ApiException REPORT_HAS_COMMIT_EXCEPTION = new AlreadyExistsException("report approval has commit");
}
...@@ -3,6 +3,22 @@ package pwc.taxtech.atms.exception; ...@@ -3,6 +3,22 @@ package pwc.taxtech.atms.exception;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
public class NotFoundException extends ApiException { public class NotFoundException extends ApiException {
public NotFoundException() {
super();
}
public NotFoundException(String message) {
super(message);
}
public NotFoundException(String message, Throwable cause) {
super(message, cause);
}
public NotFoundException(Throwable cause) {
super(cause);
}
@Override @Override
public <Object> ResponseEntity handle() { public <Object> ResponseEntity handle() {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();
......
package pwc.taxtech.atms.service.impl;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.PeriodCellDataMapper;
import pwc.taxtech.atms.vat.dao.PeriodCellTemplateMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.entity.*;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
@Service
public class ExcelDataServiceImpl extends AbstractService {
@Autowired
private PeriodCellTemplateMapper periodCellTemplateMapper;
@Autowired
private PeriodCellDataMapper periodCellDataMapper;
@Autowired
private PeriodReportMapper periodReportMapper;
public void parseExcelData(MultipartFile file, Long periodTemplateId, String projectId) throws ServiceException{
if (null == file) {
throw new ServiceException(ErrorMessage.NoFile);
}
try{
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
Sheet sheet = workbook.getSheetAt(0);
Date now = new Date();
// insert a record into PERIOD_REPORT
PeriodReport pr = new PeriodReport();
pr.setProjectId(projectId);
pr.setCreateBy("Admin");
pr.setCreateTime(now);
pr.setPeriod(0);
pr.setTemplateId(periodTemplateId);
pr.setUpdateBy("Admin");
pr.setUpdateTime(now);
pr.setId(distributedIdService.nextId());
periodReportMapper.insertSelective(pr);
// get cell template according to templateId
PeriodCellTemplateExample pctExample = new PeriodCellTemplateExample();
pctExample.createCriteria().andReportTemplateIdEqualTo(periodTemplateId);
List<PeriodCellTemplate> templates = periodCellTemplateMapper.selectByExample(pctExample);
// save cell data into PERIOD_CELL_DATA
List<PeriodCellData> list = Lists.newArrayList();
for(PeriodCellTemplate template : templates){
Row r = sheet.getRow(template.getRowIndex());
Cell c = r.getCell(template.getColumnIndex());
if(StringUtils.isBlank(c.getStringCellValue())){
continue;
}
PeriodCellData periodCellData = new PeriodCellData();
periodCellData.setData(c.getStringCellValue());
periodCellData.setId(distributedIdService.nextId());
periodCellData.setCellTemplateId(template.getId());
periodCellData.setUpdateTime(now);
periodCellData.setCreateBy("Admin");
periodCellData.setCreateTime(now);
periodCellData.setPeriod(1);
periodCellData.setUpdateBy("Admin");
periodCellData.setFormulaExp(periodCellData.getData());
periodCellData.setProjectId(projectId);
periodCellData.setReportId(pr.getId());
list.add(periodCellData);
}
periodCellDataMapper.batchInsert(list);
// periodCellDataMapper.batchInsert2(list);
} catch (Exception e){
logger.error("importTemplateExcelFile error.", e);
throw new ServiceException(ErrorMessage.SystemError);
}
}
}
package pwc.taxtech.atms.vat.service.impl;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Attachment;
import org.activiti.engine.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.PeriodApproveMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import java.util.*;
@Service
public class ApprovalService {
private static Logger logger = LoggerFactory.getLogger(ApprovalService.class);
@Autowired
RuntimeService runtimeService;
@Autowired
TaskService taskService;
@Autowired
PeriodApproveMapper periodApproveMapper;
@Autowired
PeriodReportMapper reportMapper;
@Transactional
public void startInstanceAndAssignee(ApprovalDto dto) {
PeriodReportExample pre = new PeriodReportExample();
pre.createCriteria().andProjectIdEqualTo(dto.getProjectId()).andPeriodEqualTo(dto.getPeriod());
List<PeriodReport> currentReports = reportMapper.selectByExample(pre);
MyAsserts.assertNotEmpty(currentReports, Exceptions.NOT_FOUND_REPORT_EXCEPTION);
PeriodApprove pa = new PeriodApprove();
pa.setId(UUID.randomUUID().toString());
pa.setPeriod(dto.getPeriod());
pa.setYear(dto.getYear());
StringBuilder reportIds = new StringBuilder("");
StringBuilder reportTemplateIds = new StringBuilder("");
currentReports.forEach(m -> {
reportIds.append(m.getId()).append(",");
reportTemplateIds.append(m.getTemplateId()).append(",");
});
PeriodApproveExample pae = new PeriodApproveExample();
pae.createCriteria().andProjectIdEqualTo(dto.getProjectId()).andPeriodEqualTo(dto.getPeriod())
.andYearEqualTo(dto.getYear()).andReportIdsEqualTo(reportIds.toString())
.andTemplateIdsEqualTo(reportTemplateIds.toString()).andStatusEqualTo(Constant.APPROVAL_COMMITTED);
List<PeriodApprove> pas = periodApproveMapper.selectByExample(pae);
MyAsserts.assertEmpty(pas, Exceptions.REPORT_HAS_COMMIT_EXCEPTION);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("approvalProcess");
dto.setInstanceId(pi.getId());
pa.setInstanceId(pi.getId());
pa.setReportIds(reportIds.toString());
pa.setTemplateIds(reportTemplateIds.toString());
pa.setStatus(Constant.APPROVAL_COMMITTED);
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_ACCOUNTANT).processInstanceId(
pi.getId()).list();
if (tasks != null && tasks.size() == 1) {
Task task = tasks.get(0);
Map<String, Object> map = new HashMap<>();
map.put("committed", 0);
taskService.complete(task.getId(), map);
taskService.createAttachment("java.lang.String", task.getId(), task.getProcessInstanceId(),
"period_approval_uuid", pa.getId(), "");
periodApproveMapper.insert(pa);
} else {
logger.warn("task must not null or size gt 1");
}
}
public List<ApprovalTask> getTask(String assignee) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(assignee).list();
List<ApprovalTask> list = new ArrayList<>();
for (Task task : tasks) {
ApprovalTask t = new ApprovalTask();
list.add(t.copyfrom(task));
}
return list;
}
@Transactional
public void checkTask(String taskId, String decide) {
Map<String, Object> map = new HashMap<>();
PeriodApprove pa = new PeriodApprove();
switch (decide) {
case Constant.APPROVAL_AGREED:
pa.setStatus(Constant.APPROVAL_AGREED);
map.put("decide", 1);
break;
case Constant.APPROVAL_DISAGREED:
pa.setStatus(Constant.APPROVAL_DISAGREED);
map.put("decide", 0);
break;
default:
throw new BadParameterException("not support decide param type");
}
List<Attachment> attachments = taskService.getTaskAttachments(taskId);
if (attachments != null && attachments.size() == 1) {
String uuid = attachments.get(0).getDescription();
taskService.complete(taskId, map);
pa.setId(uuid);
periodApproveMapper.updateByPrimaryKeySelective(pa);
PeriodApprove result = periodApproveMapper.selectByPrimaryKey(uuid);
//save report on service
} else {
logger.warn("task must not null or size gt 1");
}
}
}
...@@ -75,9 +75,16 @@ public class OutputInvoiceServiceImpl { ...@@ -75,9 +75,16 @@ public class OutputInvoiceServiceImpl {
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId()); Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample(); OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES). if(organization.getTaxPayerNumber() == null){
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()), outputInvoiceExample.createCriteria().andXFSHIsNull().andKPZTEqualTo(OUTPUT_KPZT_YES).
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd())); andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
} else {
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
}
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize()); PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample); List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
......
...@@ -289,10 +289,12 @@ public class ReportGeneratorImpl { ...@@ -289,10 +289,12 @@ public class ReportGeneratorImpl {
} }
//如果有正则匹配就进行更新公式解析 //如果有正则匹配就进行更新公式解析
// if (isFind) { if (isFind) {
periodCellTemplateConfig.setParsedFormula(resultFormula); periodCellTemplateConfig.setParsedFormula(StringUtils.isNotBlank(resultFormula) ? resultFormula : null);
periodCellTemplateConfigMapper.updateByPrimaryKeySelective(periodCellTemplateConfig); if (periodCellTemplateConfig.getFormula() != null && !periodCellTemplateConfig.getFormula().contains("BB("))
// } periodCellTemplateConfig.setFormula(StringUtils.isNotBlank(periodCellTemplateConfig.getFormula()) ? resultFormula : null);
periodCellTemplateConfigMapper.updateByPrimaryKeySelective(periodCellTemplateConfig);
}
String regexNormalCell = "[A-Z]{1,2}((?!0)[0-9]{1,3})"; String regexNormalCell = "[A-Z]{1,2}((?!0)[0-9]{1,3})";
p = Pattern.compile(regexNormalCell); p = Pattern.compile(regexNormalCell);
...@@ -366,7 +368,7 @@ public class ReportGeneratorImpl { ...@@ -366,7 +368,7 @@ public class ReportGeneratorImpl {
if (data != null && data.equals("#VALUE!")) { if (data != null && data.equals("#VALUE!")) {
data = "0.0"; data = "0.0";
} }
//evaluator.evaluate(cell) //evaluator.evaluate(cell);
// if (cell.getCellTypeEnum().equals(CellType.NUMERIC)||cell.getCellTypeEnum().equals(CellType.FORMULA)) { // if (cell.getCellTypeEnum().equals(CellType.NUMERIC)||cell.getCellTypeEnum().equals(CellType.FORMULA)) {
// data = Double.toString(cell.getNumericCellValue()); // data = Double.toString(cell.getNumericCellValue());
// } else { // } else {
...@@ -393,6 +395,9 @@ public class ReportGeneratorImpl { ...@@ -393,6 +395,9 @@ public class ReportGeneratorImpl {
// periodFormulaBlockExample.createCriteria().andPeriodEqualTo(period) // periodFormulaBlockExample.createCriteria().andPeriodEqualTo(period)
// .andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId()); // .andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId());
if (StringUtils.isBlank(resultFormula)) {
resultFormula = null;
}
// if (isFind) { // if (isFind) {
cellData.setFormulaExp(resultFormula); cellData.setFormulaExp(resultFormula);
// } else { // } else {
......
...@@ -85,11 +85,11 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -85,11 +85,11 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
// List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVatInvoiceMapper.getInputVATInvoiceResultDto(dbName); // List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVatInvoiceMapper.getInputVATInvoiceResultDto(dbName);
List<InputInvoiceResultDto> inputInvoice = SpringContextUtil.inputInvoiceMapper.getInputInvoiceResultDto(); List<InputInvoiceResultDto> inputInvoice = SpringContextUtil.inputInvoiceMapper.getInputInvoiceResultDto();
if (!goodsName.equals("99")) { // if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream() // inputInvoice = inputInvoice.stream()
.filter(a -> a.getInputInvoiceDetail() != null && StringUtils.isNotBlank(goodsName) && goodsName.equals(a.getInputInvoiceDetail().getSPMC())) // .filter(a -> a.getInputInvoiceDetail() != null && StringUtils.isNotBlank(goodsName) && goodsName.equals(a.getInputInvoiceDetail().getSPMC()))
.collect(Collectors.toList()); // .collect(Collectors.toList());
} // }
if (taxRateVal.compareTo(new BigDecimal("-1")) == 0) { if (taxRateVal.compareTo(new BigDecimal("-1")) == 0) {
inputInvoice = inputInvoice.stream() inputInvoice = inputInvoice.stream()
......
#log4j.debug = true log4j.debug = true
log4j.rootLogger=INFO,stdout,fileoutall,fileoutwarn,fileouterror log4j.rootLogger=INFO,stdout,fileoutall,fileoutwarn,fileouterror
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender
......
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0 cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables PERIOD_APPROVE call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose
echo @@@@@@@@@@@ DONE @@@@@@@@@@@ echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause pause
\ 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.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
@Mapper
public interface PeriodApproveMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
long countByExample(PeriodApproveExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int deleteByExample(PeriodApproveExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int insert(PeriodApprove record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int insertSelective(PeriodApprove record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
List<PeriodApprove> selectByExampleWithRowbounds(PeriodApproveExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
List<PeriodApprove> selectByExample(PeriodApproveExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
PeriodApprove selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") PeriodApprove record, @Param("example") PeriodApproveExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int updateByExample(@Param("record") PeriodApprove record, @Param("example") PeriodApproveExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(PeriodApprove record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated
*/
int updateByPrimaryKey(PeriodApprove record);
}
\ No newline at end of file
...@@ -110,6 +110,10 @@ public interface PeriodCellDataMapper extends MyVatMapper { ...@@ -110,6 +110,10 @@ public interface PeriodCellDataMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(PeriodCellData record); int updateByPrimaryKey(PeriodCellData record);
int batchInsert2(List<PeriodCellData> list);
int batchInsert(List<PeriodCellData> list);
@Select("<script>" + @Select("<script>" +
"SELECT " + "SELECT " +
" R.PERIOD, C.CELL_TEMPLATE_ID AS CELLTEMPLATEID, DATA " + " R.PERIOD, C.CELL_TEMPLATE_ID AS CELLTEMPLATEID, DATA " +
......
...@@ -7,18 +7,18 @@ import java.util.Date; ...@@ -7,18 +7,18 @@ import java.util.Date;
public class CellInvoiceDto { public class CellInvoiceDto {
String id; String id;
Integer period; Integer period;
Date invoiceDate; String invoiceDate;
String invoiceNumber; String invoiceNumber;
String invoiceCode; String invoiceCode;
BigDecimal amount; String amount;
BigDecimal taxAmount; String taxAmount;
BigDecimal rate; String rate;
String productionName; String productionName;
String dataSourceId; String dataSourceId;
//数据源名称 //数据源名称
String dataSourceName; String dataSourceName;
Integer operationType; String operationType;
Integer invoiceType; String invoiceType;
public String getId() { public String getId() {
return id; return id;
...@@ -36,11 +36,11 @@ public class CellInvoiceDto { ...@@ -36,11 +36,11 @@ public class CellInvoiceDto {
this.period = period; this.period = period;
} }
public Date getInvoiceDate() { public String getInvoiceDate() {
return invoiceDate; return invoiceDate;
} }
public void setInvoiceDate(Date invoiceDate) { public void setInvoiceDate(String invoiceDate) {
this.invoiceDate = invoiceDate; this.invoiceDate = invoiceDate;
} }
...@@ -60,27 +60,27 @@ public class CellInvoiceDto { ...@@ -60,27 +60,27 @@ public class CellInvoiceDto {
this.invoiceCode = invoiceCode; this.invoiceCode = invoiceCode;
} }
public BigDecimal getAmount() { public String getAmount() {
return amount; return amount;
} }
public void setAmount(BigDecimal amount) { public void setAmount(String amount) {
this.amount = amount; this.amount = amount;
} }
public BigDecimal getTaxAmount() { public String getTaxAmount() {
return taxAmount; return taxAmount;
} }
public void setTaxAmount(BigDecimal taxAmount) { public void setTaxAmount(String taxAmount) {
this.taxAmount = taxAmount; this.taxAmount = taxAmount;
} }
public BigDecimal getRate() { public String getRate() {
return rate; return rate;
} }
public void setRate(BigDecimal rate) { public void setRate(String rate) {
this.rate = rate; this.rate = rate;
} }
...@@ -108,19 +108,19 @@ public class CellInvoiceDto { ...@@ -108,19 +108,19 @@ public class CellInvoiceDto {
this.dataSourceName = dataSourceName; this.dataSourceName = dataSourceName;
} }
public Integer getOperationType() { public String getOperationType() {
return operationType; return operationType;
} }
public void setOperationType(Integer operationType) { public void setOperationType(String operationType) {
this.operationType = operationType; this.operationType = operationType;
} }
public Integer getInvoiceType() { public String getInvoiceType() {
return invoiceType; return invoiceType;
} }
public void setInvoiceType(Integer invoiceType) { public void setInvoiceType(String invoiceType) {
this.invoiceType = invoiceType; this.invoiceType = invoiceType;
} }
} }
...@@ -8,14 +8,15 @@ public class OutputInvoiceDataSourceDto { ...@@ -8,14 +8,15 @@ public class OutputInvoiceDataSourceDto {
private Integer type; private Integer type;
private String id; private String id;
private Integer period; private Integer period;
private Date invoiceDate; private String invoiceDate;
private String buyerName; private String buyerName;
private String invoiceCode; private String invoiceCode;
private String invoiceNumber; private String invoiceNumber;
private BigDecimal taxRate; private String taxRate;
private BigDecimal taxAmount; private String taxAmount;
private Integer invoiceType; private String invoiceType;
private String dataSourceId; private String dataSourceId;
private String amount;
//数据源名称 //数据源名称
private String dataSourceName; private String dataSourceName;
...@@ -35,11 +36,11 @@ public class OutputInvoiceDataSourceDto { ...@@ -35,11 +36,11 @@ public class OutputInvoiceDataSourceDto {
this.period = period; this.period = period;
} }
public Date getInvoiceDate() { public String getInvoiceDate() {
return invoiceDate; return invoiceDate;
} }
public void setInvoiceDate(Date invoiceDate) { public void setInvoiceDate(String invoiceDate) {
this.invoiceDate = invoiceDate; this.invoiceDate = invoiceDate;
} }
...@@ -67,27 +68,24 @@ public class OutputInvoiceDataSourceDto { ...@@ -67,27 +68,24 @@ public class OutputInvoiceDataSourceDto {
this.invoiceNumber = invoiceNumber; this.invoiceNumber = invoiceNumber;
} }
public BigDecimal getTaxRate() { public String getTaxRate() {
return taxRate; return taxRate;
} }
public void setTaxRate(BigDecimal taxRate) { public void setTaxRate(String taxRate) {
this.taxRate = taxRate; this.taxRate = taxRate;
} }
public BigDecimal getTaxAmount() { public String getTaxAmount() {
return taxAmount; return taxAmount;
} }
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public Integer getInvoiceType() { public String getInvoiceType() {
return invoiceType; return invoiceType;
} }
public void setInvoiceType(Integer invoiceType) { public void setInvoiceType(String invoiceType) {
this.invoiceType = invoiceType; this.invoiceType = invoiceType;
} }
...@@ -114,4 +112,16 @@ public class OutputInvoiceDataSourceDto { ...@@ -114,4 +112,16 @@ public class OutputInvoiceDataSourceDto {
public void setType(Integer type) { public void setType(Integer type) {
this.type = type; this.type = type;
} }
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public void setTaxAmount(String taxAmount) {
this.taxAmount = taxAmount;
}
} }
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @mbg.generated do_not_delete_during_merge
*/
public class PeriodApprove implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.PROJECT_ID
*
* @mbg.generated
*/
private String projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.PERIOD
*
* @mbg.generated
*/
private Integer period;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.REPORT_IDS
*
* @mbg.generated
*/
private String reportIds;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.REPORT_PATHS
*
* @mbg.generated
*/
private String reportPaths;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.STATUS
*
* @mbg.generated
*/
private String status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.INSTANCE_ID
*
* @mbg.generated
*/
private String instanceId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.YEAR
*
* @mbg.generated
*/
private Integer year;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_APPROVE.TEMPLATE_IDS
*
* @mbg.generated
*/
private String templateIds;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @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_APPROVE.ID
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.ID
*
* @param id the value for TAX_ADMIN.PERIOD_APPROVE.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.PROJECT_ID
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.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_APPROVE.PROJECT_ID
*
* @param projectId the value for TAX_ADMIN.PERIOD_APPROVE.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_APPROVE.PERIOD
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.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_APPROVE.PERIOD
*
* @param period the value for TAX_ADMIN.PERIOD_APPROVE.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_APPROVE.REPORT_IDS
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.REPORT_IDS
*
* @mbg.generated
*/
public String getReportIds() {
return reportIds;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.REPORT_IDS
*
* @param reportIds the value for TAX_ADMIN.PERIOD_APPROVE.REPORT_IDS
*
* @mbg.generated
*/
public void setReportIds(String reportIds) {
this.reportIds = reportIds == null ? null : reportIds.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.REPORT_PATHS
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.REPORT_PATHS
*
* @mbg.generated
*/
public String getReportPaths() {
return reportPaths;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.REPORT_PATHS
*
* @param reportPaths the value for TAX_ADMIN.PERIOD_APPROVE.REPORT_PATHS
*
* @mbg.generated
*/
public void setReportPaths(String reportPaths) {
this.reportPaths = reportPaths == null ? null : reportPaths.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.STATUS
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.STATUS
*
* @mbg.generated
*/
public String getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.STATUS
*
* @param status the value for TAX_ADMIN.PERIOD_APPROVE.STATUS
*
* @mbg.generated
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.INSTANCE_ID
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.INSTANCE_ID
*
* @mbg.generated
*/
public String getInstanceId() {
return instanceId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.INSTANCE_ID
*
* @param instanceId the value for TAX_ADMIN.PERIOD_APPROVE.INSTANCE_ID
*
* @mbg.generated
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId == null ? null : instanceId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.YEAR
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.YEAR
*
* @mbg.generated
*/
public Integer getYear() {
return year;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.YEAR
*
* @param year the value for TAX_ADMIN.PERIOD_APPROVE.YEAR
*
* @mbg.generated
*/
public void setYear(Integer year) {
this.year = year;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_APPROVE.TEMPLATE_IDS
*
* @return the value of TAX_ADMIN.PERIOD_APPROVE.TEMPLATE_IDS
*
* @mbg.generated
*/
public String getTemplateIds() {
return templateIds;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_APPROVE.TEMPLATE_IDS
*
* @param templateIds the value for TAX_ADMIN.PERIOD_APPROVE.TEMPLATE_IDS
*
* @mbg.generated
*/
public void setTemplateIds(String templateIds) {
this.templateIds = templateIds == null ? null : templateIds.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_APPROVE
*
* @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(", projectId=").append(projectId);
sb.append(", period=").append(period);
sb.append(", reportIds=").append(reportIds);
sb.append(", reportPaths=").append(reportPaths);
sb.append(", status=").append(status);
sb.append(", instanceId=").append(instanceId);
sb.append(", year=").append(year);
sb.append(", templateIds=").append(templateIds);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodCellTemplateMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.PeriodCellDataMapper">
<insert id="batchInsert2" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellData">
INSERT ALL
<foreach collection="list" item="item">
INTO PERIOD_CELL_DATA VALUES
(
#{item.id,jdbcType=DECIMAL},
#{item.reportId,jdbcType=DECIMAL},
#{item.cellTemplateId,jdbcType=DECIMAL},
#{item.data,jdbcType=VARCHAR},
#{item.formulaExp,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR},
#{item.period,jdbcType=DECIMAL}
)
</foreach>
SELECT 1 FROM DUAL
</insert>
<insert id="batchInsert" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellData">
INSERT ALL
<foreach collection="list" item="item">
INTO PERIOD_CELL_DATA (
ID,
PERIOD,
REPORT_ID,
CELL_TEMPLATE_ID,
"DATA",
FORMULA_EXP,
CREATE_TIME,
UPDATE_TIME,
CREATE_BY,
UPDATE_BY,
PROJECT_ID
) VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.reportId != null">#{item.reportId,jdbcType=VARCHAR},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.cellTemplateId != null">#{item.cellTemplateId,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.data != null">#{item.data,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
<choose>
<when test="item.formulaExp != null">#{item.formulaExp,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>to_date('1970-01-01 08:00:00','yyyy-mm-dd hh24:mi:ss'),</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>to_date('1970-01-01 08:00:00','yyyy-mm-dd hh24:mi:ss'),</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
<choose>
<when test="item.updateBy != null">#{item.updateBy,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>' ',</otherwise>
</choose>
</trim>
</foreach>
SELECT 1 FROM DUAL
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -641,22 +641,22 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g ...@@ -641,22 +641,22 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
sticky: true sticky: true
}); });
$stateProvider.state({ // $stateProvider.state({
name: 'vat.reductionData.goodsMapping', // name: 'vat.reductionData.goodsMapping',
url: '/goodsMapping', // url: '/goodsMapping',
views: { // views: {
'@vat.reductionData': { // '@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation', // controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) { // function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]); // appTranslation.load([appTranslation.vat]);
}], // }],
template: '<vat-goods-mapping></vat-goods-mapping>', // template: '<vat-goods-mapping></vat-goods-mapping>',
} // }
}, // },
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat), // resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true, // deepStateRedirect: true,
sticky: true // sticky: true
}); // });
$stateProvider.state({ $stateProvider.state({
name: 'vat.reductionData.caculateData', name: 'vat.reductionData.caculateData',
......
...@@ -445,8 +445,7 @@ ...@@ -445,8 +445,7 @@
// 根据已有信息通过spreadJS计算各单元格的值 // 根据已有信息通过spreadJS计算各单元格的值
var setData = function () { var setData = function () {
//todo: change to 0 at here,just for test now var sheet = scope.spread.sheets[0];
var sheet = scope.spread.sheets[1];
var isExportData = false; var isExportData = false;
if (angular.isArray(scope.reportSource)) { if (angular.isArray(scope.reportSource)) {
spreadJsTipService.initialize(sheet); spreadJsTipService.initialize(sheet);
......
...@@ -441,8 +441,7 @@ ...@@ -441,8 +441,7 @@
//纳税申报表 //纳税申报表
var sheets = $scope.spread.sheets; var sheets = $scope.spread.sheets;
if (sheets && sheets.length > 0) { if (sheets && sheets.length > 0) {
//todo: change to sheets[0] here later var tagInfo = sheets[0].getTag(row, column);
var tagInfo = sheets[1].getTag(row, column);
if (constant.regesterInformation.active) { if (constant.regesterInformation.active) {
tagInfo = sheets[0].getTag(row, column); tagInfo = sheets[0].getTag(row, column);
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</a> </a>
</div> </div>
<div class="nav-element-right" style="width: 180px;"> <!--<div class="nav-element-right" style="width: 180px;">
<div class="form-group input-group"> <div class="form-group input-group">
<input type="text" class="form-control" style="margin-top: 9px;height: 36px;"> <input type="text" class="form-control" style="margin-top: 9px;height: 36px;">
<span class="input-group-btn"> <span class="input-group-btn">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</button> </button>
</span> </span>
</div> </div>
</div> </div>-->
<div class="clear"></div> <div class="clear"></div>
</div> </div>
......
...@@ -885,10 +885,10 @@ ...@@ -885,10 +885,10 @@
constant.vatPermission.dataPreview.outputInvoice.queryCode, constant.vatPermission.dataPreview.outputInvoice.queryCode,
constant.vatPermission.dataPreview.inputInvoice.queryCode, constant.vatPermission.dataPreview.inputInvoice.queryCode,
constant.vatPermission.dataManage.accountMappingCode, // constant.vatPermission.dataManage.accountMappingCode,
constant.vatPermission.dataManage.goodsMappingCode, // constant.vatPermission.dataManage.goodsMappingCode,
constant.vatPermission.dataManage.caculateDataCode, constant.vatPermission.dataManage.caculateDataCode,
constant.vatPermission.dataManage.unbilledInvoiceCode, // constant.vatPermission.dataManage.unbilledInvoiceCode,
constant.vatPermission.reportView.bsplCode, constant.vatPermission.reportView.bsplCode,
constant.vatPermission.reportView.taxReturnCode, constant.vatPermission.reportView.taxReturnCode,
...@@ -932,15 +932,16 @@ ...@@ -932,15 +932,16 @@
// else if (data[constant.vatPermission.dataPreview.customInvoice.queryCode]) { // else if (data[constant.vatPermission.dataPreview.customInvoice.queryCode]) {
// $state.go('vat.previewData.customInvoice'); // $state.go('vat.previewData.customInvoice');
// } // }
else if (data[constant.vatPermission.dataManage.accountMappingCode]) { // else if (data[constant.vatPermission.dataManage.accountMappingCode]) {
$state.go('vat.reductionData.accountMapping'); // $state.go('vat.reductionData.accountMapping');
} else if (data[constant.vatPermission.dataManage.goodsMappingCode]) { // } else if (data[constant.vatPermission.dataManage.goodsMappingCode]) {
$state.go('vat.reductionData.goodsMapping'); // $state.go('vat.reductionData.goodsMapping');
} else if (data[constant.vatPermission.dataManage.caculateDataCode]) { // }
else if (data[constant.vatPermission.dataManage.caculateDataCode]) {
$state.go('vat.reductionData.caculateData'); $state.go('vat.reductionData.caculateData');
} else if (data[constant.vatPermission.dataManage.unbilledInvoiceCode]) { } /*else if (data[constant.vatPermission.dataManage.unbilledInvoiceCode]) {
$state.go('vat.reductionData.unbilledInvoice'); $state.go('vat.reductionData.unbilledInvoice');
} else if (data[constant.vatPermission.reportView.bsplCode] || data[constant.vatPermission.reportView.taxReturnCode]) { }*/ else if (data[constant.vatPermission.reportView.bsplCode] || data[constant.vatPermission.reportView.taxReturnCode]) {
$state.go('vat.generateReport'); $state.go('vat.generateReport');
} else if (data[constant.vatPermission.dataAnalysis.modelAnalysisCode]) { } else if (data[constant.vatPermission.dataAnalysis.modelAnalysisCode]) {
$state.go('vat.analyzeLayout.analyzeReport'); $state.go('vat.analyzeLayout.analyzeReport');
......
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
<button type="button" class="btn btn-in-grid" ng-show="serviceTypeId ==='12' && updateStatus" ngf-select="" ng-model="productFileName" ngf-drag-over-class="'dragover'" accept=".xls,.xlsx" ngf-multiple="false" ngf-allow-dir="false"><i class="material-icons middle">add_circle_outline</i>导入</button> <button type="button" class="btn btn-in-grid" ng-show="serviceTypeId ==='12' && updateStatus" ngf-select="" ng-model="productFileName" ngf-drag-over-class="'dragover'" accept=".xls,.xlsx" ngf-multiple="false" ngf-allow-dir="false"><i class="material-icons middle">add_circle_outline</i>导入</button>
</div> </div>
<a href="" ng-click="toggleView('workflowView')" ng-class="{true:'active',false:'inactive'}[currentView == 'workflowView']"><i class="fa fa-tasks" aria-hidden="true"></i></a> <a href="" ng-click="toggleView('workflowView')" ng-class="{true:'active',false:'inactive'}[currentView == 'workflowView']"><i class="fa fa-tasks" aria-hidden="true"></i></a>
<a href="" ng-click="toggleView('listView')" ng-class="{true:'active',false:'inactive'}[currentView == 'listView']"><i class="fa fa-list-ul" aria-hidden="true"></i></a> <!--<a href="" ng-click="toggleView('listView')" ng-class="{true:'active',false:'inactive'}[currentView == 'listView']"><i class="fa fa-list-ul" aria-hidden="true"></i></a>-->
<a href="" ng-click="toggleView('cardView')" ng-class="{true:'active',false:'inactive'}[currentView == 'cardView']"><i class="fa fa-th" aria-hidden="true"></i></a> <!-- <a href="" ng-click="toggleView('cardView')" ng-class="{true:'active',false:'inactive'}[currentView == 'cardView']"><i class="fa fa-th" aria-hidden="true"></i></a>-->
<div class="button-sort" ng-if="currentView == 'cardView'"> <div class="button-sort" ng-if="currentView == 'cardView'">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ 'OrderBy' | translate }}<span class="glyphicon glyphicon-sort"></span> {{ 'OrderBy' | translate }}<span class="glyphicon glyphicon-sort"></span>
......
...@@ -571,39 +571,39 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g ...@@ -571,39 +571,39 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
sticky: true sticky: true
}); });
$stateProvider.state({ // $stateProvider.state({
name: 'vat.reductionData.accountMapping', // name: 'vat.reductionData.accountMapping',
url: '/accountMapping', // url: '/accountMapping',
views: { // views: {
'@vat.reductionData': { // '@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation', // controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) { // function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]); // appTranslation.load([appTranslation.vat]);
}], // }],
template: '<vat-account-mapping></vat-account-mapping>', // template: '<vat-account-mapping></vat-account-mapping>',
} // }
}, // },
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat), // resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true, // deepStateRedirect: true,
sticky: true // sticky: true
}); // });
//
$stateProvider.state({ // $stateProvider.state({
name: 'vat.reductionData.goodsMapping', // name: 'vat.reductionData.goodsMapping',
url: '/goodsMapping', // url: '/goodsMapping',
views: { // views: {
'@vat.reductionData': { // '@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation', // controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) { // function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]); // appTranslation.load([appTranslation.vat]);
}], // }],
template: '<vat-goods-mapping></vat-goods-mapping>', // template: '<vat-goods-mapping></vat-goods-mapping>',
} // }
}, // },
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat), // resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true, // deepStateRedirect: true,
sticky: true // sticky: true
}); // });
$stateProvider.state({ $stateProvider.state({
name: 'vat.reductionData.caculateData', name: 'vat.reductionData.caculateData',
......
...@@ -760,7 +760,7 @@ var citModule = angular.module('app.cit', ['ui.grid', 'ui.grid.selection', 'ui.g ...@@ -760,7 +760,7 @@ var citModule = angular.module('app.cit', ['ui.grid', 'ui.grid.selection', 'ui.g
sticky: true sticky: true
}); });
$stateProvider.state({ /*$stateProvider.state({
name: 'cit.reductionData.goodsMapping', name: 'cit.reductionData.goodsMapping',
url: '/goodsMapping', url: '/goodsMapping',
views: { views: {
...@@ -775,7 +775,7 @@ var citModule = angular.module('app.cit', ['ui.grid', 'ui.grid.selection', 'ui.g ...@@ -775,7 +775,7 @@ var citModule = angular.module('app.cit', ['ui.grid', 'ui.grid.selection', 'ui.g
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit), resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true, deepStateRedirect: true,
sticky: true sticky: true
}); });*/
$stateProvider.state({ $stateProvider.state({
name: 'cit.reductionData.caculateData', name: 'cit.reductionData.caculateData',
......
...@@ -51,18 +51,18 @@ function ($scope, $log, $translate, $location, loginContext, enums, vatSessionSe ...@@ -51,18 +51,18 @@ function ($scope, $log, $translate, $location, loginContext, enums, vatSessionSe
name: 'caculateData', permission: constant.vatPermission.dataManage.caculateDataCode, name: 'caculateData', permission: constant.vatPermission.dataManage.caculateDataCode,
text: $translate.instant('caculateData'), icon: 'fa fa-random', show: true text: $translate.instant('caculateData'), icon: 'fa fa-random', show: true
}, },
{ /*{
name: 'accountMapping', permission: constant.vatPermission.dataManage.accountMappingCode, name: 'accountMapping', permission: constant.vatPermission.dataManage.accountMappingCode,
text: $translate.instant('accountMapping'), icon: 'fa fa-map', show: true text: $translate.instant('accountMapping'), icon: 'fa fa-map', show: true
}, },
{ {
name: 'goodsMapping', permission: constant.vatPermission.dataManage.goodsMappingCode, name: 'goodsMapping', permission: constant.vatPermission.dataManage.goodsMappingCode,
text: $translate.instant('goodsMapping'), icon: 'fa fa-map-signs', show: true text: $translate.instant('goodsMapping'), icon: 'fa fa-map-signs', show: true
}, },
{ {
name: 'unbilledInvoice', permission: constant.vatPermission.dataManage.unbilledInvoiceCode, name: 'unbilledInvoice', permission: constant.vatPermission.dataManage.unbilledInvoiceCode,
text: $translate.instant('unbilledInvoice'), icon: 'fa fa-shield', show: true text: $translate.instant('unbilledInvoice'), icon: 'fa fa-shield', show: true
}, ]; },*/ ];
} }
else { else {
$scope.nodeDicKey = constant.DictionaryDictKey.DataImport; $scope.nodeDicKey = constant.DictionaryDictKey.DataImport;
......
...@@ -131,9 +131,9 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer ...@@ -131,9 +131,9 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
constant.vatPermission.dataPreview.inputInvoice.queryCode, constant.vatPermission.dataPreview.inputInvoice.queryCode,
constant.vatPermission.dataManage.caculateDataCode, constant.vatPermission.dataManage.caculateDataCode,
constant.vatPermission.dataManage.accountMappingCode, // constant.vatPermission.dataManage.accountMappingCode,
constant.vatPermission.dataManage.goodsMappingCode, // constant.vatPermission.dataManage.goodsMappingCode,
constant.vatPermission.dataManage.unbilledInvoiceCode, // constant.vatPermission.dataManage.unbilledInvoiceCode,
constant.vatPermission.reportView.bsplCode, constant.vatPermission.reportView.bsplCode,
constant.vatPermission.reportView.taxReturnCode, constant.vatPermission.reportView.taxReturnCode,
...@@ -323,30 +323,30 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer ...@@ -323,30 +323,30 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
name: 'reductionData', state: 'reductionData', num: 3, name: 'reductionData', state: 'reductionData', num: 3,
permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData' permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData'
}); });
subMenus.push({ /* subMenus.push({
name: 'reductionData.accountMapping', state: 'reductionData.accountMapping', num: 3, name: 'reductionData.accountMapping', state: 'reductionData.accountMapping', num: 3,
permission: constant.vatPermission.dataManage.accountMappingCode, url: '#/vat/reductionData/accountMapping' permission: constant.vatPermission.dataManage.accountMappingCode, url: '#/vat/reductionData/accountMapping'
}); });*/
} }
else if (data[constant.vatPermission.dataManage.goodsMappingCode]) { else if (data[constant.vatPermission.dataManage.goodsMappingCode]) {
$scope.menus.push({ $scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3, name: 'reductionData', state: 'reductionData', num: 3,
permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData' permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData'
}); });
subMenus.push({ /* subMenus.push({
name: 'reductionData.goodsMapping', state: 'reductionData.goodsMapping', num: 3, name: 'reductionData.goodsMapping', state: 'reductionData.goodsMapping', num: 3,
permission: constant.vatPermission.dataManage.goodsMappingCode, url: '#/vat/reductionData/goodsMapping' permission: constant.vatPermission.dataManage.goodsMappingCode, url: '#/vat/reductionData/goodsMapping'
}); });*/
} }
else if (data[constant.vatPermission.dataManage.unbilledInvoiceCode]) { else if (data[constant.vatPermission.dataManage.unbilledInvoiceCode]) {
$scope.menus.push({ $scope.menus.push({
name: 'reductionData', state: 'reductionData', num: 3, name: 'reductionData', state: 'reductionData', num: 3,
permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData' permission: constant.vatPermission.dataManage.dataManageCode, url: '#/vat/reductionData'
}); });
subMenus.push({ /*subMenus.push({
name: 'reductionData.unbilledInvoice', state: 'reductionData.unbilledInvoice', num: 3, name: 'reductionData.unbilledInvoice', state: 'reductionData.unbilledInvoice', num: 3,
permission: constant.vatPermission.dataManage.unbilledInvoiceCode, url: '#/vat/reductionData/unbilledInvoice' permission: constant.vatPermission.dataManage.unbilledInvoiceCode, url: '#/vat/reductionData/unbilledInvoice'
}); });*/
} }
if (data[constant.vatPermission.reportView.bsplCode] || data[constant.vatPermission.reportView.taxReturnCode]) { if (data[constant.vatPermission.reportView.bsplCode] || data[constant.vatPermission.reportView.taxReturnCode]) {
......
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