Commit c76a2465 by jiangyun

修改

parent 65e22788
......@@ -115,4 +115,7 @@ public interface SysDeptMapper
* @return 结果
*/
public int deleteDeptById(Long deptId);
List<SysDept> selectDeptListByParentId(Long parentId);
}
......@@ -133,4 +133,7 @@ public interface SysUserMapper
List<SysUser> selectUserListByRoleKey(String roleKey);
List<SysUser> selectUserLoginNamesByRoleKeyAndDeptId(Long deptId, String roleKey, String deptName);
}
......@@ -209,4 +209,7 @@ public interface ISysUserService
List<String> selectUserLoginNamesByRoleKeyDept(Long secondaryUnit, String lcsp1);
List<String> selectUserLoginNamesByRoleKeyDept2(Long secondaryUnit, String s);
List<String> selectUserLoginNamesByRoleKeyAndDeptId(Long secondaryUnit, String gcAqsp,String deptName);
}
package com.zjsgfa.project.system.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
......@@ -557,9 +558,7 @@ public class SysUserServiceImpl implements ISysUserService
public List<String> selectUserLoginNamesByRoleKeyDept(Long deptId, String roleKey) {
List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey);
List<String> collect = userList.stream().map(SysUser::getUserName).collect(Collectors.toList());
if(collect.size()==0){
collect.add("chenggq58");
}
return collect;
}
......@@ -567,9 +566,13 @@ public class SysUserServiceImpl implements ISysUserService
public List<String> selectUserLoginNamesByRoleKeyDept2(Long deptId, String roleKey) {
List<SysUser> userList=userMapper.selectUserLoginNamesByRoleKeyDept(deptId,roleKey);
List<String> collect = userList.stream().map(SysUser::getNickName).collect(Collectors.toList());
if(collect.size()==0){
collect.add("成冠琪");
return collect;
}
@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;
}
}
......@@ -18,6 +18,7 @@ import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
......@@ -60,11 +61,18 @@ public class DjjcLcController
* 工程_专家审批
*/
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_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
@GetMapping("/submitApply")
@Transactional
public AjaxResult getDjjcLc(Long ID)
{
......@@ -197,6 +206,7 @@ public class DjjcLcController
* @return
*/
@PostMapping("/complete")
@Transactional
public AjaxResult complete(@RequestBody SjDjjc sjDjjc) {
try {
......@@ -230,6 +240,9 @@ public class DjjcLcController
if(secondaryUnit==null){
secondaryUnit=applyUserDeptId;
}
//查询二级单位下所有的单位
List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
Map<String,Object> variables =new HashMap<>();
String ndxsjg = entity.getNdxsjg();
......@@ -251,9 +264,35 @@ public class DjjcLcController
// 根据当前不同的节点,下一节点不同,需要设置的处理人不同
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
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);
variables.put(paramName_audit_user, assignee);
}else {
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)) {//当前节点 站长审批
if(ndxsjg.equals("3")){
......@@ -261,28 +300,84 @@ public class DjjcLcController
tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_ZJSP);
variables.put(paramName_audit_user, assignee);
List<String> assignee=new ArrayList<>();
//侧钻井+生产井、探井
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));
}
}
}else if (GC_ZJSP.equals(act_id)) {//当前节点 站长审批
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)) {//当前节点 专家审批
if(ndxsjg.equals("5")){
variables.put(processTrend, "结束");
tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_SXZJ);
variables.put(paramName_audit_user, assignee);
List<String> assignee=new ArrayList<>();
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));
}
}else if (GC_SXZJ.equals(act_id)) {//当前节点 站长审批
}
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)) {//当前节点 首席专家审批
if(ndxsjg.equals("7")){
variables.put(processTrend, "结束");
tmpProject.setProcessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,GC_FGLD);
variables.put(paramName_audit_user, assignee);
List<String> assignee =new ArrayList<>();
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)) {//当前节点 站长审批
tmpProject.setProcessStatus("通过");
......@@ -312,6 +407,7 @@ public class DjjcLcController
@GetMapping("/submitApplyZjy")
@Transactional
public AjaxResult submitApplyZjy(Long ID)
{
......@@ -363,6 +459,7 @@ public class DjjcLcController
* @return
*/
@PostMapping("/completeZjy")
@Transactional
public AjaxResult completeZjy(@RequestBody SjDjjc sjDjjc) {
try {
......@@ -396,6 +493,8 @@ public class DjjcLcController
if(secondaryUnit==null){
secondaryUnit=applyUserDeptId;
}
//查询二级单位下所有的单位
List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
Map<String,Object> variables =new HashMap<>();
String ndxsjg = entity.getNdxsjg();
......@@ -417,9 +516,26 @@ public class DjjcLcController
// 根据当前不同的节点,下一节点不同,需要设置的处理人不同
// 下一节点审核节点 处理人为根据角色code取多人 一人处理即可通过
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)) {//当前节点 站长审批
if(ndxsjg.equals("3")){
......@@ -427,30 +543,60 @@ public class DjjcLcController
tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_ZZSP);
variables.put(paramName_audit_user, assignee);
List<String> assignee=new ArrayList<>();
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));
}
}
}else if (ZJY_ZJSP.equals(act_id)) {//当前节点 站长审批
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)) {//当前节点 专家审批
if(ndxsjg.equals("5")){
variables.put(processTrend, "结束");
tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}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")){
variables.put(processTrend, "结束");
tmpProject.setZjyprocessStatus("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}else {
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(secondaryUnit,ZJY_FGLD);
variables.put(paramName_audit_user, assignee);
List<String> assignee = userService.selectUserLoginNamesByRoleKeyDept(118L,ZJY_FGLD);
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("通过");
sjDjjcMapper.updateSjDjjcById(tmpProject);
}
......@@ -505,7 +651,7 @@ public class DjjcLcController
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);
return success(resultMap);
......@@ -589,6 +735,7 @@ public class DjjcLcController
private String ndxsjg;
private String applyUserName;
private Long secondaryUnit;
private Long applyUserDeptId;
// getters and setters
public String getNdxsjg() { return ndxsjg; }
......@@ -597,6 +744,9 @@ public class DjjcLcController
public void setApplyUserName(String applyUserName) { this.applyUserName = applyUserName; }
public Long getSecondaryUnit() { return secondaryUnit; }
public void setSecondaryUnit(Long secondaryUnit) { this.secondaryUnit = secondaryUnit; }
public Long getApplyUserDeptId() { return applyUserDeptId; }
public void setApplyUserDeptId(Long applyUserDeptId) { this.applyUserDeptId = applyUserDeptId; }
}
/**
......@@ -618,6 +768,7 @@ public class DjjcLcController
SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
info.setSecondaryUnit(secondaryUnit != null ? secondaryUnit : applyUserDeptId);
info.setApplyUserDeptId(applyUserDeptId);
return info;
}
......@@ -672,21 +823,161 @@ public class DjjcLcController
/**
* 填充节点用户信息和状态
*/
private void populateNodeUserInfo(List<Map<String, Object>> jdList, List<BizTodoItem> bizTodoItems, Long secondaryUnit) {
for (Map<String, Object> item : jdList) {
String nodeName = item.get("name").toString();
private void populateNodeUserInfo(List<Map<String, Object>> jdList, List<BizTodoItem> bizTodoItems, Long secondaryUnit,Long applyUserDeptId,Boolean isEngineeringType) {
List<SysDept> sysDeptList=sysDeptMapper.selectDeptListByParentId(secondaryUnit);
SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
for (Map<String, Object> it : jdList) {
String nodeName = it.get("name").toString();
// 设置审批人员(除开始节点外)
if (!"开始".equals(nodeName)) {
String roleKey = item.get("roleKye").toString();
List<String> userList = userService.selectUserLoginNamesByRoleKeyDept2(secondaryUnit, roleKey);
item.put("userList", userList);
String roleKey = it.get("roleKye").toString();
List<String> userList= new ArrayList<>();
//设置人员
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()
.anyMatch(todo -> todo.getNodeName().equals(nodeName) && "1".equals(todo.getIsHandle()));
item.put("jdxz", isExecuted);
it.put("jdxz", isExecuted);
}else {
item.put("jdxz", true);
it.put("jdxz", true);
}
......@@ -725,11 +1016,13 @@ public class DjjcLcController
String applyUserId = entity.getApplyUser();
Long applyUserDeptId = userService.selectUserByLoginName(applyUserId).getDeptId();
SysDept sysDept = sysDeptMapper.selectDeptById(applyUserDeptId);
//获取到黄河钻井公司
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
//获取安全审批站点人员
// 设置下一节点处理人
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取多人 一人处理即可通过
variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId
......@@ -776,7 +1069,9 @@ public class DjjcLcController
Long secondaryUnit = getSecondaryUnit(applyUserDeptId, sysDept.getAncestors());
// 设置下一节点处理人
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取多人 一人处理即可通过
variables.put(paramName_audit_user, assignee); // 设置下一节点审核人 设置userId
......
......@@ -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
//完钻垂直井深
private Double wzczjs;
//钻机台月
private Double zjy;
private String zjy;
//建井周期
private String jjzq1;
......
......@@ -62,4 +62,5 @@ public interface ISjLjfzqkService
int insertSjLjfzqkBatch(List<SjLjjw> list);
int insertSjLjfzqkBatch2(List<SjLjfzqk> list);
}
......@@ -124,4 +124,13 @@ public class SjLjfzqkServiceImpl implements ISjLjfzqkService
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
public int insertSjZysx(SjZysx sjZysx)
{
String lb = sjZysx.getLb();
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)){
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)|| "浅层气".equals(lb)){
if(StringUtils.isNotEmpty(sjZysx.getZysx())){
sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8));
}
......@@ -77,7 +77,7 @@ public class SjZysxServiceImpl implements ISjZysxService
public int updateSjZysx(SjZysx sjZysx)
{
String lb = sjZysx.getLb();
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)){
if("喷漏卡塌".equals(lb) || "特殊岩性风险".equals(lb)|| "浅层气".equals(lb)){
if(StringUtils.isNotEmpty(sjZysx.getZysx())){
sjZysx.setZysx(new String(Base64.decode(sjZysx.getZysx()), StandardCharsets.UTF_8));
}
......
......@@ -86,6 +86,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</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 into sys_dept(
......
......@@ -159,6 +159,17 @@ 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} ) )
and del_flag = '0'
</select>
<select id="selectUserLoginNamesByRoleKeyAndDeptId" resultType="com.zjsgfa.project.system.domain.SysUser">
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(
......
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