Commit 8622b313 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed no data issue

parent d9a72b6c
...@@ -146,7 +146,7 @@ public interface TaxRuleSettingMapper extends MyMapper { ...@@ -146,7 +146,7 @@ public interface TaxRuleSettingMapper extends MyMapper {
@Select("select trs.GroupName,trs.ID,trs.IsDefault,trs.Name,trs.TaxBase,trs.TaxRate*100 as TaxRate,trso.OrganizationID" @Select("select trs.GroupName,trs.ID,trs.IsDefault,trs.Name,trs.TaxBase,trs.TaxRate*100 as TaxRate,trso.OrganizationID"
+ " from TaxRuleSetting trs " + " from TaxRuleSetting trs "
+ "join TaxRuleSettingOrganization trso on trs.ID=trso.TaxSettingID") + "left join TaxRuleSettingOrganization trso on trs.ID=trso.TaxSettingID")
@Results({ @Results({
@Result(id = true, column = "ID", property = "ID"), @Result(id = true, column = "ID", property = "ID"),
@Result(column = "GroupName",property="GroupName"), @Result(column = "GroupName",property="GroupName"),
......
...@@ -4,10 +4,10 @@ import java.util.List; ...@@ -4,10 +4,10 @@ import java.util.List;
public class TaxPayerReportRuleDto { public class TaxPayerReportRuleDto {
private String ID; private String ID;
private int IsDefault; private int isDefault;
private int TaxPayerType; private int taxPayerType;
private String TemplateGroupID; private String templateGroupID;
private List<String> Orgs; private List<String> orgs;
public String getID() { public String getID() {
return ID; return ID;
...@@ -18,34 +18,34 @@ public class TaxPayerReportRuleDto { ...@@ -18,34 +18,34 @@ public class TaxPayerReportRuleDto {
} }
public int getIsDefault() { public int getIsDefault() {
return IsDefault; return isDefault;
} }
public void setIsDefault(int isDefault) { public void setIsDefault(int isDefault) {
this.IsDefault = isDefault; this.isDefault = isDefault;
} }
public int getTaxPayerType() { public int getTaxPayerType() {
return TaxPayerType; return taxPayerType;
} }
public void setTaxPayerType(int taxPayerType) { public void setTaxPayerType(int taxPayerType) {
this.TaxPayerType = taxPayerType; this.taxPayerType = taxPayerType;
} }
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 List<String> getOrgs() { public List<String> getOrgs() {
return Orgs; return orgs;
} }
public void setOrgs(List<String> orgs) { public void setOrgs(List<String> orgs) {
this.Orgs = orgs; this.orgs = orgs;
} }
......
...@@ -31,12 +31,12 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -31,12 +31,12 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
@Override @Override
public List<KeyValueConfigDisplayDto> Get() { public List<KeyValueConfigDisplayDto> Get() {
List<KeyValueConfig> list = keyValueConfigMapper.SelectKeyValueConfigsByOrderByCreateTime(); List<KeyValueConfig> list = keyValueConfigMapper.SelectKeyValueConfigsByOrderByCreateTime();
List<KeyValueConfigDisplayDto> result = new ArrayList<KeyValueConfigDisplayDto>(); List<KeyValueConfigDisplayDto> result = new ArrayList<>();
if (list.size() > 0) { if (list.size() > 0) {
Map<String, String> industryList = new HashMap<String, String>(); Map<String, String> industryList = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).stream() industryMapper.selectByExample(new IndustryExample()).stream()
.map(item -> industryList.put(item.getID(), item.getName())).collect(Collectors.toList()); .map(item -> industryList.put(item.getID(), item.getName())).collect(Collectors.toList());
Map<String, String> serviceType = new HashMap<String, String>(); Map<String, String> serviceType = new HashMap<>();
serviceTypeMapper.selectByExample(new ServiceTypeExample()).stream() serviceTypeMapper.selectByExample(new ServiceTypeExample()).stream()
.map(item -> serviceType.put(item.getID(), item.getName())).collect(Collectors.toList()); .map(item -> serviceType.put(item.getID(), item.getName())).collect(Collectors.toList());
List<KeyValueReference> scopes = keyValueReferenceMapper.selectByExample(new KeyValueReferenceExample()); List<KeyValueReference> scopes = keyValueReferenceMapper.selectByExample(new KeyValueReferenceExample());
...@@ -48,13 +48,13 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -48,13 +48,13 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
dtoObj.setIndustryIds(Arrays.asList(keyValueConfig.getIndustryIDs().split(","))); dtoObj.setIndustryIds(Arrays.asList(keyValueConfig.getIndustryIDs().split(",")));
dtoObj.setServiceTypeIds(Arrays.asList(keyValueConfig.getServiceTypeIDs().split(","))); dtoObj.setServiceTypeIds(Arrays.asList(keyValueConfig.getServiceTypeIDs().split(",")));
List<KeyValueReference> selectScopeList = scopes.stream() List<KeyValueReference> selectScopeList = scopes.stream()
.filter(item -> item.getKeyValueConfigID() == item.getID()).collect(Collectors.toList()); .filter(item -> item.getKeyValueConfigID().equals(item.getID())).collect(Collectors.toList());
List<Integer> selectScopes = selectScopeList.stream().map(item -> item.getScope()).distinct() List<Integer> selectScopes = selectScopeList.stream().map(item -> item.getScope()).distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
Map<Integer, Integer> scopeCount = new HashMap<Integer,Integer>(); Map<Integer, Integer> scopeCount = new HashMap<>();
if(selectScopeList!=null&&selectScopeList.size()>0) { if(selectScopeList!=null&&selectScopeList.size()>0) {
for(Integer selectScope :selectScopes) { for(Integer selectScope :selectScopes) {
Integer count = (int)(selectScopeList.stream().filter(a->a.getScope()==selectScope).count()); Integer count = (int)(selectScopeList.stream().filter(a-> a.getScope().equals(selectScope)).count());
scopeCount.put(selectScope, count); scopeCount.put(selectScope, count);
} }
} }
...@@ -79,7 +79,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -79,7 +79,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
return source; return source;
} }
String[] sArray = source.split(","); String[] sArray = source.split(",");
List<String> sName = new ArrayList<String>(); List<String> sName = new ArrayList<>();
for (String s : sArray) { for (String s : sArray) {
if (queryList.containsKey(s)) { if (queryList.containsKey(s)) {
sName.add(queryList.get(s)); sName.add(queryList.get(s));
......
...@@ -65,6 +65,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul ...@@ -65,6 +65,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
for (TaxPayerReportRule rule : filterRules) { for (TaxPayerReportRule rule : filterRules) {
TaxPayerReportRuleDto ruleDto = new TaxPayerReportRuleDto(); TaxPayerReportRuleDto ruleDto = new TaxPayerReportRuleDto();
CommonUtils.copyProperties(rule, ruleDto); CommonUtils.copyProperties(rule, ruleDto);
ruleDto.setOrgs(new ArrayList<>(Arrays.asList(rule.getOrganizationID().split(","))));
dtoList.add(ruleDto); dtoList.add(ruleDto);
} }
return dtoList; return dtoList;
...@@ -87,6 +88,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul ...@@ -87,6 +88,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
for (TaxRuleSettingOperation trso : batchUpdateTaxRule.getTaxRuleSettingOperations()) { for (TaxRuleSettingOperation trso : batchUpdateTaxRule.getTaxRuleSettingOperations()) {
TaxRuleSetting taxRuleSetting = new TaxRuleSetting(); TaxRuleSetting taxRuleSetting = new TaxRuleSetting();
CommonUtils.copyProperties(trso.getTaxRuleSetting(), taxRuleSetting); CommonUtils.copyProperties(trso.getTaxRuleSetting(), taxRuleSetting);
taxRuleSetting.setTaxBase(String.valueOf(Integer.parseInt(trso.getTaxRuleSetting().getTaxBase())/100));
taxRuleSetting.setCreateTime(new Date()); taxRuleSetting.setCreateTime(new Date());
taxRuleSetting.setUpdateTime(new Date()); taxRuleSetting.setUpdateTime(new Date());
...@@ -123,6 +125,12 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul ...@@ -123,6 +125,12 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
TaxPayerReportRuleDto reportDto = tprrdo.getTaxPayerReportRule(); TaxPayerReportRuleDto reportDto = tprrdo.getTaxPayerReportRule();
TaxPayerReportRule taxPayerReportRule = new TaxPayerReportRule(); TaxPayerReportRule taxPayerReportRule = new TaxPayerReportRule();
CommonUtils.copyProperties(reportDto, taxPayerReportRule); CommonUtils.copyProperties(reportDto, taxPayerReportRule);
StringBuilder sb = new StringBuilder();
for(String s: reportDto.getOrgs()){
sb.append(s+",");
}
String tempStr = sb.toString();
taxPayerReportRule.setOrganizationID(tempStr.substring(0,tempStr.length()-2));
taxPayerReportRule.setCreateTime(new Date()); taxPayerReportRule.setCreateTime(new Date());
taxPayerReportRule.setUpdateTime(new Date()); taxPayerReportRule.setUpdateTime(new Date());
SaveOrganizationServiceTemplateGroup(taxPayerReportRule,tprrdo.getAction()); SaveOrganizationServiceTemplateGroup(taxPayerReportRule,tprrdo.getAction());
...@@ -135,6 +143,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul ...@@ -135,6 +143,7 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
TaxPayerReportRule old = taxPayerReportRuleMapper.selectByPrimaryKey(reportDto.getID()); TaxPayerReportRule old = taxPayerReportRuleMapper.selectByPrimaryKey(reportDto.getID());
TaxPayerReportRule original = new TaxPayerReportRule(); TaxPayerReportRule original = new TaxPayerReportRule();
CommonUtils.copyProperties(old, original); CommonUtils.copyProperties(old, original);
old.setIsDefault(taxPayerReportRule.getIsDefault()); old.setIsDefault(taxPayerReportRule.getIsDefault());
old.setOrganizationID(taxPayerReportRule.getOrganizationID()); old.setOrganizationID(taxPayerReportRule.getOrganizationID());
old.setTaxPayerType(taxPayerReportRule.getTaxPayerType()); old.setTaxPayerType(taxPayerReportRule.getTaxPayerType());
......
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