Commit 5b968322 authored by frank.xa.zhang's avatar frank.xa.zhang

[fixed issue] report config renew with new table

parent 707b9abc
......@@ -383,6 +383,14 @@
</includes>
<filtering>true</filtering><!-- replace variable attribute or not -->
</resource>
<resource>
<directory>src/main/resources/Document</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/document</targetPath>
</resource>
<resource>
<directory>test/resources</directory>
<includes>
......@@ -470,15 +478,26 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
<!-- java编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
<configuration>
<source>1.8</source>
<target>1.8</target>
......
......@@ -20,7 +20,7 @@ public class CellTemplateController extends BaseController {
@Autowired
CellTemplateService cellTemplateService;
@RequestMapping(value = "configList/{templateID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "configList/{templateID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody
OperationResultDto<List<CellTemplateConfigDto>> getConfigList(@PathVariable Long templateID) {
OperationResultDto<List<CellTemplateConfigDto>> result = new OperationResultDto<>();
......
......@@ -112,5 +112,5 @@ public interface CellTemplateConfigMapper extends MyMapper {
void batchInsert(List<CellTemplateConfig> list);
void batchInser2(List<CellTemplateConfig> list);
void batchInsert2(List<CellTemplateConfig> list);
}
\ No newline at end of file
......@@ -16,20 +16,20 @@ public class CellTemplateConfigDto {
private String formula;
private String parsedFormula;
private String formulaDescription;
private boolean hasVoucher;
private Boolean hasVoucher;
private List<String> accountCodes;
private boolean hasInvoice;
private Boolean hasInvoice;
private Integer invoiceType;
private List<String> taxRate;
private boolean hasKeyIn;
private Boolean hasKeyIn;
private String creator;
private String updater;
private Integer invoiceAmountType;
private boolean hasModel;
private Boolean hasModel;
private List<String> modelIDs;
private List<Integer> invoiceCategory;
private String formulaDataSource;
private boolean hasValidation;
private Boolean hasValidation;
private String validation;
private String parsedValidation;
private String validationDescription;
......@@ -100,11 +100,11 @@ public class CellTemplateConfigDto {
this.isReadOnly = isReadOnly;
}
public boolean getHasFormula() {
public Boolean getHasFormula() {
return hasFormula;
}
public void setHasFormula(boolean hasFormula) {
public void setHasFormula(Boolean hasFormula) {
this.hasFormula = hasFormula;
}
......@@ -132,11 +132,11 @@ public class CellTemplateConfigDto {
this.formulaDescription = formulaDescription;
}
public boolean getHasVoucher() {
public Boolean getHasVoucher() {
return hasVoucher;
}
public void setHasVoucher(boolean hasVoucher) {
public void setHasVoucher(Boolean hasVoucher) {
this.hasVoucher = hasVoucher;
}
......@@ -148,11 +148,11 @@ public class CellTemplateConfigDto {
this.accountCodes = accountCodes;
}
public boolean getHasInvoice() {
public Boolean getHasInvoice() {
return hasInvoice;
}
public void setHasInvoice(boolean hasInvoice) {
public void setHasInvoice(Boolean hasInvoice) {
this.hasInvoice = hasInvoice;
}
......@@ -172,11 +172,11 @@ public class CellTemplateConfigDto {
this.taxRate = taxRate;
}
public boolean getHasKeyIn() {
public Boolean getHasKeyIn() {
return hasKeyIn;
}
public void setHasKeyIn(boolean hasKeyIn) {
public void setHasKeyIn(Boolean hasKeyIn) {
this.hasKeyIn = hasKeyIn;
}
......@@ -204,11 +204,11 @@ public class CellTemplateConfigDto {
this.invoiceAmountType = invoiceAmountType;
}
public boolean getHasModel() {
public Boolean getHasModel() {
return hasModel;
}
public void setHasModel(boolean hasModel) {
public void setHasModel(Boolean hasModel) {
this.hasModel = hasModel;
}
......@@ -236,11 +236,11 @@ public class CellTemplateConfigDto {
this.formulaDataSource = formulaDataSource;
}
public boolean getHasValidation() {
public Boolean getHasValidation() {
return hasValidation;
}
public void setHasValidation(boolean hasValidation) {
public void setHasValidation(Boolean hasValidation) {
this.hasValidation = hasValidation;
}
......
......@@ -2,17 +2,17 @@ package pwc.taxtech.atms.dto;
import pwc.taxtech.atms.constant.enums.RoleSource;
public class NameDto {
private String ID;
private Long ID;
private String name;
private RoleSource RoleSource;
public String getID() {
public Long getID() {
return ID;
}
public void setID(String ID) {
public void setID(Long ID) {
this.ID = ID;
}
......
......@@ -2,26 +2,26 @@ package pwc.taxtech.atms.dto;
public class TemplateAndGroupDbDto {
private Long templateID;
private Long templateId;
private Long templateGroupID;
private Long templateGroupId;
private String templateCode;
public Long getTemplateID() {
return templateID;
public Long getTemplateId() {
return templateId;
}
public void setTemplateID(Long templateID) {
this.templateID = templateID;
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
public Long getTemplateGroupID() {
return templateGroupID;
public Long getTemplateGroupId() {
return templateGroupId;
}
public void setTemplateGroupID(Long templateGroupID) {
this.templateGroupID = templateGroupID;
public void setTemplateGroupId(Long templateGroupId) {
this.templateGroupId = templateGroupId;
}
public String getTemplateCode() {
......
......@@ -4,14 +4,14 @@ import java.util.Date;
import java.util.List;
public final class TemplateDto {
private String ID;
private Long id;
private String name;
private String path;
private Integer reportType;
private String templateGroupID;
private String templateGroupId;
private Date createTime;
private Date updateTime;
private String parentID;
private String parentId;
private String templateName;
private int orderIndex;
......@@ -32,12 +32,12 @@ public final class TemplateDto {
*/
private String validateMsg;
public String getID() {
return ID;
public Long getId() {
return id;
}
public void setID(String ID) {
this.ID = ID;
public void setId(Long id) {
this.id = id;
}
public String getName() {
......@@ -64,12 +64,12 @@ public final class TemplateDto {
this.reportType = reportType;
}
public String getTemplateGroupID() {
return templateGroupID;
public String getTemplateGroupId() {
return templateGroupId;
}
public void setTemplateGroupID(String templateGroupID) {
this.templateGroupID = templateGroupID;
public void setTemplateGroupId(String templateGroupId) {
this.templateGroupId = templateGroupId;
}
public Date getCreateTime() {
......@@ -88,12 +88,12 @@ public final class TemplateDto {
this.updateTime = updateTime;
}
public String getParentID() {
return parentID;
public String getParentId() {
return parentId;
}
public void setParentID(String parentID) {
this.parentID = parentID;
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getTemplateName() {
......
......@@ -6,25 +6,25 @@ import java.util.List;
/** @see PwC.Tax.Tech.Atms.Application.Dto\TaxAdminDto\TemplateGroupDto.cs */
public class TemplateGroupDto {
private Long ID;
private Long id;
private String name;
private String serviceTypeID;
private String serviceTypeId;
private Date updateTime;
private Date createTime;
private Long copyFrom;
private String industryIDs;
private String industryIds;
private Integer payTaxType;
private Integer groupType;
private Boolean isSystemType;
private List<TemplateFormulaDto> changedFormulas;
private List<String> sheetNameList;
public Long getID() {
return ID;
public Long getId() {
return id;
}
public void setID(Long iD) {
ID = iD;
public void setId(Long iD) {
id = iD;
}
public String getName() {
......@@ -35,12 +35,12 @@ public class TemplateGroupDto {
this.name = name;
}
public String getServiceTypeID() {
return serviceTypeID;
public String getServiceTypeId() {
return serviceTypeId;
}
public void setServiceTypeID(String serviceTypeID) {
this.serviceTypeID = serviceTypeID;
public void setServiceTypeId(String serviceTypeId) {
this.serviceTypeId = serviceTypeId;
}
public Date getUpdateTime() {
......@@ -67,12 +67,12 @@ public class TemplateGroupDto {
this.copyFrom = copyFrom;
}
public String getIndustryIDs() {
return industryIDs;
public String getIndustryIds() {
return industryIds;
}
public void setIndustryIDs(String industryIDs) {
this.industryIDs = industryIDs;
public void setIndustryIds(String industryIds) {
this.industryIds = industryIds;
}
public Integer getPayTaxType() {
......
......@@ -2,7 +2,7 @@ package pwc.taxtech.atms.dto;
public class TemplateUniqDto {
private String ID;
private Long id;
private String code;
......@@ -12,12 +12,12 @@ public class TemplateUniqDto {
private Integer reportType;
private String templateGroupID;
private Long templateGroupId;
private String templateGroupName;
private String parentID;
private Long parentId;
private String parentName;
......@@ -26,18 +26,18 @@ public class TemplateUniqDto {
*/
private Integer payTaxType;
private String industryIDs;
private String industryIds;
private String serviceTypeID;
private String serviceTypeId;
private boolean isActiveAssociation;
public String getID() {
return ID;
public Long getId() {
return id;
}
public void setID(String ID) {
this.ID = ID;
public void setId(Long id) {
this.id = id;
}
public String getCode() {
......@@ -72,12 +72,12 @@ public class TemplateUniqDto {
this.reportType = reportType;
}
public String getTemplateGroupID() {
return templateGroupID;
public Long getTemplateGroupId() {
return templateGroupId;
}
public void setTemplateGroupID(String templateGroupID) {
this.templateGroupID = templateGroupID;
public void setTemplateGroupId(Long templateGroupId) {
this.templateGroupId = templateGroupId;
}
public String getTemplateGroupName() {
......@@ -88,12 +88,12 @@ public class TemplateUniqDto {
this.templateGroupName = templateGroupName;
}
public String getParentID() {
return parentID;
public Long getParentId() {
return parentId;
}
public void setParentID(String parentID) {
this.parentID = parentID;
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getParentName() {
......@@ -112,20 +112,20 @@ public class TemplateUniqDto {
this.payTaxType = payTaxType;
}
public String getIndustryIDs() {
return industryIDs;
public String getIndustryIds() {
return industryIds;
}
public void setIndustryIDs(String industryIDs) {
this.industryIDs = industryIDs;
public void setIndustryIds(String industryIds) {
this.industryIds = industryIds;
}
public String getServiceTypeID() {
return serviceTypeID;
public String getServiceTypeId() {
return serviceTypeId;
}
public void setServiceTypeID(String serviceTypeID) {
this.serviceTypeID = serviceTypeID;
public void setServiceTypeId(String serviceTypeId) {
this.serviceTypeId = serviceTypeId;
}
public boolean getIsActiveAssociation() {
......
......@@ -3,8 +3,8 @@ package pwc.taxtech.atms.dto.vatdto;
import java.util.Date;
public class ReportDto {
private String ID ;
private String templateID ;
private Long id;
private Long templateId;
private String templateCode ;
private String templateName ;
private int period ;
......@@ -13,20 +13,20 @@ public class ReportDto {
private String updater ;
private Date updateTime ;
public String getID() {
return ID;
public Long getId() {
return id;
}
public void setID(String ID) {
this.ID = ID;
public void setId(Long id) {
this.id = id;
}
public String getTemplateID() {
return templateID;
public Long getTemplateId() {
return templateId;
}
public void setTemplateID(String templateID) {
this.templateID = templateID;
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
public String getTemplateCode() {
......
......@@ -18,8 +18,6 @@ import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.datasource.ShardingContextHolder;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.AccountMappingMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountMapper;
import pwc.taxtech.atms.dao.OrganizationServiceTemplateGroupMapper;
import pwc.taxtech.atms.dao.ProjectClientMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
......@@ -38,15 +36,11 @@ import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.entitiy.ProjectClientExample.Criteria;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.ProjectService;
import pwc.taxtech.atms.vat.dao.VatEnterpriseAccountMapper;
import pwc.taxtech.atms.vat.dao.VatStandardAccountMapper;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
......@@ -132,7 +126,7 @@ public class ProjectServiceImpl implements ProjectService {
// serviceType 和 templateGroup是上下层级关系,遍历ServiceTypeDto,
// 并将每个ServiceType下级关联的templateGroup填充进去
serviceTypeDto.setTemplateGroupList(templateGroupDtoList.stream()
.filter(templateGroupDto -> (serviceTypeDto.getID().equals(templateGroupDto.getServiceTypeID())))
.filter(templateGroupDto -> (serviceTypeDto.getID().equals(templateGroupDto.getServiceTypeId())))
.collect(Collectors.toList()));
}
return serviceTypeDtoList;
......
......@@ -94,9 +94,9 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
@Override
public OperationResultDto<Object> updateTemplateGroupName(TemplateGroupDto templateGroupDto) {
TemplateGroup entity = templateGroupMapper.selectByPrimaryKey(templateGroupDto.getID());
TemplateGroup entity = templateGroupMapper.selectByPrimaryKey(templateGroupDto.getId());
TemplateGroupExample example = new TemplateGroupExample();
example.createCriteria().andNameEqualTo(templateGroupDto.getName()).andIdNotEqualTo(templateGroupDto.getID()).andServiceTypeIdEqualTo(entity.getServiceTypeId()).andIndustryIdsEqualTo(entity.getIndustryIds()).andPayTaxTypeEqualTo(entity.getPayTaxType());
example.createCriteria().andNameEqualTo(templateGroupDto.getName()).andIdNotEqualTo(templateGroupDto.getId()).andServiceTypeIdEqualTo(entity.getServiceTypeId()).andIndustryIdsEqualTo(entity.getIndustryIds()).andPayTaxTypeEqualTo(entity.getPayTaxType());
List<TemplateGroup> templateGroups = templateGroupMapper.selectByExample(example);
if (!templateGroups.isEmpty()) {
OperationResultDto<Object> result = new OperationResultDto<>();
......@@ -114,7 +114,7 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public OperationResultDto<Object> deleteTemplateGroup(TemplateGroupDto templateGroupDto) {
OperationResultDto<Object> result = new OperationResultDto<>();
TemplateGroup templateGroupDb = templateGroupMapper.selectByPrimaryKey(templateGroupDto.getID());
TemplateGroup templateGroupDb = templateGroupMapper.selectByPrimaryKey(templateGroupDto.getId());
if (templateGroupDb.getIsSystemType()) {
result.setResult(false);
......@@ -122,7 +122,7 @@ public class TemplateGroupServiceImpl extends AbstractService implements Templat
return result;
}
List<String> userOranizationNameList = organizationServiceTemplateGroupMapper.getOrgnizationServiceTemplateGroupOrgNames(templateGroupDto.getID());
List<String> userOranizationNameList = organizationServiceTemplateGroupMapper.getOrgnizationServiceTemplateGroupOrgNames(templateGroupDto.getId());
if (userOranizationNameList != null && !userOranizationNameList.isEmpty()) {
result.setResult(false);
result.setResultMsg(TemplateGroupMessage.ORGANIZATION_USED_TEMPLATE_GROUP);
......
......@@ -31,7 +31,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
criteria.andReportTypeEqualTo(reportType.intValue());
}
example.setOrderByClause("OrderIndex asc");
example.setOrderByClause("order_index asc");
List<Template> templates = templateMapper.selectByExample(example);
List<TemplateDto> templateDtos = new ArrayList<>();
......@@ -74,7 +74,9 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
map.put("industryIDs", industryIDs);
List<TemplateUniqDto> templatedbList = templateMapper.getTemplateUniqDtosByTemplateAndTemplateGroup(map);
Map<String, Map<String, List<TemplateUniqDto>>> groupList = templatedbList.stream().filter(sa -> sa.getIsActiveAssociation()).collect(groupingBy(TemplateUniqDto::getTemplateGroupID, Collectors.groupingBy(TemplateUniqDto::getTemplateGroupName)));
Map<Long, Map<String, List<TemplateUniqDto>>> groupList = templatedbList.stream()
.filter(sa -> sa.getIsActiveAssociation())
.collect(groupingBy(TemplateUniqDto::getTemplateGroupId, Collectors.groupingBy(TemplateUniqDto::getTemplateGroupName)));
List<NameDto> groupListResult = new ArrayList<>();
groupList.forEach((key, value) -> {
NameDto temp = new NameDto();
......@@ -89,15 +91,17 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
for (NameDto group : groupListResult) {
TemplateUniqDto parent = new TemplateUniqDto();
parent.setID(group.getID());
parent.setId(group.getID());
parent.setCode("");
parent.setName(group.getName());
result.add(parent);
List<TemplateUniqDto> subList = templatedbList.stream().filter(sa -> sa.getTemplateGroupID() == group.getID() && sa.getIsActiveAssociation()).collect(Collectors.toList());
List<TemplateUniqDto> subList = templatedbList.stream()
.filter(sa -> sa.getTemplateGroupId() == group.getID() && sa.getIsActiveAssociation())
.collect(Collectors.toList());
subList.forEach(sa -> {
sa.setParentID(sa.getTemplateGroupID());
sa.setParentId(sa.getTemplateGroupId());
sa.setParentName(sa.getTemplateGroupName());
});
result.addAll(subList);
......@@ -107,14 +111,14 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
if (!noGroupTemplateList.isEmpty()) {
TemplateUniqDto parent = new TemplateUniqDto();
parent.setID(UUID.fromString("").toString());
parent.setId(0L);
parent.setCode("");
parent.setName(Constant.Other);
result.add(parent);
noGroupTemplateList.forEach(sa -> {
sa.setParentID(parent.getID());
sa.setParentId(parent.getId());
sa.setParentName(parent.getName());
});
......@@ -135,7 +139,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result;
}
Map<String, Object> map = new HashMap<>(3);
map.put("templateGroupID", templateDb.getTemplateGroupID());
map.put("templateGroupID", templateDb.getTemplateGroupId());
map.put("templateID", param.getID());
map.put("templateName", param.getName());
......@@ -148,7 +152,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result;
}
Template updateTemplate = templateMapper.selectByPrimaryKey(templateDb.getTemplateID());
Template updateTemplate = templateMapper.selectByPrimaryKey(templateDb.getTemplateId());
updateTemplate.setName(param.getName());
updateTemplate.setUpdateTime(new Date());
templateMapper.updateByPrimaryKey(updateTemplate);
......
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