소스 검색

部分bug修复

qzyReal 3 년 전
부모
커밋
add6ad389f

+ 1 - 1
app/manifest.json

@@ -85,7 +85,7 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/test/",
+            "base" : "/h5/",
             "mode" : "history"
         },
         "devServer" : {

+ 1 - 1
app/pages/business-entering/declare-select.vue

@@ -84,7 +84,7 @@
 			},
 			getDeclareList() {
 				if(!this.p.declareNo){
-					this.p.declareNo='-1'
+					this.p.declareNo='1'
 				}
 				this.$api.getDeclareList(this.p).then(resp => {
 					this.status = 'loadmore';

+ 3 - 3
app/pages/index/index.vue

@@ -68,7 +68,7 @@
 					id:'tb-business-item',
 					auth: true,
 					icon: '../../static/home-icon-03.png',
-					text: '我的业务',
+					text: '作业订单',
 					url: '/pages/business-order/partner-business-item',
 				},
 				{
@@ -123,7 +123,7 @@
 					// },
 					{
 						auth: false,
-						icon: '../../static/home-icon-03.jpg',
+						icon: '../../static/home-icon-03.png',
 						text: '业务管理',
 						url: '/pages/onely-disinfect/Index',
 						customer:true
@@ -168,7 +168,7 @@
 					},
 					{
 						auth: false,
-						icon: '../../static/home-icon-03.jpg',
+						icon: '../../static/home-icon-03.png',
 						text: '业务管理',
 						url: '/pages/onely-disinfect/Index',
 						customer:true

+ 5 - 8
app/pages/onely-disinfect/type-business-edit.vue

@@ -4,7 +4,7 @@
 			<view class="top">
 				<text class="title">{{goods.name}}</text>
 			</view>
-			<view class="item">
+			<view class="item"  v-if="goods.needDeclare==1">
 				<view class="l"><text style="color: red;" v-if="goods.needDeclare==1">*</text>申报单号:</view>
 				<view class="r">
 					<u-input placeholder="申报订单号" v-model="form.declareNo" clearable readonly>
@@ -13,7 +13,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">企业:</view>
+				<view class="l">客户:</view>
 				<view class="r" style="flex: 12;">
 					<picker :disabled="goods.needDeclare==1" v-if="customer.customerList.length>0" class="p-picker"
 						@change="customerChange($event)" :value="customer.index" :range="customer.customerList"
@@ -22,7 +22,7 @@
 					</picker>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" v-if="goods.needOwner==1">
 				<view class="l"><text style="color: red;">*</text>货主:</view>
 				<view class="r">
 					<u-input placeholder="输入货主" v-model="form.owner">
@@ -98,7 +98,7 @@
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn" v-show="perList.indexOf('tb-business-add')!==-1"></u-button>
+		<u-button type="primary" text="确定" @click="saveFn" v-show="perList.indexOf('tb-flex-business-edit')!==-1"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-picker :show="show" :columns="columns" @confirm="confirmFn" keyName="itemName" @cancel="show=false">
@@ -201,15 +201,12 @@
 					let items = type.items;
 					if (carType) {
 						items = items.filter(item => item.itemType && item.itemType.indexOf(carType) !== -1);
-						console.log(items)
 					}
 					if (carSize && carSize > 1) {
 						items = items.filter(item => item.minLength <= carSize && item.carLength >= carSize);
-						console.log(items)
 					}
 					if (netWeight && netWeight > 1 && carType.indexOf('空') == -1) {
 						items = items.filter(item => item.minWeight <= netWeight && item.maxWeight >= netWeight);
-						console.log(items)
 					}
 					let itemIds = items.map(item => item.id);
 					if (itemIds.indexOf(type.itemId) == -1) {
@@ -384,7 +381,7 @@
 					this.$common.toast('请选择申报单');
 					return false;
 				}
-				if (!form.owner) {
+				if (!form.owner&&goods.needOwner==1) {
 					this.$common.toast('请填写货主');
 					return false;
 				}

+ 5 - 8
app/pages/onely-disinfect/type-business.vue

@@ -4,7 +4,7 @@
 			<view class="top">
 				<text class="title">{{goods.name}}</text>
 			</view>
-			<view class="item">
+			<view class="item"  v-if="goods.needDeclare==1">
 				<view class="l"><text style="color: red;" v-if="goods.needDeclare==1">*</text>申报单号:</view>
 				<view class="r">
 					<u-input placeholder="申报订单号" v-model="form.declareNo" clearable readonly>
@@ -13,7 +13,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">企业:</view>
+				<view class="l">客户:</view>
 				<view class="r" style="flex: 12;">
 					<picker :disabled="goods.needDeclare==1" v-if="customer.customerList.length>0" class="p-picker"
 						@change="customerChange($event)" :value="customer.index" :range="customer.customerList"
@@ -22,7 +22,7 @@
 					</picker>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" v-if="goods.needOwner==1">
 				<view class="l"><text style="color: red;">*</text>货主:</view>
 				<view class="r">
 					<u-input placeholder="输入货主" v-model="form.owner">
@@ -98,7 +98,7 @@
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn" v-show="perList.indexOf('tb-business-add')!==-1"></u-button>
+		<u-button type="primary" text="确定" @click="saveFn" v-show="perList.indexOf('tb-flex-business-add')!==-1"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-picker :show="show"  :columns="columns" @confirm="confirmFn" keyName="itemName" @cancel="show=false">
@@ -199,15 +199,12 @@
 					let items = type.items;
 					if (carType) {
 						items = items.filter(item => item.itemType && item.itemType.indexOf(carType) !== -1);
-						console.log(items)
 					}
 					if (carSize && carSize > 1) {
 						items = items.filter(item => item.minLength <= carSize && item.carLength >= carSize);
-						console.log(items)
 					}
 					if (netWeight && netWeight > 1 && carType.indexOf('空') == -1) {
 						items = items.filter(item => item.minWeight <= netWeight && item.maxWeight >= netWeight);
-						console.log(items)
 					}
 					let itemIds = items.map(item => item.id);
 					if (itemIds.indexOf(type.itemId) == -1) {
@@ -359,7 +356,7 @@
 					this.$common.toast('请选择申报单');
 					return false;
 				}
-				if (!form.owner) {
+				if (!form.owner&&goods.needOwner==1) {
 					this.$common.toast('请填写货主');
 					return false;
 				}

+ 8 - 15
app/pages/wx/pay.vue

@@ -103,6 +103,7 @@
 				carsSelect: [],
 				itemSelect: [],
 				businessSelect: [],
+				goodsName:'',
 				state: '',
 				list: [],
 				cars: [],
@@ -204,9 +205,9 @@
 				let carIds = this.carsSelect
 				let cars = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1);
 				let carNos = this.cars.map(obj => obj.carNo).join('、');
-				let type = this.type;
+				let businessSelect=this.businessSelect;
 				let p = {
-					b: this.businessSelect.length > 0 ? this.item.businessId : '',
+					b: businessSelect.length > 0 ? this.item.businessId : '',
 					c: JSON.stringify(cars.map(obj => {
 						return {
 							id: obj.id,
@@ -215,23 +216,14 @@
 					})),
 					money: this.total,
 					tradeType: "JSAPI",
-					openid: this.openid,
-					type: type
+					openid: this.openid
 				}
 				let con = 'A1-停车费';
 				let tradeType = 'PORT_PARKING_FEE';
-				if (type == 2) {
-					con = 'A1-整车业务';
+				if (carIds.length==0||businessSelect.length>0) {//交业务费
+					con = 'A1-'+this.goodsName;
 					tradeType = 'PORT_OPERATION_FEE';
-				} else if (type == 1) {
-					let itemSelect = this.itemSelect;
-					let itemStr = this.item.list
-						.filter(obj => itemSelect.indexOf(obj.id) !== -1).map(obj => obj.name.substr(0, obj.name.indexOf(
-							'(')))
-						.join('、');
-					con = 'A1-' + itemStr;
-					tradeType = 'PORT_OPERATION_FEE';
-				}
+				} 
 				p.desc = con + '-' + carNos;
 				p.businessType = tradeType;
 				this.$common.showLoading('正在请求...');
@@ -301,6 +293,7 @@
 				}).then(resp => {
 					let data = resp.data;
 					this.cars = data.carList;
+					this.goodsName=data.goodsName;
 					this.showPay = data.showPay;
 					this.type = data.type;
 					let list = data.itemList;

+ 9 - 2
app/pages/wx/payOrder.vue

@@ -8,7 +8,7 @@
 				</view>
 			</view>
 			<view class="item-line">
-				业务项
+				收费明细
 			</view>
 			<view class="item" v-for="item in form.items" :key="item.id">
 				<view class="l" style="flex: 7;">{{item.itemTypeName}}:</view>
@@ -24,6 +24,13 @@
 				</view>
 			</view>
 			<view class="item">
+				<view class="l" style="flex: 7;">业务项:</view>
+				<view class="r">
+					{{form.goodsName}}
+					<text>(元)</text>
+				</view>
+			</view>
+			<view class="item">
 				<view class="l" style="flex: 7;">合计费用:</view>
 				<view class="r">
 					{{form.totalMoney}}元
@@ -156,7 +163,7 @@
 					tradeType: "JSAPI",
 					openid: this.wx.openid
 				}
-				p.desc = "A1-整车业务";
+				p.desc = "A1-"+this.form.goodsName;
 				p.businessType='PORT_OPERATION_FEE';
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;

+ 2 - 2
app/utils/request.js

@@ -1,5 +1,5 @@
-// const server = 'http://127.0.0.1:8099/pro';
-const server = 'https://pco.aseanbusiness.cn/pro';
+const server = 'http://127.0.0.1:8099/pro';
+// const server = 'https://pco.aseanbusiness.cn/pro';
 // const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';

+ 4 - 8
sp-admin/sa-view/tb-business/tb-car-disincle-add.html

@@ -74,9 +74,9 @@
 											</sa-item>
 										</el-col>
 										<el-col span=8>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needDeclare==1">
 												<label class="c-label">
-													<span style="color: red;" v-if="goods.needDeclare==1">*</span>
+													<span style="color: red;">*</span>
 													申报单号:</label>
 												<el-input v-model="m.declareNo" placeholder="选择申报单"
 													:readonly="goods.needDeclare==1" clearable>
@@ -104,7 +104,7 @@
 													</el-option>
 												</el-select>
 											</div>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needOwner==1">
 												<label class="c-label">
 													<span style="color: red;">*</span>
 													货主:</label>
@@ -371,10 +371,6 @@
 						this.getDeclareList();
 					},
 					getDeclareList() {
-						let currentCustomerId = this.currentCustomerId;
-						if (currentCustomerId != '1') {
-							this.declare.p.customerId = this.currentCustomerId;
-						}
 						let declareNo = this.m.declareNo;
 						if (declareNo) {
 							this.declare.p.declareNo = declareNo;
@@ -635,7 +631,7 @@
 							sa.error('请选择作业时间');
 							return false;
 						}
-						if (!m.owner) {
+						if (!m.owner&&goods.needOwner==1) {
 							sa.error('请填写货主');
 							return false;
 						}

+ 3 - 3
sp-admin/sa-view/tb-business/tb-car-disincle-edit.html

@@ -70,7 +70,7 @@
 											</sa-item>
 										</el-col>
 										<el-col span=8>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needDeclare==1">
 												<label class="c-label">
 													<span style="color: red;" v-if="goods.needDeclare==1">*</span>
 													申报单号:</label>
@@ -101,7 +101,7 @@
 													</el-option>
 												</el-select>
 											</div>
-											<div class="c-item">
+											<div class="c-item" v-if="goods.needOwner==1">
 												<label class="c-label">
 													<span style="color: red;">*</span>
 													货主:</label>
@@ -629,7 +629,7 @@
 							sa.error('请选择作业时间');
 							return false;
 						}
-						if (!m.owner) {
+						if (!m.owner && goods.needOwner == 1) {
 							sa.error('请填写货主');
 							return false;
 						}

+ 8 - 2
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -75,7 +75,7 @@
 					<sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
 					<sa-td width="160" name="创建时间" prop="createTime"></sa-td>
 					</sa-td>
-					<el-table-column label="操作" width="420px" fixed="right">
+					<el-table-column label="操作" width="415px" fixed="right">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
 								&&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认</el-button>
@@ -90,7 +90,7 @@
 								@click="carFn(s.row)">车辆管理
 							</el-button>
 							<el-button class="c-btn" type="primary" v-if="(currentCustomerId=='1'||(sa.isAuth('tb-flex-business-pay')))
-								&&s.row.payStatus!=='3'" @click="handlerPay(s.row)">
+								&&s.row.payStatus!=3" @click="handlerPay(s.row)">
 								线下收费</el-button>
 							<el-button v-if="sa.isAuth('tb-business-car-bind')" class="c-btn" type="primary"
 								@click="businessFn(s.row)">绑定车辆
@@ -176,6 +176,7 @@
 						}, val * 1000)
 					},
 					businessFn(data) {
+						this.stopTimmer();
 						sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
 							businessId: data.id
 						}, function(resp) {
@@ -188,10 +189,12 @@
 						}.bind(this))
 					},
 					carFn(data) {
+						this.stopTimmer();
 						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
 							.payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
 					},
 					handlerPay(data) {
+						this.stopTimmer();
 						sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
 					},
 					getCurrendCustomer() {
@@ -201,15 +204,18 @@
 					},
 					// 查看
 					get: function(data) {
+						this.stopTimmer();
 						sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1050px', '90%');
 					},
 					add: function(data) {
+						this.stopTimmer();
 						sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
 					},
 					update(data) {
 						sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
 					},
 					getPcodeByCurrRid() {
+						this.stopTimmer();
 						sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
 							this.perCode = resp.data;
 						}.bind(this))

