|
@@ -1,5 +1,5 @@
|
|
package com.fdkankan.sale.service.impl;
|
|
package com.fdkankan.sale.service.impl;
|
|
-import com.fdkankan.sale.common.RepairStatusEnumMsg;
|
|
|
|
|
|
+import com.fdkankan.sale.common.*;
|
|
import com.fdkankan.sale.entity.OrderReceiving;
|
|
import com.fdkankan.sale.entity.OrderReceiving;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.fdkankan.sale.entity.CustomerAddress;
|
|
import com.fdkankan.sale.entity.CustomerAddress;
|
|
@@ -9,8 +9,6 @@ import com.fdkankan.sale.vo.response.RepairRegisterVo;
|
|
import com.fdkankan.sale.entity.RepairTest;
|
|
import com.fdkankan.sale.entity.RepairTest;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
-import com.fdkankan.sale.common.PageInfo;
|
|
|
|
-import com.fdkankan.sale.common.RepairStatusEnum;
|
|
|
|
import com.fdkankan.sale.entity.*;
|
|
import com.fdkankan.sale.entity.*;
|
|
import com.fdkankan.sale.service.*;
|
|
import com.fdkankan.sale.service.*;
|
|
import com.fdkankan.sale.util.OrderListVo;
|
|
import com.fdkankan.sale.util.OrderListVo;
|
|
@@ -18,7 +16,6 @@ import com.fdkankan.sale.util.StatusUtil;
|
|
import com.fdkankan.sale.vo.request.RepairInfoListParam;
|
|
import com.fdkankan.sale.vo.request.RepairInfoListParam;
|
|
import com.fdkankan.sale.vo.response.*;
|
|
import com.fdkankan.sale.vo.response.*;
|
|
|
|
|
|
-import com.fdkankan.sale.common.ResultCode;
|
|
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.omg.CORBA.INTERNAL;
|
|
import org.omg.CORBA.INTERNAL;
|
|
@@ -166,9 +163,7 @@ public class RepairInfoService {
|
|
repairLogVo.setCustomerAddress(customerAddress);
|
|
repairLogVo.setCustomerAddress(customerAddress);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if(repairLogVo.getOldRepairStatus() != null){
|
|
|
|
- setTitle(repairLogVo);
|
|
|
|
- }
|
|
|
|
|
|
+ setTitle(repairLogVo,1);
|
|
}
|
|
}
|
|
List<RepairLogVo> repairLogListVo = new ArrayList<>();
|
|
List<RepairLogVo> repairLogListVo = new ArrayList<>();
|
|
if(repairLogList.size() >0){
|
|
if(repairLogList.size() >0){
|
|
@@ -191,39 +186,44 @@ public class RepairInfoService {
|
|
if(log.getRepairStatus() >=RepairStatusEnum.OVER_SHIPPED.status()){
|
|
if(log.getRepairStatus() >=RepairStatusEnum.OVER_SHIPPED.status()){
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- return setTitle(log);
|
|
|
|
|
|
+ return setTitle(log,0);
|
|
}
|
|
}
|
|
|
|
|
|
- private RepairLogVo setTitle(RepairLogVo log) {
|
|
|
|
- Integer status = log.getOldRepairStatus() == null ? log.getRepairStatus() :log.getOldRepairStatus() ;
|
|
|
|
- String subTitle = RepairStatusEnumMsg.getByStatus(status).getMessage();
|
|
|
|
- List<Integer> noUserNameList = Arrays.asList( 30,40, 80, 110);
|
|
|
|
- if(!noUserNameList.contains(status)){
|
|
|
|
|
|
+ private RepairLogVo setTitle(RepairLogVo log,Integer type) {
|
|
|
|
+ Integer status = null;
|
|
|
|
+ String subTitle = null;
|
|
|
|
+ String title = null;
|
|
|
|
+ List<Integer> noUserNameList = null;
|
|
|
|
+ String role = null;
|
|
|
|
+ if(type == 0){
|
|
|
|
+ status = log.getRepairStatus();
|
|
|
|
+ subTitle = RepairStatusProcessComing.getByStatus(status).getSubTitle();
|
|
|
|
+ title = RepairStatusProcessComing.getByStatus(status).getTitle();
|
|
|
|
+ role = RepairStatusProcessComing.getByStatus(status).getRole();
|
|
|
|
+ }
|
|
|
|
+ if(type == 1){
|
|
|
|
+ status = log.getOldRepairStatus() == null ? log.getRepairStatus() :log.getOldRepairStatus() ;
|
|
|
|
+ subTitle = RepairStatusProcessIng.getByStatus(status).getSubTitle();
|
|
|
|
+ title = RepairStatusProcessIng.getByStatus(status).getTitle();
|
|
|
|
+ role = RepairStatusProcessComing.getByStatus(status).getRole();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotBlank(role)){
|
|
OrderReceiving orderReceiving = orderReceivingService.getByRepairId(log.getRepairId());
|
|
OrderReceiving orderReceiving = orderReceivingService.getByRepairId(log.getRepairId());
|
|
Long sysUserId = null;
|
|
Long sysUserId = null;
|
|
- switch (status){
|
|
|
|
- case 10 :
|
|
|
|
- case 60 :
|
|
|
|
- sysUserId = orderReceiving.getRepairManId();break;
|
|
|
|
- case 20 :
|
|
|
|
- case 100 :
|
|
|
|
- sysUserId = orderReceiving.getSysUserId();break;
|
|
|
|
- case 50 :
|
|
|
|
- case 90 :
|
|
|
|
- case 91 :
|
|
|
|
- sysUserId = orderReceiving.getSupplyAdminId();break;
|
|
|
|
- case 70 :
|
|
|
|
- sysUserId = orderReceiving.getTesterId();break;
|
|
|
|
|
|
+ switch (role){
|
|
|
|
+ case "sale" : sysUserId = orderReceiving.getSysUserId();break;
|
|
|
|
+ case "repairMan" : sysUserId = orderReceiving.getRepairManId();break;
|
|
|
|
+ case "repairSupply" : sysUserId = orderReceiving.getSupplyAdminId();break;
|
|
|
|
+ case "tester" : sysUserId = orderReceiving.getTesterId();break;
|
|
}
|
|
}
|
|
SysUser sysUser = sysUserService.getById(sysUserId);
|
|
SysUser sysUser = sysUserService.getById(sysUserId);
|
|
if(sysUser != null){
|
|
if(sysUser != null){
|
|
//log.setSysUserName(sysUser.getUserName());
|
|
//log.setSysUserName(sysUser.getUserName());
|
|
subTitle = subTitle.replace("{userName}",sysUser.getNickName());
|
|
subTitle = subTitle.replace("{userName}",sysUser.getNickName());
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
log.setSubTitle(subTitle);
|
|
log.setSubTitle(subTitle);
|
|
- String title = RepairStatusEnum.getByStatus(status).getMessage();
|
|
|
|
log.setTitle(title);
|
|
log.setTitle(title);
|
|
log.setRemark(title);
|
|
log.setRemark(title);
|
|
return log;
|
|
return log;
|