Commit c76a2465 by jiangyun

修改

parent 65e22788
...@@ -115,4 +115,7 @@ public interface SysDeptMapper ...@@ -115,4 +115,7 @@ public interface SysDeptMapper
* @return 结果 * @return 结果
*/ */
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
List<SysDept> selectDeptListByParentId(Long parentId);
} }
...@@ -133,4 +133,7 @@ public interface SysUserMapper ...@@ -133,4 +133,7 @@ public interface SysUserMapper
List<SysUser> selectUserListByRoleKey(String roleKey); List<SysUser> selectUserListByRoleKey(String roleKey);
List<SysUser> selectUserLoginNamesByRoleKeyAndDeptId(Long deptId, String roleKey, String deptName);
} }
...@@ -209,4 +209,7 @@ public interface ISysUserService ...@@ -209,4 +209,7 @@ public interface ISysUserService
List<String> selectUserLoginNamesByRoleKeyDept(Long secondaryUnit, String lcsp1); List<String> selectUserLoginNamesByRoleKeyDept(Long secondaryUnit, String lcsp1);
List<String> selectUserLoginNamesByRoleKeyDept2(Long secondaryUnit, String s); List<String> selectUserLoginNamesByRoleKeyDept2(Long secondaryUnit, String s);
List<String> selectUserLoginNamesByRoleKeyAndDeptId(Long secondaryUnit, String gcAqsp,String deptName);
} }
package com.zjsgfa.project.system.service.impl; package com.zjsgfa.project.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
...@@ -557,9 +558,7 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -557,9 +558,7 @@ public class SysUserServiceImpl implements ISysUserService
public List<String> selectUserLoginNamesByRoleKeyDept(Long deptId, String roleKey) { public List<String> selectUserLoginNamesByRoleKeyDept(Long deptId, String roleKey) {
List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey); List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey);
List<String> collect = userList.stream().map(SysUser::getUserName).collect(Collectors.toList()); List<String> collect = userList.stream().map(SysUser::getUserName).collect(Collectors.toList());
if(collect.size()==0){
collect.add("chenggq58");
}
return collect; return collect;
} }
...@@ -567,9 +566,13 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -567,9 +566,13 @@ public class SysUserServiceImpl implements ISysUserService
public List<String> selectUserLoginNamesByRoleKeyDept2(Long deptId, String roleKey) { public List<String> selectUserLoginNamesByRoleKeyDept2(Long deptId, String roleKey) {
List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey); List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey);
List<String> collect = userList.stream().map(SysUser::getNickName).collect(Collectors.toList()); List<String> collect = userList.stream().map(SysUser::getNickName).collect(Collectors.toList());
if(collect.size()==0){ return collect;
collect.add("成冠琪"); }
}
@Override
public List<String> selectUserLoginNamesByRoleKeyAndDeptId(Long deptId, String roleKey, String deptName) {
List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyAndDeptId(deptId,roleKey,deptName);
List<String> collect = userList.stream().map(SysUser::getUserName).collect(Collectors.toList());
return collect; return collect;
} }
} }
...@@ -18,6 +18,7 @@ import org.activiti.engine.TaskService; ...@@ -18,6 +18,7 @@ import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task; import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -60,11 +61,18 @@ public class DjjcLcController ...@@ -60,11 +61,18 @@ public class DjjcLcController
* 工程_专家审批 * 工程_专家审批
*/ */
public static final String GC_ZJSP = "gc_zjsp"; public static final String GC_ZJSP = "gc_zjsp";
public static final String GC_ZJSPHB = "gc_zjsphb";
public static final String GC_ZJSP_YYY_NDY = "gc_zjsp_yyy_ndy";
/** /**
* 工程_首席专家 * 工程_首席专家
*/ */
public static final String GC_SXZJ = "gc_sxzj"; public static final String GC_SXZJ = "gc_sxzj";
public static final String GC_SXZJ_CZJ = "gc_sxzj_czj";
public static final String GC_SXZJ_YYY = "gc_sxzj_yyy";
public static final String GC_SXZJ_SCJ = "gc_sxzj_scj";
/** /**
* 工程_分管领导 * 工程_分管领导
...@@ -148,6 +156,7 @@ public class DjjcLcController ...@@ -148,6 +156,7 @@ public class DjjcLcController
@GetMapping("/submitApply") @GetMapping("/submitApply")
@Transactional
public AjaxResult getDjjcLc(Long ID) public AjaxResult getDjjcLc(Long ID)
{ {
...@@ -197,6 +206,7 @@ public class DjjcLcController ...@@ -197,6 +206,7 @@ public class DjjcLcController
* @return * @return
*/ */
@PostMapping("/complete") @PostMapping("/complete")
@Transactional
public AjaxResult complete(@RequestBody SjDjjc sjDjjc) { public AjaxResult complete(@RequestBody SjDjjc sjDjjc) {
try { try {
...@@ -230,6 +240,9 @@ public class DjjcLcController ...@@ -230,6 +240,9 @@ public class DjjcLcController
if(secondaryUnit==null){ if(secondaryUnit==null){
secondaryUnit=applyUserDeptId; secondaryUnit=applyUserDeptId;
} }
//查询二级单位下所有的单位
List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
Map<String,Object> variables =new HashMap<>(); Map<String,Object> variables =new HashMap<>();
String ndxsjg = entity.getNdxsjg(); String ndxsjg = entity.getNdxsjg();
...@@ -251,9 +264,35 @@ public class DjjcLcController ...@@ -251,9 +264,35 @@ public class DjjcLcController
// 根据当前不同的节点,下一节点不同,需要设置的处理人不同 // 根据当前不同的节点,下一节点不同,需要设置的处理人不同
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过 // 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
if (GC_AQSP.equals(act_id)) {//当前节点 安全审批 if (GC_AQSP.equals(act_id)) {//当前节点 安全审批
//判断发起人的部门
List<String> assignee=new ArrayList<>();
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(applyUserDeptId,GC_ZZSP));
//侧钻井站(侧钻井站长和华北站的都可以审批)
if(sysDept.getDeptId()==116L){
//查询华北站审批人
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 119L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_ZZSP));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井和探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 125L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_ZZSP));
}
SysDept sysDept2 = sysDeptList.stream().filter(item -> item.getDeptId() == 124L).findFirst().orElse(null);
if(sysDept2!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept2.getDeptId(),GC_ZZSP));
}
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_ZZSP); }else {
variables.put(paramName_audit_user, assignee); assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(applyUserDeptId,GC_ZZSP));
}
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
}else if (GC_ZZSP.equals(act_id)) {//当前节点 站长审批 }else if (GC_ZZSP.equals(act_id)) {//当前节点 站长审批
if(ndxsjg.equals("3")){ if(ndxsjg.equals("3")){
...@@ -261,28 +300,84 @@ public class DjjcLcController ...@@ -261,28 +300,84 @@ public class DjjcLcController
tmpProject.setProcessStatus("通过"); tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_ZJSP); List<String> assignee=new ArrayList<>();
variables.put(paramName_audit_user, assignee); //侧钻井+生产井、探井
if(sysDept.getDeptId()==116L || sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//查询华北站审批人
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 115L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_ZJSP));
}
}else if(sysDept.getDeptId()==119L){
//华北
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 128L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_ZJSPHB));
}
}else if(sysDept.getDeptId()==126L || sysDept.getDeptId()==122L){
//页岩油+难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 128L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_ZJSP_YYY_NDY));
}
}
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (GC_ZJSP.equals(act_id)) {//当前节点 站长审批 }else if (GC_ZJSP.equals(act_id)) {//当前节点 专家审批
if(ndxsjg.equals("5")){ if(ndxsjg.equals("5")){
variables.put(processTrend, "结束"); variables.put(processTrend, "结束");
tmpProject.setProcessStatus("通过"); tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_SXZJ); List<String> assignee=new ArrayList<>();
variables.put(paramName_audit_user, assignee); if(sysDept.getDeptId()==122L){
//难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_SXZJ));
}
}else if(sysDept.getDeptId()==116L){
//侧钻井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_SXZJ_CZJ));
}
}else if(sysDept.getDeptId()==126L){
//页岩油
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_SXZJ_YYY));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井、探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),GC_SXZJ_SCJ));
}
}
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (GC_SXZJ.equals(act_id)) {//当前节点 站长审批 }else if (GC_SXZJ.equals(act_id)) {//当前节点 首席专家审批
if(ndxsjg.equals("7")){ if(ndxsjg.equals("7")){
variables.put(processTrend, "结束"); variables.put(processTrend, "结束");
tmpProject.setProcessStatus("通过"); tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_FGLD); List<String> assignee =new ArrayList<>();
variables.put(paramName_audit_user, assignee); assignee = userService.selectUserLoginNamesByRoleKeyDept(118L,GC_FGLD);
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (GC_FGLD.equals(act_id)) {//当前节点 站长审批 }else if (GC_FGLD.equals(act_id)) {//当前节点 站长审批
tmpProject.setProcessStatus("通过"); tmpProject.setProcessStatus("通过");
...@@ -312,6 +407,7 @@ public class DjjcLcController ...@@ -312,6 +407,7 @@ public class DjjcLcController
@GetMapping("/submitApplyZjy") @GetMapping("/submitApplyZjy")
@Transactional
public AjaxResult submitApplyZjy(Long ID) public AjaxResult submitApplyZjy(Long ID)
{ {
...@@ -363,6 +459,7 @@ public class DjjcLcController ...@@ -363,6 +459,7 @@ public class DjjcLcController
* @return * @return
*/ */
@PostMapping("/completeZjy") @PostMapping("/completeZjy")
@Transactional
public AjaxResult completeZjy(@RequestBody SjDjjc sjDjjc) { public AjaxResult completeZjy(@RequestBody SjDjjc sjDjjc) {
try { try {
...@@ -396,6 +493,8 @@ public class DjjcLcController ...@@ -396,6 +493,8 @@ public class DjjcLcController
if(secondaryUnit==null){ if(secondaryUnit==null){
secondaryUnit=applyUserDeptId; secondaryUnit=applyUserDeptId;
} }
//查询二级单位下所有的单位
List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
Map<String,Object> variables =new HashMap<>(); Map<String,Object> variables =new HashMap<>();
String ndxsjg = entity.getNdxsjg(); String ndxsjg = entity.getNdxsjg();
...@@ -417,9 +516,26 @@ public class DjjcLcController ...@@ -417,9 +516,26 @@ public class DjjcLcController
// 根据当前不同的节点,下一节点不同,需要设置的处理人不同 // 根据当前不同的节点,下一节点不同,需要设置的处理人不同
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过 // 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
if (ZJY_AQSP.equals(act_id)) {//当前节点 安全审批 if (ZJY_AQSP.equals(act_id)) {//当前节点 安全审批
List<String> assignee=new ArrayList<>();
assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_ZZSP);
if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井和探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 125L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),ZJY_ZZSP));
}
SysDept sysDept2 = sysDeptList.stream().filter(item -> item.getDeptId() == 124L).findFirst().orElse(null);
if(sysDept2!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept2.getDeptId(),ZJY_ZZSP));
}
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_ZZSP); }
variables.put(paramName_audit_user, assignee);
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
}else if (ZJY_ZZSP.equals(act_id)) {//当前节点 站长审批 }else if (ZJY_ZZSP.equals(act_id)) {//当前节点 站长审批
if(ndxsjg.equals("3")){ if(ndxsjg.equals("3")){
...@@ -427,30 +543,60 @@ public class DjjcLcController ...@@ -427,30 +543,60 @@ public class DjjcLcController
tmpProject.setZjyprocessStatus("通过"); tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_ZZSP); List<String> assignee=new ArrayList<>();
variables.put(paramName_audit_user, assignee); if(sysDept.getDeptId()==116L || sysDept.getDeptId()==122L){
//侧钻井+难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 127L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==126L){
//页岩油
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 126L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井、探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 129L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==119L ){
//华北站
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 119L).findFirst().orElse(null);
if(sysDept1!=null){
assignee.addAll(userService.selectUserLoginNamesByRoleKeyDept(sysDept1.getDeptId(),ZJY_ZJSP));
}
}
if(assignee.size()==0){
assignee.add("chenggq58");
}
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (ZJY_ZJSP.equals(act_id)) {//当前节点 站长审批 }else if (ZJY_ZJSP.equals(act_id)) {//当前节点 专家审批
if(ndxsjg.equals("5")){ if(ndxsjg.equals("5")){
variables.put(processTrend, "结束"); variables.put(processTrend, "结束");
tmpProject.setZjyprocessStatus("通过"); tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_SXZJ); //分管领导
variables.put(paramName_audit_user, assignee); List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(118L,ZJY_SXZJ);
variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (ZJY_SXZJ.equals(act_id)) {//当前节点 站长审批 }else if (ZJY_SXZJ.equals(act_id)) {//当前节点 首席专家审批
if(ndxsjg.equals("7")){ if(ndxsjg.equals("7")){
variables.put(processTrend, "结束"); variables.put(processTrend, "结束");
tmpProject.setZjyprocessStatus("通过"); tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
}else { }else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_FGLD); List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(118L,ZJY_FGLD);
variables.put(paramName_audit_user, assignee); variables.put(paramName_audit_user, assignee.stream().distinct().collect(Collectors.toList()));
} }
}else if (ZJY_FGLD.equals(act_id)) {//当前节点 站长审批 }else if (ZJY_FGLD.equals(act_id)) {//当前节点 分管领导审批
tmpProject.setZjyprocessStatus("通过"); tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject); sjDjjcMapper.updateSjDjjcById(tmpProject);
} }
...@@ -505,7 +651,7 @@ public class DjjcLcController ...@@ -505,7 +651,7 @@ public class DjjcLcController
List<Map<String, Object>> jdList = buildProcessNodes(isEngineeringType, ndjg, approvalInfo.getApplyUserName()); List<Map<String, Object>> jdList = buildProcessNodes(isEngineeringType, ndjg, approvalInfo.getApplyUserName());
// 查询审批人员并设置节点状态 // 查询审批人员并设置节点状态
populateNodeUserInfo(jdList, bizTodoItems, approvalInfo.getSecondaryUnit()); populateNodeUserInfo(jdList, bizTodoItems, approvalInfo.getSecondaryUnit(),approvalInfo.applyUserDeptId,isEngineeringType);
resultMap.put("jdList", jdList); resultMap.put("jdList", jdList);
return success(resultMap); return success(resultMap);
...@@ -589,7 +735,8 @@ public class DjjcLcController ...@@ -589,7 +735,8 @@ public class DjjcLcController
private String ndxsjg; private String ndxsjg;
private String applyUserName; private String applyUserName;
private Long secondaryUnit; private Long secondaryUnit;
private Long applyUserDeptId;
// getters and setters // getters and setters
public String getNdxsjg() { return ndxsjg; } public String getNdxsjg() { return ndxsjg; }
public void setNdxsjg(String ndxsjg) { this.ndxsjg = ndxsjg; } public void setNdxsjg(String ndxsjg) { this.ndxsjg = ndxsjg; }
...@@ -597,6 +744,9 @@ public class DjjcLcController ...@@ -597,6 +744,9 @@ public class DjjcLcController
public void setApplyUserName(String applyUserName) { this.applyUserName = applyUserName; } public void setApplyUserName(String applyUserName) { this.applyUserName = applyUserName; }
public Long getSecondaryUnit() { return secondaryUnit; } public Long getSecondaryUnit() { return secondaryUnit; }
public void setSecondaryUnit(Long secondaryUnit) { this.secondaryUnit = secondaryUnit; } public void setSecondaryUnit(Long secondaryUnit) { this.secondaryUnit = secondaryUnit; }
public Long getApplyUserDeptId() { return applyUserDeptId; }
public void setApplyUserDeptId(Long applyUserDeptId) { this.applyUserDeptId = applyUserDeptId; }
} }
/** /**
...@@ -618,7 +768,8 @@ public class DjjcLcController ...@@ -618,7 +768,8 @@ public class DjjcLcController
SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId); SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors()); Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
info.setSecondaryUnit(secondaryUnit != null ? secondaryUnit : applyUserDeptId); info.setSecondaryUnit(secondaryUnit != null ? secondaryUnit : applyUserDeptId);
info.setApplyUserDeptId(applyUserDeptId);
return info; return info;
} }
...@@ -672,21 +823,161 @@ public class DjjcLcController ...@@ -672,21 +823,161 @@ public class DjjcLcController
/** /**
* 填充节点用户信息和状态 * 填充节点用户信息和状态
*/ */
private void populateNodeUserInfo(List<Map<String, Object>> jdList, List<BizTodoItem> bizTodoItems, Long secondaryUnit) { private void populateNodeUserInfo(List<Map<String, Object>> jdList, List<BizTodoItem> bizTodoItems, Long secondaryUnit,Long applyUserDeptId,Boolean isEngineeringType) {
for (Map<String, Object> item : jdList) { List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
String nodeName = item.get("name").toString(); SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
for (Map<String, Object> it : jdList) {
String nodeName = it.get("name").toString();
// 设置审批人员(除开始节点外) // 设置审批人员(除开始节点外)
if (!"开始".equals(nodeName)) { if (!"开始".equals(nodeName)) {
String roleKey = item.get("roleKye").toString(); String roleKey = it.get("roleKye").toString();
List<String> userList = userService.selectUserLoginNamesByRoleKeyDept2(secondaryUnit, roleKey); List<String> userList= new ArrayList<>();
item.put("userList", userList); //设置人员
if(isEngineeringType){
//安全
if(roleKey.equals(GC_AQSP)){
userList = userService.selectUserLoginNamesByRoleKeyDept2(132L, GC_AQSP);
}else if(roleKey.equals(GC_ZZSP)){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(applyUserDeptId,GC_ZZSP));
//侧钻井站(侧钻井站长和华北站的都可以审批)
if(sysDept.getDeptId()==116L){
//查询华北站审批人
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 119L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_ZZSP));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井和探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 125L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_ZZSP));
}
SysDept sysDept2 = sysDeptList.stream().filter(item -> item.getDeptId() == 124L).findFirst().orElse(null);
if(sysDept2!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept2.getDeptId(),GC_ZZSP));
}
}else {
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(applyUserDeptId,GC_ZZSP));
}
}else if(roleKey.equals(GC_ZJSP)){
//侧钻井+生产井、探井
if(sysDept.getDeptId()==116L || sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 115L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_ZJSP));
}
}else if(sysDept.getDeptId()==119L){
//华北
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 128L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_ZJSPHB));
}
}else if(sysDept.getDeptId()==126L || sysDept.getDeptId()==122L){
//页岩油+难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 128L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_ZJSP_YYY_NDY));
}
}
}else if(roleKey.equals(GC_SXZJ)){
if(sysDept.getDeptId()==122L){
//难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_SXZJ));
}
}else if(sysDept.getDeptId()==116L){
//侧钻井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_SXZJ_CZJ));
}
}else if(sysDept.getDeptId()==126L){
//页岩油
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_SXZJ_YYY));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井、探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 121L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),GC_SXZJ_SCJ));
}
}
}else if(roleKey.equals(GC_FGLD)){
userList = userService.selectUserLoginNamesByRoleKeyDept2(118L,GC_FGLD);
}
}else {
//钻井液
if(roleKey.equals(ZJY_AQSP)){
userList = userService.selectUserLoginNamesByRoleKeyDept2(132L, ZJY_AQSP);
}else if(roleKey.equals(ZJY_ZZSP)){
userList = userService.selectUserLoginNamesByRoleKeyDept2(sysDept.getDeptId(),ZJY_ZZSP);
if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井和探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 125L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),ZJY_ZZSP));
}
SysDept sysDept2 = sysDeptList.stream().filter(item -> item.getDeptId() == 124L).findFirst().orElse(null);
if(sysDept2!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept2.getDeptId(),ZJY_ZZSP));
}
}
}else if(roleKey.equals(ZJY_ZJSP)){
if(sysDept.getDeptId()==116L || sysDept.getDeptId()==122L){
//侧钻井+难动用
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 127L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==126L){
//页岩油
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 126L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==124L || sysDept.getDeptId()==125L){
//生产井、探井
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 129L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),ZJY_ZJSP));
}
}else if(sysDept.getDeptId()==119L ){
//华北站
SysDept sysDept1 = sysDeptList.stream().filter(item -> item.getDeptId() == 119L).findFirst().orElse(null);
if(sysDept1!=null){
userList.addAll(userService.selectUserLoginNamesByRoleKeyDept2(sysDept1.getDeptId(),ZJY_ZJSP));
}
}
}else if(roleKey.equals(ZJY_SXZJ) ){
userList = userService.selectUserLoginNamesByRoleKeyDept2(118L,ZJY_SXZJ);
}else if(roleKey.equals(ZJY_FGLD) ){
userList = userService.selectUserLoginNamesByRoleKeyDept2(118L,ZJY_FGLD);
}
}
if(userList.size()==0){
userList.add("成冠琪");
}
// userList = userService.selectUserLoginNamesByRoleKeyDept2(secondaryUnit, roleKey);
it.put("userList", userList.stream().distinct().collect(Collectors.toList()));
// 设置节点执行状态 // 设置节点执行状态
boolean isExecuted = bizTodoItems.stream() boolean isExecuted = bizTodoItems.stream()
.anyMatch(todo -> todo.getNodeName().equals(nodeName) && "1".equals(todo.getIsHandle())); .anyMatch(todo -> todo.getNodeName().equals(nodeName) && "1".equals(todo.getIsHandle()));
item.put("jdxz", isExecuted); it.put("jdxz", isExecuted);
}else { }else {
item.put("jdxz", true); it.put("jdxz", true);
} }
...@@ -725,11 +1016,13 @@ public class DjjcLcController ...@@ -725,11 +1016,13 @@ public class DjjcLcController
String applyUserId = entity.getApplyUser(); String applyUserId = entity.getApplyUser();
Long applyUserDeptId = userService.selectUserByLoginName(applyUserId).getDeptId(); Long applyUserDeptId = userService.selectUserByLoginName(applyUserId).getDeptId();
SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId); SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
//获取到黄河钻井公司
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors()); Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
//获取安全审批站点人员
// 设置下一节点处理人 // 设置下一节点处理人
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit, GC_AQSP); List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(132L, GC_AQSP);
// List<String> assignee = userService.selectUserLoginNamesByRoleKeyAndDeptId(secondaryUnit, GC_AQSP,"安全审批");
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过 // 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId
...@@ -776,7 +1069,9 @@ public class DjjcLcController ...@@ -776,7 +1069,9 @@ public class DjjcLcController
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors()); Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
// 设置下一节点处理人 // 设置下一节点处理人
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit, ZJY_AQSP); List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(132L, ZJY_AQSP);
// List<String> assignee = userService.selectUserLoginNamesByRoleKeyAndDeptId(secondaryUnit, ZJY_AQSP,"安全审批");
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过 // 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId
......
...@@ -114,6 +114,12 @@ public class SjLjfzqkController extends BaseController ...@@ -114,6 +114,12 @@ public class SjLjfzqkController extends BaseController
} }
@PostMapping("/plSave")
public AjaxResult plSave(@RequestBody List<SjLjfzqk> list) throws Exception
{
return toAjax(sjLjfzqkService.insertSjLjfzqkBatch2(list));
}
} }
...@@ -110,7 +110,7 @@ public class SjLjjw extends BaseEntity ...@@ -110,7 +110,7 @@ public class SjLjjw extends BaseEntity
//完钻垂直井深 //完钻垂直井深
private Double wzczjs; private Double wzczjs;
//钻机台月 //钻机台月
private Double zjy; private String zjy;
//建井周期 //建井周期
private String jjzq1; private String jjzq1;
......
...@@ -62,4 +62,5 @@ public interface ISjLjfzqkService ...@@ -62,4 +62,5 @@ public interface ISjLjfzqkService
int insertSjLjfzqkBatch(List<SjLjjw> list); int insertSjLjfzqkBatch(List<SjLjjw> list);
int insertSjLjfzqkBatch2(List<SjLjfzqk> list);
} }
...@@ -124,4 +124,13 @@ public class SjLjfzqkServiceImpl implements ISjLjfzqkService ...@@ -124,4 +124,13 @@ public class SjLjfzqkServiceImpl implements ISjLjfzqkService
return 1; return 1;
} }
@Override
public int insertSjLjfzqkBatch2(List<SjLjfzqk> list) {
String jh = list.get(0).getJh();
SjDjjc sjDjjc = sjDjjcMapper.selectSjDjjcByJh(jh);
//先删除已有数据
sjLjfzqkMapper.deleteSjLjfzqkByJh(sjDjjc.getId());
return sjLjfzqkMapper.insertSjLjfzqkBatch(list);
}
} }
...@@ -59,7 +59,7 @@ public class SjZysxServiceImpl implements ISjZysxService ...@@ -59,7 +59,7 @@ public class SjZysxServiceImpl implements ISjZysxService
public int insertSjZysx(SjZysx sjZysx) public int insertSjZysx(SjZysx sjZysx)
{ {
String lb = sjZysx.getLb(); String lb = sjZysx.getLb();
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)){ if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)|| "浅层气".equals(lb)){
if(StringUtils.isNotEmpty(sjZysx.getZysx())){ if(StringUtils.isNotEmpty(sjZysx.getZysx())){
sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8)); sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8));
} }
...@@ -77,7 +77,7 @@ public class SjZysxServiceImpl implements ISjZysxService ...@@ -77,7 +77,7 @@ public class SjZysxServiceImpl implements ISjZysxService
public int updateSjZysx(SjZysx sjZysx) public int updateSjZysx(SjZysx sjZysx)
{ {
String lb = sjZysx.getLb(); String lb = sjZysx.getLb();
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)){ if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)|| "浅层气".equals(lb)){
if(StringUtils.isNotEmpty(sjZysx.getZysx())){ if(StringUtils.isNotEmpty(sjZysx.getZysx())){
sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8)); sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8));
} }
......
...@@ -86,7 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,7 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select> </select>
<select id="selectDeptListByParentId" resultType="com.zjsgfa.project.system.domain.SysDept">
select * from sys_dept where parent_id = #{parentId} and del_flag = '0'
</select>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept">
insert into sys_dept( insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>
......
...@@ -159,8 +159,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -159,8 +159,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from sys_user where user_id in ( select user_id from sys_user_role where role_id = ( select role_id from sys_role where role_key = #{roleKey} ) ) select * from sys_user where user_id in ( select user_id from sys_user_role where role_id = ( select role_id from sys_role where role_key = #{roleKey} ) )
and del_flag = '0' and del_flag = '0'
</select> </select>
<select id="selectUserLoginNamesByRoleKeyAndDeptId" resultType="com.zjsgfa.project.system.domain.SysUser">
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> select a.*, r.role_key, role_name
from sys_user a
left join sys_dept d on a.dept_id = d.dept_id
left join sys_user_role ur on a.user_id = ur.user_id
left join sys_role r on ur.role_id = r.role_id
where 1 = 1
and a.dept_id in (select dept_id from sys_dept where parent_id = #{deptId} and dept_name = #{deptName})
and role_key =#{roleKey}
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user( insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if> <if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>
......
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