+ 11 - 1
sp-admin/sa-view/tb-goods/tb-goods-list.html

@@ -40,6 +40,8 @@
 						@change="s => updateNeedCarSize(s.row)" width="90"></sa-td>
 					<sa-td name="申报单" prop="needDeclare" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
 						@change="s => updateNeedDeclare(s.row)" width="90"></sa-td>
+						<sa-td name="货主" prop="needOwner" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
+							@change="s => updateNeedOwner(s.row)" width="90"></sa-td>
 					<sa-td name="作业时间" prop="needOperateTime" type="switch" :jv="{0: '选填[#005500]', 1: '必填[#ff0000]'}"
 						@change="s => updateNeedOperateTime(s.row)" width="90"></sa-td>
 					<sa-td name="中国车" prop="chinaCarPay" type="switch" :jv="{0: '免停车费[#005500]', 1: '收停车费[#ff0000]'}"
@@ -137,7 +139,15 @@
 						sa.ajax('/TbGoods/vietnamLeaveChange',obj,function(resp){
 							
 						}.bind(this))
-						console.log(v)
+					},
+					updateNeedOwner(v){
+						let obj={
+							id:v.id,
+							value:v.needOwner
+						}
+						sa.ajax('/TbGoods/updateNeedOwner',obj,function(resp){
+							
+						}.bind(this))
 					},
 					// 查看
 					get: function(data) {

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

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

+ 0 - 1
sp-server/src/main/java/com/pj/api/jh/service/JhService.java

@@ -74,7 +74,6 @@ public class JhService {
         String businessId = request.getParameter("b");
         String c = request.getParameter("c");
         String a = request.getParameter("a");
-        String tradeType = request.getParameter("tradeType");
         String businessType = request.getParameter("businessType");
         Attach atchMap = new Attach();
         atchMap.setC(c).setB(businessId).setA(a);

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

@@ -234,7 +234,7 @@ public class WxService {
                 TbBusiness business = tbBusinessService.getById(car.getBusinessId());
                 if (business != null) {
                     business.setPayMoney(business.getPayMoney().add(price));
-                    business.setPayStatus(business.getPayMoney().equals(business.getTotalMoney()) ? 3 : 4);
+                    business.setPayStatus(business.getPayMoney().equals(business.getItemPrice()) ? 3 : 4);
                     tbBusinessService.updateById(business);
                 }
             }
@@ -248,7 +248,7 @@ public class WxService {
                     tbBusiness.setPayTime(now).setPayType(3).setConfirmInput(1).setConfirmInputTime(now)
                             .setPayMoney(tbBusiness.getPayMoney().add(tbBusiness.getItemPrice()))
                             .setPayNo(transactionId);
-                    tbBusiness.setPayStatus(tbBusiness.getPayMoney().equals(tbBusiness.getTotalMoney()) ? 3 : 4);
+                    tbBusiness.setPayStatus(tbBusiness.getPayMoney().equals(tbBusiness.getItemPrice()) ? 3 : 4);
                     tbBusinessService.updateById(tbBusiness);
                     TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
                     List<TbBusinessCar> carList = tbBusinessCarService.findOtherBusinessCar(businessId);

+ 11 - 4
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemService.java

@@ -12,6 +12,7 @@ import com.pj.project.tb_item.TbItem;
 import com.pj.project.tb_item.TbItemMapper;
 import com.pj.project.tb_item_type.TbItemType;
 import com.pj.project.tb_item_type.TbItemTypeService;
+import com.pj.project4sp.global.BusinessException;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -62,11 +63,13 @@ public class RelationTypeItemService extends ServiceImpl<RelationTypeItemMapper,
         List<String> dbItemIdList = list.stream().map(RelationTypeItem::getItemId).collect(Collectors.toList());
         itemIdList.stream().filter(id -> !dbItemIdList.contains(id)).
                 forEach(id -> {
-                    RelationTypeItem relationTypeItem = new RelationTypeItem();
-                    relationTypeItem.setItemId(id).setTypeId(typeId).setNeed(1).setTypeName(tbItemType.getName());
-                    this.save(relationTypeItem);
+                    RelationTypeItem db=findByTypeIdAndItemId(typeId,id);
+                    if (db==null){
+                        RelationTypeItem relationTypeItem = new RelationTypeItem();
+                        relationTypeItem.setItemId(id).setTypeId(typeId).setNeed(1).setTypeName(tbItemType.getName());
+                        this.save(relationTypeItem);
+                    }
                 });
-
     }
 
     public void removeByTypeId(String typeId) {
@@ -76,6 +79,10 @@ public class RelationTypeItemService extends ServiceImpl<RelationTypeItemMapper,
     }
 
     public void setSingle(String typeId, String itemId) {
+        RelationTypeItem db=  this.findByTypeIdAndItemId(typeId,itemId);
+        if (db!=null){
+            return;
+        }
         RelationTypeItem relationTypeItem = new RelationTypeItem();
         TbItemType tbItemType = tbItemTypeService.getById(typeId);
         relationTypeItem.setNeed(1).setItemId(itemId).setTypeId(typeId).setTypeName(tbItemType.getName());

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

@@ -235,57 +235,7 @@ public class TbBusinessController {
         return AjaxJson.getSuccess();
     }
 
-    @RequestMapping("adminOut")
-    public AjaxJson adminOut() {
-        if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            return AjaxJson.getError("无离场权限");
-        }
-        SoMap so = SoMap.getRequestSoMap();
-        String id = so.getString("id");
-        TbBusiness business = tbBusinessService.getById(id);
-        Date outTime = so.getDateTime("outDayTime");
-        if (business.getRealInTime().getTime() > outTime.getTime()) {
-            return AjaxJson.getError("离场时间须大于出场时间");
-        }
-        business.setOutDayTime(outTime);
-        tbBusinessService.calculationPartMoney("越南车", business);
-        tbBusinessService.updateById(business);
-        Date chinaCarOutTime = so.getDateTime("chinaCarOutTime");
-        if (chinaCarOutTime.getTime() < business.getChinaCarInTime().getTime()) {
-            return AjaxJson.getError("离场时间须大于出场时间");
-        }
-        business.setChinaCarOutTime(chinaCarOutTime);
-        tbBusinessService.calculationPartMoney("中国车", business);
-        business.setAdminConfirmOut(1);
-        tbBusinessService.updateById(business);
-        //更新境外车出场记录
-
-        //更新中国车出场记录
 
-        tbBusinessService.storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已完成作业离场" + DateUtil.now() + "。");
-        //发送消息
-        String text = "您的车辆已离场,业务单号[" + business.getNo() + "]";
-        tbNoticesService.sendNotice(business.getId(), business.getNo(), business.getCustomerId(), text);
-        return AjaxJson.getSuccess();
-    }
-
-    @RequestMapping("calJwPartMoney")
-    public AjaxJson calJwPartMoney(TbBusiness business) {
-        if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            return AjaxJson.getError("无生成账单权限");
-        }
-        tbBusinessService.calculationPartMoney("越南车", business);
-        return AjaxJson.getSuccessData(business);
-    }
-
-    @RequestMapping("calChinaPartMoney")
-    public AjaxJson calChinaPartMoney(TbBusiness business) {
-        if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            return AjaxJson.getError("无生成账单权限");
-        }
-        tbBusinessService.calculationPartMoney("中国车", business);
-        return AjaxJson.getSuccessData(business);
-    }
 
     @RequestMapping("complete")
     public AjaxJson complete(TbBusiness business) {

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

@@ -430,40 +430,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     }
 
