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