|
@@ -311,10 +311,29 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
model.setNo(IdGeneratorUtils.getPreparationNo(++count));
|
|
|
model.setStatus(PreparationStatusEnum.NOT_ALLOCATED.getValue()); // 待主管审核
|
|
|
model.setNodeNum(PreparationNodeEnum.APPLY.getValue());
|
|
|
+ // 根据是否有审核主管,判断审核节点和状态
|
|
|
+ boolean sendToVerify = Boolean.TRUE;
|
|
|
+ if(StringUtils.isEmpty(model.getApplyVerifyUserId())){
|
|
|
+ model.setStatus(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue()); // 待主管审核
|
|
|
+ model.setNodeNum(PreparationNodeEnum.APPLY_MANAGER_VERIFY.getValue());
|
|
|
+ sendToVerify = Boolean.FALSE;
|
|
|
+ }
|
|
|
model.setDelUserId("[]");
|
|
|
Preparation preparation = this.saveModelByDTO(model);
|
|
|
+ // 保存文件图片
|
|
|
+ if(model.getImageList() != null && model.getImageList().size() > 0){
|
|
|
+ sysFileService.saveFile(preparation.getId(), SysFileTypeEnum.PREPARATION_APPLICATION_IMGS_APPLY.getValue(), model.getImageList());
|
|
|
+ }
|
|
|
+ if(model.getFileList() != null && model.getFileList().size() > 0){
|
|
|
+ sysFileService.saveFile(preparation.getId(), SysFileTypeEnum.PREPARATION_APPLICATION_FILES_APPLY.getValue(), model.getFileList());
|
|
|
+ }
|
|
|
// 给申请部门主管发送信息,通知审核
|
|
|
- SysUser sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyUserId());
|
|
|
+ SysUser sendUser = null;
|
|
|
+ if(sendToVerify){
|
|
|
+ sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyUserId());
|
|
|
+ }else{
|
|
|
+ sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyLeader());
|
|
|
+ }
|
|
|
sendMessageToApplyManger(sendUser, preparation);
|
|
|
// 存储操作记录
|
|
|
addRecord(preparation, PreparationRecordTypeEnum.FLOW.getValue(), model.getRemark());
|
|
@@ -406,6 +425,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
public void completePreparation(PreparationDTO model) {
|
|
|
Preparation preparation = mapper.selectByPrimaryKey(model.getId());
|
|
|
Preparation updPre = new Preparation();
|
|
|
+ updPre.setActualFee(model.getActualFee());
|
|
|
updPre.setId(model.getId());
|
|
|
updPre.setFinishContent(model.getFinishContent());
|
|
|
updPre.setRepairEndTime(LocalDateTime.now());
|
|
@@ -436,6 +456,8 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
List<SysFile> sysFiles = sysFileService.getListByTargetAndType(id, null);
|
|
|
List<SysFile> imageList = ListUtils.newArrayList();
|
|
|
List<SysFile> fileList = ListUtils.newArrayList();
|
|
|
+ List<SysFile> applyImageList = ListUtils.newArrayList();
|
|
|
+ List<SysFile> applyFileList = ListUtils.newArrayList();
|
|
|
sysFiles.forEach(item -> {
|
|
|
if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_IMGS.getValue())) {
|
|
|
imageList.add(item);
|
|
@@ -443,9 +465,17 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_FILES.getValue())) {
|
|
|
fileList.add(item);
|
|
|
}
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_IMGS_APPLY.getValue())) {
|
|
|
+ applyImageList.add(item);
|
|
|
+ }
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.PREPARATION_APPLICATION_FILES_APPLY.getValue())) {
|
|
|
+ applyFileList.add(item);
|
|
|
+ }
|
|
|
});
|
|
|
vo.setImageList(imageList);
|
|
|
vo.setFileList(fileList);
|
|
|
+ vo.setApplyImageList(applyImageList);
|
|
|
+ vo.setApplyFileList(applyFileList);
|
|
|
// 审批主管
|
|
|
if (!StringUtils.isEmpty(vo.getApplyVerifyUserId())) {
|
|
|
vo.setApplyVerifyUser(sysUserMapper.selectUserNameById(vo.getApplyVerifyUserId()));
|
|
@@ -706,6 +736,14 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
updPre.setApplyReason(model.getApplyReason());
|
|
|
updPre.setContent(model.getContent());
|
|
|
updPre.setFee(model.getFee());
|
|
|
+ updPre.setActualFee(model.getActualFee());
|
|
|
+ // 判断前后费用不一致
|
|
|
+ if(preparation.getActualFee().compareTo(model.getActualFee()) != 0){
|
|
|
+ // 判断修改人是否是执行人
|
|
|
+ if(!SecurityUtils.getUserInfo().getUserId().equals(preparation.getRepairUserId())){
|
|
|
+ throw new DeniedException("非执行人不能修改实际费用");
|
|
|
+ }
|
|
|
+ }
|
|
|
SysUserDTO queryUserDTO = new SysUserDTO();
|
|
|
List<SysUserVO> userVOS = null;
|
|
|
// 查询发送消息用户
|
|
@@ -950,6 +988,19 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
mapper.updateByPrimaryKeySelective(updPre);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateActualFee(String id, BigDecimal actualFee) {
|
|
|
+ Preparation preparation = mapper.selectByPrimaryKey(id);
|
|
|
+ String userId = SecurityUtils.getUserInfo().getUserId();
|
|
|
+ if(!userId.equals(preparation.getRepairUserId())){
|
|
|
+ throw new DeniedException("非执行人不可以修改实际费用");
|
|
|
+ }
|
|
|
+ Preparation updInfo = new Preparation();
|
|
|
+ updInfo.setId(id);
|
|
|
+ updInfo.setActualFee(actualFee);
|
|
|
+ mapper.updateByPrimaryKeySelective(updInfo);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AbstractPageResultBean<Preparation> selectPageInfo(PreparationDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|