Ver Fonte

Merge branch 'feature/relation_type_item' of http://47.101.143.145:8090/77975466/pco into feature/relation_type_item

qzyReal há 3 anos atrás
pai
commit
4555c2b0b4

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsMapper.xml

@@ -74,7 +74,7 @@
 			<if test=' this.has("id") '> and id = #{id} </if>
             <if test=' this.has("businessId") '> and business_id = #{businessId} </if>
 			<if test=' this.has("businessNo") '> and business_no = #{businessNo} </if>
-			<if test=' this.has("carNo") '> and car_no = #{carNo} </if>
+			<if test=' this.has("carNo") '> and car_no like concat('%',#{carNo},'%') </if>
             <if test=' this.has("feeType") '> and fee_type = #{feeType} </if>
 			<if test=' this.has("itemTypeId") '> and item_type_id = #{itemTypeId} </if>
 			<if test=' this.has("itemTypeName") '> and item_type_name = #{itemTypeName} </if>

+ 1 - 4
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -203,7 +203,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         taxPrice = taxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
         BigDecimal noTaxPrice = parkFee.getItemPrice().subtract(taxPrice);
         noTaxPrice = noTaxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
-        parkFee.setBusinessId(car.getBusinessId()).setBusinessCarId(car.getId())
+        parkFee.setBusinessCarId(car.getId())
                 .setCarNo(car.getCarNo())
                 .setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                 .setFeeType(TbFeeDetails.fee.PARK_FEE.getCode())
@@ -211,9 +211,6 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 .setIsSettle(1).setPayMode(1).setPayTime(nowStr)
                 .setTransactionId(transactionId).setOutTradeNo(outTradeNo)
                 .setBusinessCarNo(car.getNo());
-//        if (business!=null){
-//            parkFee.setWeight(business.getNetWeight()).setBusinessNo(business.getNo());
-//        }
     }
 
     public String export(SoMap so) throws Exception{

+ 23 - 2
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -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)