From 70df292288eca4130f6c2015d57ef85e14ab8462 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Fri, 6 Dec 2024 20:40:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=81=E8=A3=85=E5=A4=87?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/controller/OrderController.java | 2 +- .../material/order/domain/OrderInfoDto.java | 6 ++- .../order/service/impl/OrderServiceImpl.java | 7 ++-- .../mapper/material/device/DevInfoMapper.xml | 2 + .../mapper/material/order/OrderInfoMapper.xml | 40 +++++-------------- 5 files changed, 23 insertions(+), 34 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/controller/OrderController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/controller/OrderController.java index ad136e9..ddf6424 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/controller/OrderController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/controller/OrderController.java @@ -93,7 +93,7 @@ public class OrderController extends BaseController { // 编码设备已退租的先下架 dto.setMaStatus("1"); orderMapper.updateDeviceStatus(dto); - /* } else { + /* } else { // 数量设备已退租的增加库存 orderMapper.updateAddDevCount(dto); }*/ diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java index 30140a6..67dd2f1 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java @@ -61,7 +61,11 @@ public class OrderInfoDto { private String address; @ApiModelProperty(value = "买方承租方用户id") - private String buyerId; + private Integer buyerId; + @ApiModelProperty(value = "买方承租方公司id") + private Integer buyerCompany; + @ApiModelProperty(value = "卖方出租方公司id") + private Integer sellerCompany; @ApiModelProperty(value = "卖方出租方用户id") private String sellerId; diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java index f8ab332..c54f770 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java @@ -64,7 +64,8 @@ public class OrderServiceImpl implements OrderService { String code = "D" + System.currentTimeMillis(); orderInfoDto.setCode(code); Long userid = SecurityUtils.getLoginUser().getUserid(); - orderInfoDto.setBuyerId(userid.toString()); + orderInfoDto.setBuyerId(userid.intValue()); + orderInfoDto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue()); orderInfoDto.setCreater(userid); Integer i = orderMapper.insertOrderInfo(orderInfoDto); j += i; @@ -81,9 +82,9 @@ public class OrderServiceImpl implements OrderService { @Override public List getOrderDetails(OrderInfoDto orderInfoDto) throws Exception { if (orderInfoDto.isFlag()) { - orderInfoDto.setSellerId(SecurityUtils.getLoginUser().getUserid().toString()); + orderInfoDto.setSellerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue()); } else { - orderInfoDto.setBuyerId(SecurityUtils.getLoginUser().getUserid().toString()); + orderInfoDto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue()); } List orderInfoDtos = orderMapper.getOrderDetails(orderInfoDto); diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index b6af77a..cb99b11 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -390,6 +390,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" specification = #{specification}, deposit = #{deposit}, is_active = #{isOperator}, + check_date = #{checkDate}, + check_cycle = #{checkCycle}, update_time = now() where ma_id = #{maId} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml index efdac63..dc71559 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml @@ -5,9 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into ma_order_info (code, order_time, cost, buyer_id, address, creater, create_time) + insert into ma_order_info (code, order_time, cost, buyer_id, address, creater, create_time, buyer_company) values - (#{code}, now(), #{cost}, #{buyerId}, #{address}, #{creater}, now()) + (#{code}, now(), #{cost}, #{buyerId}, #{address}, #{creater}, now(), #{buyerCompany}) INSERT INTO `ma_order_details` ( @@ -86,46 +86,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" moi.code AS code, GROUP_CONCAT(hh.id) AS ids, moi.order_time, - c.company_name AS czcompanyName, + up.dept_name AS czcompanyName, mdi.person_phone AS personPhone, su.phonenumber AS phoneNumber, moi.address, moi.order_id, sum(hh.costs) cost, - dept.companyName + dept.dept_name as companyName FROM ma_order_details hh LEFT JOIN ma_order_info moi ON moi.order_id = hh.order_id LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id - LEFT JOIN bm_company_info c ON mdi.own_co = c.company_id LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id LEFT JOIN sys_user su ON su.user_id = moi.buyer_id - LEFT JOIN ( - SELECT - sd.dept_id AS deptId, - sd1.dept_name AS companyName - FROM - sys_dept sd - JOIN ( - SELECT - CASE - ancestors - WHEN ( '0' ) THEN - dept_id ELSE SUBSTRING_INDEX( SUBSTRING_INDEX( ancestors, ',', 2 ), ',', - 1 ) - END AS first_ancestor, - dept_id - FROM - sys_dept - ) AS subquery ON sd.dept_id = subquery.dept_id - LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor - ) dept ON dept.deptId = su.dept_id + left join sys_dept dept on dept.dept_id = moi.buyer_company + left join sys_dept up on up.dept_id = mdi.own_co WHERE mt.del_flag = '0' - - AND moi.buyer_id = #{buyerId} + + AND moi.buyer_company = #{buyerCompany} - - AND mdi.own_id = #{sellerId} + + AND mdi.own_co = #{sellerCompany} AND mdi.device_name like concat('%',#{deviceName},'%') @@ -148,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt.lease_price BETWEEN #{lowerBound} AND #{upperBound} GROUP BY - c.company_id, + moi.buyer_company, moi.`code`, su.phonenumber, moi.address,