|
@@ -35,6 +35,8 @@ public class RepairCustomerService {
|
|
IRepairPayService repairPayService;
|
|
IRepairPayService repairPayService;
|
|
@Autowired
|
|
@Autowired
|
|
IPriceListService priceListService;
|
|
IPriceListService priceListService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IRepairRegisterPartService repairRegisterPartService;
|
|
|
|
|
|
public Object getRepairByOpenId(String openId) {
|
|
public Object getRepairByOpenId(String openId) {
|
|
List<Customer> list = customerService.getByOpenId(openId);
|
|
List<Customer> list = customerService.getByOpenId(openId);
|
|
@@ -65,18 +67,23 @@ public class RepairCustomerService {
|
|
if(!repair.getStatus().equals(RepairStatusEnum.TO_BE_CONFIRMED.status())){
|
|
if(!repair.getStatus().equals(RepairStatusEnum.TO_BE_CONFIRMED.status())){
|
|
throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
|
|
throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
|
|
}
|
|
}
|
|
-
|
|
|
|
if(param.getConfirm() == 0){
|
|
if(param.getConfirm() == 0){
|
|
priceListService.updateStatusByRepairId(repair.getRepairId());
|
|
priceListService.updateStatusByRepairId(repair.getRepairId());
|
|
- repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_PREPARED.status(),"确认维修");
|
|
|
|
|
|
+ //无备件更换,不需要备料,应直接进入维修中
|
|
|
|
+ List<RepairRegisterPart> partList = repairRegisterPartService.getByRepairId(repair.getRepairId());
|
|
|
|
+ if(partList == null || partList.size() <=0){
|
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_REPAIRED.status(),"确认维修");
|
|
|
|
+ }else {
|
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_PREPARED.status(),"确认维修");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(param.getConfirm() == 1) {
|
|
if(param.getConfirm() == 1) {
|
|
//有检测费用,已取消,无检测费用,直接到代发货
|
|
//有检测费用,已取消,无检测费用,直接到代发货
|
|
BigDecimal robAmount = priceListService.getRobAmountByRepairId(repair.getRepairId());
|
|
BigDecimal robAmount = priceListService.getRobAmountByRepairId(repair.getRepairId());
|
|
if(robAmount !=null && robAmount.compareTo(BigDecimal.ZERO) >0){
|
|
if(robAmount !=null && robAmount.compareTo(BigDecimal.ZERO) >0){
|
|
- repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_CANCELED.status(),"拒绝报价");
|
|
|
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_CANCELED.status(),"已取消维修");
|
|
}else {
|
|
}else {
|
|
- repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_SHIPPED.status(),"拒绝报价");
|
|
|
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_SHIPPED.status(),"已取消维修");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|