qzyReal 2 years ago
parent
commit
0f13dc278e

+ 0 - 23
sp-admin/sa-view/tb-fee-statistics/dayStatsPrint.html

@@ -94,14 +94,6 @@
             </div>
             <div align="center">
                 <br/><br/>
-                <SPAN style=";font-size:15px">
-                收费统计员:
-                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
-                收费核对员:
-                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
-                收费员:
-              </SPAN>
-                <br/><br/>
                 <SPAN id="leader" style=";font-size:15px">
 
               </SPAN>
@@ -149,21 +141,6 @@
             $("#unit").attr('colspan', 5);
             $("#td_time").attr('colspan', 3);
         }
-        if (isMonth != null || isYear != null) {
-            $("#leader").html("运营负责人:\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                运营分管领导:");
-        } else {
-            $("#leader").html("运营负责人:\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
-                "                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp");
-        }
-
-
         var beginDay = getUrlParam('beginDay');
         beginDay = beginDay != '' ? beginDay : null;
         var endDay = getUrlParam('endDay');

+ 1 - 1
sp-admin/static/sa.js

@@ -22,7 +22,7 @@ var sa = {
 		api_url: 'https://dxkaa1.gxbtka.com/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
+	sa.cfg = cfg_test; // 最终环境 , 上线前请选择正确的环境
 })();
 
 

+ 2 - 1
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -11,6 +11,7 @@ import com.pj.api.open.bo.CheckCarNumberBO;
 import com.pj.api.open.bo.InRecordBO;
 import com.pj.constants.business.CarEnum;
 import com.pj.constants.business.GoodsEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.current.config.PartConfig;
 import com.pj.current.task.TaskService;
 import com.pj.project.tb_account.AutomaticPay;
@@ -190,7 +191,7 @@ public class OpenService {
         BigDecimal chinaCarMoney = new BigDecimal(0);
         List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(businessCarId);
         int payPart=tbBusinessCar.getPay();
-        businessList=businessList.stream().filter(tbBusiness -> tbBusiness.getPayStatus()!=TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode()).collect(Collectors.toList());
+        businessList=businessList.stream().filter(tbBusiness -> tbBusiness.getPayStatus()!= PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode()).collect(Collectors.toList());
         if (businessList.isEmpty()) {//无业务车辆===>计算停车费
             //如果已经支付过,则从支付时间算起,重新计算停车费
             double dif = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now,tbBusinessCar.getCarSize()).doubleValue();

+ 6 - 5
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -14,6 +14,7 @@ import com.pj.api.wx.WxUtils;
 import com.pj.api.wx.bo.*;
 import com.pj.api.wx.vo.PrePayVO;
 import com.pj.constants.business.CarEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.current.config.MyConfig;
 import com.pj.current.config.PartConfig;
 import com.pj.current.config.WxConfig;
@@ -248,21 +249,21 @@ public class WxService {
                 //支付完之后要解绑
                 automaticPay.unbindRun(car.getCarNo());
             }
-            tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo, payTime, TbBusiness.PayType.WX_PAY);//添加cars的收费明细
+            tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo, payTime, PayEnum.PayType.WX_PAY);//添加cars的收费明细
             String businessId = attach.getB();
             Date finalPayTime = payTime;
             if (StrUtil.isNotEmpty(businessId)) {
                 List<String> businessIds = StrUtil.splitTrim(businessId, ",");
                 List<TbBusiness> businessList = tbBusinessService.listByIds(businessIds);
-                businessList = businessList.stream().filter(tbBusiness -> tbBusiness.getPayStatus() != TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode()).collect(Collectors.toList());
+                businessList = businessList.stream().filter(tbBusiness -> tbBusiness.getPayStatus() != PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode()).collect(Collectors.toList());
                 businessIds = businessList.stream().map(TbBusiness::getId).collect(Collectors.toList());
                 List<TbBusinessItem> items = tbBusinessItemService.findByBusinessIdList(businessIds);
                 items = items.stream().filter(item -> item.getPayStatus() == 0).collect(Collectors.toList());
                 for (TbBusiness tbBusiness : businessList) {
-                    tbBusiness.setPayTime(payTime).setPayType(TbBusiness.PayType.WX_PAY.getCode()).setConfirmInput(1).setConfirmInputTime(payTime)
+                    tbBusiness.setPayTime(payTime).setPayType(PayEnum.PayType.WX_PAY.getCode()).setConfirmInput(1).setConfirmInputTime(payTime)
                             .setPayMoney(tbBusiness.getItemPrice()).setPayOpenid(payopenid)
                             .setPayNo(transactionId).setOutTradeNo(outTradeNo);
-                    tbBusiness.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode());
+                    tbBusiness.setPayStatus(PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode());
                     tbBusinessService.updateById(tbBusiness);
                     TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
                     List<TbBusinessCar> carList = tbBusinessCarService.findOtherBusinessCar(businessId);
@@ -276,7 +277,7 @@ public class WxService {
                         }
                     });
                 }
