Commit e0128142 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 102172dd 786164b8
......@@ -41,4 +41,12 @@ public class MyAsserts {
public static void assertEmpty(Collection obj, ApiException exception) {
if (obj != null && !obj.isEmpty()) throw exception;
}
public static <T,S> void assertEq(T t,S s,ApiException exception){
if(s != t) throw exception;
}
public static <T,S> void assertNotEq(T t,S s,ApiException exception){
if(s == t) throw exception;
}
}
package pwc.taxtech.atms.constant.enums;
public enum EnumOutputInvoiceType {
Normal(0, "普通发票"),
Special(1, "专用发票"),
MotorVehicle(2, "机动车销售发票");
Normal(7, "普通发票"),
Special(4, "专用发票"),
MotorVehicle(26, "机动车销售发票");
private int code;
private String name;
......
......@@ -7,6 +7,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
......@@ -23,11 +24,7 @@ import pwc.taxtech.atms.vat.service.impl.OutputInvoiceServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
......@@ -38,6 +35,8 @@ import static pwc.taxtech.atms.constant.Constant.TEMP_FILE_NAME;
@RequestMapping(value = "api/v1/outputInvoiceImport")
public class OutputInvoiceController {
@Autowired
private BeanUtil beanUtil;
@Autowired
OutputInvoiceServiceImpl outputInvoiceService;
@Autowired
......@@ -87,6 +86,14 @@ public class OutputInvoiceController {
if (list.size() == 0) {
return 0;
}
List<pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto> list2 = new ArrayList<>();
list.stream().forEach(x -> {
pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto d =
new pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto();
d = beanUtil.copyProperties(x,d);
d.setInvoiceTypeName(d.getInvoiceTypeName());
list2.add(d);
});
Map<String, String> header = new HashMap<>();
header.put("InvoiceTypeName", "发票类型");
header.put("ClassCode", "发票代码");
......@@ -107,7 +114,7 @@ public class OutputInvoiceController {
header.put("TaxRate", "税率");
header.put("TaxAmount", "税额");
header.put("TaxClassCode", "税收分类编码");
ExcelUtil.exportExcel(header, list, outputStream);
ExcelUtil.exportExcel(header, list2, outputStream);
return list.size();
}
......
......@@ -10,6 +10,7 @@ import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
......@@ -32,22 +33,22 @@ public class ReportController {
return reportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period);
}
@RequestMapping(value = "updateConfig/{projectId}/{ifDeleteManualDataSource}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto updateConfig(@PathVariable String projectId,
@PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period,
@RequestParam String generator,
@RequestParam Boolean mergeManual) {
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator, mergeManual);
// OperationResultDto operationResultDto = new OperationResultDto();
// operationResultDto.setResult(true);
// return operationResultDto;
}
@RequestMapping(value = "generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto generateAllData(@PathVariable String projectId, @PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period, @RequestParam Optional<String> generator) {
return reportService.generateData(projectId, EnumServiceType.VAT, ifDeleteManualDataSource, period, null, generator);
@RequestMapping(value = "generateByTotal/{projectId}/{mergeManual}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto generateAllData(@PathVariable String projectId, @PathVariable Integer period, @RequestParam Optional<String> generator,
@PathVariable Boolean mergeManual) {
return reportService.generateData(projectId, EnumServiceType.VAT, mergeManual, period, null, generator);
}
@RequestMapping(value = "getRunningJob/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public PeriodJob getRunningJob(@PathVariable String projectId, @PathVariable Integer period) {
return reportService.getRunningJob(projectId, period);
}
@RequestMapping(value = "getJobStatus/{projectId}//{period}/{jobId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public PeriodJob getJobStatus(@PathVariable String projectId, @PathVariable Integer period, @PathVariable String jobId) {
return reportService.getJobStatus(projectId, period, jobId);
}
@RequestMapping(value = "templateReferences/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -137,7 +137,7 @@ public class TemplateController extends BaseController {
@RequestMapping(value = "getTemplateUniqList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<TemplateUniqDto> getTemplateUniqList(String serviceTypeId, Integer payTaxType, Integer reportType, String industryIds) {
List<TemplateUniqDto> getTemplateUniqList(@RequestParam(value = "serviceTypeID") String serviceTypeId, Integer payTaxType, Integer reportType, @RequestParam(value = "industryIDs") String industryIds) {
return templateService.getTemplateUniqList(serviceTypeId, payTaxType, reportType, industryIds);
}
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.dto.vatdto;
import com.fasterxml.jackson.annotation.JsonProperty;
import pwc.taxtech.atms.constant.enums.EnumOutputInvoiceType;
import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.math.BigDecimal;
import java.util.Date;
......@@ -9,31 +10,55 @@ import java.util.Date;
public class OutputVATInvoiceInfoDto {
@JsonProperty("invoiceID")
private String invoiceId;
private Integer invoiceType;
@ExcelCell(index=13)
private String invoiceTypeName;
@ExcelCell(index=11)
private String classCode;
@ExcelCell(index=18)
private String invoiceNumber;
@ExcelCell(index=17)
private String buyerName;
@ExcelCell(index=1)
private String buyerTaxNumber;
@ExcelCell(index=5)
private String bankAccount;
@ExcelCell(index=12)
private String phoneNum;
@ExcelCell(index=19)
private Date invoiceDate;
@ExcelCell(index=16)
private String codeVersion;
@ExcelCell(index=2)
private String productName;
@ExcelCell(index=14)
private String documentNum;
@ExcelCell(index=7)
private String productStandard;
@ExcelCell(index=6)
private String unit;
@ExcelCell(index=4)
private Integer quantity;
@ExcelCell(index=9)
private Double unitPrice;
@ExcelCell(index=3)
private BigDecimal amount;
@ExcelCell(index=15)
private BigDecimal taxRate;
@ExcelCell(index=10)
private BigDecimal taxAmount;
@ExcelCell(index=8)
private String taxClassCode;
@JsonProperty("periodID")
private int periodId;
private boolean isDuplicate;
private BigDecimal amountDifference;
public void setInvoiceTypeName(String invoiceTypeName) {
this.invoiceTypeName = invoiceTypeName;
}
public String getInvoiceId() {
return invoiceId;
}
......@@ -202,11 +227,11 @@ public class OutputVATInvoiceInfoDto {
this.periodId = periodId;
}
public boolean isDuplicate() {
public boolean getIsDuplicate() {
return isDuplicate;
}
public void setDuplicate(boolean duplicate) {
public void setIsDuplicate(boolean duplicate) {
isDuplicate = duplicate;
}
......@@ -219,6 +244,19 @@ public class OutputVATInvoiceInfoDto {
}
public String getInvoiceTypeName() {
return EnumOutputInvoiceType.values()[this.invoiceType].getName();
if(this.invoiceType == null){
return "";
}
switch (this.invoiceType) {
case 4:
return "专用发票";
case 8:
return "普通发票";
case 26:
return "机动车销售发票";
default: return "";
}
// return EnumOutputInvoiceType.values()[this.invoiceType].getName();
}
}
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.TemplateGroup;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.service.impl.Message;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplate;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Getter
public class PeriodResources {
Project project;
List<PeriodTemplate> periodTemplates = new ArrayList<>();
List<PeriodCellTemplate> periodCellTemplates = new ArrayList<>();
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = new ArrayList<>();
public void setProject(Project project) {
this.project = project;
}
public void putAllTemplate(List<PeriodTemplate> periodTemplates) {
this.periodTemplates.addAll(periodTemplates);
}
public List<Long> getTemolateIds() {
MyAsserts.assertNotEmpty(periodTemplates, Exceptions.NOT_FOUND_TEMPLATE_EXCEPTION);
return periodTemplates.stream()
.map(PeriodTemplate::getTemplateId)
.collect(Collectors.toList());
}
public void putAllCellTemplate(List<PeriodCellTemplate> periodCellTemplates) {
this.periodCellTemplates.addAll(periodCellTemplates);
}
public void putAllCellTemplateConfig(List<PeriodCellTemplateConfig> periodCellTemplateConfigs) {
this.periodCellTemplateConfigs.addAll(periodCellTemplateConfigs);
}
public Long getTemplateGroupId(){
return periodTemplates.get(0).getTemplateGroupId();
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class WrapPeriodJobDto {
public static final String STATUS_BEGIN = "Begin";
public static final String STATUS_CANCEL = "Cancel";
public static final String STATUS_ERROR = "Error";
public static final String STATUS_END = "End";
public static final String STEP_UPDATE_CONFIG = "UpdateConfig";
public static PeriodJob createReportGenJob(String projectId, Integer period, List<Template> templates) {
MyAsserts.assertNotEmpty(templates, Exceptions.NOT_FOUND_TEMPLATE_EXCEPTION);
PeriodJob job = new PeriodJob();
job.setCreateTime(new Date());
job.setName("Gen All Report");
job.setProjectId(projectId);
job.setPeriod(period);
job.setId(UUID.randomUUID().toString());
job.setStatus(STATUS_BEGIN);
job.setCurrentStep(STEP_UPDATE_CONFIG);
StringBuilder builder = new StringBuilder(STEP_UPDATE_CONFIG);
templates.forEach(m -> {
builder.append(",").append(m.getCode());
});
job.setStepsCode(builder.toString());
return job;
}
}
package pwc.taxtech.atms.exception;
import org.springframework.http.ResponseEntity;
import javax.net.ssl.SSLEngineResult;
import static org.springframework.http.HttpStatus.CONFLICT;
public class ConflictException extends ApiException {
public ConflictException() {
super();
}
public ConflictException(String message) {
super(message);
}
public ConflictException(String message, Throwable cause) {
super(message, cause);
}
public ConflictException(Throwable cause) {
super(cause);
}
@Override
public <Object> ResponseEntity handle() {
return ResponseEntity.status(CONFLICT).build();
}
}
......@@ -10,6 +10,12 @@ public class Exceptions {
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 NOT_FOUND_TEMPLATE_EXCEPTION = new NotFoundException("not found template");
public static final ApiException REPORT_HAS_COMMIT_EXCEPTION = new AlreadyExistsException("report approval has commit");
public static final ApiException SERVER_ERROR_EXCEPTION= new ServerErrorException("server error exception");
public static final ApiException SERVER_ERROR_EXCEPTION = new ServerErrorException("server error exception");
public static final ApiException TASK_HAS_BEGINNING = new ConflictException("task has beginning ..");
public static final ApiException PROJECT_EMPTY_EXCEPTION = new BadParameterException("projectId is empty");
public static final ApiException PROJECT_PROJECT_EXCEPTION = new NotFoundException("not found project");
public static final ApiException NOT_FOUND_TEMPLATE_GROUP_EXCEPTION = new NotFoundException("not found template group");
public static final ApiException NOT_FOUND_EXCEPTION = new NotFoundException("not found resources");
}
......@@ -5,11 +5,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -267,17 +263,19 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked());
cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
// CellTemplateConfig config = new CellTemplateConfig();
// config.setId(distributedIdService.nextId());
// config.setCellTemplateId(cellTemplate.getId());
// config.setReportTemplateId(template.getId());
// config.setDataSourceType(1);//todo 枚举
// config.setFormula(POIUtil.getCellFormulaString(cell));
// //config.setFormula(cell.getCellFormula());
//// config.setFormulaDataSource(); //todo KV相关
// config.setUpdateTime(now);
// config.setUpdateBy(authUserHelper.getCurrentUserId());
// cellTemplateConfigList.add(config);
if(!cell.getCellStyle().getLocked() && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
CellTemplateConfig config = new CellTemplateConfig();
config.setId(distributedIdService.nextId());
config.setCellTemplateId(cellTemplate.getId());
config.setReportTemplateId(template.getId());
config.setDataSourceType(1);//todo 枚举
config.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// config.setFormulaDataSource(); //todo KV相关
config.setUpdateTime(now);
config.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(config);
}
}
}
List<List<CellTemplate>> tmpList = CommonUtils.subListWithLen(cellTemplateList, CommonUtils.BATCH_NUM);
......@@ -358,16 +356,19 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? true : false);
cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
// CellTemplateConfig config = new CellTemplateConfig();
// config.setId(distributedIdService.nextId());
// config.setCellTemplateId(cellTemplate.getId());
// config.setReportTemplateId(template.getId());
// config.setDataSourceType(1);//todo 枚举
// config.setFormula(POIUtil.getCellFormulaString(cell));
//// config.setFormulaDataSource(); //todo KV相关
// config.setUpdateTime(now);
// config.setUpdateBy(authUserHelper.getCurrentUserId());
// cellTemplateConfigList.add(config);
if(!cell.getCellStyle().getLocked() && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
CellTemplateConfig config = new CellTemplateConfig();
config.setId(distributedIdService.nextId());
config.setCellTemplateId(cellTemplate.getId());
config.setReportTemplateId(template.getId());
config.setDataSourceType(1);//todo 枚举
config.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// config.setFormulaDataSource(); //todo KV相关
config.setUpdateTime(now);
config.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(config);
}
}
}
List<List<CellTemplate>> tmpList = CommonUtils.subListWithLen(cellTemplateList, CommonUtils.BATCH_NUM);
......
......@@ -85,7 +85,7 @@ public class TemplateServiceImpl extends AbstractService {
map.put("serviceTypeId", serviceTypeId);
map.put("payTaxType", payTaxType);
map.put("reportType", reportType);
map.put("industryIds", industryIds);
map.put("industryID", industryIds);
List<TemplateUniqDto> templatedbList = templateMapper.getTemplateUniqDtosByTemplateAndTemplateGroup(map);
Map<Long, Map<String, List<TemplateUniqDto>>> groupList = templatedbList.stream()
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
@Setter
......@@ -36,4 +37,22 @@ public class FormulaContext {
private FormulaAgent formulaAgent;
//private Map<String, FormulaResult> replaceSpecialCellFormulaDic;
public static FormulaContext extractContextFromProject(Project project){
FormulaContext formulaContext = new FormulaContext();
formulaContext.setProjectId(project.getId());
formulaContext.setYear(project.getYear());
formulaContext.setIfRound(true);
formulaContext.setOrganizationId(project.getOrganizationId());
formulaContext.setIfRound(true);
return formulaContext;
}
public FormulaContext fixedFormula(Integer period,Long reportTemplateGroupId,FormulaAgent agent){
this.period=period;
this.formulaAgent=agent;
this.reportTemplateGroupId=reportTemplateGroupId;
this.isYear=(period==0);
return this;
}
}
......@@ -51,7 +51,8 @@
<property name="patterns">
<list>
<value>pwc.taxtech.atms.dao.*</value>
<value>pwc.taxtech.atms.vatDao.*</value>
<value>pwc.taxtech.atms.vat.dao.*</value>
<value>pwc.taxtech.atms.invoice.*</value>
</list>
</property>
</bean>
......
......@@ -228,5 +228,11 @@
<columnOverride column="YEAR" javaType="java.lang.Integer" />
</table>
<table tableName="PERIOD_JOB" schema="tax_admin" domainObjectName="PeriodJob">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="PERIOD" javaType="java.lang.Integer" />
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -8,10 +7,13 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputInvoiceExample;
import pwc.taxtech.atms.vat.entity.OutputInvoiceKey;
import java.util.List;
@Mapper
public interface OutputInvoiceMapper extends MyVatMapper {
/**
......@@ -183,4 +185,6 @@ public interface OutputInvoiceMapper extends MyVatMapper {
List<OutputInvoiceDto> getOutputInvoiceWithDetail();
List<OutputVATInvoiceInfoDto> selectOutputInvoiceInfoLeftJoinItem(QueryOutputDto queryDto);
}
\ 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.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import pwc.taxtech.atms.vat.entity.PeriodJobExample;
@Mapper
public interface PeriodJobMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
long countByExample(PeriodJobExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int deleteByExample(PeriodJobExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int insert(PeriodJob record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int insertSelective(PeriodJob record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
List<PeriodJob> selectByExampleWithRowbounds(PeriodJobExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
List<PeriodJob> selectByExample(PeriodJobExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
PeriodJob selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") PeriodJob record, @Param("example") PeriodJobExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int updateByExample(@Param("record") PeriodJob record, @Param("example") PeriodJobExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(PeriodJob record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated
*/
int updateByPrimaryKey(PeriodJob record);
@Select("SELECT " +
" ID AS id, " +
" NAME AS name, " +
" CURRENT_STEP AS currentStep, " +
" PROJECT_ID AS projectId, " +
" PERIOD AS period, " +
" STEPS_CODE AS stepsCode, " +
" CREATE_TIME AS createTime, " +
" STATUS AS status, " +
" ERROR_MSG AS errorMsg " +
"FROM " +
" PERIOD_JOB " +
"WHERE " +
" STATUS = 'Begin' " +
" AND PROJECT_ID = #{projectId} " +
" AND PERIOD =#{period}")
PeriodJob getRunningJob(@Param("projectId") String projectId, @Param("period") Integer period);
@Select("SELECT " +
" ID AS id, " +
" NAME AS name, " +
" CURRENT_STEP AS currentStep, " +
" PROJECT_ID AS projectId, " +
" PERIOD AS period, " +
" STEPS_CODE AS stepsCode, " +
" CREATE_TIME AS createTime, " +
" STATUS AS status, " +
" ERROR_MSG AS errorMsg " +
"FROM " +
" PERIOD_JOB " +
"WHERE " +
" PROJECT_ID = #{projectId} " +
" AND PERIOD =#{period} " +
" AND ID = #{id}")
PeriodJob getJobStatus(@Param("projectId") String projectId, @Param("period") Integer period,@Param("id") String id);
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ public class OutputVATInvoiceInfoDto {
private Integer invoiceType;
private String invoiceTypeName;
private String classCode;
private String invoiceNumber;
private String buyerName;
private String buyerTaxNumber;
......@@ -21,6 +22,7 @@ public class OutputVATInvoiceInfoDto {
private String productStandard;
private String unit;
private Integer quantity;
private String fpqqlsh;
private Double unitPrice;
private BigDecimal amount;
private BigDecimal taxRate;
......@@ -30,6 +32,18 @@ public class OutputVATInvoiceInfoDto {
private boolean isDuplicate;
private BigDecimal amountDifference;
public void setInvoiceTypeName(String invoiceTypeName) {
this.invoiceTypeName = invoiceTypeName;
}
public String getFpqqlsh() {
return fpqqlsh;
}
public void setFpqqlsh(String fpqqlsh) {
this.fpqqlsh = fpqqlsh;
}
public String getInvoiceId() {
return invoiceId;
}
......@@ -198,13 +212,19 @@ public class OutputVATInvoiceInfoDto {
this.periodId = periodId;
}
public boolean isDuplicate() {
public boolean getIsDuplicate() {
return isDuplicate;
}
public boolean isDuplicate() {
return isDuplicate;
}
public void setDuplicate(boolean duplicate) {
isDuplicate = duplicate;
}
public void setIsDuplicate(boolean duplicate) {
isDuplicate = duplicate;
}
public BigDecimal getAmountDifference() {
return amountDifference;
......
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @mbg.generated do_not_delete_during_merge
*/
public class PeriodJob implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.NAME
*
* @mbg.generated
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.CURRENT_STEP
*
* @mbg.generated
*/
private String currentStep;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.PROJECT_ID
*
* @mbg.generated
*/
private String projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.PERIOD
*
* @mbg.generated
*/
private Integer period;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.STEPS_CODE
*
* @mbg.generated
*/
private String stepsCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.CREATE_TIME
*
* @mbg.generated
*/
private Date createTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.STATUS
*
* @mbg.generated
*/
private String status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_ADMIN.PERIOD_JOB.ERROR_MSG
*
* @mbg.generated
*/
private String errorMsg;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @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_JOB.ID
*
* @return the value of TAX_ADMIN.PERIOD_JOB.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_JOB.ID
*
* @param id the value for TAX_ADMIN.PERIOD_JOB.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_JOB.NAME
*
* @return the value of TAX_ADMIN.PERIOD_JOB.NAME
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_JOB.NAME
*
* @param name the value for TAX_ADMIN.PERIOD_JOB.NAME
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_JOB.CURRENT_STEP
*
* @return the value of TAX_ADMIN.PERIOD_JOB.CURRENT_STEP
*
* @mbg.generated
*/
public String getCurrentStep() {
return currentStep;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_JOB.CURRENT_STEP
*
* @param currentStep the value for TAX_ADMIN.PERIOD_JOB.CURRENT_STEP
*
* @mbg.generated
*/
public void setCurrentStep(String currentStep) {
this.currentStep = currentStep == null ? null : currentStep.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_JOB.PROJECT_ID
*
* @return the value of TAX_ADMIN.PERIOD_JOB.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_JOB.PROJECT_ID
*
* @param projectId the value for TAX_ADMIN.PERIOD_JOB.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_JOB.PERIOD
*
* @return the value of TAX_ADMIN.PERIOD_JOB.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_JOB.PERIOD
*
* @param period the value for TAX_ADMIN.PERIOD_JOB.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_JOB.STEPS_CODE
*
* @return the value of TAX_ADMIN.PERIOD_JOB.STEPS_CODE
*
* @mbg.generated
*/
public String getStepsCode() {
return stepsCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_JOB.STEPS_CODE
*
* @param stepsCode the value for TAX_ADMIN.PERIOD_JOB.STEPS_CODE
*
* @mbg.generated
*/
public void setStepsCode(String stepsCode) {
this.stepsCode = stepsCode == null ? null : stepsCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_ADMIN.PERIOD_JOB.CREATE_TIME
*
* @return the value of TAX_ADMIN.PERIOD_JOB.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_JOB.CREATE_TIME
*
* @param createTime the value for TAX_ADMIN.PERIOD_JOB.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_JOB.STATUS
*
* @return the value of TAX_ADMIN.PERIOD_JOB.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_JOB.STATUS
*
* @param status the value for TAX_ADMIN.PERIOD_JOB.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_JOB.ERROR_MSG
*
* @return the value of TAX_ADMIN.PERIOD_JOB.ERROR_MSG
*
* @mbg.generated
*/
public String getErrorMsg() {
return errorMsg;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_ADMIN.PERIOD_JOB.ERROR_MSG
*
* @param errorMsg the value for TAX_ADMIN.PERIOD_JOB.ERROR_MSG
*
* @mbg.generated
*/
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg == null ? null : errorMsg.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_ADMIN.PERIOD_JOB
*
* @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(", name=").append(name);
sb.append(", currentStep=").append(currentStep);
sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period);
sb.append(", stepsCode=").append(stepsCode);
sb.append(", createTime=").append(createTime);
sb.append(", status=").append(status);
sb.append(", errorMsg=").append(errorMsg);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
......@@ -131,7 +131,7 @@
#{item.createTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
'1970-01-01 08:00:00',
TO_DATE('1970-01-01 08:00:00','yyyy-mm-dd hh24:mi:ss'),
</otherwise>
</choose>
<choose>
......@@ -147,7 +147,7 @@
#{item.updateTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
'1970-01-01 08:00:00',
TO_DATE('1970-01-01 08:00:00','yyyy-mm-dd hh24:mi:ss'),
</otherwise>
</choose>
<choose>
......
<?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">
<mapper namespace="pwc.taxtech.atms.invoice.OutputInvoiceMapper">
<resultMap id="OutputVATInvoiceInfoDto" type="pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto">
<id column="InvoiceID" jdbcType="VARCHAR" property="invoiceID"/>
<resultMap id="OutputInvoiceInfoDto" type="pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto">
<id column="Invoice_ID" jdbcType="VARCHAR" property="invoiceId"/>
<result column="INVOICE_TYPE" jdbcType="INTEGER" property="invoiceType"/>
<result column="INVOICE_TYPE_NAME" jdbcType="VARCHAR" property="invoiceTypeName"/>
<result column="CLASS_CODE" jdbcType="VARCHAR" property="classCode"/>
<result column="INVOICE_NUMBER" jdbcType="VARCHAR" property="invoiceNumber"/>
<result column="FPQQLSH" jdbcType="VARCHAR" property="fpqqlsh"/>
<result column="BUYER_NAME" jdbcType="VARCHAR" property="buyerName"/>
<result column="BUYER_TAX_NUMBER" jdbcType="VARCHAR" property="buyerTaxNumber"/>
<result column="BANK_ACCOUNT" jdbcType="VARCHAR" property="bankAccount"/>
......@@ -28,68 +29,68 @@
<result column="AMOUNT_DIFFERENCE" jdbcType="DECIMAL" property="amountDifference"/>
</resultMap>
<select id="selectOutputVATInvoiceInfoLeftJoinItem" parameterType="pwc.taxtech.atms.dto.vatdto.QueryOutputDto" resultMap="OutputVATInvoiceInfoDto">
<select id="selectOutputInvoiceInfoLeftJoinItem" parameterType="pwc.taxtech.atms.vat.dpo.QueryOutputDto" resultMap="OutputInvoiceInfoDto">
SELECT
O.ID AS INVOICE_ID,
O.FPLX AS INVOICE_TYPE,
O.CLASS_CODE,
O.FPLXDM AS INVOICE_TYPE,
O.FPDM AS CLASS_CODE,
O.FPHM AS INVOICE_NUMBER,
O.FPQQLSH,
O.GFMC AS BUYER_NAME,
O.GFSH AS BUYER_TAX_NUMBER,
O.GFYHZH AS BANK_ACCOUNT,
O.GFDZDH AS PHONE_NUM,
O.INVOICE_DATE,
IFNULL (
O.KPRQ AS INVOICE_DATE,
/*nvl (
OI.CODE_VERSION,
''
)
AS CODE_VERSION,
IFNULL (
AS CODE_VERSION,*/
nvl (
OI.SPMC,
''
)
AS PRODUCT_NAME,
IFNULL (
nvl (
OI.MXXH,
''
)
AS DOCUMENT_NUM,
IFNULL (
nvl (
OI.GGXH,
''
)
AS PRODUCT_STANDARD,
IFNULL (
nvl (
OI.DW,
''
)
AS UNIT,
IFNULL (
nvl (
OI.SL,
''
)
AS QUANTITY,
IFNULL (
nvl (
OI.DJ,
''
)
AS UNIT_PRICE,
IFNULL (
nvl (
OI.JE,
''
)
AS AMOUNT,
IFNULL (
nvl (
OI.SE,
''
)
AS TAX_AMOUNT,
IFNULL (
nvl (
OI.SSFLDM,
''
)
AS TAX_CLASS_CODE,
O.PERIOD_ID
AS TAX_CLASS_CODE
FROM
OUTPUT_INVOICE O
LEFT JOIN
......@@ -104,10 +105,10 @@
<!--<if test="queryDto.periodEnd">-->
<!--AND O.PERIOD_ID &lt;= #{queryDto.periodEnd,jdbcType=VARCHAR}-->
<!--</if>-->
<if test="queryDto.productName!=null and queryDto.productName!=''">
AND PRODUCT_NAME LIKE concat (
<if test="productName!=null and productName!=''">
AND OI.SPMC LIKE concat (
'%',
#{query.productName,jdbcType=VARCHAR,'%'}
#{ productName,jdbcType=VARCHAR,'%'}
)
</if>
</select>
......
......@@ -48,8 +48,14 @@
generate: function (projectId, templateId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generate/' + projectId + '/' + templateId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator, {}, apiConfig.createVat({ignoreLoadingBar: true}));
},
generateAll: function (projectId, ifDeleteManualDataSource, period, generator) {
return $http.post('/Report/generateByTotal/' + projectId + '/' + ifDeleteManualDataSource + '/' + period + '?generator=' + generator , {}, apiConfig.createVat({ignoreLoadingBar: true}));
generateAll: function (projectId, isMergeManualDataSource, period, generator) {
return $http.post('/Report/generateByTotal/' + projectId + '/' + isMergeManualDataSource + '/' + period + '?generator=' + generator , {}, apiConfig.createVat({ignoreLoadingBar: true}));
},
getRunningJob: function (projectId, period) {
return $http.get('/Report/getRunningJob/' + projectId+'/'+period, apiConfig.createVat());
},
getJobStatus: function (projectId, period, jobId) {
return $http.get('/Report/getJobStatus/' + projectId+'/'+period+'/'+jobId, apiConfig.createVat({ignoreLoadingBar: true}));
},
getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
......
......@@ -2,7 +2,8 @@
<div class="vat-caculate-data-title" ng-if="tasks.length > 0">
<!--<span translate="vatCaculateDataDesc"></span>-->
<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>
<!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>-->
<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate2()"></button>
<span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span>
</div>
......
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