4
hao
2025-04-16 c5fb1fbcbb2bf4d511773d348f9ef625855c61fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.web.supplier.service.internal;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import javax.servlet.http.HttpServletResponse;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
 
import com.app.base.data.ApiResponseResult;
import com.utils.UserUtil;
import com.web.supplier.service.SearchService;
 
@Service(value = "SearchService")
@Transactional(propagation = Propagation.REQUIRED)
public class Searchlmpl extends PrcUtils implements SearchService {
 
    /**
     * 查询-获取采购订单列表-2022-6-8
     **/
    public ApiResponseResult getPurchaseOrder(String billNo, String materialNo, String begTime, String endTime,
            PageRequest pageRequest) throws Exception {
        List<Object> list = getPurchaseOrderPrc(UserUtil.getSessionUser().getFcompany() + "", billNo,
                UserUtil.getSessionUser().getFcode() + "", materialNo, begTime, endTime, pageRequest.getPageSize(),
                pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
    
    /**
     * 查询-获取送货计划列表,通过采购订单带出-2022-6-8 
     **/
    public ApiResponseResult getDeliveryPlanByOrder(String materialNo,PageRequest pageRequest) throws Exception {
        List<Object> list = getDeliveryPlanByOrderPrc(UserUtil.getSessionUser().getFcompany() + "", 
                materialNo, pageRequest.getPageSize(),
                pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
 
    /**
     * 查询-获取送货单明细从表-2022-6-20
     **/
    public ApiResponseResult getDeliveryDet(String billNo,String lineNo,String materialNo,PageRequest pageRequest)throws Exception {
        List<Object> list = getDeliveryDetPrc(UserUtil.getSessionUser().getFcompany() + "", billNo,lineNo,
                materialNo, pageRequest.getPageSize(),
                pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
 
    /**
     * 查询-获取条码历史记录-2022-6-20
     **/
    public ApiResponseResult getBarcodeHistory(String billNo,String begTime, String endTime,String materialNo,
            String materialName,String barcode, PageRequest pageRequest)throws Exception {
        List<Object> list = getBarcodeHistoryPrc(UserUtil.getSessionUser().getFcompany() + "", billNo,
                UserUtil.getSessionUser().getFcode() + "", begTime,endTime,materialNo, materialName,
                barcode,pageRequest.getPageSize(),pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
    
    /**
     * 查询-获取送货单据-2022-6-21
     **/
    public ApiResponseResult getDeliveryRecord(String deliveryNo,String billNo, String begTime, String endTime, String materialNo,
            String materialName, PageRequest pageRequest)throws Exception {
        List<Object> list = getDeliveryRecordPrc(UserUtil.getSessionUser().getFcompany() + "",deliveryNo, billNo,
                UserUtil.getSessionUser().getFcode() + "", begTime,endTime,materialNo, materialName,
                pageRequest.getPageSize(),pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
    
    /**
     * 查询-获取送货计划-2022-6-21
     **/
    public ApiResponseResult getDeliveryPlan(String planOrder,String materialNo,String materialName, 
            String begTime, String endTime,PageRequest pageRequest)throws Exception {
        List<Object> list = getDeliveryPlanPrc(UserUtil.getSessionUser().getFcompany() + "",UserUtil.getSessionUser().getFcode() + "",
                planOrder, begTime,endTime,materialNo, materialName,pageRequest.getPageSize(),pageRequest.getPageNumber());
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("total", list.get(2));
        map.put("rows", list.get(3));
        return ApiResponseResult.success().data(map);
    }
}