-                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbBusiness.PayType.WX_PAY);//添加items的收费明细
+                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, PayEnum.PayType.WX_PAY);//添加items的收费明细
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(finalPayTime));
                 tbBusinessItemService.updateBatchById(items);
             }

+ 3 - 4
sp-server/src/main/java/com/pj/constants/business/CarEnum.java

@@ -1,12 +1,10 @@
 package com.pj.constants.business;
 
+import cn.hutool.core.util.StrUtil;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Getter
 @AllArgsConstructor
@@ -62,4 +60,5 @@ public class CarEnum {
         private int code;
         private String desc;
     }
+
 }

+ 16 - 0
sp-server/src/main/java/com/pj/constants/business/OAResultEnum.java

@@ -0,0 +1,16 @@
+package com.pj.constants.business;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum OAResultEnum {
+
+    PASS("审批通过","审批通过"),
+    NO_PASS("审批驳回","审批驳回"),
+    JUDGE_ING("审批中","审批中")
+    ;
+    private String code;
+    private String desc;
+}

+ 38 - 0
sp-server/src/main/java/com/pj/constants/business/PayEnum.java

@@ -0,0 +1,38 @@
+package com.pj.constants.business;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+
+public class PayEnum {
+    @Getter
+    @AllArgsConstructor
+    public static enum PayStatusEnum{
+        NO_PAY(1, "未支付"),
+        HAS_PAY(2, "已支付"),
+        HAS_PAY_CONFIRM(3, "已支付已确认"),
+        HAS_PAY_PART(4, "已支付"),
+        ;
+        private int code;
+        private String desc;
+    }
+
+    @Getter
+    @AllArgsConstructor
+    public static enum PayType {
+        /**
+         * (1=线下支付,2现金支付,3=微信支付,4=支付宝支付,5=预充值自动支付)
+         */
+        OFF_LINE_PAY(1, "线下支付"),
+        CASH_PAY(2, "现金支付"),
+        WX_PAY(3, "微信支付"),
+        ALI_PAY(4, "支付宝支付"),
+        PER_PAY(5, "预充值支付"),
+        ;
+        private int code;
+        private String desc;
+    }
+
+
+}

+ 9 - 8
sp-server/src/main/java/com/pj/project/tb_account/AutomaticPay.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.api.wx.bo.PriceBO;
 import com.pj.constants.business.CarEnum;
 import com.pj.constants.business.GoodsEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_car.TbBusinessCar;
@@ -134,7 +135,7 @@ public class AutomaticPay {
         }
         StaticLog.info("开始收取业务费:{}", businessId);
         TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-        if (TbBusiness.PayStatus.NO_PAY.getCode() != tbBusiness.getPayStatus()) {
+        if (PayEnum.PayStatusEnum.NO_PAY.getCode() != tbBusiness.getPayStatus()) {
             StaticLog.info("已收取过业务费,退出收费程序:{}", businessId);
             return;
         }
@@ -171,7 +172,7 @@ public class AutomaticPay {
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
         tbBusiness.setPayMoney(tbBusiness.getItemPrice()).setPayTime(now).setPayType(5)
                 .setPayNo(no).setConfirmInput(1).setConfirmInputTime(now).setPayStatus(
-                TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode());
+                PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode());
         tbBusiness.updateById();
         List<TbBusinessItem> businessItems = tbBusinessItemService.findByBusinessId(businessId);
         for (TbBusinessItem businessItem : businessItems) {
@@ -204,7 +205,7 @@ public class AutomaticPay {
             });
             deductionBindService.setDeductMoney(bind.getCustomerId(), plate, parkingMoneyBig);
             List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
-                    priceBOList, null, null, now, TbBusiness.PayType.PER_PAY);
+                    priceBOList, null, null, now, PayEnum.PayType.PER_PAY);
             createTbDeductionRecord(parkFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
 
         }
