From c08f3570690ac28feb840dd3c19d11373c1770ed Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Fri, 11 Apr 2025 18:33:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E4=BF=AE=E6=94=B9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD-=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=BA=94=E7=94=A8=E9=85=8D=E7=BD=AE=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=BA=20D:\ruoyi\uploadPath=20-=20=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E5=8A=9F=E8=83=BD=20-=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AE=A2=E5=8D=95=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E6=A0=91=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=8A=9F=E8=83=BD=20-=20=E6=9B=B4=E6=96=B0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=20SQL=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=B3=E8=81=94=E6=9F=A5=E8=AF=A2=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20-=20=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF=20-=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E8=AE=A2=E5=8D=95=E4=BF=A1=E6=81=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E7=AE=80=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- .../templates/manage/delivery/import.html | 2 +- .../templates/manage/order/edit.html | 54 +++++++++++++++++-- .../service/impl/OrderInfoServiceImpl.java | 42 ++++++++------- .../mapper/manage/OrderInfoMapper.xml | 11 ++-- 5 files changed, 79 insertions(+), 34 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index da4aee84..d315f3f4 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -9,7 +9,7 @@ ruoyi: # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: ruoyi/uploadPath + profile: D:\ruoyi\uploadPath # 获取ip地址开关 addressEnabled: false @@ -98,7 +98,7 @@ shiro: # 首页地址 indexUrl: /index # 验证码开关 - captchaEnabled: true + captchaEnabled: false # 验证码类型 math 数字计算 char 字符验证 captchaType: math cookie: diff --git a/ruoyi-admin/src/main/resources/templates/manage/delivery/import.html b/ruoyi-admin/src/main/resources/templates/manage/delivery/import.html index 7d82de79..23f57717 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/delivery/import.html +++ b/ruoyi-admin/src/main/resources/templates/manage/delivery/import.html @@ -1,5 +1,5 @@ - + diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html index 2b4a5d91..29f50cda 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -7,6 +7,7 @@
+

合同档案信息

@@ -85,17 +86,25 @@
- +
- + +
+
+ + + +
+
- +
- + +
@@ -143,7 +152,42 @@ $.operate.save(prefix + "/edit", $('#form-order-edit').serialize()); } } - + function selectDeptTree() { + var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val(); + console.log(deptId) + var url = ctx + "system/user/selectDeptTree/" + deptId; + var options = { + title: '选择部门', + width: "380", + url: url, + callBack: doSubmit + }; + $.modal.openOptions(options); + } + function doSubmit(index, layero){ + var body = $.modal.getChildFrame(index); + $("#treeId").val(body.find('#treeId').val()); + $("#treeName").val(body.find('#treeName').val()); + $.modal.close(index); + } + function selectDeptTreePartener() { + var deptId = $.common.isEmpty($("#treeId1").val()) ? "100" : $("#treeId1").val(); + console.log(deptId) + var url = ctx + "system/user/selectDeptTree/" + deptId; + var options = { + title: '选择部门', + width: "380", + url: url, + callBack: doSubmitPartener + }; + $.modal.openOptions(options); + } + function doSubmitPartener(index, layero){ + var body = $.modal.getChildFrame(index); + $("#treeId1").val(body.find('#treeId').val()); + $("#treeName1").val(body.find('#treeName').val()); + $.modal.close(index); + } $("input[name='orderDate']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java index 5ea2f8d1..1254649b 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java @@ -76,26 +76,28 @@ public class OrderInfoServiceImpl implements IOrderInfoService @Override public int updateOrderInfo(OrderInfo orderInfo) { - List orderListList = orderInfo.getOrderListList(); - Map> operateMap = - orderListList.stream().collect(Collectors.groupingBy(OrderList::getOperateFlag)); - //新增 - List addList = operateMap.get("0"); - if (addList!=null && !addList.isEmpty()){ - orderInfoMapper.batchOrderList(addList); - } - //更新 - List updateList = operateMap.get("1"); - if (updateList!=null && !updateList.isEmpty()){ - - orderInfoMapper.updateListBatch(updateList); - } - //删除 - List deleteList = operateMap.get("2"); - if (deleteList!=null && !deleteList.isEmpty()){ - - orderInfoMapper.logicRemoveListById(deleteList); - } +// List orderListList = orderInfo.getOrderListList(); +// Map> operateMap = +// orderListList.stream().collect(Collectors.groupingBy(OrderList::getOperateFlag)); +// //新增 +// List addList = operateMap.get("0"); +// if (addList!=null && !addList.isEmpty()){ +// orderInfoMapper.batchOrderList(addList); +// } +// //更新 +// List updateList = operateMap.get("1"); +// if (updateList!=null && !updateList.isEmpty()){ +// +// orderInfoMapper.updateListBatch(updateList); +// } +// //删除 +// List deleteList = operateMap.get("2"); +// if (deleteList!=null && !deleteList.isEmpty()){ +// +// orderInfoMapper.logicRemoveListById(deleteList); +// } + orderInfoMapper.deleteOrderListByOrderId(orderInfo.getId()); + insertOrderList(orderInfo); return orderInfoMapper.updateOrderInfo(orderInfo); } diff --git a/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml index 2620aeaa..b6ae7040 100644 --- a/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/manage/OrderInfoMapper.xml @@ -96,11 +96,11 @@ t1.created_at, t1. updated_at, t1.deleted_at, - t2.dept_name, - t3.dept_name + t2.dept_name as order_dept_name, + t3.dept_name as partener_dept_name from order_info t1 left join sys_dept t2 on t1.order_dept = t2.dept_id - left join sys_dept t3 on t1.partener_dept = t2.dept_id + left join sys_dept t3 on t1.partener_dept = t3.dept_id where t1.id = #{id} @@ -245,11 +245,10 @@ - insert into order_list( id, order_id, product_code, quantity, price, amount, remark, created_at, updated_at, - deleted_at) values + insert into order_list( id, order_id, product_code, quantity, price, amount, remark, created_at, updated_at) values ( #{item.id}, #{item.orderId}, #{item.productCode}, #{item.quantity}, #{item.price}, #{item.amount}, - #{item.remark}, #{item.createdAt}, #{item.updatedAt}, #{item.deletedAt}) + #{item.remark}, now(),now())