소스 검색

运费结算

fanzherong_v 2 주 전
부모
커밋
8b5a4b51d3

+ 3 - 3
snowy-admin-web/src/views/biz/bizsettle/detail.vue

@@ -64,7 +64,7 @@
 					<td>订单重量</td>
 					<td>实际托运重量</td>
 					<td>运费单价</td>
-					<td>操作</td>
+<!--					<td>操作</td>-->
 				</tr>
 				<tr v-for="(order, index) in formData.orderList">
 					<td>
@@ -107,7 +107,7 @@
 							{{ order.freightPrice }}
 						</a-tooltip>
 					</td>
-					<td>
+<!--					<td>
 						<a-button
 							danger
 							size="small"
@@ -117,7 +117,7 @@
 						>
 							<delete-outlined />
 						</a-button>
-					</td>
+					</td>-->
 				</tr>
 <!--				<tr v-if="formData.orderList.length>0">
 					<th colspan="1">合计</th>

+ 9 - 1
snowy-admin-web/src/views/biz/bizsettle/form.vue

@@ -24,7 +24,7 @@
 					<td>货品编码</td>
 					<td>供应商名称</td>
 					<td>订单重量</td>
-					<td>实际托运重量</td>
+					<td>托运重量</td>
 					<td>运费单价</td>
 					<td>操作</td>
 				</tr>
