Jelajahi Sumber

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

# Conflicts:
#	sp-admin/sa-view/tb-disinfect/print.html
qzyReal 3 tahun lalu
induk
melakukan
a180470b30

+ 6 - 2
sp-admin/sa-view/tb-business/tb-business-edit.html

@@ -76,8 +76,12 @@
 										</div>
 										<sa-item type="num" name="载重(吨)" placeholder="请输入车辆载重" v-model="m.netWeight" br>
 										</sa-item>
-										<sa-item type="text" name="境外车牌号" placeholder="请输入境外车牌号" v-model="m.cardNo" br>
-										</sa-item>
+									
+										<div class="c-item">
+											<label class="c-label">境外车牌号:</label>
+											<el-input v-model="m.cardNo" readonly disabled placeholder="请输入境外车牌号">
+											</el-input>
+										</div>
 										</sa-item>
 										<div class="c-item">
 											<label class="c-label"><span style="color: red;">*</span>境外车规格:</label>

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

@@ -9,7 +9,7 @@ var sa = {
 (function(){
 	// 公司开发环境
 	var cfg_dev = {
-		api_url: 'http://192.168.3.74:8099/pro',	// 所有ajax请求接口父地址
+		api_url: 'http://127.0.0.1:8099/pro',	// 所有ajax请求接口父地址
 		web_url: 'http://www.baidu.com'		// 此项目前台地址 (此配置项非必须)
 	}
 	// 服务器测试环境
@@ -22,7 +22,7 @@ var sa = {
 		api_url: 'https://dxkaa1.bgigc.com/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_prod; // 最终环境 , 上线前请选择正确的环境
+	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
 })();
 
 

+ 1 - 2
sp-server/app.pid

@@ -1,2 +1 @@
-
-18980
+37868

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

@@ -72,7 +72,6 @@ import javax.annotation.Resource;
 @Service
 @Transactional
 public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness> implements IService<TbBusiness> {
-    private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
     /**
      * 底层 Mapper 对象
@@ -192,7 +191,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         String yueCarNo = t.getCardNo().toUpperCase();
         TbBusinessCar yueCar = tbBusinessCarService.findInAndNoBusinessCar(yueCarNo);
         if (yueCar == null) {
-            yueCar = new TbBusinessCar();
+             yueCar = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), yueCarNo);
+            if (yueCar == null) {
+                yueCar = new TbBusinessCar();
+            }
         }
         yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
         carList.add(yueCar);

+ 18 - 5
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -4,7 +4,9 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -31,6 +33,7 @@ import javax.annotation.Resource;
 @Service
 @Transactional
 public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBusinessCar> implements IService<TbBusinessCar> {
+    private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
     /**
      * 底层 Mapper 对象
@@ -125,9 +128,9 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
             throw new Exception("车辆已存在");
         }
         TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-        if (tbBusiness!=null){
+        if (tbBusiness != null) {
             tbBusiness.setChinaPartMoney(tbBusiness.getChinaPartMoney().add(partConfig.getBasePrice()))
-            .setTotalMoney(tbBusiness.getTotalMoney().add(partConfig.getBasePrice()));
+                    .setTotalMoney(tbBusiness.getTotalMoney().add(partConfig.getBasePrice()));
             tbBusinessService.updateById(tbBusiness);
         }
 
@@ -137,6 +140,16 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public void updateCar(TbBusinessCar t) {
         this.updateById(t);
+        TbBusiness tbBusiness = tbBusinessService.getById(t.getBusinessId());
+        String carNo = t.getCarNo();
+        if (!CAR_LIST.contains(carNo)) {
+            tbBusiness.setCardNo(carNo);
+        } else {
+            List<TbBusinessCar> cars = this.findByBusinessId(t.getBusinessId());
+            String chiaCarNo = cars.stream().filter(obj -> CAR_LIST.contains(obj.getCarNo())).map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
+            tbBusiness.setChinaCarNo(chiaCarNo);
+        }
+        tbBusinessService.updateById(tbBusiness);
     }
 
     public void adminIn(String businessId, String carNo, Date realInTime) {
@@ -160,12 +173,12 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     }
 
     public void deleteCar(String id) {
-        TbBusinessCar db=this.getById(id);
+        TbBusinessCar db = this.getById(id);
         this.removeById(id);
         TbBusiness tbBusiness = tbBusinessService.getById(db.getBusinessId());
-        if (tbBusiness!=null){
+        if (tbBusiness != null) {
             tbBusiness.setChinaPartMoney(tbBusiness.getChinaPartMoney().subtract(partConfig.getBasePrice()))
-            .setTotalMoney(tbBusiness.getTotalMoney().subtract(partConfig.getBasePrice()));
+                    .setTotalMoney(tbBusiness.getTotalMoney().subtract(partConfig.getBasePrice()));
             tbBusinessService.updateById(tbBusiness);
         }
     }

+ 2 - 2
sp-server/src/main/resources/application-dev.yml

@@ -6,9 +6,9 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://127.0.0.1:3307/pco_system?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
+        url: jdbc:mysql://127.0.0.1:3306/pco_system?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
         username: root
-        password: 1234
+        password: 123456
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet: