|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.sale.entity.Part;
|
|
|
+import com.fdkankan.sale.entity.PriceList;
|
|
|
import com.fdkankan.sale.entity.RepairRegister;
|
|
|
import com.fdkankan.sale.entity.RepairRegisterPart;
|
|
|
import com.fdkankan.sale.mapper.IRepairRegisterMapper;
|
|
@@ -13,7 +14,9 @@ import com.fdkankan.sale.service.IRepairRegisterPartService;
|
|
|
import com.fdkankan.sale.service.IRepairRegisterService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.sale.util.DateUtil;
|
|
|
+import com.fdkankan.sale.util.StatusUtil;
|
|
|
import com.fdkankan.sale.vo.response.CheckRegisterVo;
|
|
|
+import com.fdkankan.sale.vo.response.PriceListVo;
|
|
|
import com.fdkankan.sale.vo.response.RepairRegisterPartVo;
|
|
|
import com.fdkankan.sale.vo.response.RepairRegisterVo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -115,4 +118,32 @@ public class RepairRegisterServiceImpl extends ServiceImpl<IRepairRegisterMapper
|
|
|
wrapper.eq(RepairRegister::getRepairId,repairId);
|
|
|
this.remove(wrapper);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PriceListVo getPriceList(String repairId) {
|
|
|
+ RepairRegisterVo vo = this.getBaseMapper().getVoByRepairId(repairId);
|
|
|
+ if(vo == null){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<RepairRegisterPart> partList = repairRegisterPartService.getByRepairId(vo.getRepairId());
|
|
|
+ PriceListVo priceListVo = new PriceListVo();
|
|
|
+ priceListVo.setCount(1);
|
|
|
+ List<PriceList> priceLists = new ArrayList<>();
|
|
|
+ for (RepairRegisterPart repairRegisterPart : partList) {
|
|
|
+ Part part = partService.getById(repairRegisterPart.getPartId());
|
|
|
+ if(part == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ PriceList priceList = new PriceList();
|
|
|
+ priceList.setRepairId(repairId);
|
|
|
+ priceList.setName(part.getPartName());
|
|
|
+ priceList.setPrice(part.getPartPrice());
|
|
|
+ priceList.setCount(repairRegisterPart.getPartCount());
|
|
|
+ priceList.setPartId(part.getPartId());
|
|
|
+ priceList.setPriceDiscount(part.getPartPriceDiscount());
|
|
|
+ priceLists.add(priceList);
|
|
|
+ }
|
|
|
+ priceListVo.setPriceLists(priceLists);
|
|
|
+ return priceListVo;
|
|
|
+ }
|
|
|
}
|