根据项目id、领域id 查询法规清单编辑时下拉数据接口。
匹配相关人员接口。 发起清单确认,发送消息。
This commit is contained in:
+7
@@ -243,4 +243,11 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
List<SysUser> queryByDepIds(List<String> departIds, String username);
|
List<SysUser> queryByDepIds(List<String> departIds, String username);
|
||||||
|
|
||||||
List<SysUser> queryByWorkNo(String workNo);
|
List<SysUser> queryByWorkNo(String workNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户idList 查询用户信息
|
||||||
|
* @param userIdList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysUser> querySysUserListByIdList(List<String> userIdList);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -472,4 +472,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysUser> querySysUserListByIdList(List<String> userIdList) {
|
||||||
|
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||||
|
QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
|
||||||
|
sysUserQueryWrapper.lambda().in(SysUser::getId,userIdList);
|
||||||
|
List<SysUser> sysUsers = this.baseMapper.selectList(sysUserQueryWrapper);
|
||||||
|
return sysUsers;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -180,4 +180,16 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
|||||||
return this.projectLawsInventoryEOService.updateStatusBatch(params);
|
return this.projectLawsInventoryEOService.updateStatusBatch(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配相关人员
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "项目库-法规清单表-匹配相关人员")
|
||||||
|
@ApiOperation(value="项目库-法规清单表-匹配相关人员", notes="项目库-法规清单表-匹配相关人员")
|
||||||
|
@GetMapping(value = "/matchRelevantPeople")
|
||||||
|
public Result<?> matchRelevantPeople(@RequestParam Map<String,Object> params){
|
||||||
|
return this.projectLawsInventoryEOService.matchRelevantPeople(params);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -160,4 +160,16 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
|
|||||||
return super.importExcel(request, response, ProjectRelatedPersonnel.class);
|
return super.importExcel(request, response, ProjectRelatedPersonnel.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过projectId查询
|
||||||
|
*
|
||||||
|
* @param projectId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "项目库-相关人员维护表-根据projectId查询编辑时下拉数据")
|
||||||
|
@ApiOperation(value="项目库-相关人员维护表-根据projectId查询编辑时下拉数据", notes="项目库-相关人员维护表-根据projectId查询编辑时下拉数据")
|
||||||
|
@GetMapping(value = "/queryPersonByProjectId")
|
||||||
|
public Result<?> queryPersonByProjectId(@RequestParam(name="projectId",required=true) String projectId,@RequestParam(name="dutyTerritory",required=true) String dutyTerritory) {
|
||||||
|
return this.projectRelatedPersonnelService.queryPersonByProjectId(projectId,dutyTerritory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -309,4 +309,11 @@ public class ProjectLawsInventoryEO implements Serializable {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "任务确认-截止时间")
|
@ApiModelProperty(value = "任务确认-截止时间")
|
||||||
private Date taskAffirmDueDate;
|
private Date taskAffirmDueDate;
|
||||||
|
|
||||||
|
/**任务确认-截止时间*/
|
||||||
|
@Excel(name = "任务确认-截止时间", width = 15, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "任务确认-截止时间")
|
||||||
|
private String sendMsgFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.jero.modules.project.enums;
|
||||||
|
|
||||||
|
public enum SendMsgFlagEnum {
|
||||||
|
TRUE("未发","0"),
|
||||||
|
FALSE("已发","1");
|
||||||
|
|
||||||
|
String name;
|
||||||
|
String value;
|
||||||
|
|
||||||
|
private SendMsgFlagEnum(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTextByValue(String value) {
|
||||||
|
SendMsgFlagEnum[] values = values();
|
||||||
|
for (SendMsgFlagEnum sendMsgFlagEnum : values) {
|
||||||
|
if (sendMsgFlagEnum.value.equals(value)) {
|
||||||
|
return sendMsgFlagEnum.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -69,4 +69,11 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<?> updateStatusBatch(Map<String, Object> params);
|
Result<?> updateStatusBatch(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配相关人员
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result<?> matchRelevantPeople(Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.project.service;
|
package com.jero.modules.project.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -62,4 +63,6 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
|
|||||||
List<ProjectRelatedPersonnel> queryList();
|
List<ProjectRelatedPersonnel> queryList();
|
||||||
|
|
||||||
IPage<ProjectRelatedPersonnel> queryPageList(Map<String, Object> params);
|
IPage<ProjectRelatedPersonnel> queryPageList(Map<String, Object> params);
|
||||||
|
|
||||||
|
Result<?> queryPersonByProjectId(String projectId,String dutyTerritory);
|
||||||
}
|
}
|
||||||
|
|||||||
+176
-1
@@ -1,31 +1,45 @@
|
|||||||
package com.jero.modules.project.service.impl;
|
package com.jero.modules.project.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.constant.CommonConstant;
|
||||||
|
import com.jero.common.constant.WebsocketConst;
|
||||||
|
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||||
|
import com.jero.modules.feishu.service.IFeishuService;
|
||||||
|
import com.jero.modules.message.websocket.WebSocket;
|
||||||
import com.jero.modules.oss.entity.OSSFile;
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import com.jero.modules.oss.service.IOSSFileService;
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||||
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.project.enums.*;
|
import com.jero.modules.project.enums.*;
|
||||||
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
||||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||||
|
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
||||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||||
|
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||||
|
import com.jero.modules.system.entity.SysAnnouncement;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.mapper.SysUserMapper;
|
import com.jero.modules.system.mapper.SysUserMapper;
|
||||||
|
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||||
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -55,6 +69,21 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOSSFileService iOSSFileService;
|
private IOSSFileService iOSSFileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IFeishuService iFeishuService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysAnnouncementService sysAnnouncementService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WebSocket webSocket;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectRelatedPersonnelMapper projectRelatedPersonnelMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -416,6 +445,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
}
|
}
|
||||||
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = this.baseMapper.selectList(queryWrapper);
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = this.baseMapper.selectList(queryWrapper);
|
||||||
|
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
|
||||||
|
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
|
||||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOS) {
|
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOS) {
|
||||||
|
|
||||||
//如果该数据的状态为 未发起或拒绝 可以发起清单确认
|
//如果该数据的状态为 未发起或拒绝 可以发起清单确认
|
||||||
@@ -433,8 +464,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
updateWrapper.set(ProjectLawsInventoryEO::getHomologationEngineerSubmitStatus,null);
|
updateWrapper.set(ProjectLawsInventoryEO::getHomologationEngineerSubmitStatus,null);
|
||||||
updateWrapper.eq(ProjectLawsInventoryEO::getId,projectLawsInventoryEO.getId());
|
updateWrapper.eq(ProjectLawsInventoryEO::getId,projectLawsInventoryEO.getId());
|
||||||
super.update(projectLawsInventoryEO, updateWrapper);
|
super.update(projectLawsInventoryEO, updateWrapper);
|
||||||
|
//消息内容
|
||||||
|
// String msgContentCN = currentUser.getRealname() + "发起了 " + projectLibraryBase.getProjectName()
|
||||||
|
// + " (项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ ", 请及时查看处理。";
|
||||||
|
String msgContentEN = currentUser.getRealname() + "发起了 " + projectLibraryBase.getProjectName()
|
||||||
|
+ " (项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ ", 请及时查看处理。";
|
||||||
//发送消息
|
//发送消息
|
||||||
String sendMessage = "XXX" + "发起了" + " XXX " + "(项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ ", 请及时查看处理。";
|
sendMessage(msgContentEN,projectLawsInventoryEO);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = "发起清单确认";
|
result = "发起清单确认";
|
||||||
@@ -493,4 +530,142 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
}
|
}
|
||||||
return new Result<>().success(result + "成功!");
|
return new Result<>().success(result + "成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息
|
||||||
|
* @param msgContent
|
||||||
|
* @param projectLawsInventoryEO
|
||||||
|
*/
|
||||||
|
public void sendMessage(String msgContent,ProjectLawsInventoryEO projectLawsInventoryEO){
|
||||||
|
|
||||||
|
String idTemp = projectLawsInventoryEO.getProjectLibraryId();
|
||||||
|
|
||||||
|
List<String> userIdList = new ArrayList<>();
|
||||||
|
String homologationEngineerId = projectLawsInventoryEO.getHomologationEngineerId();
|
||||||
|
String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
|
||||||
|
if(StringUtils.isNotEmpty(homologationEngineerId)){
|
||||||
|
userIdList.add(homologationEngineerId);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(regulationOwnerId)){
|
||||||
|
userIdList.add(regulationOwnerId);
|
||||||
|
}
|
||||||
|
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||||
|
List<String> thirdIdList = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||||
|
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//系统消息
|
||||||
|
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgContent, "");
|
||||||
|
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||||
|
sendWebsocket(idTemp, idTemp);
|
||||||
|
|
||||||
|
//飞书消息
|
||||||
|
try {
|
||||||
|
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), "");
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("飞书消息推送失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo) {
|
||||||
|
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||||
|
sysAnnouncement.setDelFlag("0");
|
||||||
|
sysAnnouncement.setSendStatus("0");
|
||||||
|
sysAnnouncement.setSendTime(new Date());
|
||||||
|
sysAnnouncement.setMsgCategory(MessageTypeEnum.READ.getValue());//消息类型
|
||||||
|
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
|
||||||
|
sysAnnouncement.setMsgContent(content);
|
||||||
|
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||||
|
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
|
||||||
|
return sysAnnouncement;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendWebsocket(String msgId, String msgTet) {
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||||
|
obj.put(WebsocketConst.MSG_ID, msgId);
|
||||||
|
obj.put(WebsocketConst.MSG_TXT, msgTet);
|
||||||
|
webSocket.sendMessage(obj.toJSONString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配相关人员
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<?> matchRelevantPeople(Map<String, Object> params) {
|
||||||
|
String projectLibraryId = (String) params.get("projectLibraryId");//项目id
|
||||||
|
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
int isProjectRole = checkUserRole(projectLibraryId, currentUser.getId(), "");
|
||||||
|
//验证用户是否是该项目的studio工程师,只有studio工程师才能匹配相关人员
|
||||||
|
if(isProjectRole == Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())){
|
||||||
|
//获取当前项目中的相关人员信息
|
||||||
|
QueryWrapper<ProjectRelatedPersonnel> queryProjectPerson = new QueryWrapper<>();
|
||||||
|
queryProjectPerson.lambda().eq(ProjectRelatedPersonnel::getProjectId,projectLibraryId);
|
||||||
|
List<ProjectRelatedPersonnel> projectRelatedPersonnels = this.projectRelatedPersonnelMapper.selectList(queryProjectPerson);
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(projectRelatedPersonnels)){
|
||||||
|
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||||
|
List<String> inventoryAffirmStatusList = new ArrayList<>();
|
||||||
|
inventoryAffirmStatusList.add(InventoryAffirmStatusEnum.NOT_STARTED.getValue());
|
||||||
|
inventoryAffirmStatusList.add(InventoryAffirmStatusEnum.REJECTED.getValue());
|
||||||
|
queryWrapper.lambda().in(ProjectLawsInventoryEO::getInventoryAffirmStatus,inventoryAffirmStatusList);
|
||||||
|
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||||
|
//查询当前项目下,清单状态为 未发起、拒绝状态的法规清单。
|
||||||
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = this.baseMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOS) {
|
||||||
|
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnels) {
|
||||||
|
if(StringUtils.equals(projectRelatedPersonnel.getDutyTerritory(),projectLawsInventoryEO.getDutyTerritory())){
|
||||||
|
//法规工程师
|
||||||
|
if (StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerId())) {
|
||||||
|
String lawEngineer = projectRelatedPersonnel.getLawEngineer();
|
||||||
|
if(StringUtils.isNotEmpty(lawEngineer)){
|
||||||
|
String[] lawEngineerArr = lawEngineer.split(",");
|
||||||
|
if(lawEngineerArr.length == 1){
|
||||||
|
projectLawsInventoryEO.setRegulationOwnerId(lawEngineer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//认证工程师
|
||||||
|
if (StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerId())) {
|
||||||
|
String certificationEngineer = projectRelatedPersonnel.getCertificationEngineer();
|
||||||
|
if(StringUtils.isNotEmpty(certificationEngineer)){
|
||||||
|
String[] certificationEngineerArr = certificationEngineer.split(",");
|
||||||
|
if(certificationEngineerArr.length == 1){
|
||||||
|
projectLawsInventoryEO.setHomologationEngineerId(certificationEngineer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//项目接口人
|
||||||
|
if (StringUtils.isEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||||
|
String engineeringInterfacePerson = projectRelatedPersonnel.getEngineeringInterfacePerson();
|
||||||
|
if(StringUtils.isNotEmpty(engineeringInterfacePerson)){
|
||||||
|
String[] engineeringInterfacePersonArr = engineeringInterfacePerson.split(",");
|
||||||
|
if(engineeringInterfacePersonArr.length == 1){
|
||||||
|
projectLawsInventoryEO.setEngineeringInterfacePerson(engineeringInterfacePerson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.baseMapper.updateById(projectLawsInventoryEO);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new JeroBootException("当前项目中,未找到相关维护人员信息");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new JeroBootException("当前操作用户不是该项目的studio工程师,没有权限操作!");
|
||||||
|
}
|
||||||
|
return new Result<>().success("带入成功!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+95
@@ -1,15 +1,18 @@
|
|||||||
package com.jero.modules.project.service.impl;
|
package com.jero.modules.project.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
||||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.mapper.SysUserMapper;
|
import com.jero.modules.system.mapper.SysUserMapper;
|
||||||
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
@@ -33,6 +36,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -219,4 +225,93 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> queryPersonByProjectId(String projectId,String dutyTerritory) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
List<Map<String,Object>> lawEngineerList = new ArrayList<>();
|
||||||
|
List<Map<String,Object>> certificationEngineerList = new ArrayList<>();
|
||||||
|
List<Map<String,Object>> engineeringInterfacePersonList = new ArrayList<>();
|
||||||
|
|
||||||
|
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().eq(ProjectRelatedPersonnel::getProjectId,projectId);
|
||||||
|
queryWrapper.lambda().eq(ProjectRelatedPersonnel::getDutyTerritory,dutyTerritory);
|
||||||
|
List<ProjectRelatedPersonnel> projectRelatedPersonnels = this.baseMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(projectRelatedPersonnels)){
|
||||||
|
List<String> userIdList = new ArrayList<>();
|
||||||
|
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnels) {
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getLawEngineer())){
|
||||||
|
String[] lawEngineerArr = projectRelatedPersonnel.getLawEngineer().split(",");
|
||||||
|
for (String lawEngineer : lawEngineerArr) {
|
||||||
|
userIdList.add(lawEngineer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getCertificationEngineer())){
|
||||||
|
String[] certificationEngineerArr = projectRelatedPersonnel.getCertificationEngineer().split(",");
|
||||||
|
for (String certificationEngineer : certificationEngineerArr) {
|
||||||
|
userIdList.add(certificationEngineer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getEngineeringInterfacePerson())){
|
||||||
|
String[] engineeringInterfacePersonArr = projectRelatedPersonnel.getEngineeringInterfacePerson().split(",");
|
||||||
|
for (String engineeringInterfacePerson : engineeringInterfacePersonArr) {
|
||||||
|
userIdList.add(engineeringInterfacePerson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<SysUser> sysUserList = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||||
|
sysUserList = sysUserService.querySysUserListByIdList(userIdList);
|
||||||
|
}
|
||||||
|
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnels) {
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getLawEngineer())){
|
||||||
|
String[] lawEngineerArr = projectRelatedPersonnel.getLawEngineer().split(",");
|
||||||
|
for (String lawEngineer : lawEngineerArr) {
|
||||||
|
for (SysUser sysUser : sysUserList) {
|
||||||
|
if(StringUtils.equals(lawEngineer,sysUser.getId())){
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("name",sysUser.getRealname());
|
||||||
|
map.put("value",sysUser.getId());
|
||||||
|
lawEngineerList.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getCertificationEngineer())){
|
||||||
|
String[] certificationEngineerArr = projectRelatedPersonnel.getCertificationEngineer().split(",");
|
||||||
|
for (String certificationEngineer : certificationEngineerArr) {
|
||||||
|
for (SysUser sysUser : sysUserList) {
|
||||||
|
if(StringUtils.equals(certificationEngineer,sysUser.getId())){
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("name",sysUser.getRealname());
|
||||||
|
map.put("value",sysUser.getId());
|
||||||
|
certificationEngineerList.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectRelatedPersonnel.getEngineeringInterfacePerson())){
|
||||||
|
String[] engineeringInterfacePersonArr = projectRelatedPersonnel.getEngineeringInterfacePerson().split(",");
|
||||||
|
for (String engineeringInterfacePerson : engineeringInterfacePersonArr) {
|
||||||
|
for (SysUser sysUser : sysUserList) {
|
||||||
|
if(StringUtils.equals(engineeringInterfacePerson,sysUser.getId())){
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("name",sysUser.getRealname());
|
||||||
|
map.put("value",sysUser.getId());
|
||||||
|
engineeringInterfacePersonList.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put("lawEngineerList",lawEngineerList);
|
||||||
|
result.put("certificationEngineerList",certificationEngineerList);
|
||||||
|
result.put("engineeringInterfacePersonList",engineeringInterfacePersonList);
|
||||||
|
return Result.OK(result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user