Commit 1ff127fa by hzc

修改null bug

parent 99432c4c
...@@ -58,15 +58,18 @@ public class TaskRuleServiceImpl implements TaskRuleService { ...@@ -58,15 +58,18 @@ public class TaskRuleServiceImpl implements TaskRuleService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void createRule(TaskRule rule) { public void createRule(TaskRule rule) {
String orgNo = rule.getOrgNo(); String orgNo = rule.getOrgNo();
int size = orgNo.length();
int orgType=0; int orgType=0;
if(size==2){ if(orgNo!=null&&orgNo!=""){
orgType = Constants.RULE_TYPE_PROVINCE; int size = orgNo.length();
}else if(size==4){ if(size==2){
orgType = Constants.RULE_TYPE_CITY; orgType = Constants.RULE_TYPE_PROVINCE;
}else if(size==6){ }else if(size==4){
orgType = Constants.RULE_TYPE_COUNTY; orgType = Constants.RULE_TYPE_CITY;
}else if(size==6){
orgType = Constants.RULE_TYPE_COUNTY;
}
} }
rule.setOrgType(orgType); rule.setOrgType(orgType);
rule.setState(Constants.DATA_STATE_A); rule.setState(Constants.DATA_STATE_A);
taskRuleMapper.insert(rule); taskRuleMapper.insert(rule);
......
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