Преглед изворни кода

合作伙伴公众号推送类型调整,收费明细调整

lzm пре 2 година
родитељ
комит
962fb93021

+ 10 - 2
sp-admin/sa-view/tb-partner/tb-partner-add.html

@@ -41,8 +41,9 @@
 							<div class="c-item">
 								<label class="c-label">公众号通知:</label>
 								<el-select v-model="businessType" multiple :disabled="currentCustomerId!=='1'">
-									<el-option label="其他业务" value="1"></el-option>
-									<el-option label="整车业务" value="2"></el-option>
+									<el-option v-for="good in goodsList" :key="good.id"
+											   :label="good.name" :value="good.id">
+									</el-option>
 								</el-select>
 							</div>
 							<div class="c-item">
@@ -77,8 +78,14 @@
 					currentCustomerId: '1',
 					type: [],
 					businessType: [],
+					goodsList: [],
 				},
 				methods: {
+					getGoodsList(){
+						sa.ajax('/TbGoods/getList', function(resp) {
+							this.goodsList = resp.data;
+						}.bind(this));
+					},
 					getCurrendCustomer() {
 						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
 							this.currentCustomerId = resp.data;
@@ -137,6 +144,7 @@
 				},
 				mounted: function() {
 					this.getCurrendCustomer()
+					this.getGoodsList();
 					// 初始化数据 
 					if (this.id <= 0) {
 						this.m = this.createModel();

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -353,7 +353,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             String carNoStr = cars.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
             storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已确认" + DateUtil.now() + "。");
             List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
-            Integer bigBusinessType = business.getBusinessType();
+            String bigBusinessType = business.getGoodsId();
             items.forEach(item -> {
                 String businessType = item.getBusinessType();
                 if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {

+ 3 - 26
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomer.java

@@ -112,6 +112,9 @@ public class TbCostomer extends Model<TbCostomer> implements Serializable {
      */
     private String type = "0";
 
+    /**
+     * 公众号通知类型,关联业务项管理表
+     */
     private String businessType = "2";
 
     @TableField(exist = false)
@@ -127,17 +130,6 @@ public class TbCostomer extends Model<TbCostomer> implements Serializable {
         return sb.substring(0, sb.lastIndexOf("、"));
     }
 
-    @TableField(exist = false)
-    private String businessTypeDes;
-    public String getBusinessTypeDes() {
-        String businessType = this.businessType;
-        StringBuilder sb = new StringBuilder();
-        StrUtil.splitTrim(businessType, ",")
-                .forEach(bt -> {
-                    sb.append(BusinessTypeEnum.getDesc(bt)).append("、");
-                });
-        return sb.substring(0, sb.lastIndexOf("、"));
-    }
 
     @Getter
     @AllArgsConstructor
@@ -171,21 +163,6 @@ public class TbCostomer extends Model<TbCostomer> implements Serializable {
 
     }
 
-    @Getter
-    @AllArgsConstructor
-    public static enum BusinessTypeEnum {
-        CAR_DISINCLE("1","其他业务"),
-        HOLD_CAR("2","整车业务"),
-        ;
-        private String code;
-        private String desc;
-
-        public static String getDesc(String code) {
-            return Arrays.stream(BusinessTypeEnum.values()).filter(businessTypeEnum -> businessTypeEnum.getCode().equals(code))
-                    .findFirst().orElseThrow(() -> new BusinessException("不存在")).getDesc();
-        }
-
-    }
 
 
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerMapper.java

@@ -54,5 +54,5 @@ public interface TbCostomerMapper extends BaseMapper <TbCostomer> {
 	List<TbCostomer> getList(SoMap so);
 
 
-    List<String> findByBusinessTypeOpenid(@Param("businessType") String businessType, @Param("bigBusinessType") Integer bigBusinessType);
+    List<String> findByBusinessTypeOpenid(@Param("businessType") String businessType, @Param("bigBusinessType") String bigBusinessType);
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java

@@ -178,7 +178,7 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
         spAdminMapper.updateCustomerAdmin(costomer.getId(), 2);
     }
 
-    public List<String> findByBusinessTypeOpenid(String businessType, Integer bigBusinessType) {
+    public List<String> findByBusinessTypeOpenid(String businessType, String bigBusinessType) {
         return  tbCostomerMapper.findByBusinessTypeOpenid(businessType, bigBusinessType);
 
     }

+ 10 - 6
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -31,6 +31,8 @@ import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_fee_details.ExportFeeDetailDTO;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
+import com.pj.project.tb_goods.TbGoods;
+import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project.tb_item_type.TbItemType;
 import com.pj.project.tb_item_type.TbItemTypeService;
 import com.pj.project4sp.uploadfile.UploadUtil;
@@ -75,6 +77,8 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
     private TbItemTypeService tbItemTypeService;
     @Resource
     private RelationBusinessCarService relationBusinessCarService;
+    @Resource
+    private TbGoodsService tbGoodsService;
 
     /**
      * 增
@@ -248,16 +252,16 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             taxPrice = taxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
             BigDecimal noTaxPrice = item.getTotal().subtract(taxPrice);
             noTaxPrice = noTaxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
+
             String carNo = business.getCardNo();
             if (StrUtil.isEmpty(business.getCardNo())) {
                 carNo = business.getChinaCarNo();
             }
-//            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);
-//            }
+            TbGoods businessCfg = tbGoodsService.getById(business.getGoodsId());
+            if((TbGoods.LeaveEnum.BUSINESS_MONEY.getCode()==businessCfg.getChinaCarLeave() || TbGoods.LeaveEnum.APART_BUSINESS.getCode()==businessCfg.getChinaCarLeave())
+            && TbGoods.LeaveEnum.BUSINESS_MONEY.getCode()!=businessCfg.getVietnamCarLeave() && TbGoods.LeaveEnum.APART_BUSINESS.getCode()!=businessCfg.getVietnamCarLeave()){
+                carNo = business.getChinaCarNo();
+            }
             String businessCarIds = "";
             String businessCarNos = "";
             List<RelationBusinessCar> relation = relationBusinessCarService.findByBusinessId(item.getBusinessId());