@@ -298,7 +299,7 @@ public class AutomaticPay {
         bo.setId(car.getId()).setP(car.getMoney());
         priceBOList.add(bo);
         List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
-                priceBOList, null, null, new Date(), TbBusiness.PayType.PER_PAY);
+                priceBOList, null, null, new Date(), PayEnum.PayType.PER_PAY);
         createTbDeductionRecord(parkFeeDetailsList, account, plate, bind.getCustomerName(), no);
         createTbInvoiceOrderPark(car, account.getCustomerId(), no);
         deductionBindService.autoUnbindCar(cars);
@@ -614,7 +615,7 @@ public class AutomaticPay {
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
         //车辆的扣费记录
         List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
-                priceBOList, null, null, now, TbBusiness.PayType.PER_PAY);
+                priceBOList, null, null, now, PayEnum.PayType.PER_PAY);
         this.createTbDeductionRecord(parkFeeDetailsList, tbAccount, tbBusinessCar.getCarNo(), bind.getCustomerName(), no);
         tbFeeStatisticsService.addOrUpdateStatistic(now);//更新当前日期的日统计
         return true;
@@ -663,7 +664,7 @@ public class AutomaticPay {
         tbAccount.setTotalMoney(AesUtil.encryptECB(balance.toString(), key));
         tbAccountService.updateById(tbAccount);
         businessList.forEach(tbBusiness -> {
-            tbBusiness.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode())
+            tbBusiness.setPayStatus(PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode())
                     .setPayMoney(tbBusiness.getItemPrice()).setTotalMoney(tbBusiness.getItemPrice());
         });
         tbBusinessService.updateBatchById(businessList);
@@ -678,9 +679,9 @@ public class AutomaticPay {
         }};
         String plate = tbBusinessCar.getCarNo();
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
-        List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(priceBOList, null, null, now, TbBusiness.PayType.PER_PAY);
+        List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(priceBOList, null, null, now, PayEnum.PayType.PER_PAY);
         this.createTbDeductionRecord(parkFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
-        List<TbFeeDetails> tbFeeDetails = tbFeeDetailsService.chargeBusinessFee(tbBusinessItems, null, null, now, TbBusiness.PayType.PER_PAY);
+        List<TbFeeDetails> tbFeeDetails = tbFeeDetailsService.chargeBusinessFee(tbBusinessItems, null, null, now, PayEnum.PayType.PER_PAY);
         createTbDeductionRecord(tbFeeDetails, tbAccount, plate, bind.getCustomerName(), no);
         tbFeeStatisticsService.addOrUpdateStatistic(now);//更新当前日期的日统计
         return true;

+ 0 - 52
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -329,58 +329,6 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
         return StrUtil.join("、",list);
     }
 
-    @Getter
-    @AllArgsConstructor
-    public static enum BusinessType {
-        NO_BUSINESS(0, "无业务车辆"),
-        CAR_DISINCLE(1, "其他业务"),
-        HOLD_CAR(2, "整车业务"),
-        ;
-        private Integer code;
-        private String desc;
-    }
-
-    @Getter
-    @AllArgsConstructor
-    public static enum OAResultEnum{
-        PASS("审批通过","审批通过"),
-        NO_PASS("审批驳回","审批驳回"),
-        JUDGE_ING("审批中","审批中")
-        ;
-        private String code;
-        private String desc;
-    }
-
-    @Getter
-    @AllArgsConstructor
-    public static enum PayStatus {
-        NO_PAY(1, "未支付"),
-        HAS_PAY(2, "已支付"),
-        HAS_PAY_CONFIRM(3, "已支付已确认"),
-        HAS_PAY_PART(4, "已支付"),
-        ;
-        private int code;
-        private String desc;
-    }
-
-  @Getter
-    @AllArgsConstructor
-    public static enum PayType {
-      /**
-       * (1=线下支付,2现金支付,3=微信支付,4=支付宝支付,5=预充值自动支付)
-       */
-      OFF_LINE_PAY(1, "线下支付"),
-        CASH_PAY(2, "现金支付"),
-        WX_PAY(3, "微信支付"),
-        ALI_PAY(4, "支付宝支付"),
-        PER_PAY(5, "预充值支付"),
-        ;
-        private int code;
-        private String desc;
-    }
-
-
-
     public void setCardNo(String cardNo) {
         this.cardNo = StrUtil.isNotEmpty(cardNo) ? cardNo.toUpperCase().trim() : "";
     }

