|
@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.pj.api.wx.bo.PriceBO;
|
|
|
import com.pj.current.config.MyConfig;
|
|
|
import com.pj.current.config.PartConfig;
|
|
|
+import com.pj.project.relation_business_car.RelationBusinessCar;
|
|
|
+import com.pj.project.relation_business_car.RelationBusinessCarService;
|
|
|
import com.pj.project.tb_business.TbBusiness;
|
|
|
import com.pj.project.tb_business.TbBusinessService;
|
|
|
import com.pj.project.tb_business_car.TbBusinessCar;
|
|
@@ -71,6 +73,8 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
|
private MyConfig myConfig;
|
|
|
@Resource
|
|
|
private TbItemTypeService tbItemTypeService;
|
|
|
+ @Resource
|
|
|
+ private RelationBusinessCarService relationBusinessCarService;
|
|
|
|
|
|
/**
|
|
|
* 增
|
|
@@ -248,9 +252,26 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
|
|
|
if (StrUtil.isEmpty(business.getCardNo())) {
|
|
|
carNo = business.getChinaCarNo();
|
|
|
}
|
|
|
- TbBusinessCar businessCar = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
|
|
|
+// TbBusinessCar businessCar = new TbBusinessCar();
|
|
|
+// if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(business.getBusinessType())) {
|
|
|
+// businessCar = tbBusinessCarService.getById(business.getBusinessCarId());
|
|
|
+// } else {
|
|
|
+// businessCar = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
|
|
|
+// }
|
|
|
+ String businessCarIds = "";
|
|
|
+ String businessCarNos = "";
|
|
|
+ List<RelationBusinessCar> relation = relationBusinessCarService.findByBusinessId(item.getBusinessId());
|
|
|
+ for (RelationBusinessCar rela : relation) {
|
|
|
+ TbBusinessCar bt = tbBusinessCarService.getById(rela.getBusinessCarId());
|
|
|
+ if(StrUtil.contains(carNo, bt.getCarNo())){
|
|
|
+ businessCarIds += bt.getId() + ",";
|
|
|
+ businessCarNos += bt.getCarNo() + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ businessCarIds = StrUtil.sub(businessCarIds, 0, businessCarIds.length()-1);
|
|
|
+ businessCarNos = StrUtil.sub(businessCarNos, 0, businessCarNos.length()-1);
|
|
|
businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
|
|
|
- .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCar.getId()).setBusinessCarNo(businessCar.getNo())
|
|
|
+ .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCarIds).setBusinessCarNo(businessCarNos)
|
|
|
.setCarNo(carNo)
|
|
|
.setItemPrice(item.getTotal()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
|
|
|
.setFeeType(feeType)
|