-    public void adminOut(String id, Date outDayTime, String outChannel, String carType) {
-        TbBusiness tbBusiness = this.getById(id);
-        tbBusiness.setOutDayTime(outDayTime).setOutChannel(outChannel);
-        calculationPartMoney(carType, tbBusiness);
-        this.updateById(tbBusiness);
-
-        //更新境外车出场记录
 
-        //更新中国车出场记录
 
-        //发送消息
-        String text = "您的车辆已离场,业务单号[" + tbBusiness.getNo() + "]";
-        tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
 
-    }
-
-    @Async
-    @Deprecated
-    public void calculationPartMoney(String itemType, TbBusiness tbBusiness) {
-        Date iTime = tbBusiness.getRealInTime();
-        Date oTime = tbBusiness.getOutDayTime();
-        if (itemType.contains("中国")) {
-            iTime = tbBusiness.getChinaCarInTime();
-            oTime = tbBusiness.getChinaCarOutTime();
-        }
-        BigDecimal price = calculationPartMoney(iTime, oTime);
-        if (itemType.contains("中国")) {
-            int len = tbBusiness.getCardNo().split(" ").length;
-            tbBusiness.setChinaPartMoney(price.multiply(new BigDecimal(len)));
-        } else {
-            tbBusiness.setPartMoney(price);
-        }
-        tbBusiness.setTotalMoney(tbBusiness.getItemPrice().add(tbBusiness.getChinaPartMoney()).add(tbBusiness.getPartMoney()));
-    }
 
     public BigDecimal calculationPartMoney(Date iTime, Date oTime) {
         BigDecimal zero = new BigDecimal("0");
@@ -592,6 +561,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         }
         result.put("itemsPrice", itemsPrice);
         result.put("itemList", itemList);
