Commit 53bc8a3d authored by neo's avatar neo

[DEL] delete key value config service interface

parent 799bb62a
...@@ -23,7 +23,7 @@ import pwc.taxtech.atms.dto.KeyValueConfigDisplayDto; ...@@ -23,7 +23,7 @@ import pwc.taxtech.atms.dto.KeyValueConfigDisplayDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateKeyValueConfigDto; import pwc.taxtech.atms.dto.UpdateKeyValueConfigDto;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto; import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
import pwc.taxtech.atms.service.KeyValueConfigService; import pwc.taxtech.atms.service.impl.KeyValueConfigServiceImpl;
import pwc.taxtech.atms.service.impl.TemplateFormulaServiceImpl; import pwc.taxtech.atms.service.impl.TemplateFormulaServiceImpl;
import java.util.List; import java.util.List;
...@@ -34,7 +34,7 @@ public class KeyValueConfigController { ...@@ -34,7 +34,7 @@ public class KeyValueConfigController {
private static final Logger logger = LoggerFactory.getLogger(EnterpriseAccountManagerController.class); private static final Logger logger = LoggerFactory.getLogger(EnterpriseAccountManagerController.class);
@Autowired @Autowired
private KeyValueConfigService keyValueConfigService; private KeyValueConfigServiceImpl keyValueConfigService;
@Autowired @Autowired
private TemplateFormulaServiceImpl templateFormulaService; private TemplateFormulaServiceImpl templateFormulaService;
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dpo.AnalyticsModelDetail;
import pwc.taxtech.atms.dpo.FinancialStatementDetail;
import pwc.taxtech.atms.dpo.TaxReturnDetail;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
public interface KeyValueConfigService {
List<KeyValueConfigDisplayDto> get();
OperationResultDto<List<FormulaConfigDto>> getAllFormulaList();
List<FinancialStatementDetail> getFinacialStatement(String configurationId);
List<TaxReturnDetail> getTaxReturn(String configurationId);
List<AnalyticsModelDetail> getAnalyticsModel(String configurationId);
int deleteKeyValueConfiguration(String keyId);
void addKeyValueConfiguration(AddKeyValueConfigDto addKeyValueConfigDto);
void updateKeyValueConfiguration(UpdateKeyValueConfigDto updateKeyValueConfigDto);
boolean isKeyValueDuplicated(String name);
List<KeyValueConfigDisplayDto> getByOrgId(String orgId);
}
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.*; import com.alibaba.druid.util.StringUtils;
import java.util.stream.Collectors;
import org.apache.poi.openxml4j.exceptions.InvalidOperationException; import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.alibaba.druid.util.StringUtils;
import pwc.taxtech.atms.common.ApplyScope; import pwc.taxtech.atms.common.ApplyScope;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
...@@ -19,19 +14,29 @@ import pwc.taxtech.atms.constant.enums.KeyValueConfigType; ...@@ -19,19 +14,29 @@ import pwc.taxtech.atms.constant.enums.KeyValueConfigType;
import pwc.taxtech.atms.dpo.AnalyticsModelDetail; import pwc.taxtech.atms.dpo.AnalyticsModelDetail;
import pwc.taxtech.atms.dpo.FinancialStatementDetail; import pwc.taxtech.atms.dpo.FinancialStatementDetail;
import pwc.taxtech.atms.dpo.TaxReturnDetail; import pwc.taxtech.atms.dpo.TaxReturnDetail;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.AddKeyValueConfigDto;
import pwc.taxtech.atms.dto.KeyValueConfigDisplayDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateKeyValueConfigDto;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto; import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.service.KeyValueConfigService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@Service @Service
public class KeyValueConfigServiceImpl extends AbstractService implements KeyValueConfigService { public class KeyValueConfigServiceImpl extends AbstractService {
private static final Logger logger = LoggerFactory.getLogger(KeyValueConfigServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(KeyValueConfigServiceImpl.class);
private OperateLogType logType = OperateLogType.OperationLogKeyvalue; private OperateLogType logType = OperateLogType.OperationLogKeyvalue;
@Override
public List<KeyValueConfigDisplayDto> get() { public List<KeyValueConfigDisplayDto> get() {
List<KeyValueConfig> list = keyValueConfigMapper.selectKeyValueConfigsByOrderByCreateTime(); List<KeyValueConfig> list = keyValueConfigMapper.selectKeyValueConfigsByOrderByCreateTime();
List<KeyValueConfigDisplayDto> result = new ArrayList<>(); List<KeyValueConfigDisplayDto> result = new ArrayList<>();
...@@ -65,7 +70,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -65,7 +70,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return result; return result;
} }
@Override
public OperationResultDto<List<FormulaConfigDto>> getAllFormulaList() { public OperationResultDto<List<FormulaConfigDto>> getAllFormulaList() {
OperationResultDto<List<FormulaConfigDto>> result = new OperationResultDto<>(); OperationResultDto<List<FormulaConfigDto>> result = new OperationResultDto<>();
List<FormulaConfig> dbItems = formulaConfigMapper.selectByExample(new FormulaConfigExample()); List<FormulaConfig> dbItems = formulaConfigMapper.selectByExample(new FormulaConfigExample());
...@@ -76,7 +80,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -76,7 +80,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return result; return result;
} }
@Override
public List<FinancialStatementDetail> getFinacialStatement(String configurationId) { public List<FinancialStatementDetail> getFinacialStatement(String configurationId) {
Map<String, String> jointObjectMap = new HashMap<>(); Map<String, String> jointObjectMap = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getId(), a.getName())); industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getId(), a.getName()));
...@@ -87,7 +90,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -87,7 +90,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return referenceFinance; return referenceFinance;
} }
@Override
public List<TaxReturnDetail> getTaxReturn(String configurationId) { public List<TaxReturnDetail> getTaxReturn(String configurationId) {
Map<String, String> jointObjectMap = new HashMap<>(); Map<String, String> jointObjectMap = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getId(), a.getName())); industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getId(), a.getName()));
...@@ -98,7 +100,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -98,7 +100,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return referenceTax; return referenceTax;
} }
@Override
public List<AnalyticsModelDetail> getAnalyticsModel(String configurationId) { public List<AnalyticsModelDetail> getAnalyticsModel(String configurationId) {
Map<String, String> industryList = new HashMap<>(); Map<String, String> industryList = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> industryList.put(a.getId(), a.getName())); industryMapper.selectByExample(new IndustryExample()).forEach(a -> industryList.put(a.getId(), a.getName()));
...@@ -112,7 +113,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -112,7 +113,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return referenceModel; return referenceModel;
} }
@Override
public int deleteKeyValueConfiguration(String keyId) { public int deleteKeyValueConfiguration(String keyId) {
KeyValueReferenceExample example = new KeyValueReferenceExample(); KeyValueReferenceExample example = new KeyValueReferenceExample();
example.createCriteria().andKeyValueConfigIdEqualTo(keyId); example.createCriteria().andKeyValueConfigIdEqualTo(keyId);
...@@ -133,7 +133,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -133,7 +133,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return referenceCount; return referenceCount;
} }
@Override
public void addKeyValueConfiguration(AddKeyValueConfigDto addKeyValueConfigDto) { public void addKeyValueConfiguration(AddKeyValueConfigDto addKeyValueConfigDto) {
Date now = new Date(); Date now = new Date();
KeyValueConfig keyValueConfig = new KeyValueConfig(); KeyValueConfig keyValueConfig = new KeyValueConfig();
...@@ -155,7 +154,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -155,7 +154,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
, Message.Log.AddKeyValueConfiguration, "", keyValueConfig.getName(), logType); , Message.Log.AddKeyValueConfiguration, "", keyValueConfig.getName(), logType);
} }
@Override
public void updateKeyValueConfiguration(UpdateKeyValueConfigDto updateKeyValueConfigDto) { public void updateKeyValueConfiguration(UpdateKeyValueConfigDto updateKeyValueConfigDto) {
KeyValueConfig keyValueConfig = keyValueConfigMapper.selectByPrimaryKey(updateKeyValueConfigDto.getId()); KeyValueConfig keyValueConfig = keyValueConfigMapper.selectByPrimaryKey(updateKeyValueConfigDto.getId());
...@@ -179,7 +177,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -179,7 +177,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
, keyValueConfig.getName(), "Operation content", logType); , keyValueConfig.getName(), "Operation content", logType);
} }
@Override
public boolean isKeyValueDuplicated(String name) { public boolean isKeyValueDuplicated(String name) {
KeyValueConfigExample example = new KeyValueConfigExample(); KeyValueConfigExample example = new KeyValueConfigExample();
example.createCriteria().andNameEqualTo(name); example.createCriteria().andNameEqualTo(name);
...@@ -187,7 +184,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -187,7 +184,6 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return keyValueConfig.isPresent(); return keyValueConfig.isPresent();
} }
@Override
public List<KeyValueConfigDisplayDto> getByOrgId(String orgId) { public List<KeyValueConfigDisplayDto> getByOrgId(String orgId) {
Organization organization = organizationMapper.selectByPrimaryKey(orgId); Organization organization = organizationMapper.selectByPrimaryKey(orgId);
if (organization == null) { if (organization == null) {
......
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