qzyReal před 3 roky
rodič
revize
a596d4005a

+ 10 - 1
sp-admin/sa-view/tb-business-car/tb-business-car-list.html

@@ -99,7 +99,16 @@
 							<label v-else>-</label>
 						</template>
 					</el-table-column>
-					<sa-td name="支付状态" prop="payType"></sa-td>
+					<sa-td name="支付状态" prop="payType">
+						<template slot-scope="s">
+							<label v-if="s.row.payType.indexOf('免')!==-1">{{s.row.payType}}</label>
+							<label v-else>
+								<label v-if="s.row.money">已支付</label>
+								<label v-else>未支付</label>
+							</label>
+							
+						</template>
+					</sa-td>
 					<el-table-column label="操作" width="200px">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看

+ 1 - 1
sp-admin/sa-view/tb-business-sort/tb-business-sort-add.html

@@ -41,7 +41,7 @@
 						<div v-for="item in list" :key="item.index">
 							<div class="c-item" v-if="item.index>0">
 								<label class="c-label">间隔(分):</label>
-								<el-input-number class="item-num" v-model="item.interval" :step="10" :min="1"
+								<el-input-number class="item-num" v-model="item.interval" :step="10" :min="0"
 									:max="9999">
 								</el-input-number>
 							</div>

+ 1 - 1
sp-admin/sa-view/tb-business-sort/tb-business-sort-list.html

@@ -42,7 +42,7 @@
 							<div v-for="item in list" :key="item.index">
 								<div class="c-item" v-if="item.index>0">
 									<label class="c-label">项目间隔(分):</label>
-									<el-input-number :disabled="!sa.isAuth('tb-business-sort-edit')" class="item-num" v-model="item.interval" :step="10" :min="1"
+									<el-input-number :disabled="!sa.isAuth('tb-business-sort-edit')" class="item-num" v-model="item.interval" :step="10" :min="0"
 										:max="9999">
 									</el-input-number>
 								</div>

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

