|
@@ -108,7 +108,20 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
@Override
|
|
|
public RepairApplicationFormDTO sendRepair(RepairApplicationFormDTO model) {
|
|
|
RepairApplicationFormDTO superModel = super.sendRepair(model);
|
|
|
- // 自己派工
|
|
|
+ RepairApplicationForm applicationForm = new RepairApplicationForm();
|
|
|
+ applicationForm.setId(model.getId());
|
|
|
+ applicationForm.setRepairUserId(superModel.getRepairUserId());
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
+ if (superModel.getRepairStartTime() == null) {
|
|
|
+ applicationForm.setRepairStartTime(LocalDateTime.now());
|
|
|
+ superModel.setRepairStartTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ applicationForm.setReceiveMinutes(DateUtils.getDurationHours(superModel.getApplyTime(), superModel.getRepairStartTime()));
|
|
|
+ applicationForm.setUpdateTime(LocalDateTime.now());
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKeySelective(applicationForm);
|
|
|
+ // 给报修人发送消息
|
|
|
+ sendMessageToRepairCaller(superModel.getId(),superModel.getNo(),superModel.getUserId());
|
|
|
+ /*// 自己派工
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
String userNames = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_SUPER_USERS.name()); // 超级用户
|
|
|
if(StringUtils.isNotBlank(userNames)){
|
|
@@ -137,7 +150,7 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
return model;
|
|
|
}
|
|
@@ -159,9 +172,9 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
public RepairApplicationForm submitRepair(RepairApplicationFormDTO model) {
|
|
|
RepairApplicationForm applicationForm = super.submitRepair(model);
|
|
|
SbInfoVO sbInfoVO = sbInfoService.getById(applicationForm.getSbId());
|
|
|
- // 默认的提交审核后的审核人,就是维修主管的角色,每家不同自行实现
|
|
|
- SysUserVO userVO;
|
|
|
- SysUserDTO query = new SysUserDTO();
|
|
|
+ // 完成维修提交给生产审核
|
|
|
+ SysUserVO userVO = sysUserService.selectUserVO(applicationForm.getUserId());
|
|
|
+ /*SysUserDTO query = new SysUserDTO();
|
|
|
query.setRoleCode(SysRoleCodeEnum.REPAIR_EXAMINE.name());
|
|
|
List<SysUserVO> users = sysUserService.selectDeptRoleUser(query);
|
|
|
if (CollectionUtil.isNotEmpty(users)) {
|
|
@@ -169,7 +182,8 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
} else {
|
|
|
throw new BusinessException("审核角色:REPAIR_EXAMINE未绑定用户,REPAIR_EXAMINE为维修单最终验收人,请设置用户");
|
|
|
}
|
|
|
- applicationForm.setCheckUserId(userVO.getUserId());
|
|
|
+ applicationForm.setCheckUserId(userVO.getUserId());*/
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
repairApplicationFormMapper.updateByPrimaryKeySelective(applicationForm);
|
|
|
// 发送邮件和通知
|
|
|
String domain = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_DOMAIN.name());
|
|
@@ -267,6 +281,13 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
|
|
|
@Override
|
|
|
public RepairApplicationFormDTO closeRepair(RepairApplicationFormDTO dto) {
|
|
|
+ // 保存维修记录图片和文件
|
|
|
+ sysFileService.saveFile(dto.getId(), SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue(), dto.getRepairFileList());
|
|
|
+ sysFileService.saveFile(dto.getId(), SysFileTypeEnum.REPAIR_REPAIR_FILES.getValue(), dto.getOpinionFileList());
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
+ updForm.setId(dto.getId());
|
|
|
+ updForm.setStatus(RepairApplicationFormStatusEnum.MM_REPAIR_CLOSE.getValue());
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKey(updForm);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -282,7 +303,15 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
|
|
|
@Override
|
|
|
public void verifyRepairByProduce(RepairApplicationFormDTO model) {
|
|
|
-
|
|
|
+ if(model.getStatus() == null || model.getStatus() != RepairApplicationFormStatusEnum.FINISHED.getValue()
|
|
|
+ || model.getStatus() != RepairApplicationFormStatusEnum.VERIFY_REFUSED.getValue()){
|
|
|
+ throw new DeniedException("审核状态有问题");
|
|
|
+ }
|
|
|
+ RepairApplicationForm updForm = new RepairApplicationForm();
|
|
|
+ updForm.setId(model.getId());
|
|
|
+ updForm.setRemark(model.getRemark());
|
|
|
+ updForm.setStatus(model.getStatus());
|
|
|
+ repairApplicationFormMapper.updateByPrimaryKey(updForm);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -317,11 +346,14 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
|
|
|
@Override
|
|
|
public RepairApplicationFormDTO handleRepair(RepairApplicationFormDTO dto) {
|
|
|
- super.handleRepair(dto);
|
|
|
+ //super.handleRepair(dto);
|
|
|
RepairApplicationForm applicationForm = repairApplicationFormMapper.selectById(dto.getId());
|
|
|
+ applicationForm.setRepairEndTime(LocalDateTime.now());
|
|
|
+ applicationForm.setRepairContent(dto.getRepairContent());
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
applicationForm.setRepairMinutes(DateUtils.getDurationHours(applicationForm.getRepairStartTime(), applicationForm.getRepairEndTime()));
|
|
|
// 根据配置判断维修是否超时
|
|
|
- String hourFirstStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_FIRST.name());
|
|
|
+ /*String hourFirstStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_FIRST.name());
|
|
|
int hourFirst = 180;// 默认3小时,180分钟
|
|
|
if (StringUtils.isNotBlank(hourFirstStr)) {
|
|
|
hourFirst = Integer.valueOf(hourFirstStr) * 60;
|
|
@@ -332,7 +364,7 @@ public class AllocateRepairBaseStrategy extends AbstractRepairBaseStrategy {
|
|
|
applicationForm.setRepairOvertime(false);
|
|
|
}
|
|
|
// 保存维修图片
|
|
|
- sysFileService.saveFile(dto.getId(), SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue(), dto.getRepairFileList());
|
|
|
+ sysFileService.saveFile(dto.getId(), SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue(), dto.getRepairFileList());*/
|
|
|
repairApplicationFormMapper.updateByPrimaryKeySelective(applicationForm);
|
|
|
return dto;
|
|
|
}
|