Commit 34ceeb01 by hzc

增加任务规则的级别

parent fe95c08b
......@@ -103,8 +103,17 @@ public class TaskRule extends BaseModel {
private Date lastActiveTime;
/**
* 1省 2市 3县(增加规则用户机构的级别)
*/
private Integer orgType;
/**
* 关联的指标
*/
@Transient
private List<TaskRuleIndicator> indicators;
/**
* 接收机构编号
* */
@Transient
private String orgNo;
}
......@@ -57,6 +57,17 @@ public class TaskRuleServiceImpl implements TaskRuleService {
@Override
@Transactional(rollbackFor = Exception.class)
public void createRule(TaskRule rule) {
String orgNo = rule.getOrgNo();
int size = orgNo.length();
int orgType=0;
if(size==2){
orgType = Constants.RULE_TYPE_PROVINCE;
}else if(size==4){
orgType = Constants.RULE_TYPE_CITY;
}else if(size==6){
orgType = Constants.RULE_TYPE_COUNTY;
}
rule.setOrgType(orgType);
rule.setState(Constants.DATA_STATE_A);
taskRuleMapper.insert(rule);
saveRuleIndicators(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