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 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 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 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)); } }