This commit is contained in:
wangzhijiang
2022-05-09 09:08:42 +08:00
parent 634e35dc3e
commit 33a30522dd
4 changed files with 31 additions and 7 deletions
@@ -734,6 +734,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//operatorType: 0studio工程师发起清单确认 1:法规工程师/认证工程师 (提交或拒绝)
String operatorType = (String) params.get("operatorType");
String projectLibraryId = (String) params.get("projectLibraryId");//项目id
String cut = (String) params.get("cut");//中英文切换标识
String ids = (String) params.get("ids");
if(StringUtils.isEmpty(operatorType)){
throw new JeroBootException("操作类型不能为空!");
@@ -742,6 +743,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
try {
//TODO 切换成枚举,不要在代码里出现魔数
if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){
//验证用户是否是该项目的studio
isStudio(projectLibraryId,cut);
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
//清单确认截止时间
String inventoryAffirmDueDate = (String) params.get("inventoryAffirmDueDate");
@@ -787,10 +790,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
//消息内容
//String msgContentCN = currentUser.getUsername() + "发起了 " + projectLibraryBase.getProjectName()
//+ " (项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ " 请及时查看处理。";
String msgContentEN = currentUser.getUsername() + "initiated the regulation list confirmation of " + projectNameInfoEO.getProjectName()
+ " (project name).The due date is" +inventoryAffirmDueDate+ ". Please check and deal with it in time.";
String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation of " + projectNameInfoEO.getProjectName()
+ " (project name). The due date is" +inventoryAffirmDueDate+ ". Please check and deal with it in time.";
//发送消息
sendMessage(msgContentEN,userIdList,projectLibraryId);
@@ -2571,4 +2572,24 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
}
}
/**
* 验证用户是否是该项目的studio工程师。
* @param projectLibraryId
* @param cut
*/
public void isStudio(String projectLibraryId,String cut){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
int roleCode = checkUserRole(projectLibraryId, currentUser.getId(), "");
if(roleCode != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())){
String errorMessage = "";
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
errorMessage = "该用户不是这个项目的studio工程师,没有权限操作!";
}else {
errorMessage = "This user is not a studio engineer for this project and does not have permission to operate!";
}
throw new JeroBootException(errorMessage);
}
}
}
@@ -192,7 +192,9 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
if(StringUtils.equals(operatorType,OperatorTypeEnum.UPDATE_STATUS.getValue())){
ProjectTaskInventoryEO projectTaskInventoryEO = JSONObject.parseObject(jsonObject.toString(), ProjectTaskInventoryEO.class);
this.baseMapper.updateById(projectTaskInventoryEO);
QueryWrapper<ProjectTaskInventoryEO> updateWrapper = new QueryWrapper<>();
updateWrapper.lambda().eq(ProjectTaskInventoryEO::getProjectLawsInventoryId,projectTaskInventoryEO.getProjectLawsInventoryId());
this.baseMapper.update(projectTaskInventoryEO,updateWrapper);
}else if(StringUtils.equals(operatorType,OperatorTypeEnum.SEND_MSG.getValue())){
workFlowSendMsg(jsonObject);
}else if(StringUtils.equals(operatorType,OperatorTypeEnum.ADD_TASK_INVENTORY_DETAIL.getValue())){
@@ -1,5 +1,6 @@
package com.jero.modules.wkflow.entity;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -42,7 +43,7 @@ public class TaskCommonQuery {
private String prcNum;
@ApiModelProperty(value = "流程类型")
private String prcType;
private String prcType = FlowTypeEnum.RWQRLC.getValue();
@ApiModelProperty(value = "高级搜索字符串")
private String advanceSearchVOStr;
@@ -6,7 +6,7 @@ package com.jero.modules.wkflow.enums;
public enum FlowTypeEnum {
RWQRLC("1","任务确认流程","RWQRLC","任务确认流程","rwqrlc"),
SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxsclc"),
SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxlc"),
PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc"),
YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc"),
;