+ 0 - 18
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -61,26 +61,8 @@ public class TbBusinessController {
         return AjaxJson.getSuccessData(BusinessMessageManager.get(StpUserUtil.getCustomerId()));
     }
 
-    /**
-     * 增
-     */
-    @RequestMapping("add")
-    @SaCheckPermission(TbBusiness.PERMISSION_CODE)
-    @Transactional(rollbackFor = Exception.class)
-    public AjaxJson add(TbBusiness t) {
-        return tbBusinessService.addOrUpdate(t);
-    }
 
 
-    /**
-     * 改
-     */
-    @RequestMapping("update")
-    @SaCheckPermission(TbBusiness.PERMISSION_CODE)
-    public AjaxJson update(TbBusiness t) {
-        tbBusinessService.addOrUpdate(t);
-        return AjaxJson.getSuccess();
-    }
 
     /**
      * 确认业务

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

@@ -27,6 +27,8 @@ import com.pj.api.wx.service.WxService;
 import com.pj.constants.UserTypeEnum;
 import com.pj.constants.business.CarEnum;
 import com.pj.constants.business.GoodsEnum;
+import com.pj.constants.business.OAResultEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.current.config.*;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.oa.bo.OAResultBO;
@@ -176,119 +178,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
 
-    /**
-     * 增
-     */
-    public AjaxJson addOrUpdate(TbBusiness t) {
-        t.setBusinessType(TbBusiness.BusinessType.HOLD_CAR.getCode());
-        if (StrUtil.isEmpty(t.getDeclareNo())) {
-            throw new BusinessException("请选择申报单");
-        }
-        if (StrUtil.isNotEmpty(t.getId()) && StrUtil.isNotEmpty(t.getDeclareNo())) {
-            TbBusiness db = this.getById(t.getId());
-            if (!StrUtil.equals(db.getDeclareNo(), t.getDeclareNo())) {
-                TbDeclare tbDeclare = tbDeclareService.findByDeclareNo(db.getDeclareNo());
-                if (tbDeclare != null) {
-                    tbDeclare.setBusinessId("");
-                    tbDeclareService.updateById(tbDeclare);
-                }
-            }
-        }
-        Double carSize = t.getCardSize();
-        if (carSize != null && carSize > carConfig.getMaxLength()) {
-            return AjaxJson.getError("车辆规格不能大于" + carConfig.getMaxLength());
-        }
-        Double netWeight = t.getNetWeight();
-        if (netWeight != null && netWeight > carConfig.getMaxWeight()) {
-            return AjaxJson.getError("车辆载重不能大于" + carConfig.getMaxWeight());
-        }
-        SpAdmin spAdmin = StpUserUtil.getAdmin();
-        String createName = StrUtil.isEmpty(spAdmin.getNickname()) ? spAdmin.getName() : spAdmin.getNickname();
-        t.setCreateBy(createName);
-        createCarUnit(t);
-        String customerId = t.getCustomerId();
-        TbCostomer tbCostomer = tbCostomerService.getById(customerId);
-        t.setCustomerName(tbCostomer.getName()).setCustomerType(tbCostomer.getPayType());
-        if (StrUtil.equals(customerId, UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            t.setConfirmInputBy(StpUserUtil.getAdmin().getName())
-                    .setConfirmInput(1)
-                    .setConfirmInputTime(new Date());
-        }
-        if (StrUtil.isEmpty(t.getId())) {
-            t.setCreateTime(new Date());
-            t.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
-            storeMsg(t.getCustomerId(), "新增一条业务数据:【" + t.getNo() + "】" + DateUtil.now() + "。");
-        } else {
-            storeMsg(t.getCustomerId(), "业务订单:【" + t.getNo() + "】数据发生更改," + DateUtil.now() + "。");
-        }
-        saveOrUpdate(t);
-        createBusinessPeople(t);
-        tbBusinessItemService.removeByBusinessId(t.getId());
-        BigDecimal price = new BigDecimal(0);
-        List<TbBusinessItem> items = JSONUtil.toList(t.getItemJson(), TbBusinessItem.class);
-        int index = 1;
-        for (TbBusinessItem item : items) {
-            Double num = NumberUtil.parseDouble(item.getNum());
-            TbItem tbItem = tbItemService.getById(item.getItemId());
-            String typeId = tbItem.getTypeId();
-            price = price.add(NumberUtil.mul(num, tbItem.getPrice()));
-            TbItemType tbItemType = tbItemTypeService.getById(typeId);
-            item.setBusinessId(t.getId()).setItemCode(tbItem.getItemCode()).setBusinessType(tbItem.getBusinessType())
-                    .setPayType(tbItem.getPayType()).setPayTypeName(tbItem.getPayTypeName())
-                    .setItemName(tbItem.getItemName()).setItemPrice(tbItem.getPrice())
-                    .setTaxRate(NumberUtil.div(tbItem.getTaxRate().doubleValue(), 100D, 2))
-                    .setItemTypeId(typeId).setItemTypeName(tbItemType.getName()).setBusinessType(tbItemType.getBusinessType())
-                    .setUnit(tbItem.getUnit()).setTotal(NumberUtil.mul(num, tbItem.getPrice())).setCreateTime(new Date())
-                    .setNo(t.getNo() + "0" + index);
-            tbBusinessItemService.save(item);
 
-            index++;
-        }
-        List<TbBusinessCar> carList = JSONUtil.toList(t.getCarJson(), TbBusinessCar.class);
-        String chinaCarNo = carList.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
-        t.setChinaCarNo(StrUtil.isNotEmpty(chinaCarNo) ? chinaCarNo.toUpperCase() : "");
-        carList.forEach(tbBusinessCar -> {
-            tbBusinessCar.setIsLock(0);
-            String carNo = tbBusinessCar.getCarNo().toUpperCase();
-
-            TbBusinessCar car = tbBusinessCarService.findInAndNoBusinessCar(carNo);
-            if (car != null) {
-                tbBusinessCar.setId(car.getId()).setRealInTime(car.getRealInTime()).setIsLock(car.getIsLock());
-            }
-            TbCar tbCar = tbCarService.findByCardNo(carNo);
-            tbBusinessCar.setBusinessId(t.getId());
-            tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
-            tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
-            if (StrUtil.isEmpty(tbBusinessCar.getNo())) {
-                tbBusinessCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
-            }
-
-        });
-        String yueCarNo = t.getCardNo().toUpperCase();
-        TbBusinessCar yueCar = tbBusinessCarService.findInAndNoBusinessCar(yueCarNo);
-
-
-        if (yueCar == null) {
-            yueCar = new TbBusinessCar();
-            yueCar.setIsLock(0);
-        }
-
-        yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
-        if (StrUtil.isEmpty(yueCar.getNo())) {
-            yueCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
-        }
-        carList.add(yueCar);
-        tbBusinessCarService.saveOrUpdateBatch(carList);
-        t.setItemPrice(price)
-                .setTotalMoney(price);
-        this.saveOrUpdate(t);
-        if (StrUtil.isNotEmpty(t.getDeclareNo())) {
-            TbDeclare tbDeclare = tbDeclareService.findByDeclareNo(t.getDeclareNo());
-            tbDeclare.setBusinessId(t.getId());
-            tbDeclareService.updateById(tbDeclare);
-        }
-        return AjaxJson.getSuccess();
-    }
 
     public void storeMsg(String businessCustomerId, String content) {
         String currentCustomerId = StpUserUtil.getCustomerId();
@@ -742,7 +632,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             tbBusinessCar.setPay(1).setPayTime(payTime)
                     .setPayType(CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType());
-            if (payType == TbBusiness.PayType.PER_PAY.getCode()) {
+            if (payType == PayEnum.PayType.PER_PAY.getCode()) {
                 TbDeductionBind deductionBind = tbDeductionBindService.getBindCarByPlate(carNo);
                 if (deductionBind != null) {
                     plate = carNo;
@@ -753,7 +643,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         BigDecimal itemPrice = db.getItemPrice();
         BigDecimal money = itemPrice.add(partMoney);
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
-        if (payType == TbBusiness.PayType.PER_PAY.getCode()) {
+        if (payType == PayEnum.PayType.PER_PAY.getCode()) {
             if (bind == null) {
                 throw new AjaxError("车辆未绑定预支付款,无法完成收费");
             }
@@ -770,26 +660,26 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (partMoney.doubleValue() > 0 && !priceBOList.isEmpty()) {
                 //车辆的扣费记录
                 List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
-                        priceBOList, null, null, payTime, TbBusiness.PayType.PER_PAY);
+                        priceBOList, null, null, payTime, PayEnum.PayType.PER_PAY);
                 automaticPay.createTbDeductionRecord(parkFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
             }
             //生成收费明细
             List<TbFeeDetails> tbFeeDetailsList = tbFeeDetailsService.chargeBusinessFee(
-                    items, null, null, payTime, TbBusiness.PayType.PER_PAY);
+                    items, null, null, payTime, PayEnum.PayType.PER_PAY);
             //生成扣费记录
             automaticPay.createTbDeductionRecord(tbFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
             automaticPay.unbindRun(plate);
-        }else if (payType == TbBusiness.PayType.OFF_LINE_PAY.getCode()){
+        }else if (payType == PayEnum.PayType.OFF_LINE_PAY.getCode()){
             //车辆的扣费记录
             if (partMoney.doubleValue() > 0){
                 tbFeeDetailsService.chargeParkFee(
-                        priceBOList, null, null, payTime, TbBusiness.PayType.OFF_LINE_PAY);
+                        priceBOList, null, null, payTime, PayEnum.PayType.OFF_LINE_PAY);
             }
             //生成收费明细
             tbFeeDetailsService.chargeBusinessFee(
-                    items, null, null, payTime, TbBusiness.PayType.OFF_LINE_PAY);
+                    items, null, null, payTime, PayEnum.PayType.OFF_LINE_PAY);
         }
-        db.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode())
+        db.setPayStatus(PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode())
                 .setPayMoney(db.getItemPrice())
                 .setPayType(payType).setPayChannelType(payChannelType)
                 .setTransactionId(transactionId)
@@ -974,7 +864,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         Integer vietnamCarPay = tbGoods.getVietnamCarPay();
         String carBuseinssNo = DateUtil.format(now, "yyyyMMddHHmm");
         List<TbBusinessItem> itemList = new ArrayList<>();
-        if (TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode() != dbBusiness.getPayStatus()) {
+        if (PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() != dbBusiness.getPayStatus()) {
             tbBusinessItemService.removeByBusinessId(id);
             BigDecimal price = new BigDecimal("0");
             String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4);
@@ -1196,7 +1086,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 .setSupplementBy(errorBusinessBO.getSupplementBy())
                 .setSupplementTime(new Date())
                 .setSupplementReason(errorBusinessBO.getSupplementReason());
-        if (TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus()) {
+        if (PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus()) {
             tbBusiness.setPayMoney(tbBusiness.getItemPrice())
                     .setPayTime(errorBusinessBO.getPayTime());
             items.forEach(item -> item.setPayTime(errorBusinessBO.getPayTime()).setPayStatus(1));
@@ -1265,7 +1155,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (StrUtil.isEmpty(fdId)) {
                 throw new BusinessException("流程发起失败");
             }
-            tbBusiness.setSendOa(1).setOaResult(TbBusiness.OAResultEnum.JUDGE_ING.getCode())
+            tbBusiness.setSendOa(1).setOaResult(OAResultEnum.JUDGE_ING.getCode())
                     .setSendTime(new Date()).setSendBy(sendBy)
                     .setOaFdId(fdId);
             this.updateById(tbBusiness);
@@ -1357,7 +1247,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 .setOperatingOutlay(tbBusiness.getItemPrice().toString()).setAmount(tbBusiness.getItemPrice())
                 .setPaymentTime(tbBusiness.getPayTime() == null ? "" : DateUtil.format(tbBusiness.getPayTime(), "yyyy-MM-dd HH:mm:ss")).setCargoOwner(tbBusiness.getOwner()).setOperationNo(tbBusiness.getNo())
                 .setRecordingTime(DateUtil.format(tbBusiness.getCreateTime(), "yyyy-MM-dd HH:mm:ss")).setRecorder(tbBusiness.getCreateBy())
-                .setIsPay(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode() == tbBusiness.getPayStatus() ? "已支付" : "未支付");
+                .setIsPay(PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() == tbBusiness.getPayStatus() ? "已支付" : "未支付");
         return JSONUtil.parseObj(formValuesBO);
     }
 
@@ -1425,7 +1315,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (tbCostomer != null) {
             tbBusiness.setCustomerId(customerId).setCustomerName(tbCostomer.getName());
         }
-        boolean businessIsPay = TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus();
+        boolean businessIsPay =PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus();
         Date businessPayTime = errorBusinessBO.getPayTime();
 
         BigDecimal price = new BigDecimal("0");
@@ -1545,7 +1435,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (dbBusiness == null) {
             throw new BusinessException("记录不存在");
         }
-        if (!(dbBusiness.getSendOa() == 0 || TbBusiness.OAResultEnum.NO_PASS.getCode().equals(dbBusiness.getOaResult()))) {
+        if (!(dbBusiness.getSendOa() == 0 || OAResultEnum.NO_PASS.getCode().equals(dbBusiness.getOaResult()))) {
             throw new BusinessException("业务单正在审核,无法修改");
         }
         List<TbItem> tbItems = errorBusinessBO.getItems();
@@ -1595,11 +1485,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     }).
                     collect(Collectors.toList());
             if (!priceBOList.isEmpty()) {
-                tbFeeDetailsService.chargeParkFee(priceBOList, transactionId, outTradeNo, payTime, TbBusiness.PayType.OFF_LINE_PAY);//添加cars的收费明细
+                tbFeeDetailsService.chargeParkFee(priceBOList, transactionId, outTradeNo, payTime, PayEnum.PayType.OFF_LINE_PAY);//添加cars的收费明细
             }
-            if (tbBusiness.getPayStatus() == TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode()) {
+            if (tbBusiness.getPayStatus() == PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode()) {
                 List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId);
-                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbBusiness.PayType.OFF_LINE_PAY);//添加items的收费明细
+                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, PayEnum.PayType.OFF_LINE_PAY);//添加items的收费明细
             }
 
         }

