This commit is contained in:
linfso 2024-05-24 09:43:12 +08:00
parent 8e6cec3e01
commit 386480097b
2 changed files with 66 additions and 22 deletions

View File

@ -35,9 +35,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.Charset;
import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* EMIS 公共 Controller
@ -181,6 +185,46 @@ public class EmisCommonController extends BaseController
}
}
@RequestMapping("/getPrintDataByPrinter")
public AjaxResult getPrintDataByPrinter(HttpServletRequest request, HttpServletResponse response, String billCode, String billCodeRange, String lang, String printType)
{
if(StringUtils.isEmpty(billCode)){
return AjaxResult.error("参数错误");
}
if(!StringUtils.isEmpty(billCode)){
try {
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
JSONObject printItem = new JSONObject();
printItem.put("billCode",billCode);
if(order!=null) {
printItem.put("billDetail", Base64.getEncoder().encodeToString(JSONObject.toJSONString(order).getBytes(Charset.forName("UTF-8"))));
printItem.put("isEncrpt",false);
printItem.put("printCount",1);
printItem.put("printDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
printItem.put("result","success");
printItem.put("message","success");
}else{
printItem.put("result","fail");
printItem.put("message","未获取到数据");
}
return AjaxResult.success("获取成功",printItem);
}catch (Exception ex){
ex.printStackTrace();
return AjaxResult.error("获取失败");
}
}
return AjaxResult.error("获取失败");
}
/**
* 预览电子面单打印
*/

View File

@ -46,28 +46,28 @@
order by site_code asc
</select>>
<select id="selectEmisTmsTransPlanDtlList_old" parameterType="EmisTmsTransPlanDtl" resultMap="EmisTmsTransPlanDtlResult">
<include refid="selectEmisTmsTransPlanDtlVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="startSite != null and startSite != ''"> and start_site like concat('%', #{startSite}, '%')</if>
<if test="destSite != null and destSite != ''"> and dest_site like concat('%', #{destSite}, '%')</if>
<if test="transType != null and transType != ''"> and trans_type like concat('%', #{transType}, '%')</if>
<if test="estCostDay != null and estCostDay != ''"> and est_cost_day like concat('%', #{estCostDay}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<!-- <select id="selectEmisTmsTransPlanDtlList_old" parameterType="EmisTmsTransPlanDtl" resultMap="EmisTmsTransPlanDtlResult">-->
<!-- <include refid="selectEmisTmsTransPlanDtlVo"/>-->
<!-- <where>-->
<!-- <if test="id != null "> and id = #{id}</if>-->
<!-- <if test="planId != null "> and plan_id = #{planId}</if>-->
<!-- <if test="startSite != null and startSite != ''"> and start_site like concat('%', #{startSite}, '%')</if>-->
<!-- <if test="destSite != null and destSite != ''"> and dest_site like concat('%', #{destSite}, '%')</if>-->
<!-- <if test="transType != null and transType != ''"> and trans_type like concat('%', #{transType}, '%')</if>-->
<!-- <if test="estCostDay != null and estCostDay != ''"> and est_cost_day like concat('%', #{estCostDay}, '%')</if>-->
<!-- <if test="orderNum != null "> and order_num = #{orderNum}</if>-->
<!-- <if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>-->
<!-- <if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>-->
<!-- <if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>-->
<!-- <if test="createTime != null "> and create_time = #{createTime}</if>-->
<!-- <if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>-->
<!-- <if test="updateTime != null "> and update_time = #{updateTime}</if>-->
<!-- <if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>-->
<!-- <if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>-->
<!-- <if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>-->
<!-- </where>-->
<!-- order by create_time desc-->
<!-- </select>-->
<select id="selectEmisTmsTransPlanDtlById" parameterType="Long" resultMap="EmisTmsTransPlanDtlResult">
select id, plan_id, start_site, dest_site, trans_type, est_cost_day, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site