From 769b5faa1169ab3945ca7d8f487c19047863a0bd Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Wed, 28 Jul 2021 17:54:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=8A=A1=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/custom/SysOrderController.java | 3 ++ .../com/stdiet/custom/domain/SysOrder.java | 6 +++ .../service/impl/SysOrderServiceImpl.java | 23 ++++++++ .../com/stdiet/custom/utils/OrderUtils.java | 2 +- .../mapper/custom/SysCommisionMapper.xml | 8 +++ .../mapper/custom/SysOrderMapper.xml | 13 ++++- stdiet-ui/src/components/OrderAdd/index.vue | 52 ++++++++++++++++--- .../src/components/OrderDetail/index.vue | 5 +- stdiet-ui/src/components/OrderEdit/index.vue | 32 +++++++++--- stdiet-ui/src/store/getters.js | 3 +- stdiet-ui/src/store/modules/global.js | 4 +- stdiet-ui/src/utils/orderType.js | 5 ++ stdiet-ui/src/views/custom/order/index.vue | 34 +++++++++--- 13 files changed, 165 insertions(+), 25 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysOrderController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysOrderController.java index 2824ce842..fa1719d47 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysOrderController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysOrderController.java @@ -171,6 +171,9 @@ public class SysOrderController extends OrderBaseController { if (user.getUserId().equals(order.getPushPreSaleId())) { order.setPushPreSale(user.getNickName()); } + if (user.getUserId().equals(order.getBusinessAffairId())) { + order.setBusinessAffair(user.getNickName()); + } } order.setOrderTypeName(OrderUtils.getOrderTypeName(order)); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java index 5c206c66c..1dece95c8 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysOrder.java @@ -188,6 +188,12 @@ public class SysOrder extends BaseEntity { @Excel(name = "运营助理") private String operatorAssis; + /** 商务ID */ + private Long businessAffairId; + + /** 商务*/ + private String businessAffair; + /** * 推荐人 */ diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java index 3e22eddef..66bf11ab6 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysOrderServiceImpl.java @@ -214,6 +214,20 @@ public class SysOrderServiceImpl implements ISysOrderService { } } } + //商务订单 + else if("4".equals(sysOrder.getOrderType())){ + sysOrder.setNutritionistId((sysOrder.getNutritionistIdList() != null && sysOrder.getNutritionistIdList().length > 0) ? sysOrder.getNutritionistIdList()[0] : null); + sysOrder.setMainOrderId(0L); + sysOrder.setAfterSaleCommissOrder(0); + sysOrder.setPreSaleId(null); + sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); + sysOrder.setPlannerId(null); + sysOrder.setPlannerAssisId(null); + sysOrder.setOperatorId(null); + sysOrder.setOperatorAssisId(null); + row = sysOrderMapper.insertSysOrder(sysOrder); + } return row; } @@ -273,6 +287,15 @@ public class SysOrderServiceImpl implements ISysOrderService { if("3".equals(sysOrder.getOrderType())){ sysOrder.setPreSaleId(null); } + if("4".equals(sysOrder.getOrderType())){ + sysOrder.setPreSaleId(null); + sysOrder.setOnSaleId(null); + sysOrder.setPushPreSaleId(null); + sysOrder.setPlannerId(null); + sysOrder.setPlannerAssisId(null); + sysOrder.setOperatorId(null); + sysOrder.setOperatorAssisId(null); + } if(oldSysOrder.getStartTime() == null){//确保提成计算时间不为空 sysOrder.setCommissStartTime(sysOrder.getOrderTime()); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java b/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java index 9c86dbf32..96c68be4c 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/utils/OrderUtils.java @@ -4,7 +4,7 @@ import com.stdiet.custom.domain.SysOrder; public class OrderUtils { - private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单","售中单"}; + private static final String[] orderTypeArray = {"普通单","比例拆分单","体验单","售中单","商务单"}; private static final String[] orderCountTypeArray = {"一开单","二开单","一开单(拆分)","二开单(拆分)"}; diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml index 9fced82a6..2adfd0325 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml @@ -77,6 +77,14 @@ UNION + + + + + + + + UNION diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml index fe8aa5b08..e02ac9243 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml @@ -41,6 +41,7 @@ + @@ -64,7 +65,7 @@ o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id, o.recommender, o.order_time,o.give_serve_day,o.conditioning_project_id,cp.dict_label as conditioning_project,o.server_end_time, - o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted,o.push_pre_sale_id + o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted,o.push_pre_sale_id,o.business_affair_id from sys_order o LEFT JOIN sys_customer sc ON sc.id = o.cus_id LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id @@ -127,6 +128,9 @@ and o.on_sale_id = #{onSaleId} + + and o.business_affair_id = #{businessAffairId} + and o.after_sale_id = #{afterSaleId} and o.nutritionist_id = #{nutritionistId} and o.nutri_assis_id = #{nutriAssisId} @@ -185,6 +189,9 @@ and o.on_sale_id = #{onSaleId} + + and o.business_affair_id = #{businessAffairId} + and pre_sale_id = #{preSaleId} and after_sale_id = #{afterSaleId} and nutritionist_id = #{nutritionistId} @@ -252,6 +259,7 @@ operator_id, serve_time_id, recommender, + business_affair_id, push_pre_sale_id, amount, order_time, @@ -296,6 +304,7 @@ #{operatorId}, #{serveTimeId}, #{recommender}, + #{businessAffairId}, #{pushPreSaleId}, #{amount}, #{orderTime}, @@ -343,6 +352,7 @@ operator_id = #{operatorId}, serve_time_id = #{serveTimeId}, recommender = #{recommender}, + business_affair_id = #{businessAffairId}, push_pre_sale_id = #{pushPreSaleId}, amount = #{amount}, order_time = #{orderTime}, @@ -415,6 +425,7 @@ + diff --git a/stdiet-ui/src/components/OrderAdd/index.vue b/stdiet-ui/src/components/OrderAdd/index.vue index 7fd42f1c1..da543fdea 100644 --- a/stdiet-ui/src/components/OrderAdd/index.vue +++ b/stdiet-ui/src/components/OrderAdd/index.vue @@ -111,7 +111,7 @@ - + @@ -124,6 +124,18 @@ + + + + + + + - + @@ -217,7 +229,7 @@ - + @@ -230,7 +242,7 @@ - + @@ -243,7 +255,7 @@ - + @@ -481,6 +493,8 @@ export default { pushPreSaleShow: false, //售后、营养师、营养师助理是否显示 afterNutiShow: true, + //商务订单 + businessAffairShow: false }; }, created() { @@ -546,7 +560,9 @@ export default { // 运营助理字典 "operatorAssisIdOptions", //售前推送 - "pushPreSaleIdOptions" + "pushPreSaleIdOptions", + //商务 + "bdOptions" ]), }, methods: { @@ -662,6 +678,25 @@ export default { return false; } } + }else if(this.form.orderTypeList[0] == 4){ + //商务不能为空 + if(this.form.businessAffairId == null || this.form.businessAffairId <= 0){ + this.$message({ + type: 'warning', + message: '商务不能为空', + center: true + }); + return false; + } + //营养师不能为空 + if(this.form.nutritionistIdList == null || this.form.nutritionistIdList.length != 1 || this.form.nutritionistIdList[0] <= 0){ + this.$message({ + type: 'warning', + message: '营养师不能为空,普通单只能选择一个营养师', + center: true + }); + return false; + } } return true; }, @@ -731,6 +766,7 @@ export default { pauseTime: null, payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null, preSaleId: defaultPresale ? parseInt(defaultPresale.dictValue) : null, + businessAffairId: null, pushPreSaleId: null, recipesPlanContinue: 1, createBy: null, @@ -815,7 +851,7 @@ export default { // }, "form.orderTypeList": function (newVal, oldVal) { //判断订单类型是否选择了二开 - if (newVal[1] == 1 || newVal[1] == 3) { + if ((newVal[1] == 1 || newVal[1] == 3) && newVal[0] != 4) { this.form.secondAfterSaleFlag = 1; this.secondAfterSaleFlagShow = true; } else { @@ -867,6 +903,8 @@ export default { this.onSaleShow = false; } } + //是否选择了商务单 + this.businessAffairShow = newVal[0] == 4; }, }, }; diff --git a/stdiet-ui/src/components/OrderDetail/index.vue b/stdiet-ui/src/components/OrderDetail/index.vue index ced246c13..a8f2a422a 100644 --- a/stdiet-ui/src/components/OrderDetail/index.vue +++ b/stdiet-ui/src/components/OrderDetail/index.vue @@ -73,7 +73,7 @@ export default { ["订单类型","审核状态", "成交时间"], ["调理项目","姓名", "手机号"], ["金额","收款方式", "收款账号"], - ["服务时长","赠送时长", "售前"], + ["服务时长","赠送时长", "售前/商务"], ["售前推送","售中","售后"], ["营养师","助理营养师","策划"], ["策划助理","运营","运营助理"], @@ -112,6 +112,9 @@ export default { getInfoDetail({ orderId }).then((response) => { response.data.weight = response.data.weight != null ? response.data.weight + "斤" : ""; response.data.giveServeDay = response.data.giveServeDay != null ? response.data.giveServeDay + "天" : ""; + if(response.data.orderType == 4){ + response.data.preSale = response.data.businessAffair; + } for (let i = 0; i < this.orderTitleData.length; i++) { this.orderDetailList.push({ attr_name_one: this.orderTitleData[i][0], diff --git a/stdiet-ui/src/components/OrderEdit/index.vue b/stdiet-ui/src/components/OrderEdit/index.vue index 706f09328..c214fed80 100644 --- a/stdiet-ui/src/components/OrderEdit/index.vue +++ b/stdiet-ui/src/components/OrderEdit/index.vue @@ -90,7 +90,7 @@ - + - + + + + + + + @@ -163,7 +174,7 @@ - + - + - + - + state.global.plannerAssisIdOptions, operatorIdOptions: state => state.global.operatorIdOptions, operatorAssisIdOptions: state => state.global.operatorAssisIdOptions, - pushPreSaleIdOptions: state => state.global.pushPreSaleIdOptions + pushPreSaleIdOptions: state => state.global.pushPreSaleIdOptions, + bdOptions: state => state.global.bdOptions }; export default getters; diff --git a/stdiet-ui/src/store/modules/global.js b/stdiet-ui/src/store/modules/global.js index c0dfee00b..b93604e42 100644 --- a/stdiet-ui/src/store/modules/global.js +++ b/stdiet-ui/src/store/modules/global.js @@ -11,7 +11,8 @@ const oriState = { operatorIdOptions: [], operatorAssisIdOptions: [], msgUnreadCount: 0, - pushPreSaleIdOptions:[] + pushPreSaleIdOptions:[], + bdOptions:[] }; const mutations = { @@ -51,6 +52,7 @@ const actions = { operatorIdOptions: options["operator"] || [], operatorAssisIdOptions: options["operator_assis"] || [], pushPreSaleIdOptions: options["push_pre_sale"] || [], + bdOptions: options["bd"] || [], }); } }; diff --git a/stdiet-ui/src/utils/orderType.js b/stdiet-ui/src/utils/orderType.js index 6b9d7fd8b..55bec0f4b 100644 --- a/stdiet-ui/src/utils/orderType.js +++ b/stdiet-ui/src/utils/orderType.js @@ -75,6 +75,11 @@ export const orderTypeArray = [ value: 3, label: "售中单", children: orderCountExtendedTypeArray + }, + { + value: 4, + label: "商务单", + children: orderCountTypeArray } ] diff --git a/stdiet-ui/src/views/custom/order/index.vue b/stdiet-ui/src/views/custom/order/index.vue index 0814b0da4..896ad2903 100644 --- a/stdiet-ui/src/views/custom/order/index.vue +++ b/stdiet-ui/src/views/custom/order/index.vue @@ -88,6 +88,24 @@ + + + + + + + - - + + - - - + - +