|
@@ -14,6 +14,7 @@ import com.platform.dao.dto.preparation.PreparationRecordDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
|
import com.platform.dao.entity.preparation.Preparation;
|
|
|
import com.platform.dao.entity.preparation.PreparationRecord;
|
|
|
+import com.platform.dao.entity.upms.SysConfig;
|
|
|
import com.platform.dao.entity.upms.SysFile;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.enums.*;
|
|
@@ -36,6 +37,7 @@ import com.platform.dao.vo.report.PreparationReportByStatusVO;
|
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
|
import com.platform.service.preparation.PreparationService;
|
|
|
+import com.platform.service.upms.SysConfigService;
|
|
|
import com.platform.service.upms.SysFileService;
|
|
|
import com.platform.service.util.SendMessageUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -78,6 +80,8 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
private PreparationRecordMapper preparationRecordMapper;
|
|
|
@Resource
|
|
|
private BuildingMapper buildingMapper;
|
|
|
+ @Resource
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
|
|
@Override
|
|
|
public List<ExportPreparationNumVO> getPreparationReportByPositionId(PreparationDTO dto) {
|
|
@@ -291,15 +295,30 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
String userId = SecurityUtils.getUserInfo().getUserId();
|
|
|
String applyDept = sysUserDeptMapper.selectDeptIdByUserId(userId);
|
|
|
model.setDepartId(applyDept);
|
|
|
- // 判断申请部门是否有负责人
|
|
|
+ // 判断是否是指定部门,默认负责人和主管的部门
|
|
|
+ SysConfig config = sysConfigService.getByCode(SysConfigEnum.PREPARATION_SPECIAL_DEPT_IDS.name());
|
|
|
+ String specialDeptIds = config.getContent();
|
|
|
SysUserDTO queryUserDTO = new SysUserDTO();
|
|
|
- queryUserDTO.setRoleCode(SysRoleCodeEnum.DEPT_LEADER.name());
|
|
|
- queryUserDTO.setDeptId(model.getDepartId());
|
|
|
- List<SysUserVO> userVOS = sysUserMapper.selectDeptRoleUser(queryUserDTO);
|
|
|
- if (userVOS == null || userVOS.size() != 1) {
|
|
|
- throw new DeniedException("报修失败,申请部门,无审批负责人或存在多个");
|
|
|
+ List<SysUserVO> userVOS = ListUtils.newArrayList();
|
|
|
+ if(specialDeptIds.contains(applyDept)){
|
|
|
+ // 默认刘贵生主管和邓华山负责人
|
|
|
+ config = sysConfigService.getByCode(SysConfigEnum.PREPARATION_SPECIAL_USER_IDS.name());
|
|
|
+ if(config != null && StringUtils.isEmpty(config.getContent())){
|
|
|
+ throw new DeniedException("默认主管和部门负责人未配置");
|
|
|
+ }
|
|
|
+ String[] userIds = config.getContent().split("-");
|
|
|
+ model.setApplyVerifyUserId(userIds[0]);
|
|
|
+ model.setApplyVerifyLeader(userIds[1]);
|
|
|
+ }else{
|
|
|
+ // 判断申请部门是否有负责人
|
|
|
+ queryUserDTO.setRoleCode(SysRoleCodeEnum.DEPT_LEADER.name());
|
|
|
+ queryUserDTO.setDeptId(model.getDepartId());
|
|
|
+ userVOS = sysUserMapper.selectDeptRoleUser(queryUserDTO);
|
|
|
+ if (userVOS == null || userVOS.size() != 1) {
|
|
|
+ throw new DeniedException("报修失败,申请部门,无审批负责人或存在多个");
|
|
|
+ }
|
|
|
+ model.setApplyVerifyLeader(userVOS.get(0).getUserId());
|
|
|
}
|
|
|
- model.setApplyVerifyLeader(userVOS.get(0).getUserId());
|
|
|
// 判断收件部门是否有负责人
|
|
|
queryUserDTO.setRoleCode(SysRoleCodeEnum.DEPT_LEADER.name());
|
|
|
queryUserDTO.setDeptId(model.getReceiveDept());
|