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
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.PrintService;
 
@Service(value = "PrintService")
@Transactional(propagation = Propagation.REQUIRED)
public class Printlmpl extends PrcUtils implements PrintService {
 
    /**
     * 打印 标签-2022-6-14
     **/
    public ApiResponseResult printLabel(String barcodeType, String suppNo, String ebeln,  String remainQty,String materialNo, String qty,
            String prodDate, String shipDate, String envirTag, String shelfLife, String flevel, String printQty,
            String remark,String actionType) throws Exception {
        if (!UserUtil.getSessionUser().getFcode().equals(suppNo)) {
            return ApiResponseResult.failure("错误:打印标签供应商编号与登录供应商不符。");
        }
        List<Object> list = printLabelPrc(UserUtil.getSessionUser().getFcompany() + "", barcodeType, suppNo, ebeln,remainQty,
                materialNo, qty, prodDate, shipDate, envirTag, shelfLife, flevel, printQty, remark,actionType);
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        return ApiResponseResult.success().data(list.get(2));
    }
 
    /**
     * 打印 送货单-2022-6-18
     **/
    public ApiResponseResult printDelivery(String deliveryNo) throws Exception {
        List<Object> list = printDeliveryPrc(UserUtil.getSessionUser().getFcompany() + "",deliveryNo);
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        Map map = new HashMap();
        map.put("MAIN_DATA", list.get(2));
        map.put("LIST_DATA", list.get(3));
        return ApiResponseResult.success().data(map);
    }
    
    /**
     * 打印 重打标签-2022-6-24
     **/
    public ApiResponseResult rePrintLabel(String labelId,String actionType) throws Exception {
        List<Object> list = rePrintLabelPrc(UserUtil.getSessionUser().getFcompany() + "",
                UserUtil.getSessionUser().getFcode() + "",labelId, actionType);
        if (!list.get(0).toString().equals("0")) {// 存储过程调用失败 //判断返回游标
            return ApiResponseResult.failure(list.get(1).toString());
        }
        return ApiResponseResult.success().data(list.get(2));
    }
}