+ 4 - 3
sp-server/src/main/java/com/pj/project/tb_business_item/PayTask.java

@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.api.wx.bo.PriceBO;
 import com.pj.constants.business.CarEnum;
 import com.pj.constants.business.GoodsEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.current.task.Task;
 import com.pj.project.tb_account.TbAccount;
 import com.pj.project.tb_account.TbAccountService;
@@ -152,7 +153,7 @@ public class PayTask extends Task {
         StaticLog.info("开始收取业务费:{}" , businessId);
         TbBusinessService tbBusinessService = SpringUtil.getBean(TbBusinessService.class);
         TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-        if(TbBusiness.PayStatus.NO_PAY.getCode()!=tbBusiness.getPayStatus()){
+        if(PayEnum.PayStatusEnum.NO_PAY.getCode()!=tbBusiness.getPayStatus()){
             StaticLog.info("已收取过业务费,退出收费程序:{}" , businessId);
             return;
         }
@@ -189,7 +190,7 @@ public class PayTask extends Task {
         String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
         tbBusiness.setPayMoney(tbBusiness.getItemPrice()).setPayTime(now).setPayType(5)
                   .setPayNo(no).setConfirmInput(1).setConfirmInputTime(now).setPayStatus(
-                        TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode());
+                        PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode());
         tbBusiness.updateById();
         TbBusinessItemService tbBusinessItemService = SpringUtil.getBean(TbBusinessItemService.class);
         List<TbBusinessItem> businessItems = tbBusinessItemService.findByBusinessId(businessId);
@@ -219,7 +220,7 @@ public class PayTask extends Task {
         if(isOut){
             List<PriceBO> priceBOList=cars.stream().map(tbBusinessCar -> new PriceBO(tbBusinessCar.getId(),tbBusinessCar.getMoney())).collect(Collectors.toList());
             List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
-                    priceBOList,null,null,now,TbBusiness.PayType.PER_PAY);
+                    priceBOList,null,null,now,PayEnum.PayType.PER_PAY);
             createTbDeductionRecord(parkFeeDetailsList,deductionBindService,tbFeeDetailsService,tbAccount,
                     tbBusiness,totalMoneyBig,plate);
             deductionBindService.autoUnbindCar(cars);

+ 3 - 2
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemService.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.wx.bo.MsgDataBO;
 import com.pj.api.wx.service.WxService;
 import com.pj.constants.UserTypeEnum;
+import com.pj.constants.business.PayEnum;
 import com.pj.current.config.MyConfig;
 import com.pj.current.config.WxConfig;
 import com.pj.current.satoken.StpUserUtil;
@@ -267,7 +268,7 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
                 .setNo(tbBusiness.getNo() + list.size() + 1)
         .setPayType(tbItem.getPayType()).setPayTypeName(tbItem.getPayTypeName());
         this.save(tbBusinessItem);
-        tbBusiness.setPayStatus(TbBusiness.PayStatus.NO_PAY.getCode())
+        tbBusiness.setPayStatus(PayEnum.PayStatusEnum.NO_PAY.getCode())
                 .setItemPrice(tbBusiness.getItemPrice().add(totalPrice));
         tbBusinessService.updateById(tbBusiness);
     }
@@ -282,7 +283,7 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
         tbBusinessItemList.removeIf(item -> item.getId().equals(tbBusinessItem.getId()));
         long count = tbBusinessItemList.stream().filter(item -> item.getPayStatus() == 0).count();
         if (count == 0) {
-            tbBusiness.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode())
+            tbBusiness.setPayStatus(PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode())
                     .setItemPrice(tbBusiness.getItemPrice().subtract(tbBusinessItem.getTotal()));
             tbBusinessService.updateById(tbBusiness);
         }

