lyhzzz 2 年之前
父节点
当前提交
39209ccd96

+ 0 - 6
src/main/java/com/fdkankan/sale/service/impl/PriceListServiceImpl.java

@@ -82,13 +82,7 @@ public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceLis
     public void delNoCm(String repairId) {
     public void delNoCm(String repairId) {
         LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PriceList::getRepairId,repairId);
         wrapper.eq(PriceList::getRepairId,repairId);
-        wrapper.eq(PriceList::getStatus,0);
         this.remove(wrapper);
         this.remove(wrapper);
-
-        LambdaQueryWrapper<PriceList> wrapper2 = new LambdaQueryWrapper<>();
-        wrapper2.eq(PriceList::getRepairId,repairId);
-        wrapper2.eq(PriceList::getType,1);
-        this.remove(wrapper2);
     }
     }
 
 
 }
 }

+ 11 - 5
src/main/java/com/fdkankan/sale/service/impl/RepairCustomerService.java

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

+ 3 - 1
src/main/java/com/fdkankan/sale/service/impl/RepairSaleService.java

@@ -127,7 +127,8 @@ public class RepairSaleService {
             default: cameraType = 0; break;
             default: cameraType = 0; break;
         }
         }
         Date outTime = cameraDetail.getOutTime() == null ? cameraDetail.getCreateTime() : cameraDetail.getOutTime();
         Date outTime = cameraDetail.getOutTime() == null ? cameraDetail.getCreateTime() : cameraDetail.getOutTime();
-        Date date = DateUtil.dateAddOne(outTime, 7);
+        Date date = DateUtil.dateAddOneYear(outTime, 1);
+        date = DateUtil.dateAddOne(date, 7);
         String date1 = DateUtil.getDate(DateUtil.dayFmt, date) +" 23:59:59";
         String date1 = DateUtil.getDate(DateUtil.dayFmt, date) +" 23:59:59";
 
 
         Repair repair = new Repair();
         Repair repair = new Repair();
@@ -204,6 +205,7 @@ public class RepairSaleService {
             }
             }
             priceList.setRepairId(param.getRepairId());
             priceList.setRepairId(param.getRepairId());
             if(priceList.getPriceListId() != null){
             if(priceList.getPriceListId() != null){
+                priceList.setRecStatus("A");
                 priceListService.updateById(priceList);
                 priceListService.updateById(priceList);
             }else {
             }else {
                 priceListService.save(priceList);
                 priceListService.save(priceList);

+ 10 - 1
src/main/java/com/fdkankan/sale/util/DateUtil.java

@@ -182,7 +182,16 @@ public class DateUtil {
     public static Date dateAddOne(Date date,Integer i) {
     public static Date dateAddOne(Date date,Integer i) {
         Calendar  calendar = new GregorianCalendar();
         Calendar  calendar = new GregorianCalendar();
         calendar.setTime(date);
         calendar.setTime(date);
-        calendar.add(calendar.DATE,i); //把日期往后增加一天,整数  往后推,负数往前移动
+        calendar.add(Calendar.DATE,i); //把日期往后增加一天,整数  往后推,负数往前移动
+        date=calendar.getTime(); //这个时间就是日期往后推一天的结果
+        return date;
+
+    }
+    /*日期加+1天*/
+    public static Date dateAddOneYear(Date date,Integer i) {
+        Calendar  calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        calendar.add(Calendar.YEAR,i); //把日期往后增加一天,整数  往后推,负数往前移动
         date=calendar.getTime(); //这个时间就是日期往后推一天的结果
         date=calendar.getTime(); //这个时间就是日期往后推一天的结果
         return date;
         return date;