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