梁彦春 пре 6 година
родитељ
комит
21c6acee49

+ 23
- 6
src/main/java/com.huiju.welcome/controller/TaCustomerTransferController.java Прегледај датотеку

1
 package com.huiju.welcome.controller;
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
 import com.huiju.welcome.common.base.BaseController;
6
 import com.huiju.welcome.common.base.BaseController;
5
 import com.huiju.welcome.common.base.ResponseBean;
7
 import com.huiju.welcome.common.base.ResponseBean;
6
 import com.huiju.welcome.model.TaCustomer;
8
 import com.huiju.welcome.model.TaCustomer;
7
 import com.huiju.welcome.model.TaCustomerTransfer;
9
 import com.huiju.welcome.model.TaCustomerTransfer;
10
+import com.huiju.welcome.model.TdGoodsType;
8
 import com.huiju.welcome.service.ITaCustomerService;
11
 import com.huiju.welcome.service.ITaCustomerService;
9
 import com.huiju.welcome.service.ITaCustomerTransferService;
12
 import com.huiju.welcome.service.ITaCustomerTransferService;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
10
 import org.slf4j.Logger;
15
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
16
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
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
 import java.time.LocalDateTime;
20
 import java.time.LocalDateTime;
21
 
21
 
125
         }
125
         }
126
         return responseBean;
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 Прегледај датотеку

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

+ 18
- 0
src/main/java/com.huiju.welcome/mapper/TaCustomerTransferMapper.java Прегледај датотеку

2
 
2
 
3
 
3
 
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.huiju.welcome.model.TaCustomerTransfer;
6
 import com.huiju.welcome.model.TaCustomerTransfer;
7
+import com.huiju.welcome.model.TdGoodsType;
8
+import io.swagger.models.auth.In;
6
 import org.apache.ibatis.annotations.Mapper;
9
 import org.apache.ibatis.annotations.Mapper;
10
+import org.apache.ibatis.annotations.Param;
7
 
11
 
8
 /**
12
 /**
9
  * <p>
13
  * <p>
16
 @Mapper
20
 @Mapper
17
 public interface TaCustomerTransferMapper extends BaseMapper<TaCustomerTransfer> {
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 Прегледај датотеку

1
 package com.huiju.welcome.service;
1
 package com.huiju.welcome.service;
2
 
2
 
3
 
3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.baomidou.mybatisplus.extension.service.IService;
6
+import com.huiju.welcome.common.base.ResponseBean;
5
 import com.huiju.welcome.model.TaCustomerTransfer;
7
 import com.huiju.welcome.model.TaCustomerTransfer;
6
 
8
 
7
 /**
9
 /**
14
  */
16
  */
15
 public interface ITaCustomerTransferService extends IService<TaCustomerTransfer> {
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 Прегледај датотеку

1
 package com.huiju.welcome.service.impl;
1
 package com.huiju.welcome.service.impl;
2
 
2
 
3
 
3
 
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
+import com.huiju.welcome.common.base.ResponseBean;
5
 import com.huiju.welcome.mapper.TaCustomerTransferMapper;
7
 import com.huiju.welcome.mapper.TaCustomerTransferMapper;
6
 import com.huiju.welcome.model.TaCustomerTransfer;
8
 import com.huiju.welcome.model.TaCustomerTransfer;
7
 import com.huiju.welcome.service.ITaCustomerTransferService;
9
 import com.huiju.welcome.service.ITaCustomerTransferService;
10
+import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.stereotype.Service;
11
 import org.springframework.stereotype.Service;
9
 
12
 
10
 /**
13
 /**
17
  */
20
  */
18
 @Service
21
 @Service
19
 public class TaCustomerTransferServiceImpl extends ServiceImpl<TaCustomerTransferMapper, TaCustomerTransfer> implements ITaCustomerTransferService {
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 Прегледај датотеку

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 Прегледај датотеку

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