Переглянути джерело

web端 订单列表、退款列表、用户管理列表 权限校验

LiRong 1 день тому
батько
коміт
5158833f16

+ 8 - 0
leromro-admin/src/main/java/com/leromro/web/controller/system/SysUserController.java

@@ -177,6 +177,14 @@ public class SysUserController extends BaseController
         }
         user.setCreateBy(getUsername());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        SysDept sysDept = deptService.selectDeptById(user.getDeptId());
+        user.setProvinceCode(sysDept.getProvinceCode());
+        user.setProvinceName(sysDept.getProvinceName());
+        user.setCityCode(sysDept.getCityCode());
+        user.setCityName(sysDept.getCityName());
+        user.setDistrictCode(sysDept.getDistrictCode());
+        user.setDistrictName(sysDept.getDistrictName());
+        user.setAreaType(sysDept.getAreaType());
         return toAjax(userService.insertUser(user));
     }
 

+ 29 - 0
leromro-core/src/main/java/com/leromro/core/domain/OrderRefund.java

@@ -113,4 +113,33 @@ public class OrderRefund extends BaseEntity {
     private Integer refundType;
 
 
+    /** 省级区划编号 */
+    @TableField("province_code")
+    @ApiModelProperty("省级区划编号")
+    private String provinceCode;
+
+    /** 省级名称 */
+    @TableField("province_name")
+    @ApiModelProperty("省级名称")
+    private String provinceName;
+
+    /** 市级编号 */
+    @TableField("city_code")
+    @ApiModelProperty("市级编号")
+    private String cityCode;
+
+    /** 市级名称 */
+    @TableField("city_name")
+    @ApiModelProperty("市级名称")
+    private String cityName;
+
+    /** 区级区划编号 */
+    @TableField("district_code")
+    @ApiModelProperty("区级区划编号")
+    private String districtCode;
+
+    /** 区级名称 */
+    @TableField("district_name")
+    @ApiModelProperty("区级名称")
+    private String districtName;
 }

+ 1 - 2
leromro-core/src/main/java/com/leromro/core/domain/vo/SecondOrderInfoVO.java

@@ -139,7 +139,6 @@ public class SecondOrderInfoVO {
     @ApiModelProperty("纬度")
     private String latitude;
 
-    @TableField("out_trade_no")
     @ApiModelProperty("业务单号")
-    private String outTradeNo;
+    private String secondOutTradeNo;
 }

+ 2 - 1
leromro-core/src/main/java/com/leromro/core/mapper/MainOrdersMapper.java

@@ -1,6 +1,7 @@
 package com.leromro.core.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.leromro.common.core.domain.ListPermission;
 import com.leromro.core.domain.MainOrders;
 import com.leromro.core.domain.dto.WebMainOrdersDTO;
 import com.leromro.core.domain.vo.MainOrderInfoVO;
@@ -16,7 +17,7 @@ public interface MainOrdersMapper extends BaseMapper<MainOrders> {
 
      List<MainOrdersVO> selectByUserId(@Param("orderStatus") String[] orderStatus, @Param("userId") Long userId);
 
-    List<webMainOrderListVO> webMainOrderList(WebMainOrdersDTO dto);
+    List<webMainOrderListVO> webMainOrderList(ListPermission listPermission,@Param("dto") WebMainOrdersDTO dto);
 
     void startService(Long secondOrderId);
 

+ 3 - 1
leromro-core/src/main/java/com/leromro/core/mapper/OrderRefundMapper.java

@@ -2,10 +2,12 @@ package com.leromro.core.mapper;
 
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.leromro.common.core.domain.ListPermission;
 import com.leromro.core.domain.MainOrders;
 import com.leromro.core.domain.OrderRefund;
 import com.leromro.core.domain.vo.OrderRefundVO;
 import com.leromro.core.domain.vo.WebOrderRefundVO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 订单取消/退款Mapper接口
@@ -67,5 +69,5 @@ public interface OrderRefundMapper extends BaseMapper<OrderRefund>
 
     void updateList(List<OrderRefund> orderRefundList);
 
-    List<WebOrderRefundVO> selectWebOrderRefundList(MainOrders mainOrders);
+    List<WebOrderRefundVO> selectWebOrderRefundList(ListPermission listPermission,@Param("mainOrders") MainOrders mainOrders);
 }

+ 3 - 1
leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.leromro.common.constant.CommonConstants;
+import com.leromro.common.core.domain.ListPermission;
 import com.leromro.common.core.domain.R;
 import com.leromro.common.core.domain.entity.SysDept;
 import com.leromro.common.core.domain.entity.SysUser;
@@ -360,7 +362,7 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
 
     @Override
     public List<webMainOrderListVO> webMainOrderList(WebMainOrdersDTO dto) {
-        List<webMainOrderListVO> vos = baseMapper.webMainOrderList(dto);
+            List<webMainOrderListVO> vos = baseMapper.webMainOrderList(new ListPermission(MainOrders.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT) ,dto);
         return vos;
     }
 

+ 3 - 1
leromro-core/src/main/java/com/leromro/core/service/impl/OrderRefundServiceImpl.java

@@ -16,7 +16,9 @@ import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
 import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.leromro.common.constant.CommonConstants;
 import com.leromro.common.core.domain.AjaxResult;
+import com.leromro.common.core.domain.ListPermission;
 import com.leromro.common.exception.ServiceException;
 import com.leromro.common.utils.SecurityUtils;
 import com.leromro.core.domain.*;
@@ -346,7 +348,7 @@ public class OrderRefundServiceImpl extends ServiceImpl<OrderRefundMapper, Order
      */
     @Override
     public List<WebOrderRefundVO> selectWebOrderRefundList(MainOrders mainOrders) {
-        return lOrderRefundMapper.selectWebOrderRefundList(mainOrders);
+        return lOrderRefundMapper.selectWebOrderRefundList(new ListPermission(OrderRefund.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT) ,mainOrders);
     }
 
     //修改志愿者的工作时间

+ 5 - 5
leromro-core/src/main/resources/mapper/core/MainOrdersMapper.xml

@@ -141,12 +141,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select lmo.*,lvi.project_name,lvi.business_tier_name,lvi.name,lvi.phonenumber
         from l_main_orders lmo left join l_volunteer_info lvi on lmo.volunteer_info_id = lvi.volunteer_info_id
         <where>
-            <if test="name != null and name !=''">and lvi.name = #{name}</if>
-            <if test="clientTelephone != null and clientTelephone != ''">and lmo.client_telephone = #{clientTelephone}</if>
-            <if test="phonenumber != null and phonenumber != ''">and lvi.phonenumber = #{phonenumber}</if>
-            <if test="businessManagementId != null and businessManagementId != ''">and lvi.business_management_id = #{businessManagementId}</if>
+            <if test="dto.name != null and dto.name !=''">and lvi.name = #{dto.name}</if>
+            <if test="dto.clientTelephone != null and dto.clientTelephone != ''">and lmo.client_telephone = #{dto.clientTelephone}</if>
+            <if test="dto.phonenumber != null and dto.phonenumber != ''">and lvi.phonenumber = #{dto.phonenumber}</if>
+            <if test="dto.businessManagementId != null and dto.businessManagementId != ''">and lvi.business_management_id = #{dto.businessManagementId}</if>
         </where>
-        order by create_time desc
+        order by lmo.create_time desc
     </select>
     <select id="selectWebMainOrderInfoVO" resultType="com.leromro.core.domain.vo.WebMainOrdersInfoVO"
             parameterType="java.lang.Long">

+ 4 - 4
leromro-core/src/main/resources/mapper/core/OrderRefundMapper.xml

@@ -86,10 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from l_order_refund lor
         left join  l_main_orders lmo on lmo.main_order_id = lor.main_order_id
         <where>
-            <if test="orderStatus != null and orderStatus != ''">and lmo.order_status = #{orderStatus}</if>
-            <if test="clientName != null and clientName != ''">and lmo.client_name = #{clientName}</if>
-            <if test="clientTelephone != null and clientTelephone != ''">and lmo.clien_telephone = #{clientTelephone}</if>
-            <if test="businessManagementId != null and businessManagementId != ''">and lmo.business_management_id = #{businessManagementId}</if>
+            <if test="mainOrders.orderStatus != null and mainOrders.orderStatus != ''">and lmo.order_status = #{mainOrders.orderStatus}</if>
+            <if test="mainOrders.clientName != null and mainOrders.clientName != ''">and lmo.client_name = #{mainOrders.clientName}</if>
+            <if test="mainOrders.clientTelephone != null and mainOrders.clientTelephone != ''">and lmo.clien_telephone = #{mainOrders.clientTelephone}</if>
+            <if test="mainOrders.businessManagementId != null and mainOrders.businessManagementId != ''">and lmo.business_management_id = #{mainOrders.businessManagementId}</if>
         </where>
 
     </select>

+ 1 - 1
leromro-core/src/main/resources/mapper/core/SecondOrdersMapper.xml

@@ -428,7 +428,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             lso.second_order_id,lso.score,lso.service_total_price,lso.order_status,lso.volunteer_settlement_status,lso.address,
             lso.volunteer_review,lso.volunteer_picture,lso.service_category,lso.user_review,lso.user_picture,
             lso.ability_score,lso.clothing_score,lso.protocol_score,lso.quality_score,lso.province_code,lso.province_name,lso.city_name,lso.city_code,
-            lso.work_date,lso.work_start_time,lso.single_quantity,lso.work_number,lso.service_duration,
+            lso.work_date,lso.work_start_time,lso.single_quantity,lso.work_number,lso.out_trade_no as secondOutTradeNo,lso.service_duration,
             (select sd.dept_name from sys_dept sd where lso.area_distribution_id = sd.dept_id) as areaDistributionName,
             (select sd.dept_name from sys_dept sd where lso.service_center_id = sd.dept_id) as serviceCenterName
         from l_second_order lso where lso.main_order_id = #{mainOrderId};

+ 2 - 1
leromro-system/src/main/java/com/leromro/system/mapper/SysUserMapper.java

@@ -3,6 +3,7 @@ package com.leromro.system.mapper;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.leromro.common.core.domain.ListPermission;
 import org.apache.ibatis.annotations.Param;
 import com.leromro.common.core.domain.entity.SysUser;
 
@@ -127,5 +128,5 @@ public interface SysUserMapper extends BaseMapper<SysUser>
      */
     public SysUser checkEmailUnique(String email);
 
-    List<SysUser> userList(SysUser user);
+    List<SysUser> userList(ListPermission listPermission, SysUser user);
 }

+ 3 - 1
leromro-system/src/main/java/com/leromro/system/service/impl/SysUserServiceImpl.java

@@ -7,6 +7,8 @@ import javax.validation.Validator;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.leromro.common.constant.CommonConstants;
+import com.leromro.common.core.domain.ListPermission;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -559,6 +561,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Override
     public List<SysUser> userList(SysUser user) {
 
-        return baseMapper.userList(user);
+        return baseMapper.userList(new ListPermission(SysUser.class, CommonConstants.CHECK_PROVINCE_CITY_DISTRICT) ,user);
     }
 }

+ 1 - 1
leromro-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -156,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
 	</select>
 	<select id="userList" resultType="com.leromro.common.core.domain.entity.SysUser">
-		select * from sys_user where del_flag = '0' and user_or_worker != 0
+		select * from sys_user where del_flag = '0' /*and user_or_worker != 0*/
 	</select>
 
 	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">