diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java index f39b2470..c718ec5b 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java @@ -19,6 +19,7 @@ import org.activiti.engine.delegate.event.ActivitiEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.Map; @@ -30,7 +31,10 @@ import java.util.Map; public class CorrectionListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate { private static Logger logger = LoggerFactory.getLogger(CorrectionListener.class); - private static String roleName = "部门审批人"; + @Value("${big_date.assignee_role_name}") + private static String roleName; + @Value("${big_date.name}") + private static String bigDateDeptName; @Autowired private SysRoleService sysRoleService; @@ -66,8 +70,8 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti deptId = resourceEntityDto.getDeptId(); SysDeptDTO deptDTO = sysDeptService.get(resourceEntityDto.getDeptId()); - if (deptDTO != null && deptDTO.getName().equals("青岛市大数据发展管理局")) { - logger.error("第二级别审批仍然为 青岛市大数据发展管理局"); + if (deptDTO != null && deptDTO.getName().equals(bigDateDeptName)) { + logger.error("第二级别审批仍然为 " + bigDateDeptName); taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java index 9e546782..354c11b5 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java @@ -14,6 +14,7 @@ import org.activiti.engine.delegate.event.ActivitiEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** @@ -23,8 +24,10 @@ import org.springframework.stereotype.Component; public class DataCenterListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate { private static Logger logger = LoggerFactory.getLogger(DataCenterListener.class); - private static String deptName = "青岛市大数据发展管理局"; - private static String roleName = "部门审批人"; + @Value("${big_date.name}") + private static String bigDateDeptName; + @Value("${big_date.assignee_role_name}") + private static String roleName; @Autowired private SysRoleService sysRoleService; @@ -49,16 +52,17 @@ public class DataCenterListener implements TaskListener, ExecutionListener, Acti @Override public void notify(DelegateTask delegateTask) { - SysDeptDTO deptDTO = sysDeptService.getByName(deptName); + SysDeptDTO deptDTO = sysDeptService.getByName(bigDateDeptName); logger.info("deptDTOId:" + deptDTO.getId()); SysRoleDTO roleDTO = sysRoleService.getByName(roleName); logger.info("roleDTOId:" + roleDTO.getId()); SysUserDTO userDTO = sysUserService.getByDeptIdAndRoleId(deptDTO.getId(), roleDTO.getId()); - delegateTask.setAssignee("1513432847327199233"); + if (userDTO != null) { logger.info("审批人id:" + userDTO.getId()); taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString()); } else { + delegateTask.setAssignee("1513432847327199233"); logger.info("未查到该部门对应 " + roleName); } } diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index 203e6cdd..d3b28cd0 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -56,6 +56,11 @@ resource: root_url: 15.2.21.238 path: /home/yth/files/ devModelFilePath: /home/yth/files/resource +# 大数据部门相关配置 +big_date: + name: 青岛市大数据发展管理局 + assignee_role_name: 部门审批人 + ##多数据源的配置,需要引用renren-dynamic-datasource #dynamic: diff --git a/renren-admin/src/main/resources/application-prod.yml b/renren-admin/src/main/resources/application-prod.yml index f30a8847..7111c7ba 100644 --- a/renren-admin/src/main/resources/application-prod.yml +++ b/renren-admin/src/main/resources/application-prod.yml @@ -38,4 +38,8 @@ spring: resource: root_url: 15.2.21.238 path: /data/services/nengli/files/ - devModelFilePath: /data/services/nengli/files/resource \ No newline at end of file + devModelFilePath: /data/services/nengli/files/resource +# 大数据部门相关配置 +big_date: + name: 青岛市大数据发展管理局 + assignee_role_name: 部门审批人 \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-test.yml b/renren-admin/src/main/resources/application-test.yml index edd53131..42ef7767 100644 --- a/renren-admin/src/main/resources/application-test.yml +++ b/renren-admin/src/main/resources/application-test.yml @@ -39,4 +39,8 @@ spring: resource: root_url: 15.2.21.238 path: /home/yth/files/ - devModelFilePath: /home/yth/files/resource \ No newline at end of file + devModelFilePath: /home/yth/files/resource +# 大数据部门相关配置 +big_date: + name: 青岛市大数据发展管理局 + assignee_role_name: 部门审批人 \ No newline at end of file