@@ -129,7 +129,7 @@ public class OpenService {
     private ResultJson handlerOut(String carNo, String channel, String image) {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
-        if (tbBusinessCar == null || tbBusinessCar.getRealInTime() == null) {
+        if (tbBusinessCar == null || tbBusinessCar.getRealInTime() == null||tbBusinessCar.getRealOutTime()!=null) {
             log.error("请求返回【未查询到入场记录】:{}", carNo);
             return ResultJson.error("未查询到入场记录");
         }
@@ -165,7 +165,7 @@ public class OpenService {
         }
         String carNoStr = carNo.substring(0, 1);
         Date inTime = tbBusinessCar.getRealInTime();
-        if (tbBusinessCar.getPay() == 1) {
+        if (tbBusinessCar.getPay() == 1&&tbBusinessCar.getRealOutTime()==null) {
             inTime = tbBusinessCar.getPayTime();
         }
         BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);

+ 10 - 6
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -472,9 +472,11 @@ public class ApiService {
                 String typeId = afterItem.getTypeId();
                 Integer interval = afterItem.getIntervalTime();
                 LocalDateTime endTime = operateTime.plusMinutes(interval);
-                int count = tbBusinessService.checkCarBusinessType(typeId, carNo, endTime.format(formatter),1);
-                if (count > 0) {
-                    throw new BusinessException("车辆:[" + carNo + "]" + tbBusinessSort.getTypeName() + "后" + afterItem.getIntervalTime() + "分钟才可以执行" + afterItem.getTypeName());
+                if (afterItem.getIntervalTime()>0){
+                    int count = tbBusinessService.checkCarBusinessType(typeId, carNo, endTime.format(formatter),1);
+                    if (count > 0) {
+                        throw new BusinessException("车辆:[" + carNo + "]" + tbBusinessSort.getTypeName() + "后" + afterItem.getIntervalTime() + "分钟才可以执行" + afterItem.getTypeName());
+                    }
                 }
             }
             if (i > 0 &&StrUtil.equals(tbBusinessSort.getTypeId(),otherBusinessBO.getItemTypeId())) {
@@ -482,9 +484,11 @@ public class ApiService {
                 String typeId = beforeItem.getTypeId();
                 Integer interval = tbBusinessSort.getIntervalTime();
                 LocalDateTime endTime = operateTime.minusMinutes(interval);
-                int count = tbBusinessService.checkCarBusinessType(typeId, carNo, endTime.format(formatter),0);
-                if (count > 0) {
-                    throw new BusinessException("车辆:[" + carNo + "]" + beforeItem.getTypeName() + "后" + tbBusinessSort.getIntervalTime() + "分钟才可以执行" + tbBusinessSort.getTypeName());
+                if (tbBusinessSort.getIntervalTime()>0){
+                    int count = tbBusinessService.checkCarBusinessType(typeId, carNo, endTime.format(formatter),0);
+                    if (count >0) {
+                        throw new BusinessException("车辆:[" + carNo + "]" + beforeItem.getTypeName() + "后" + tbBusinessSort.getIntervalTime() + "分钟才可以执行" + tbBusinessSort.getTypeName());
+                    }
                 }
             }
             String typeId = otherBusinessBO.getItemTypeId();

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

@@ -140,7 +140,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
 
-
     /**
      * 增
      */
@@ -249,7 +248,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         yueCar.setBusinessType(TbBusiness.BusinessType.HOLD_CAR.getCode());
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
-//        BigDecimal initCarPartMoney = partConfig.getBasePrice();
         t.setItemPrice(price)
                 .setTotalMoney(price);
         this.saveOrUpdate(t);
@@ -417,7 +415,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     }
 
 
-
     @Deprecated
     public void adminConfirmIn(String id, String inChannel) {
         TbBusiness tbBusiness = this.getById(id);
@@ -488,10 +485,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     }
 
 
-
-
-
-
     public Map<String, Object> getBusinessMoney(String carId, String state) {
         Map<String, Object> result = new HashMap<>();
         TbBusinessCar car = tbBusinessCarService.getById(carId);
@@ -506,8 +499,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             List<TbBusiness> businesses = this.findOtherBusinessByCarId(carId);
             businesses = businesses.stream()
                     .filter(tbBusiness -> tbBusiness.getPayMoney().doubleValue() < tbBusiness.getTotalMoney().doubleValue()
-                    &&((TbItemType.PayStep.BEFORE_CONFIRM.getCode().equals(tbBusiness.getPayStep())&&tbBusiness.getAdminConfirmInput()>=0)
-                            ||(TbItemType.PayStep.AFTER_CONFIRM.getCode().equals(tbBusiness.getPayStep())&&tbBusiness.getAdminConfirmInput()==1)
+                                    && ((TbItemType.PayStep.BEFORE_CONFIRM.getCode().equals(tbBusiness.getPayStep()) && tbBusiness.getAdminConfirmInput() >= 0)
+                                    || (TbItemType.PayStep.AFTER_CONFIRM.getCode().equals(tbBusiness.getPayStep()) && tbBusiness.getAdminConfirmInput() == 1)
                             )
                     )
                     .collect(Collectors.toList());
@@ -530,7 +523,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             Date inTime = tbBusinessCar.getRealInTime();
             BigDecimal partMoney = new BigDecimal("0");
             String carNo = tbBusinessCar.getCarNo().substring(0, 1);
-            if (inTime != null) {
+            if (inTime != null&&tbBusinessCar.getRealOutTime()==null) {
                 if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
                     inTime = tbBusinessCar.getPayTime();
                 }
@@ -590,7 +583,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     }
 
 
-
     public List<CarDisincle> getCarDisincleList(SoMap soMap) {
         return tbBusinessMapper.getCarDisincleList(soMap);
     }
@@ -611,19 +603,22 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     public void deleteOtherBusiness(String id) {
         TbBusiness db = super.getById(id);
-        List<TbBusiness>businesses=this.findOtherBusinessByCarId(db.getBusinessCarId());
-        if (businesses.size()==1){
-            tbBusinessCarService.removeById(db.getBusinessCarId());
+        TbBusinessCar tbBusinessCar = tbBusinessCarService.getById(db.getBusinessCarId());
+        if (tbBusinessCar==null||tbBusinessCar.getRealInTime()==null){
+            List<TbBusiness> businesses = this.findOtherBusinessByCarId(db.getBusinessCarId());
+            if (businesses.size() == 1) {
+                tbBusinessCarService.removeById(db.getBusinessCarId());
+            }
         }
         this.removeById(id);
         tbBusinessItemService.removeByBusinessId(id);
     }
 
-    public int checkCarBusinessType(String typeId, String carNo, String operateTime,int before) {
-        return tbBusinessMapper.checkCarBusinessType(typeId,carNo,operateTime,before);
+    public int checkCarBusinessType(String typeId, String carNo, String operateTime, int before) {
+        return tbBusinessMapper.checkCarBusinessType(typeId, carNo, operateTime, before);
     }
 
     public int checkCarBusinessType(String typeId, String carNo, String timeStart, String timeEnd, String businessId) {
-        return tbBusinessMapper.checkCarBusinessTypeByTime(typeId,carNo,timeStart,timeEnd,businessId);
+        return tbBusinessMapper.checkCarBusinessTypeByTime(typeId, carNo, timeStart, timeEnd, businessId);
     }
 }

+ 2 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.java

@@ -38,4 +38,6 @@ public interface TbBusinessCarMapper extends BaseMapper<TbBusinessCar> {
     List<TbBusinessCar> findTodayRecord(@Param("carNo") String carNo, @Param("itemId") String itemId);
 
     int checkCarBusinessType(@Param("typeId")String typeId, @Param("carNo")String carNo,@Param("timeEnd") String timeEnd);
+
+    void removeBusinessId(String id);
 }

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -22,6 +22,9 @@
 		select * 
 		from tb_business_car 
 	</sql>
+    <update id="removeBusinessId">
+        update  tb_business_car set business_id=null where  id=#{id}
+    </update>
 
     <!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
     <select id="getList" resultMap="model">

+ 9 - 2
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -139,8 +139,15 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public void removeByBusinessId(String businessId) {
         QueryWrapper<TbBusinessCar> ew = new QueryWrapper<>();
-        ew.eq("business_id", businessId).isNull("real_in_time");
-        remove(ew);
+        ew.eq("business_id", businessId);
+        List<TbBusinessCar>list=list(ew);
+        list.forEach(tbBusinessCar -> {
+            if (tbBusinessCar.getRealInTime()==null){
+                this.removeById(tbBusinessCar.getId());
+            }else {
+                tbBusinessCarMapper.removeBusinessId(tbBusinessCar.getId());
+            }
+        });
     }
 
     public List<TbBusinessCar> findByBusinessId(String businessId) {

+ 3 - 3
sp-server/src/main/java/com/pj/project/tb_item/TbItem.java

@@ -106,9 +106,9 @@ public class TbItem extends Model<TbItem> implements Serializable {
     @Getter
     @AllArgsConstructor
     public static enum ItemTypeEnum{
-        WEIGHT_TYPE("载重","载重"),
-
-        EMPTY_TYPE("空车","空车");
+        EMPTY_TYPE("空车","空车"),
+        WEIGHT_TYPE("载重","载重")
+        ;
 
         private String type;
         private String desc;