|
@@ -18,6 +18,7 @@ import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ProjectReportSignatureRelation;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ProjectReportSignatureRelation;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ProjectReportSignatureWork;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ProjectReportSignatureWork;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ReportSignature;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.entity.ReportSignature;
|
|
|
|
+import com.jeeplus.modules.signature.projectReportSignatureWork.entity.Type;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.service.ProjectReportSignatureWorkService;
|
|
import com.jeeplus.modules.signature.projectReportSignatureWork.service.ProjectReportSignatureWorkService;
|
|
import com.jeeplus.modules.sys.entity.Office;
|
|
import com.jeeplus.modules.sys.entity.Office;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
@@ -48,10 +49,9 @@ import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: 徐滕
|
|
* @author: 徐滕
|
|
@@ -80,6 +80,8 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private WorkProjectNotifyService workProjectNotifyService;
|
|
private WorkProjectNotifyService workProjectNotifyService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private HttpServletRequest request;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -164,6 +166,37 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ WorkProjectNotify workProjectNotify = new WorkProjectNotify();
|
|
|
|
+ workProjectNotify.setUser(UserUtils.getUser());
|
|
|
|
+ workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
|
+ workProjectNotify.setRemarks("待审批");
|
|
|
|
+ List<String> typeList= Lists.newArrayList();
|
|
|
|
+ typeList.add("173");
|
|
|
|
+ typeList.add("174");
|
|
|
|
+ String types = StringUtils.join(typeList,',');
|
|
|
|
+ workProjectNotify.setTypes(types);
|
|
|
|
+ List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
|
|
|
|
+ for (ProjectReportSignatureWork info : list) {
|
|
|
|
+ for (WorkProjectNotify notify : notifyList) {
|
|
|
|
+ if(notify.getNotifyId().equals(info.getReportId()) && "173".equals(notify.getType())){
|
|
|
|
+ info.setReportNotifyId(notify.getId());
|
|
|
|
+ if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
|
|
|
|
+ info.setReportNotifyFlag(1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //报告归档资料缺失说明修改权限处理
|
|
|
|
+ if(notify.getNotifyId().equals(info.getApprovalId()) && "174".equals(notify.getType())){
|
|
|
|
+ info.setApprovalNotifyId(notify.getId());
|
|
|
|
+ if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
|
|
|
|
+ info.setApprovalNotifyFlag(4);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
model.addAttribute("page", page);
|
|
model.addAttribute("page", page);
|
|
return "modules/signature/projectRerpotSignatureWork/ProjectRerpotSignatureWorkList";
|
|
return "modules/signature/projectRerpotSignatureWork/ProjectRerpotSignatureWorkList";
|
|
}
|
|
}
|
|
@@ -185,8 +218,61 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
//根据当前登录人获取签章负责人信息
|
|
//根据当前登录人获取签章负责人信息
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
if (null != userList){
|
|
if (null != userList){
|
|
- model.addAttribute("dutyPersonList",userList);
|
|
|
|
|
|
+ Map<String, User> uniqueUserMap = userList.stream()
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
+ User::getId, // keyMapper
|
|
|
|
+ Function.identity(), // valueMapper, 直接返回User对象
|
|
|
|
+ (existing, replacement) -> existing // mergeFunction, 如果有冲突,保留现有的
|
|
|
|
+ ));
|
|
|
|
+ List<User> uniqueUserList = new ArrayList<>(uniqueUserMap.values());
|
|
|
|
+ model.addAttribute("dutyPersonList",uniqueUserList);
|
|
}
|
|
}
|
|
|
|
+ //获取当前登陆人可申请的签章类型
|
|
|
|
+ ArrayList<Type> types = new ArrayList<>();
|
|
|
|
+ String typeList = projectReportSignatureService.getSignatureTypeList(user); //typeList 1:审定单 2:报告
|
|
|
|
+ //type 1:报告 2:审定单
|
|
|
|
+ if (StringUtils.isNotBlank(typeList)){
|
|
|
|
+ if (typeList.contains(",")){
|
|
|
|
+ String[] split = typeList.split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (s.equals("2")){
|
|
|
|
+ Type type = new Type();
|
|
|
|
+ type.setValue("1");
|
|
|
|
+ type.setLabel("报告签章");
|
|
|
|
+ types.add(type);
|
|
|
|
+ }
|
|
|
|
+ if (s.equals("1")){
|
|
|
|
+ Type type = new Type();
|
|
|
|
+ type.setValue("2");
|
|
|
|
+ type.setLabel("审定单签章");
|
|
|
|
+ types.add(type);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Type type = new Type();
|
|
|
|
+ if (typeList.equals("1")){
|
|
|
|
+ type.setValue("2");
|
|
|
|
+ type.setLabel("审定单签章");
|
|
|
|
+ types.add(type);
|
|
|
|
+ }
|
|
|
|
+ if (typeList.equals("2")){
|
|
|
|
+ type.setValue("1");
|
|
|
|
+ type.setLabel("报告签章");
|
|
|
|
+ types.add(type);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //去重处理
|
|
|
|
+ Map<String, Type> uniqueTypeMap = types.stream()
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
+ Type::getValue, // keyMapper
|
|
|
|
+ Function.identity(), // valueMapper, 直接返回User对象
|
|
|
|
+ (existing, replacement) -> existing // mergeFunction, 如果有冲突,保留现有的
|
|
|
|
+ ));
|
|
|
|
+ List<Type> uniqueTypeList = new ArrayList<>(uniqueTypeMap.values());
|
|
|
|
+ model.addAttribute("signatureTypeList",uniqueTypeList);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
//根据签章id查询报告签章信息
|
|
//根据签章id查询报告签章信息
|
|
ReportSignature reportSignature=projectReportSignatureService.getReportBySigId(projectReportSignature.getId());
|
|
ReportSignature reportSignature=projectReportSignatureService.getReportBySigId(projectReportSignature.getId());
|
|
@@ -225,7 +311,14 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
//根据当前登录人获取签章负责人信息
|
|
//根据当前登录人获取签章负责人信息
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
if (null != userList){
|
|
if (null != userList){
|
|
- model.addAttribute("dutyPersonList",userList);
|
|
|
|
|
|
+ Map<String, User> uniqueUserMap = userList.stream()
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
+ User::getId, // keyMapper
|
|
|
|
+ Function.identity(), // valueMapper, 直接返回User对象
|
|
|
|
+ (existing, replacement) -> existing // mergeFunction, 如果有冲突,保留现有的
|
|
|
|
+ ));
|
|
|
|
+ List<User> uniqueUserList = new ArrayList<>(uniqueUserMap.values());
|
|
|
|
+ model.addAttribute("dutyPersonList",uniqueUserList);
|
|
}
|
|
}
|
|
|
|
|
|
model.addAttribute("projectReportSignature", projectReportSignature);
|
|
model.addAttribute("projectReportSignature", projectReportSignature);
|
|
@@ -257,7 +350,14 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
//根据当前登录人获取签章负责人信息
|
|
//根据当前登录人获取签章负责人信息
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
List<User> userList = projectReportSignatureService.getDutyPersonList(user);
|
|
if (null != userList){
|
|
if (null != userList){
|
|
- model.addAttribute("dutyPersonList",userList);
|
|
|
|
|
|
+ Map<String, User> uniqueUserMap = userList.stream()
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
+ User::getId, // keyMapper
|
|
|
|
+ Function.identity(), // valueMapper, 直接返回User对象
|
|
|
|
+ (existing, replacement) -> existing // mergeFunction, 如果有冲突,保留现有的
|
|
|
|
+ ));
|
|
|
|
+ List<User> uniqueUserList = new ArrayList<>(uniqueUserMap.values());
|
|
|
|
+ model.addAttribute("dutyPersonList",uniqueUserList);
|
|
}
|
|
}
|
|
|
|
|
|
model.addAttribute("projectReportSignature", projectReportSignature);
|
|
model.addAttribute("projectReportSignature", projectReportSignature);
|
|
@@ -669,6 +769,26 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
if (!beanValidator(model, projectReportSignature)){
|
|
if (!beanValidator(model, projectReportSignature)){
|
|
return form(projectReportSignature, model);
|
|
return form(projectReportSignature, model);
|
|
}
|
|
}
|
|
|
|
+ //校验签章责任人拥有的签章权限与当前的签章类型是否一致
|
|
|
|
+ if (StringUtils.isNotBlank(projectReportSignature.getDutyPerson()) && StringUtils.isNotBlank(projectReportSignature.getSignatureType())){
|
|
|
|
+ //获取签章责任人的签章权限
|
|
|
|
+ User user = UserUtils.get(projectReportSignature.getDutyPerson());
|
|
|
|
+ String typeList = projectReportSignatureService.getSignatureTypeList(user);
|
|
|
|
+ if (!typeList.contains(",")){
|
|
|
|
+ if (typeList.equals("1")){
|
|
|
|
+ if (!projectReportSignature.getSignatureType().equals("2")){
|
|
|
|
+ addMessage(redirectAttributes, user.getName()+"没有审定单签章权限,无法发起申请");
|
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/projectReport/projectReportSignature/?repage";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (typeList.equals("2")){
|
|
|
|
+ if (!projectReportSignature.getSignatureType().equals("1")){
|
|
|
|
+ addMessage(redirectAttributes, user.getName()+"没有报告签章权限,无法发起申请");
|
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/projectReport/projectReportSignature/?repage";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
try {
|
|
try {
|
|
String str = "";
|
|
String str = "";
|
|
if (!projectReportSignature.getIsNewRecord()) {//编辑表单保存
|
|
if (!projectReportSignature.getIsNewRecord()) {//编辑表单保存
|
|
@@ -1421,4 +1541,33 @@ public class ProjectReportSignatureWorkController extends BaseController {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 校验当前签章责任人拥有的权限
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "checkPromiss")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public Set<String> checkPromiss(){
|
|
|
|
+ String id = request.getParameter("id");
|
|
|
|
+
|
|
|
|
+ User user = UserUtils.get(id);
|
|
|
|
+ //根据id获取权限
|
|
|
|
+ String types = projectReportSignatureService.getSignatureTypeList(user);
|
|
|
|
+ Set<String> list = new LinkedHashSet<>();
|
|
|
|
+ if (StringUtils.isNotBlank(types)){
|
|
|
|
+ if (types.contains(",")){
|
|
|
|
+ String[] split = types.split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ list.add(s);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ list.add(types);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|