+ 2 - 1
sp-server/src/main/java/com/pj/project/tb_car/TbCar.java

@@ -110,6 +110,7 @@ public class TbCar extends Model<TbCar> implements Serializable {
          * 0临时车、1行政车、2业务车
          */
         TEMPORARY_CAR("临时车", 0),
+        UNKNOW_CAR("未知", -1),
         ADMINISTRATIVE_CAR("行政车", 1),
         BUSINESS_CAR("业务车", 2);
         private String name;
@@ -117,7 +118,7 @@ public class TbCar extends Model<TbCar> implements Serializable {
 
         public static Integer getType(String des) {
             return Arrays.stream(CarTypeEnum.values()).filter(obj -> StrUtil.equals(obj.getName(), des))
-                    .findAny().orElseThrow(() -> new BusinessException("系统找不到" + des)).getType();
+                    .findAny().orElse((UNKNOW_CAR)).getType();
         }
     }
 

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

@@ -212,7 +212,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
      * @param outTradeNo
      * @param now
      */
-    public List<TbFeeDetails> chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now, TbBusiness.PayType payType) {
+    public List<TbFeeDetails> chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now, PayEnum.PayType payType) {
         List<TbFeeDetails> details = new ArrayList<>();
         for (PriceBO bo1 : cars) {
             //本次支付的停车费金额
@@ -222,7 +222,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             }
             TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
             String bindIdStr = "";
-            if (payType.getCode() == TbBusiness.PayType.PER_PAY.getCode()) {
+            if (payType.getCode() == PayEnum.PayType.PER_PAY.getCode()) {
                 bindIdStr = tbDeductionBindService.getBindId(car.getCarNo());
             }
             //24小时内的停车费
@@ -295,7 +295,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
      * @param now
      * @param
      */
-    public List<TbFeeDetails> chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now, TbBusiness.PayType payType) {
+    public List<TbFeeDetails> chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now, PayEnum.PayType payType) {
         String module = payType.getDesc();
         String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
@@ -908,12 +908,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             businessCarNos = StrUtil.sub(businessCarNos, 0, businessCarNos.length() - 1);
             businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
                     .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCarIds).setBusinessCarNo(businessCarNos)
-                    .setCarNo(carNo).setModule(TbBusiness.PayType.PER_PAY.getDesc())
+                    .setCarNo(carNo).setModule(PayEnum.PayType.PER_PAY.getDesc())
                     .setItemPrice(item.getTotal()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(feeType)
                     .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
                     .setItemId(item.getItemId()).setItemName(item.getItemName())
-                    .setPayDay(toDay).setPayType(TbBusiness.PayType.PER_PAY.getCode()).setCreateTime(now).setUpdateTime(now)
+                    .setPayDay(toDay).setPayType(PayEnum.PayType.PER_PAY.getCode()).setCreateTime(now).setUpdateTime(now)
                     .setBusinessItemId(item.getId() + "")
                     .setPickCustomerName(item.getPickCustomerName())
                     .setCustomerName(business.getCustomerName())