Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+88
-45
@@ -21,6 +21,7 @@ import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.HttpRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -565,69 +566,111 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
headerMap.put("Authorization", "Bearer " + token);
|
||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
String sendJson = " {\n" +
|
||||
" \"config\": {\n" +
|
||||
" \"wide_screen_mode\": true\n" +
|
||||
" },\n" +
|
||||
//参考:https://open.feishu.cn/tool/cardbuilder?from=openplantform_mcb_entrance
|
||||
/*String sendJson = "{\n" +
|
||||
" \"header\": {\n" +
|
||||
" \"template\": \"green\",\n" +
|
||||
" \"title\": {\n" +
|
||||
" \"tag\": \"plain_text\",\n" +
|
||||
" \"content\": \"点击下方的分类查看常见问题\"\n" +
|
||||
" },\n" +
|
||||
" \"template\": \"green\"\n" +
|
||||
" \"content\": \"知识库分类负责人\",\n" +
|
||||
" \"tag\": \"plain_text\"\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"elements\": [\n" +
|
||||
" {\n" +
|
||||
" \"fields\": [\n" +
|
||||
" {\n" +
|
||||
" \"is_short\": true,\n" +
|
||||
" \"text\": {\n" +
|
||||
" \"content\": \"**\uD83D\uDC64 提交人:**\\n<at id=fag43ef3></at>\",\n" +
|
||||
" \"tag\": \"lark_md\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"tag\": \"div\"\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
"}";*/
|
||||
|
||||
String sendJson = "{\n" +
|
||||
" \"header\": {\n" +
|
||||
" \"template\": \"green\",\n" +
|
||||
" \"title\": {\n" +
|
||||
" \"content\": \"知识库分类负责人\",\n" +
|
||||
" \"tag\": \"plain_text\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
JSONObject jsonObject = JSONObject.parseObject(sendJson);
|
||||
JSONArray elements = new JSONArray();
|
||||
JSONObject element = new JSONObject();
|
||||
element.put("tag","action");
|
||||
element.put("layout","bisected");
|
||||
JSONArray fields = new JSONArray();
|
||||
|
||||
//获取分类
|
||||
List<ProblemKnowledgeBaseClassifyEO> problemKnowledgeBaseClassifyEOList = this.problemKnowledgeBaseClassifyEOService.list();
|
||||
this.problemKnowledgeBaseClassifyEOService.disposeData(problemKnowledgeBaseClassifyEOList);
|
||||
|
||||
JSONArray actions = new JSONArray();
|
||||
|
||||
//组装推送过去的点击按钮
|
||||
//获取所有分类下的负责人信息
|
||||
List<String> chargePersonUserIdList = new ArrayList<>();
|
||||
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
||||
JSONObject buttonObject = new JSONObject();
|
||||
JSONObject text = new JSONObject();
|
||||
JSONObject value = new JSONObject();
|
||||
buttonObject.put("tag","button");
|
||||
|
||||
text.put("tag","plain_text");
|
||||
text.put("content",problemKnowledgeBaseClassifyEO.getProblemLabel() + " [" + problemKnowledgeBaseClassifyEO.getChargePersonIdName() + "]");
|
||||
value.put("chosen",problemKnowledgeBaseClassifyEO.getChargePersonId());
|
||||
|
||||
buttonObject.put("text",text);
|
||||
buttonObject.put("type","primary");
|
||||
buttonObject.put("value",value);
|
||||
actions.add(buttonObject);
|
||||
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
|
||||
String chargePersonId = problemKnowledgeBaseClassifyEO.getChargePersonId();
|
||||
for (String chargePerson : chargePersonId.split(",")) {
|
||||
chargePersonUserIdList.add(chargePerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
element.put("actions",actions);
|
||||
if(CollectionUtils.isNotEmpty(chargePersonUserIdList)){
|
||||
List<SysUser> chargePersonUserList = this.sysUserService.querySysUserListByIdList(chargePersonUserIdList);
|
||||
|
||||
//组装推送过去的知识库负责人信息
|
||||
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
||||
JSONObject field = new JSONObject();
|
||||
JSONObject text = new JSONObject();
|
||||
StringBuilder atUserSb = new StringBuilder();
|
||||
|
||||
elements.add(element);
|
||||
jsonObject.put("elements",elements);
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
|
||||
for (String chargePersonId : problemKnowledgeBaseClassifyEO.getChargePersonId().split(",")) {
|
||||
for (SysUser sysUser : chargePersonUserList) {
|
||||
if(StringUtils.equals(chargePersonId,sysUser.getId())){
|
||||
String thirdId = sysUser.getThirdId();
|
||||
atUserSb.append("<at id=" + thirdId + "></at>");
|
||||
atUserSb.append(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = null;
|
||||
try {
|
||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
text.put("content","问题标签:" + problemKnowledgeBaseClassifyEO.getProblemLabel() + "\n" + "责任人:" + atUserSb.toString());
|
||||
text.put("tag","lark_md");
|
||||
|
||||
field.put("is_short",true);
|
||||
field.put("text",text);
|
||||
fields.add(field);
|
||||
}
|
||||
|
||||
element.put("tag","div");
|
||||
element.put("fields",fields);
|
||||
elements.add(element);
|
||||
jsonObject.put("elements",elements);
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = null;
|
||||
try {
|
||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -90,7 +90,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
this.batchInsertProblemKnowledgeBaseUserEO(problemKnowledgeBaseEO);
|
||||
}else {
|
||||
//如果展示权限是公开,则把该数据插入到搜索中心中。
|
||||
//this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||
this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,9 +367,9 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
//如果该条问题知识库的展示权限为私密,则创建权限表数据
|
||||
if(StringUtils.equals(problemKnowledgeBaseEO.getShowPermissions(), ShowPermissionsEnum.PRIVACY.getValue())){
|
||||
this.batchInsertProblemKnowledgeBaseUserEO(problemKnowledgeBaseEO);
|
||||
//this.deleteElasticsearchData(problemKnowledgeBaseEO.getId());
|
||||
this.deleteElasticsearchData(problemKnowledgeBaseEO.getId());
|
||||
}else {
|
||||
//this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||
this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,9 +406,9 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
|
||||
this.problemKnowledgeBaseCommentEOService.remove(deleteWrapper);
|
||||
|
||||
/*for (String problemKnowledgeBaseId : ids) {
|
||||
for (String problemKnowledgeBaseId : ids) {
|
||||
this.deleteElasticsearchData(problemKnowledgeBaseId);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+27
-13
@@ -1,26 +1,28 @@
|
||||
package com.jero.modules.project.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.jero.modules.project.vo.ConditionAssessmentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -181,4 +183,16 @@ public class ConditionAssessmentEOController extends JeroController<ConditionAss
|
||||
return conditionAssessmentEOService.addOrUpdate(conditionAssessmentEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加或修改
|
||||
*
|
||||
* @param conditionAssessmentVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "任务清单-项目状态评估表-批量添加或修改")
|
||||
@ApiOperation(value="任务清单-项目状态评估表-批量添加或修改", notes="任务清单-项目状态评估表-批量添加或修改")
|
||||
@PostMapping(value = "/addOrUpdateBatch")
|
||||
public Result<?> addOrUpdateConditionAssessmentBatch(@RequestBody ConditionAssessmentVO conditionAssessmentVO) {
|
||||
return conditionAssessmentEOService.addOrUpdateBatch(conditionAssessmentVO);
|
||||
}
|
||||
}
|
||||
|
||||
+42
-14
@@ -1,27 +1,27 @@
|
||||
package com.jero.modules.project.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.project.vo.ProjectTaskInventoryVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -203,4 +203,32 @@ public class ProjectTaskInventoryEOController extends JeroController<ProjectTask
|
||||
public Result<?> remindDispose(@RequestBody JSONObject jsonObject){
|
||||
return this.projectTaskInventoryEOService.remindDispose(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectTaskInventoryVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-批量维护进度")
|
||||
@ApiOperation(value="项目库-任务清单表-批量维护进度", notes="项目库-任务清单表-批量维护进度")
|
||||
@PostMapping(value = "/editBatch")
|
||||
public Result<?> editCertificationProgressBatch(@RequestBody ProjectTaskInventoryVO projectTaskInventoryVO) {
|
||||
projectTaskInventoryEOService.editBatch(projectTaskInventoryVO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证进度和当前状态修改时,校验角色是否符合
|
||||
*
|
||||
* @param projectTaskInventoryVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-校验角色是否符合")
|
||||
@ApiOperation(value="项目库-任务清单表-校验角色是否符合", notes="项目库-任务清单表-校验角色是否符合")
|
||||
@PostMapping(value = "/verifyRoleCode")
|
||||
public Result<?> verifyRoleCode(@RequestBody ProjectTaskInventoryVO projectTaskInventoryVO) {
|
||||
List<String> msgList = projectTaskInventoryEOService.verifyRoleCode(projectTaskInventoryVO);
|
||||
return Result.OK(msgList);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -1,11 +1,11 @@
|
||||
package com.jero.modules.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
import com.jero.modules.project.entity. ConditionAssessmentEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.vo.ConditionAssessmentVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -92,4 +92,10 @@ public interface IConditionAssessmentEOService extends IService<ConditionAssessm
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getProjectStatusAssessStatisticsGroupByTerritory(Map<String,Object> params);
|
||||
|
||||
/**
|
||||
* 任务清单-项目状态评估表-批量添加或修改
|
||||
* @param conditionAssessmentVO
|
||||
*/
|
||||
Result<?> addOrUpdateBatch(ConditionAssessmentVO conditionAssessmentVO);
|
||||
}
|
||||
|
||||
+18
-1
@@ -1,9 +1,10 @@
|
||||
package com.jero.modules.project.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.project.vo.ProjectTaskInventoryVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -84,5 +85,21 @@ public interface IProjectTaskInventoryEOService extends IService<ProjectTaskInve
|
||||
*/
|
||||
void deleteByProjectLawsInventoryIds(List<String> projectLawsInventoryIds);
|
||||
|
||||
/**
|
||||
* 批量更新认证进度
|
||||
*
|
||||
* @param projectTaskInventoryVO
|
||||
* @return
|
||||
*/
|
||||
void editBatch(ProjectTaskInventoryVO projectTaskInventoryVO);
|
||||
|
||||
/**
|
||||
* 校验角色是否符合
|
||||
*
|
||||
* @param projectTaskInventoryVO
|
||||
* @return
|
||||
*/
|
||||
List<String> verifyRoleCode(ProjectTaskInventoryVO projectTaskInventoryVO);
|
||||
|
||||
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO);
|
||||
}
|
||||
|
||||
+68
-2
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
@@ -8,6 +9,7 @@ import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.enums.ProjectRoleEnum;
|
||||
import com.jero.modules.project.mapper.ConditionAssessmentEOMapper;
|
||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.jero.modules.project.vo.ConditionAssessmentVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -16,8 +18,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 任务清单-项目状态评估表
|
||||
* @Author: jero-boot
|
||||
@@ -251,4 +251,70 @@ public class ConditionAssessmentEOServiceImpl extends ServiceImpl<ConditionAsses
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> addOrUpdateBatch(ConditionAssessmentVO conditionAssessmentVO) {
|
||||
List<String> projectLawsInventoryIdList = Arrays.asList(conditionAssessmentVO.getProjectLawsInventoryIds().split(","));
|
||||
List<String> roleCodeListOld = Arrays.asList(conditionAssessmentVO.getRoleCodes().split(","));
|
||||
|
||||
|
||||
for (int i=0; i < projectLawsInventoryIdList.size(); i++) {
|
||||
String projectLawsInventoryId = projectLawsInventoryIdList.get(i);
|
||||
String roleCode = roleCodeListOld.get(i);
|
||||
List<String> roleCodeList = new ArrayList<>();
|
||||
List<ConditionAssessmentEO> list = new ArrayList<>();
|
||||
|
||||
if (StringUtils.equals(roleCode, ProjectRoleEnum.REGULATI_ENGINEER.getValue())) {
|
||||
roleCodeList.add(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
|
||||
ConditionAssessmentEO regulatiEngineer = new ConditionAssessmentEO();
|
||||
regulatiEngineer.setProjectLawsInventoryId(projectLawsInventoryId);
|
||||
regulatiEngineer.setConditionAssessment(conditionAssessmentVO.getConditionAssessment());
|
||||
regulatiEngineer.setRemark(conditionAssessmentVO.getRemark());
|
||||
regulatiEngineer.setRoleCode(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
|
||||
list.add(regulatiEngineer);
|
||||
|
||||
} else if (StringUtils.equals(roleCode, ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())) {
|
||||
roleCodeList.add(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
|
||||
ConditionAssessmentEO homologationEngineer = new ConditionAssessmentEO();
|
||||
homologationEngineer.setProjectLawsInventoryId(projectLawsInventoryId);
|
||||
homologationEngineer.setConditionAssessment(conditionAssessmentVO.getConditionAssessment());
|
||||
homologationEngineer.setRemark(conditionAssessmentVO.getRemark());
|
||||
homologationEngineer.setRoleCode(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
|
||||
list.add(homologationEngineer);
|
||||
|
||||
} else if (StringUtils.equals(roleCode, ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())) {
|
||||
roleCodeList.add(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
roleCodeList.add(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
|
||||
ConditionAssessmentEO regulatiEngineer = new ConditionAssessmentEO();
|
||||
regulatiEngineer.setProjectLawsInventoryId(projectLawsInventoryId);
|
||||
regulatiEngineer.setConditionAssessment(conditionAssessmentVO.getConditionAssessment());
|
||||
regulatiEngineer.setRemark(conditionAssessmentVO.getRemark());
|
||||
regulatiEngineer.setRoleCode(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
|
||||
ConditionAssessmentEO homologationEngineer = new ConditionAssessmentEO();
|
||||
homologationEngineer.setProjectLawsInventoryId(projectLawsInventoryId);
|
||||
homologationEngineer.setConditionAssessment(conditionAssessmentVO.getConditionAssessment());
|
||||
homologationEngineer.setRemark(conditionAssessmentVO.getRemark());
|
||||
homologationEngineer.setRoleCode(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
|
||||
list.add(regulatiEngineer);
|
||||
list.add(homologationEngineer);
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
QueryWrapper<ConditionAssessmentEO> deleteWrapper = new QueryWrapper<>();
|
||||
deleteWrapper.lambda().eq(ConditionAssessmentEO::getProjectLawsInventoryId,projectLawsInventoryId);
|
||||
deleteWrapper.lambda().in(ConditionAssessmentEO::getRoleCode,roleCodeList);
|
||||
this.baseMapper.delete(deleteWrapper);
|
||||
|
||||
saveBatch(list);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
+84
@@ -18,6 +18,7 @@ import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.project.util.SendMessageUtils;
|
||||
import com.jero.modules.project.vo.ProjectTaskInventoryVO;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
@@ -459,6 +460,89 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
this.baseMapper.delete(deleteWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editBatch(ProjectTaskInventoryVO projectTaskInventoryVO) {
|
||||
List<String> idList = Arrays.asList(projectTaskInventoryVO.getIds().split(","));
|
||||
|
||||
List<ProjectTaskInventoryEO> updateEOList = new ArrayList<>();
|
||||
for (String id : idList) {
|
||||
ProjectTaskInventoryEO updateEO = new ProjectTaskInventoryEO();
|
||||
updateEO.setId(id);
|
||||
updateEO.setCertificationProgress(projectTaskInventoryVO.getCertificationProgress());
|
||||
updateEO.setCertificationProgressRemark(projectTaskInventoryVO.getCertificationProgressRemark());
|
||||
|
||||
Date now = new Date();
|
||||
updateEO.setUpdateTime(now);
|
||||
|
||||
updateEOList.add(updateEO);
|
||||
}
|
||||
|
||||
updateBatchById(updateEOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> verifyRoleCode(ProjectTaskInventoryVO projectTaskInventoryVO) {
|
||||
List<String> projectLawsInventoryIdList = Arrays.asList(projectTaskInventoryVO.getProjectLawsInventoryIds().split(","));
|
||||
List<String> roleCodeList = Arrays.asList(projectTaskInventoryVO.getRoleCodes().split(","));
|
||||
String cut = projectTaskInventoryVO.getCut();
|
||||
String operation = projectTaskInventoryVO.getOperation();
|
||||
|
||||
List<Map<String, String>> msgMapList = new ArrayList<>();
|
||||
for (int i=0; i < projectLawsInventoryIdList.size(); i++) {
|
||||
String projectLawsInventoryId = projectLawsInventoryIdList.get(i);
|
||||
String roleCode = roleCodeList.get(i);
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOService.getById(projectLawsInventoryId);
|
||||
|
||||
Map<String, String> msgMap = new HashMap<>();
|
||||
if ("1".equals(operation)) {
|
||||
if (! ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue().equals(roleCode)) {
|
||||
msgMap.put("serialNumber", projectLawsInventoryEO.getSerialNumber());
|
||||
|
||||
}
|
||||
} else if ("2".equals(operation)) {
|
||||
if (!(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue().equals(roleCode)
|
||||
|| ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue().equals(roleCode)
|
||||
|| ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue().equals(roleCode))) {
|
||||
msgMap.put("serialNumber", projectLawsInventoryEO.getSerialNumber());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
msgMapList.add(msgMap);
|
||||
}
|
||||
|
||||
return getMsg(msgMapList, cut, operation);
|
||||
|
||||
}
|
||||
|
||||
private List<String> getMsg(List<Map<String, String>> msgMapList, String cut, String operation) {
|
||||
List<String> msgList = new ArrayList<>();
|
||||
|
||||
for (Map<String, String> msgMap : msgMapList) {
|
||||
String serialNumber = msgMap.get("serialNumber");
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if ("1".equals(operation)) {
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
stringBuilder.append("Number ").append("<span style='color: red'>").append(serialNumber).append("</span>").append(", the current user can not maintain homologation progress.");
|
||||
} else {
|
||||
stringBuilder.append("编号").append("<span style='color: red'>").append(serialNumber).append("</span>").append(",当前用户没有维护认证进度权限。");
|
||||
}
|
||||
|
||||
} else if("2".equals(operation)) {
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
stringBuilder.append("Number ").append("<span style='color: red'>").append(serialNumber).append("</span>").append(", the current user can not modify current status.");
|
||||
} else {
|
||||
stringBuilder.append("编号").append("<span style='color: red'>").append(serialNumber).append("</span>").append("当前用户没有修改状态权限。");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
msgList.add(stringBuilder.toString());
|
||||
}
|
||||
|
||||
return msgList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建任务清单列表数据
|
||||
* @param projectTaskInventoryEOList
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.project.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConditionAssessmentVO {
|
||||
|
||||
private String cut;
|
||||
|
||||
// 当前状态
|
||||
private String projectLawsInventoryIds;
|
||||
private String roleCodes;
|
||||
private String conditionAssessment;
|
||||
private String remark;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.project.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProjectTaskInventoryVO {
|
||||
|
||||
private String cut;
|
||||
|
||||
// 认证进度
|
||||
private String ids;
|
||||
private String projectLawsInventoryIds;
|
||||
private String roleCodes;
|
||||
private String certificationProgress;
|
||||
private String certificationProgressRemark;
|
||||
|
||||
private String operation; // 1-维护进度,2-修改状态
|
||||
}
|
||||
+1
-1
@@ -146,7 +146,7 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthl
|
||||
this.updateById(lawsMonthlyReportManageEO);
|
||||
|
||||
// 同步es
|
||||
// syncElasticsearch(id, issueStatus, issueTime);
|
||||
syncElasticsearch(id, issueStatus, issueTime);
|
||||
}
|
||||
|
||||
private void syncElasticsearch(String id, String issueStatus, Date issueTime) {
|
||||
|
||||
Reference in New Issue
Block a user