|
@@ -7,6 +7,7 @@ import com.fdkankan.sale.entity.*;
|
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
|
import com.fdkankan.sale.service.*;
|
|
|
import com.fdkankan.sale.vo.request.RepairParam;
|
|
|
+import com.fdkankan.sale.vo.response.RepairRegisterPartVo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,6 +36,8 @@ public class RepairCustomerService {
|
|
|
IRepairPayService repairPayService;
|
|
|
@Autowired
|
|
|
IPriceListService priceListService;
|
|
|
+ @Autowired
|
|
|
+ RepairSupplyService repairSupplyService;
|
|
|
|
|
|
public Object getRepairByOpenId(String openId) {
|
|
|
List<Customer> list = customerService.getByOpenId(openId);
|
|
@@ -78,16 +81,19 @@ public class RepairCustomerService {
|
|
|
}
|
|
|
if(param.getConfirm() == 1) {
|
|
|
//有检测费用,已取消,无检测费用,直接到代发货
|
|
|
+ List<RepairRegisterPartVo> partVoList = repairSupplyService.partInfo(repair.getRepairId(), 1);
|
|
|
BigDecimal robAmount = priceListService.getRobAmountByRepairId(repair.getRepairId());
|
|
|
- if(robAmount !=null && robAmount.compareTo(BigDecimal.ZERO) >0){
|
|
|
- if(repair.getWarrantyType() == 0 ){
|
|
|
+
|
|
|
+ if(robAmount.compareTo(BigDecimal.ZERO) <=0 || repair.getWarrantyType() == 0 ){
|
|
|
+ if(partVoList.size() >0){
|
|
|
repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_RECOVERED.status(),"已取消维修");
|
|
|
}else {
|
|
|
- repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_CANCELED.status(),"已取消维修");
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_SHIPPED.status(),"已取消维修");
|
|
|
}
|
|
|
- }else {
|
|
|
- repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_SHIPPED.status(),"已取消维修");
|
|
|
+ } else {
|
|
|
+ repairLogService.saveBySysUser(param.getUserId(),repair.getRepairId(),RepairStatusEnum.TO_BE_CANCELED.status(),"已取消维修");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|