|
@@ -144,62 +144,64 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
@Override
|
|
|
public MyVOPage<RepairApplicationFormVO> selectPageInfoVO(RepairApplicationFormDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setRepairUserId(userInfo.getUserId());
|
|
|
- String repairModel = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_STRATEGY_MODEL.name()); // 维修模式
|
|
|
- if(record.getSearchType() != null){
|
|
|
- List<Integer> statusList = new ArrayList<>();
|
|
|
- if(record.getSearchType() == 1){ // 待分配
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
- switch (repairModel){
|
|
|
- case CommonConstants.REPAIR_STRATEGY_MODEL_BASE:
|
|
|
- record.setRepairUserId(null);
|
|
|
- break;
|
|
|
- case CommonConstants.REPAIR_STRATEGY_MODEL_DISPATCH:
|
|
|
- record.setDispatchUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
- break;
|
|
|
+ if(StringUtils.isBlank(record.getSbId())){ // 非获取设备的维修记录
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ record.setRepairUserId(userInfo.getUserId());
|
|
|
+ String repairModel = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_STRATEGY_MODEL.name()); // 维修模式
|
|
|
+ if(record.getSearchType() != null){
|
|
|
+ List<Integer> statusList = new ArrayList<>();
|
|
|
+ if(record.getSearchType() == 1){ // 待分配
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
+ switch (repairModel){
|
|
|
+ case CommonConstants.REPAIR_STRATEGY_MODEL_BASE:
|
|
|
+ record.setRepairUserId(null);
|
|
|
+ break;
|
|
|
+ case CommonConstants.REPAIR_STRATEGY_MODEL_DISPATCH:
|
|
|
+ record.setDispatchUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ if(record.getSearchType() == 2){ // 待维修
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
+ }
|
|
|
+ if(record.getSearchType() == 3){ // 待审核
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
+ }
|
|
|
+ if(record.getSearchType() == 4){ // 已完成
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.FINISHED.getValue());
|
|
|
+ }
|
|
|
+ if(record.getSearchType() == 5){ // 已驳回
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.REBACK.getValue());
|
|
|
+ }
|
|
|
+ if(record.getSearchType() == 6){ // 已驳回、待审核、待维修、待分配
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.REBACK.getValue());
|
|
|
+ }
|
|
|
+ if(record.getSearchType() == 7){
|
|
|
+ // 获取验收人
|
|
|
+ record.setRepairUserId(null);
|
|
|
+ record.setCheckUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ }
|
|
|
+ record.setStatusList(statusList);
|
|
|
}
|
|
|
- if(record.getSearchType() == 2){ // 待维修
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
- }
|
|
|
- if(record.getSearchType() == 3){ // 待审核
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
- }
|
|
|
- if(record.getSearchType() == 4){ // 已完成
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.FINISHED.getValue());
|
|
|
- }
|
|
|
- if(record.getSearchType() == 5){ // 已驳回
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.REBACK.getValue());
|
|
|
- }
|
|
|
- if(record.getSearchType() == 6){ // 已驳回、待审核、待维修、待分配
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
|
|
|
- statusList.add(RepairApplicationFormStatusEnum.REBACK.getValue());
|
|
|
+ // 排除超级用户
|
|
|
+ String userNames = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_SUPER_USERS.name()); // 超级用户
|
|
|
+ if(StringUtils.isBlank(userNames)){
|
|
|
+ throw new DeniedException("请设置维修菜单的超级用户");
|
|
|
}
|
|
|
- if(record.getSearchType() == 7){
|
|
|
- // 获取验收人
|
|
|
+ // 维修模式为派工的情况
|
|
|
+ if(userNames.contains(userInfo.getUsername())){
|
|
|
record.setRepairUserId(null);
|
|
|
- record.setCheckUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
- }
|
|
|
- record.setStatusList(statusList);
|
|
|
- }
|
|
|
- // 排除超级用户
|
|
|
- String userNames = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_SUPER_USERS.name()); // 超级用户
|
|
|
- if(StringUtils.isBlank(userNames)){
|
|
|
- throw new DeniedException("请设置维修菜单的超级用户");
|
|
|
- }
|
|
|
- // 维修模式为派工的情况
|
|
|
- if(userNames.contains(userInfo.getUsername())){
|
|
|
- record.setRepairUserId(null);
|
|
|
- record.setDispatchUserId(null);
|
|
|
- // 超级可以看到所有待审核的工单
|
|
|
- if(record.getSearchType() != null && record.getSearchType() == 7){
|
|
|
- record.setCheckUserId(null);
|
|
|
- record.setCheckAllFlag(1);
|
|
|
+ record.setDispatchUserId(null);
|
|
|
+ // 超级可以看到所有待审核的工单
|
|
|
+ if(record.getSearchType() != null && record.getSearchType() == 7){
|
|
|
+ record.setCheckUserId(null);
|
|
|
+ record.setCheckAllFlag(1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return new MyVOPage<>(mapper.selectPageList(record));
|