+        result.put("goodsName", businessList.stream().map(TbBusiness::getGoodsName).distinct().collect(Collectors.joining("、")));
         return result;
     }
 

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

@@ -127,17 +127,7 @@ 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

+ 116 - 88
sp-server/src/main/java/com/pj/project/tb_declare/TbDeclareController.java

@@ -2,7 +2,11 @@ package com.pj.project.tb_declare;
 
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
 import com.pj.constants.UserTypeEnum;
+import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerService;
+import com.pj.project4sp.admin.SpAdmin;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -14,104 +18,128 @@ import com.pj.project4sp.SP;
 import com.pj.current.satoken.StpUserUtil;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 
+import javax.annotation.Resource;
+
 
 /**
- * Controller: tb_declare -- 
- * @author lzm 
+ * Controller: tb_declare --
+ *
+ * @author lzm
  */
 @RestController
 @RequestMapping("/TbDeclare/")
 public class TbDeclareController {
 
-	/** 底层 Service 对象 */
-	@Autowired
-	TbDeclareService tbDeclareService;
-
-	/** 增 */  
-	@RequestMapping("add")
-	@SaCheckPermission(TbDeclare.PERMISSION_CODE)
-	@Transactional(rollbackFor = Exception.class)
-	public AjaxJson add(TbDeclare t){
-		tbDeclareService.add(t);
-		t = tbDeclareService.getById(SP.publicMapper.getPrimarykey());
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 删 */  
-	@RequestMapping("delete")
-	@SaCheckPermission(TbDeclare.PERMISSION_CODE)
-	public AjaxJson delete(Long id){
-		int line = tbDeclareService.delete(id);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 删 - 根据id列表 */  
-	@RequestMapping("deleteByIds")
-	@SaCheckPermission(TbDeclare.PERMISSION_CODE)
-	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
-		int line = SP.publicMapper.deleteByIds(TbDeclare.TABLE_NAME, ids);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 改 */  
-	@RequestMapping("update")
-	@SaCheckPermission(TbDeclare.PERMISSION_CODE)
-	public AjaxJson update(TbDeclare t){
-		int line = tbDeclareService.update(t);
-		return AjaxJson.getByLine(line);
-	}
-
-	/** 查 - 根据id */  
-	@RequestMapping("getById")
-	public AjaxJson getById(Long id){
-		TbDeclare t = tbDeclareService.getById(id);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	@RequestMapping("getList")
-	public AjaxJson getList() { 
-		SoMap so = SoMap.getRequestSoMap();
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbDeclareService tbDeclareService;
+    @Resource
+    private TbCostomerService tbCostomerService;
+
+    /**
+     * 增
+     */
+    @RequestMapping("add")
+    @SaCheckPermission(TbDeclare.PERMISSION_CODE)
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxJson add(TbDeclare t) {
+        tbDeclareService.add(t);
+        t = tbDeclareService.getById(SP.publicMapper.getPrimarykey());
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 删
+     */
+    @RequestMapping("delete")
+    @SaCheckPermission(TbDeclare.PERMISSION_CODE)
+    public AjaxJson delete(Long id) {
+        int line = tbDeclareService.delete(id);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 删 - 根据id列表
+     */
+    @RequestMapping("deleteByIds")
+    @SaCheckPermission(TbDeclare.PERMISSION_CODE)
+    public AjaxJson deleteByIds() {
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        int line = SP.publicMapper.deleteByIds(TbDeclare.TABLE_NAME, ids);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update")
+    @SaCheckPermission(TbDeclare.PERMISSION_CODE)
+    public AjaxJson update(TbDeclare t) {
+        int line = tbDeclareService.update(t);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 查 - 根据id
+     */
+    @RequestMapping("getById")
+    public AjaxJson getById(Long id) {
+        TbDeclare t = tbDeclareService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
         String currentCustomerId = StpUserUtil.getCustomerId();
         if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
             so.put("customerId", currentCustomerId);
         }
-		List<TbDeclare> list = tbDeclareService.getList(so.startPage());
-		return AjaxJson.getPageData(so.getDataCount(), list);
-	}
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
-	@RequestMapping("getNotBindList")
-	public AjaxJson getNotBindList() {
-		SoMap so = SoMap.getRequestSoMap();
-		List<TbDeclare> list = tbDeclareService.getList(so.startPage());
-		return AjaxJson.getPageData(so.getDataCount(), list);
-	}
-	
-	
-	
-	
-	// ------------------------- 前端接口 -------------------------
-	
-	
-	/** 改 - 不传不改 [G] */
-	@RequestMapping("updateByNotNull")
-	public AjaxJson updateByNotNull(Long id){
-		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-		// 鉴别身份,是否为数据创建者 
-		long userId = SP.publicMapper.getColumnByIdToLong(TbDeclare.TABLE_NAME, "user_id", id);
-		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-		// 开始修改 (请只保留需要修改的字段)
-		SoMap so = SoMap.getRequestSoMap();
-		so.clearNotIn("id", "businessId", "goodsName", "grossWeight", "num", "productionDate", "expirationDate", "storageMode", "productionMode", "origin", "producerCode", "sendUnit", "receiveUnit", "route", "driverName", "driverPhone", "agent", "agentPhone", "chinaCarNo", "carNo", "customProof", "quarantineProof", "shop", "productionCode", "containerCode").clearNull().humpToLineCase();	
-		int line = SP.publicMapper.updateBySoMapById(TbDeclare.TABLE_NAME, so, id);
-		return AjaxJson.getByLine(line);
-	}
-	
-	
-	
-	
-	
-	
+        List<TbDeclare> list = tbDeclareService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getNotBindList")
+    public AjaxJson getNotBindList() {
+        SoMap so = SoMap.getRequestSoMap();
+        String customerId = StpUserUtil.getAdmin().getCustomerId();
+        if (!StrUtil.equals(customerId, UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+            TbCostomer tbCostomer = tbCostomerService.getById(customerId);
+            if (tbCostomer.getType().equals(TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())){
+                so.put("customerId",customerId);
+            }
+        }
+        List<TbDeclare> list = tbDeclareService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+
+    // ------------------------- 前端接口 -------------------------
+
+
+    /**
+     * 改 - 不传不改 [G]
+     */
+    @RequestMapping("updateByNotNull")
+    public AjaxJson updateByNotNull(Long id) {
+        AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+        // 鉴别身份,是否为数据创建者
+        long userId = SP.publicMapper.getColumnByIdToLong(TbDeclare.TABLE_NAME, "user_id", id);
+        AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+        // 开始修改 (请只保留需要修改的字段)
+        SoMap so = SoMap.getRequestSoMap();
+        so.clearNotIn("id", "businessId", "goodsName", "grossWeight", "num", "productionDate", "expirationDate", "storageMode", "productionMode", "origin", "producerCode", "sendUnit", "receiveUnit", "route", "driverName", "driverPhone", "agent", "agentPhone", "chinaCarNo", "carNo", "customProof", "quarantineProof", "shop", "productionCode", "containerCode").clearNull().humpToLineCase();
+        int line = SP.publicMapper.updateBySoMapById(TbDeclare.TABLE_NAME, so, id);
+        return AjaxJson.getByLine(line);
+    }
+
 
 }

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoods.java

@@ -93,6 +93,7 @@ public class TbGoods extends Model<TbGoods> implements Serializable {
 	private Integer vietnamCarPay=1;
 	private Integer chinaCarLeave=1;
 	private Integer vietnamCarLeave=1;
+	private Integer needOwner=1;
 
 
 

+ 13 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoodsController.java

@@ -3,6 +3,7 @@ package com.pj.project.tb_goods;
 import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
 import com.pj.project.relation_goods_type.RelationGoodsType;
 import com.pj.project.tb_item_type.TbItemType;
 import com.pj.utils.so.SoMap;
@@ -104,6 +105,18 @@ public class TbGoodsController {
         int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_weight", value, id);
         return AjaxJson.getByLine(line);
     }
+    /**
+     * 改 - 载重是否必填(1=是,0=否)
+     */
+    @RequestMapping("updateNeedOwner")
+    @SaCheckPermission(TbGoods.PERMISSION_CODE_EDIT)
+    public AjaxJson updateNeedOwner(Long id, String value) {
+        if (StrUtil.isEmpty(value)){
+            return AjaxJson.getError("参数异常");
+        }
+        int line = SP.publicMapper.updateColumnById(TbGoods.TABLE_NAME, "need_owner", value, id);
+        return AjaxJson.getByLine(line);
+    }
 
     /**
      * 改 - 规格是否必填(1=是,0=否)

+ 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:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://47.101.143.145:3306/pco?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 123456
+        password: 1qaz@WSX
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet: