梁彦春 6 yıl önce
ebeveyn
işleme
21c6acee49

+ 23
- 6
src/main/java/com.huiju.welcome/controller/TaCustomerTransferController.java Dosyayı Görüntüle

@@ -1,21 +1,21 @@
1 1
 package com.huiju.welcome.controller;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 6
 import com.huiju.welcome.common.base.BaseController;
5 7
 import com.huiju.welcome.common.base.ResponseBean;
6 8
 import com.huiju.welcome.model.TaCustomer;
7 9
 import com.huiju.welcome.model.TaCustomerTransfer;
10
+import com.huiju.welcome.model.TdGoodsType;
8 11
 import com.huiju.welcome.service.ITaCustomerService;
9 12
 import com.huiju.welcome.service.ITaCustomerTransferService;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
10 15
 import org.slf4j.Logger;
11 16
 import org.slf4j.LoggerFactory;
12 17
 import org.springframework.beans.factory.annotation.Autowired;
13
-import org.springframework.web.bind.annotation.PathVariable;
14
-import org.springframework.web.bind.annotation.RequestBody;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RequestMethod;
17
-import org.springframework.web.bind.annotation.ResponseBody;
18
-import org.springframework.web.bind.annotation.RestController;
18
+import org.springframework.web.bind.annotation.*;
19 19
 
20 20
 import java.time.LocalDateTime;
21 21
 
@@ -125,4 +125,21 @@ public class TaCustomerTransferController extends BaseController {
125 125
         }
126 126
         return responseBean;
127 127
     }
128
+
129
+    @ApiOperation(value = "人员流转记录", notes = "人员流转记录")
130
+    @ApiImplicitParams({
131
+    })
132
+    @RequestMapping(value = "/taCustomerTransfer", method = RequestMethod.GET)
133
+    public ResponseBean customerTransferList(@RequestParam(defaultValue = "1") int pageNum,
134
+                                 @RequestParam(defaultValue = "10") int pageSize,
135
+                                 @RequestParam(value = "fromUserName",required = false) String fromUserName,
136
+                                             @RequestParam(value = "fromUserId",required = false) Integer fromUserId,
137
+                                             @RequestParam(value = "toUserName",required = false) String toUserName,
138
+                                             @RequestParam(value = "toUserId",required = false) Integer toUserId) {
139
+        IPage<TaCustomerTransfer> pg = new Page<>(pageNum, pageSize);
140
+
141
+        ResponseBean userManagement= iTaCustomerTransferService.customerTransferList(pg,fromUserName,fromUserId,toUserName,toUserId);
142
+
143
+        return userManagement;
144
+    }
128 145
 }

+ 0
- 1
src/main/java/com.huiju.welcome/controller/TdGoodsTypeController.java Dosyayı Görüntüle

@@ -123,7 +123,6 @@ public class TdGoodsTypeController extends BaseController {
123 123
 
124 124
     @ApiOperation(value = "商品类型列表", notes = "商品类型列表")
125 125
     @ApiImplicitParams({
126
-            @ApiImplicitParam(paramType = "body", dataType = "String", name = "typeName", value = "商品类型名称")
127 126
     })
128 127
     @RequestMapping(value = "/tdGoodsType", method = RequestMethod.GET)
129 128
     public ResponseBean typeList(@RequestParam(defaultValue = "1") int pageNum,

+ 18
- 0
src/main/java/com.huiju.welcome/mapper/TaCustomerTransferMapper.java Dosyayı Görüntüle

@@ -2,8 +2,12 @@ package com.huiju.welcome.mapper;
2 2
 
3 3
 
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
5 6
 import com.huiju.welcome.model.TaCustomerTransfer;
7
+import com.huiju.welcome.model.TdGoodsType;
8
+import io.swagger.models.auth.In;
6 9
 import org.apache.ibatis.annotations.Mapper;
10
+import org.apache.ibatis.annotations.Param;
7 11
 
8 12
 /**
9 13
  * <p>
@@ -16,4 +20,18 @@ import org.apache.ibatis.annotations.Mapper;
16 20
 @Mapper
17 21
 public interface TaCustomerTransferMapper extends BaseMapper<TaCustomerTransfer> {
18 22
 
23
+    /**
24
+     *
25
+     * @param pg
26
+     * @param fromUserName
27
+     * @param fromUserId
28
+     * @param toUserName
29
+     * @param toUserId
30
+     * @return
31
+     */
32
+    IPage<TaCustomerTransfer> customerTransferList(IPage<TaCustomerTransfer> pg,
33
+                                                   @Param("fromUserName") String fromUserName,
34
+                                                   @Param("fromUserId") Integer fromUserId,
35
+                                                   @Param("toUserName") String toUserName,
36
+                                                   @Param("toUserId") Integer toUserId);
19 37
 }

+ 12
- 0
src/main/java/com.huiju.welcome/service/ITaCustomerTransferService.java Dosyayı Görüntüle

@@ -1,7 +1,9 @@
1 1
 package com.huiju.welcome.service;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
6
+import com.huiju.welcome.common.base.ResponseBean;
5 7
 import com.huiju.welcome.model.TaCustomerTransfer;
6 8
 
7 9
 /**
@@ -14,4 +16,14 @@ import com.huiju.welcome.model.TaCustomerTransfer;
14 16
  */
15 17
 public interface ITaCustomerTransferService extends IService<TaCustomerTransfer> {
16 18
 
19
+    /**
20
+     * 商品类型列表
21
+     * @param pg
22
+     * @param fromUserName
23
+     * @param fromUserId
24
+     * @param toUserName
25
+     * @param toUserId
26
+     * @return
27
+     */
28
+    ResponseBean customerTransferList(IPage<TaCustomerTransfer> pg, String fromUserName,Integer fromUserId,String toUserName,Integer toUserId);
17 29
 }

+ 13
- 0
src/main/java/com.huiju.welcome/service/impl/TaCustomerTransferServiceImpl.java Dosyayı Görüntüle

@@ -1,10 +1,13 @@
1 1
 package com.huiju.welcome.service.impl;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
+import com.huiju.welcome.common.base.ResponseBean;
5 7
 import com.huiju.welcome.mapper.TaCustomerTransferMapper;
6 8
 import com.huiju.welcome.model.TaCustomerTransfer;
7 9
 import com.huiju.welcome.service.ITaCustomerTransferService;
10
+import org.springframework.beans.factory.annotation.Autowired;
8 11
 import org.springframework.stereotype.Service;
9 12
 
10 13
 /**
@@ -17,5 +20,15 @@ import org.springframework.stereotype.Service;
17 20
  */
18 21
 @Service
19 22
 public class TaCustomerTransferServiceImpl extends ServiceImpl<TaCustomerTransferMapper, TaCustomerTransfer> implements ITaCustomerTransferService {
23
+    @Autowired
24
+    private TaCustomerTransferMapper taCustomerTransferMapper;
25
+
26
+    @Override
27
+    public ResponseBean customerTransferList(IPage<TaCustomerTransfer> pg, String fromUserName,Integer fromUserId,String toUserName,Integer toUserId) {
28
+        ResponseBean responseBean= new ResponseBean();
29
+        IPage<TaCustomerTransfer> list= taCustomerTransferMapper.customerTransferList(pg,fromUserName,fromUserId,toUserName,toUserId);
30
+        responseBean.addSuccess(list);
31
+        return responseBean;
32
+    }
20 33
 
21 34
 }

+ 26
- 0
src/main/resources/mapper/TaCustomerTransferMapper.xml Dosyayı Görüntüle

@@ -0,0 +1,26 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.welcome.mapper.TaCustomerTransferMapper">
4
+    <select id="customerTransferList" resultType="com.huiju.welcome.model.TaCustomerTransfer">
5
+        select
6
+        *
7
+        from ta_customer_transfer
8
+        <where>
9
+            1=1
10
+            <if test="fromUserId !=null and fromUserId !=''">
11
+                and from_user_id = #{fromUserId}
12
+            </if>
13
+            <if test="fromUserName !=null and fromUserName !=''">
14
+                and from_user_name LIKE CONCAT('%',#{fromUserName},'%')
15
+            </if>
16
+            <if test="toUserId !=null and toUserId !=''">
17
+                and to_user_id = #{toUserId}
18
+            </if>
19
+            <if test="toUserName !=null and toUserName !=''">
20
+                and to_user_name LIKE CONCAT('%',#{toUserName},'%')
21
+            </if>
22
+        </where>
23
+        order by transfer_time desc
24
+    </select>
25
+
26
+</mapper>

+ 2
- 2
src/main/resources/mapper/TaGoodsMapper.xml Dosyayı Görüntüle

@@ -3,8 +3,8 @@
3 3
 <mapper namespace="com.huiju.welcome.mapper.TaGoodsMapper">
4 4
     <select id="goodsList" resultType="com.huiju.welcome.model.TaGoods">
5 5
         select
6
-        g.*
7
-        i.img_url as imgUrl
6
+        g.*,
7
+        i.img_url as imgUrl,
8 8
         t.type_name as typeName
9 9
         from ta_goods g
10 10
         left join ta_goods_img i on g.goods_id = i.goods_id