hjc 1 год назад
Родитель
Сommit
27786ae2a9

+ 2 - 1
src/main/java/com/chinaitop/depot/device/controller/BusinessImPurchaseSaleController.java

@@ -7,6 +7,7 @@ import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleEditParam;
7 7
 import com.chinaitop.depot.device.model.param.BusinessImPurchaseSalePageParam;
8 8
 import com.chinaitop.depot.device.service.BusinessImPurchaseSaleService;
9 9
 import com.github.pagehelper.Page;
10
+import com.github.pagehelper.PageInfo;
10 11
 import io.swagger.annotations.Api;
11 12
 import io.swagger.annotations.ApiOperation;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,7 +33,7 @@ public class BusinessImPurchaseSaleController {
32 33
 
33 34
     @GetMapping("/getList")
34 35
     @ApiOperation(value = "查询 采购销售管理 信息列表", notes = "查询 采购销售管理 信息列表")
35
-    public ResponseEntity<Page<BusinessImPurchaseSale>> getList(BusinessImPurchaseSalePageParam pageParam) {
36
+    public ResponseEntity<PageInfo<BusinessImPurchaseSale>> getList(@Validated BusinessImPurchaseSalePageParam pageParam) {
36 37
 
37 38
         return ResponseEntity.ok(businessImPurchaseSaleService.getList(pageParam));
38 39
     }

+ 5 - 2
src/main/java/com/chinaitop/depot/device/mapper/BusinessImPurchaseSaleMapper.java

@@ -7,6 +7,8 @@ import com.github.pagehelper.Page;
7 7
 import org.apache.ibatis.annotations.Mapper;
8 8
 import org.apache.ibatis.annotations.Param;
9 9
 
10
+import java.util.List;
11
+
10 12
 /**
11 13
  * <p>
12 14
  * 智能管理-综合业务管理-采购销售管理表 Mapper 接口
@@ -18,8 +20,9 @@ import org.apache.ibatis.annotations.Param;
18 20
 @Mapper
19 21
 public interface BusinessImPurchaseSaleMapper extends BaseMapper<BusinessImPurchaseSale> {
20 22
 
21
-    Page<BusinessImPurchaseSale> getList(@Param("purchaseCode") String purchaseCode,
22
-                                         @Param("purchasePlanName") String purchasePlanName);
23
+    List<BusinessImPurchaseSale> getList(@Param("purchaseCode") String purchaseCode,
24
+                                         @Param("purchasePlanName") String purchasePlanName,
25
+                                         @Param("orgId") Integer orgId);
23 26
 
24 27
     //int insertBusinessImPurchaseSale(BusinessImPurchaseSale businessImPurchaseSale);
25 28
 

+ 1 - 0
src/main/java/com/chinaitop/depot/device/mapper/BusinessImPurchaseSaleMapper.xml

@@ -40,6 +40,7 @@
40 40
     <select id="getList" resultType="com.chinaitop.depot.device.model.BusinessImPurchaseSale">
41 41
         select * from business_im_purchase_sale
42 42
         <where>
43
+            org_id in (#{orgId})
43 44
             <if test="purchaseCode!=null and purchaseCode!=''">
44 45
                 and purchase_code like concat("%",#{purchaseCode},"%")
45 46
             </if>

+ 22 - 8
src/main/java/com/chinaitop/depot/device/model/param/BusinessImPurchaseSalePageParam.java

@@ -2,6 +2,9 @@ package com.chinaitop.depot.device.model.param;
2 2
 
3 3
 import io.swagger.annotations.ApiModelProperty;
4 4
 
5
+import javax.validation.constraints.NotBlank;
6
+import javax.validation.constraints.NotNull;
7
+
5 8
 /**
6 9
  * @author hjc
7 10
  * @version 1.0
@@ -11,31 +14,42 @@ import io.swagger.annotations.ApiModelProperty;
11 14
 
12 15
 public class BusinessImPurchaseSalePageParam {
13 16
 
14
-    /** 当前页 */
17
+    /**
18
+     * 当前页
19
+     */
15 20
     @ApiModelProperty(value = "页码")
16 21
     private Integer pageNum;
17 22
 
18
-    /** 每页条数 */
23
+    /**
24
+     * 每页条数
25
+     */
19 26
     @ApiModelProperty(value = "每页条数")
20 27
     private Integer pageSize;
21 28
 
22
-    /** 采购编号 */
29
+    /**
30
+     * 采购编号
31
+     */
23 32
     @ApiModelProperty(value = "采购编号", position = 7)
24 33
     private String purchaseCode;
25 34
 
26
-    /** 采购计划名称 */
35
+    /**
36
+     * 采购计划名称
37
+     */
27 38
     @ApiModelProperty(value = "采购计划名称", position = 8)
28 39
     private String purchasePlanName;
29 40
 
30
-    /** 采购编号 */
41
+    /**
42
+     * 采购编号
43
+     */
31 44
     @ApiModelProperty(value = "组织id", position = 9)
32
-    private String orgId;
45
+    @NotNull(message = "组织id不能为空")
46
+    private Integer orgId;
33 47
 
34
-    public String getOrgId() {
48
+    public Integer getOrgId() {
35 49
         return orgId;
36 50
     }
37 51
 
38
-    public void setOrgId(String orgId) {
52
+    public void setOrgId(Integer orgId) {
39 53
         this.orgId = orgId;
40 54
     }
41 55
 

+ 2 - 1
src/main/java/com/chinaitop/depot/device/service/BusinessImPurchaseSaleService.java

@@ -7,6 +7,7 @@ import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleAddParam;
7 7
 import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleEditParam;
8 8
 import com.chinaitop.depot.device.model.param.BusinessImPurchaseSalePageParam;
9 9
 import com.github.pagehelper.Page;
10
+import com.github.pagehelper.PageInfo;
10 11
 
11 12
 /**
12 13
  * <p>
@@ -24,7 +25,7 @@ public interface BusinessImPurchaseSaleService extends IService<BusinessImPurcha
24 25
      * @param:
25 26
      * @return: 查询 采购销售管理 信息列表
26 27
      */
27
-    Page<BusinessImPurchaseSale> getList(BusinessImPurchaseSalePageParam pageParam);
28
+    PageInfo<BusinessImPurchaseSale> getList(BusinessImPurchaseSalePageParam pageParam);
28 29
 
29 30
     /**
30 31
      * @author: hujianchun

+ 6 - 2
src/main/java/com/chinaitop/depot/device/service/impl/BusinessImPurchaseSaleServiceImpl.java

@@ -9,6 +9,7 @@ import com.chinaitop.depot.device.model.param.BusinessImPurchaseSalePageParam;
9 9
 import com.chinaitop.depot.device.service.BusinessImPurchaseSaleService;
10 10
 import com.github.pagehelper.Page;
11 11
 import com.github.pagehelper.PageHelper;
12
+import com.github.pagehelper.PageInfo;
12 13
 import org.springframework.beans.BeanUtils;
13 14
 import org.springframework.beans.factory.annotation.Autowired;
14 15
 import org.springframework.stereotype.Service;
@@ -17,6 +18,7 @@ import java.time.LocalDate;
17 18
 import java.time.format.DateTimeFormatter;
18 19
 import java.util.Date;
19 20
 import java.util.HashMap;
21
+import java.util.List;
20 22
 import java.util.Map;
21 23
 
22 24
 /**
@@ -40,12 +42,14 @@ public class BusinessImPurchaseSaleServiceImpl extends ServiceImpl<BusinessImPur
40 42
 
41 43
 
42 44
     @Override
43
-    public Page<BusinessImPurchaseSale> getList(BusinessImPurchaseSalePageParam pageParam) {
45
+    public PageInfo<BusinessImPurchaseSale> getList(BusinessImPurchaseSalePageParam pageParam) {
44 46
 
45 47
         PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
46 48
 
47
-        return businessImPurchaseSaleMapper.getList(pageParam.getPurchaseCode(), pageParam.getPurchasePlanName());
49
+        List<BusinessImPurchaseSale> list= businessImPurchaseSaleMapper.getList(pageParam.getPurchaseCode(), pageParam.getPurchasePlanName(),pageParam.getOrgId());
48 50
 
51
+        PageInfo<BusinessImPurchaseSale> page = new PageInfo<>(list);
52
+        return page;
49 53
 
50 54
     }
51 55