@@ -162,6 +162,14 @@
 		formRef.value
 			.validate()
 			.then(() => {
+
+				//校验物料明细的字段
+				let orderList = formData.value.orderList
+				if (!orderList || orderList.length < 1) {
+					message.error('物流订单明细信息不能为空')
+					return
+				}
+
 				submitLoading.value = true
 				const formDataParam = cloneDeep(formData.value)
 				bizSettleApi

+ 16 - 4
snowy-admin-web/src/views/biz/bizsettle/index.vue

@@ -102,9 +102,21 @@
 					</a-space>-->
 					<a size="small" type="link" @click="detailRef.onOpen(record)" >详情</a>
 
-					<a-divider type="vertical" v-if="hasPerm('bizSettleSubmit') || hasPerm('bizSettleEdit') || hasPerm('bizSettleDelete')"/>
+					<a-divider type="vertical" v-if="(hasPerm('bizSettleSubmit') && record.settleStatus == '1') ||
+						(hasPerm('bizSettleAdminAudit') && record.settleStatus == '2') ||
+						(hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4') ||
+						(hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '3')) ||
+						(hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')) ||
+						(hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')) ||
+						(hasPerm('bizSettleDelete') && record.settleStatus !='7')"/>
 
-					<a-dropdown>
+					<a-dropdown v-if="(hasPerm('bizSettleSubmit') && record.settleStatus == '1') ||
+						(hasPerm('bizSettleAdminAudit') && record.settleStatus == '2') ||
+						(hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4') ||
+						(hasPerm('bizSettleEdit') && (record.settleStatus == '1' ||  record.settleStatus == '3')) ||
+						(hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')) ||
+						(hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')) ||
+						(hasPerm('bizSettleDelete') && record.settleStatus !='7' )">
 						<a class="ant-dropdown-link">
 							更多
 							<DownOutlined />
@@ -123,7 +135,7 @@
 								<a-menu-item v-if="hasPerm('bizSettleFinanceAudit') && record.settleStatus == '4'">
 									<a style="color:blue" @click="financeReviewRef.showModal(record.id)" >审核</a>
 								</a-menu-item>
-								<a-menu-item v-if="hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '2' || record.settleStatus == '3')">
+								<a-menu-item v-if="hasPerm('bizSettleEdit') && (record.settleStatus == '1' || record.settleStatus == '3')">
 									<a @click="formRef.onOpen(record)" >编辑</a>
 								</a-menu-item>
 								<a-menu-item v-if="hasPerm('bizSettleUploadInvoice') && (record.settleStatus == '5')">
@@ -132,7 +144,7 @@
 								<a-menu-item v-if="hasPerm('bizSettleUploadVoucher') && (record.settleStatus == '6')">
 									<a style="color:green" @click="uploadVoucherRef.onOpen(record)" >结款凭证</a>
 								</a-menu-item>
-								<a-menu-item v-if="hasPerm('bizSettleDelete')">
+								<a-menu-item v-if="hasPerm('bizSettleDelete') && record.settleStatus !='7'">
 									<a style="color:red" size="small" type="link" @click="deleteConfig(record)">删除</a>
 								</a-menu-item>
 							</a-menu>

+ 20 - 10
snowy-admin-web/src/views/biz/bizsettle/orderItem.vue

@@ -87,55 +87,63 @@
 			title: '订单编号',
 			width: 100,
 			dataIndex: 'orderNumber',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '客户名称',
 			width: 100,
 			dataIndex: 'customerName',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '货品名称',
 			width: 90,
 			dataIndex: 'goodsName',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '货品编码',
 			width: 80,
 			dataIndex: 'goodsCode',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '供应商名称',
 			width: 100,
 			dataIndex: 'supplierName',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '订单重量(吨)',
 			width: 80,
 			dataIndex: 'orderWeight',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
-		{
+		/*{
 			title: '过磅重量(吨)',
 			width: 80,
 			dataIndex: 'netWeight',
 			ellipsis: true
-		},
+		},*/
 		{
 			title: '托运重量(吨)',
 			width: 80,
 			dataIndex: 'shippingWeight',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		},
 		{
 			title: '运费单价(元/吨)',
 			width: 80,
 			dataIndex: 'freightPrice',
-			ellipsis: true
+			ellipsis: true,
+			align:'center'
 		}
 	]
 
@@ -163,6 +171,7 @@
 	const loadData = (parameter) => {
 		const searchFormParam = JSON.parse(JSON.stringify(searchFormState))
 		searchFormParam.orderStatus = '7'
+		searchFormParam.orderType = '1'
 		return bizOrderApi.bizOrderPage(Object.assign(parameter, searchFormParam)).then((data) => {
 			return data
 		})
@@ -222,6 +231,7 @@
 		options.rowSelection.type = selectType === 'radio' ? 'radio' : 'checkbox'
 		selectedCallBack.value = callBackType
 		visible.value = true
+		table.value.refresh(true)
 	}
 	const { x, y, isDragging } = useDraggable(modalTitleRef)
 

+ 3 - 0
snowy-admin-web/src/views/biz/bizsettle/uploadFile.vue

@@ -69,6 +69,9 @@
 						url: sysConfig.PREVIEW_PATH + formData.value.fileInvoicePath.split(',')[i],
 						name: formData.value.fileInvoiceName.split(',')[i]
 					})
+
+					formData.value.filePathList.push(formData.value.fileInvoicePath.split(',')[i])
+					formData.value.fileNameList.push(formData.value.fileInvoiceName.split(',')[i])
 				}
 			}
 		}

+ 2 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/param/BizOrderPageParam.java

@@ -69,4 +69,6 @@ public class BizOrderPageParam {
     /**订单id*/
     private String orderId;
 
+    /**订单类型*/
+    private String orderType;
 }

+ 12 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/service/impl/BizOrderServiceImpl.java

@@ -143,6 +143,10 @@ public class BizOrderServiceImpl extends ServiceImpl<BizOrderMapper, BizOrder> i
         if(ObjectUtil.isNotEmpty(bizOrderPageParam.getOrderSource())){
             queryWrapper.eq("bo.order_source",bizOrderPageParam.getOrderSource());
         }
+        //订单类型
+        if(ObjectUtil.isNotEmpty(bizOrderPageParam.getOrderType())){
+            queryWrapper.eq("bo.order_type",bizOrderPageParam.getOrderType());
+        }
         //关键字
         if(ObjectUtil.isNotEmpty(bizOrderPageParam.getSearchKey())){
             queryWrapper.and(wrapper->wrapper.like("bo.order_number",bizOrderPageParam.getSearchKey()).or().
@@ -159,7 +163,14 @@ public class BizOrderServiceImpl extends ServiceImpl<BizOrderMapper, BizOrder> i
         // 校验数据范围
         List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
         if(ObjectUtil.isEmpty(loginUserDataScope)) {
-            queryWrapper.eq("bo.customer_id", StpLoginUserUtil.getLoginUser().getCustomerId());
+            if(StpLoginUserUtil.getLoginUser().getRoleCodeList().contains("customer")){
+                //用友客户查询自己签名的物流订单
+                queryWrapper.eq("bo.customer_id", StpLoginUserUtil.getLoginUser().getCustomerId());
+            }
+        }
+        // 供应商角色,查询是自己的
+        if(StpLoginUserUtil.getLoginUser().getRoleCodeList().contains("supplier")){
+            queryWrapper.eq("bo.supplier_id",StpLoginUserUtil.getLoginUser().getCustomerId());
         }
         queryWrapper.eq("bo.delete_flag","NOT_DELETE");
         queryWrapper.orderByDesc("bo.create_time");

+ 24 - 3
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizsettle/service/impl/BizSettleServiceImpl.java

@@ -26,6 +26,7 @@ import jakarta.annotation.Resource;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
 import vip.xiaonuo.biz.modular.bizauditlog.entity.BizAuditLog;
 import vip.xiaonuo.biz.modular.bizauditlog.service.BizAuditLogService;
 import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
@@ -77,12 +78,22 @@ public class BizSettleServiceImpl extends ServiceImpl<BizSettleMapper, BizSettle
             queryWrapper.lambda().eq(BizSettle::getSettleType,bizSettlePageParam.getSettleType());
         }
         if(ObjectUtil.isNotEmpty(bizSettlePageParam.getStartCreateTime()) && ObjectUtil.isNotEmpty(bizSettlePageParam.getEndCreateTime())){
-            String format = DateUtil.format(new Date(), "yyyy-MM-dd");
-            queryWrapper.lambda().between(BizSettle::getCreateTime,format+" 00:00:00",format+" 23:59:59");
+            queryWrapper.lambda().between(BizSettle::getCreateTime,
+                    bizSettlePageParam.getStartCreateTime()+" 00:00:00",
+                    bizSettlePageParam.getEndCreateTime()+" 23:59:59");
         }
         if(ObjectUtil.isNotEmpty(bizSettlePageParam.getSettleStatus())){
             queryWrapper.lambda().eq(BizSettle::getSettleStatus,bizSettlePageParam.getSettleStatus());
         }
+        if(StpLoginUserUtil.getLoginUser().getRoleCodeList().contains("sale")){
+            //销售角色,查询公路运输
+            queryWrapper.lambda().eq(BizSettle::getSettleType,"1");
+        }
+        if(StpLoginUserUtil.getLoginUser().getRoleCodeList().contains("supplier")){
+            //供应商角色,查询自己创建结算单
+            queryWrapper.lambda().eq(BizSettle::getCreateUser,StpLoginUserUtil.getLoginUser().getId());
+        }
+        queryWrapper.lambda().orderByDesc(BizSettle::getCreateTime);
         Page<BizSettle> page = this.page(CommonPageRequest.defaultPage(), queryWrapper);
         return page;
     }
@@ -94,7 +105,7 @@ public class BizSettleServiceImpl extends ServiceImpl<BizSettleMapper, BizSettle
         if(ObjectUtil.isNotEmpty(bizSettleAddParam.getSettleAccount())){
             BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
             if(bizSettleAddParam.getSettleAccount().compareTo(bizConfig.getSettleAccount()) < 0){
-                throw new CommonException("结算总金额低于结算基础金额,不可计算!");
+                throw new CommonException("结算基础金额为{},低于该金额不可结算!",bizConfig.getSettleAccount());
             }
         }
 
@@ -141,8 +152,18 @@ public class BizSettleServiceImpl extends ServiceImpl<BizSettleMapper, BizSettle
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void edit(BizSettleEditParam bizSettleEditParam) {
+
+        if(ObjectUtil.isNotEmpty(bizSettleEditParam.getSettleAccount())){
+            BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
+            if(bizSettleEditParam.getSettleAccount().compareTo(bizConfig.getSettleAccount()) < 0){
+                throw new CommonException("结算基础金额为{},低于该金额不可结算!",bizConfig.getSettleAccount());
+            }
+        }
         BizSettle bizSettle = this.queryEntity(bizSettleEditParam.getId());
         BeanUtil.copyProperties(bizSettleEditParam, bizSettle);
+        if(StringUtils.equals(bizSettle.getSettleStatus(),"3")){
+            bizSettle.setSettleStatus("2");
+        }
         this.updateById(bizSettle);
 
         //删除之前关联信息

+ 15 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/record/controller/BizRecordController.java

@@ -318,6 +318,21 @@ public class BizRecordController {
         return CommonResult.ok();
     }
 
+    /**
+     * 二次过磅mqtt确认
+     *
+     * @author
+     * @date 2025/01/02 16:34
+     */
+    @Operation(summary = "二次过磅mqtt确认")
+    @CommonLog("二次过磅mqtt确认")
+    @PostMapping("/biz/record/mqttConfirm")
+    @CommonNoRepeat
+    public CommonResult<String> mqttConfirm(@RequestBody @Valid BizRecordEditParam bizRecordEditParam) {
+        bizRecordService.mqttConfirm(bizRecordEditParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 修改卸货重量
      *

+ 3 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/record/service/BizRecordService.java

@@ -194,6 +194,9 @@ public interface BizRecordService extends IService<BizRecord> {
     /**司机确认*/
     void updateDriverSign(BizRecordEditParam bizRecordEditParam);
 
+    /**mqtt确认*/
+    void mqttConfirm(BizRecordEditParam bizRecordEditParam);
+
     /**修改卸货重量*/
     void updateWeight(BizRecordEditParam bizRecordEditParam);
 

+ 47 - 21
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/record/service/impl/BizRecordServiceImpl.java

@@ -49,6 +49,8 @@ import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
 import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecordService;
 import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
 import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
+import vip.xiaonuo.biz.modular.bizexcessconfig.entity.BizExcessConfig;
+import vip.xiaonuo.biz.modular.bizexcessconfig.service.BizExcessConfigService;
 import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
 import vip.xiaonuo.biz.modular.bizorder.param.BizOrderEditParam;
 import vip.xiaonuo.biz.modular.bizorder.service.BizOrderService;
@@ -112,6 +114,9 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
     @Resource
     private CommonProperties commonProperties;
 
+    @Resource
+    private BizExcessConfigService bizExcessConfigService;
+
     @Override
     public Page<BizRecord> page(BizRecordPageParam bizRecordPageParam) {
         QueryWrapper<BizRecord> queryWrapper = getQueryWrapper(bizRecordPageParam);
@@ -591,6 +596,18 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
     @Override
     public void updateDriverSign(BizRecordEditParam bizRecordEditParam) {
         BizRecord bizRecord = this.queryEntity(bizRecordEditParam.getId());
+        if(ObjectUtil.isNotEmpty(bizRecord.getAppointmentId())){
+            BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
+            if(ObjectUtil.isNotNull(appointmentRecord) && ObjectUtil.isNotEmpty(appointmentRecord.getOverId())){
+                //查询超限重量
+                BizExcessConfig excessConfig = bizExcessConfigService.getById(appointmentRecord.getOverId());
+                if(ObjectUtil.isNotNull(excessConfig)){
+                    if(bizRecord.getGrossWeight().compareTo(excessConfig.getExcessWeight()) > 0){
+                        throw new CommonException("当前车辆超限,请先卸货再确认!");
+                    }
+                }
+            }
+        }
         if(ObjectUtil.isEmpty(bizRecordEditParam.getDriverSign())){
             throw new CommonException("签名不能为空!");
         }
@@ -605,27 +622,6 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
         bizRecord.setDriverConfirmTime(new Date());
         this.updateById(bizRecord);
 
-        //修改预约记录状态
-        BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
-        if(ObjectUtil.isNotNull(appointmentRecord)){
-            BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
-            if(StringUtils.equals(bizConfig.getAccessControlSwitch(),"1")){
-                //开启门禁校验
-                //司机签名后修改为可出场状态
-                appointmentRecord.setStatus("9");
-            }else{
-                appointmentRecord.setStatus("10");
-            }
-            bizAppointmentRecordService.updateById(appointmentRecord);
-        }
-
-        //司机确认后,修改订单
-        BizOrder bizOrder = bizOrderService.getById(bizRecord.getOrderId());
-        if(ObjectUtil.isNotNull(bizOrder)){
-            bizOrder.setNetWeight(bizOrder.getNetWeight().add(bizRecord.getNetWeight()));
-            bizOrderService.updateById(bizOrder);
-        }
-
         Map<String,Object> map = Maps.newHashMap();
         map.put("id",bizRecord.getRelationId());
         map.put("type","0");
@@ -635,6 +631,36 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
         log.info("司机确认mqtt下发车牌号:"+bizRecord.getLicensePlate());
     }
 
+    @Transactional
+    public void mqttConfirm(BizRecordEditParam bizRecordEditParam){
+        BizRecord bizRecord = this.getOne(new QueryWrapper<BizRecord>().lambda().
+                eq(BizRecord::getRelationId, bizRecordEditParam.getId()).
+                last("limit 1"));
+        if(ObjectUtil.isNotNull(bizRecord)){
+            //修改预约记录状态
+            BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
+            if(ObjectUtil.isNotNull(appointmentRecord)){
+                BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
+                if(StringUtils.equals(bizConfig.getAccessControlSwitch(),"1")){
+                    //开启门禁校验
+                    //司机签名后修改为可出场状态
+                    appointmentRecord.setStatus("9");
+                }else{
+                    appointmentRecord.setStatus("10");
+                }
+                bizAppointmentRecordService.updateById(appointmentRecord);
+            }
+
+            //司机确认后,修改订单重量
+            BizOrder bizOrder = bizOrderService.getById(bizRecord.getOrderId());
+            if(ObjectUtil.isNotNull(bizOrder)){
+                bizOrder.setNetWeight(bizOrder.getNetWeight().add(bizRecord.getNetWeight()));
+                bizOrderService.updateById(bizOrder);
+            }
+        }
+
+    }
+
     @Transactional
     @Override
     public void updateWeight(BizRecordEditParam bizRecordEditParam) {

+ 1 - 0
snowy-web-app/src/main/java/vip/xiaonuo/core/config/GlobalConfigure.java

@@ -192,6 +192,7 @@ public class GlobalConfigure implements WebMvcConfigurer {
             "/biz/bizaccessrecord/add",
             "/biz/record/push",
             "/biz/record/edit",
+            "/biz/record/mqttConfirm",
 
             "/thirdPart/v1/**",