This commit is contained in:
linfso 2024-05-19 10:27:10 +08:00
parent 36db4f2912
commit 2eea5d20b8
7 changed files with 50 additions and 12 deletions

View File

@ -171,7 +171,7 @@ public class EmisCommonController extends BaseController
queryEmisPrintTpl.setStatus(1);
JSONArray tplList = new JSONArray();
List<EmisPrintTpl> list=emisPrintTplService.selectEmisPrintTplList(queryEmisPrintTpl);
List<EmisPrintTpl> list=emisPrintTplService.selectPrintTplListByPrinter(queryEmisPrintTpl);
for (EmisPrintTpl tpl:list) {
JSONObject jobjTpl = new JSONObject();
@ -179,8 +179,7 @@ public class EmisCommonController extends BaseController
jobjTpl.put("name",tpl.getName());
jobjTpl.put("expressType",tpl.getExpressType());
EmisPrintTpl tplReal=emisPrintTplService.selectEmisPrintTplById(tpl.getId());
jobjTpl.put("tplEncData",tplReal.getTplEncData());
jobjTpl.put("tplEncData",tpl.getTplEncData());
tplList.add(jobjTpl);

View File

@ -60,6 +60,16 @@ public class EmisPrintTplController extends BaseController
return getDataTable(list);
}
@GetMapping("/selectPrintTplListByPrinter")
public TableDataInfo selectPrintTplListByPrinter(EmisPrintTpl emisPrintTpl)
{
startPage();
List<EmisPrintTpl> list = emisPrintTplService.selectPrintTplListByPrinter(emisPrintTpl);
return getDataTable(list);
}
/**
* 导出快递打印模板列表
*/

View File

@ -55,7 +55,10 @@ public class EmisPrintTpl extends BaseEntity
private String tplPdfData;
/* 在线图片 */
private String tplPicUrl;
/* 显示顺序 */
private Integer orderNum;
/* 0-初始 1-启用 2-禁用 */
private Integer status;
}

View File

@ -67,4 +67,7 @@ public interface EmisPrintTplMapper extends BaseMapper<EmisPrintTpl>
* @return 结果
*/
public int deleteEmisPrintTplByIds(Long[] ids);
public List<EmisPrintTpl> selectPrintTplListByPrinter(EmisPrintTpl emisPrintTpl);
}

View File

@ -35,6 +35,8 @@ public interface IEmisPrintTplService
*/
public List<EmisPrintTpl> selectEmisPrintTplList(EmisPrintTpl emisPrintTpl);
public List<EmisPrintTpl> selectPrintTplListByPrinter(EmisPrintTpl emisPrintTpl);
/**
* 新增快递打印模板
*

View File

@ -101,4 +101,11 @@ public class EmisPrintTplServiceImpl implements IEmisPrintTplService
return emisPrintTplMapper.deleteEmisPrintTplById(id);
}
@Override
public List<EmisPrintTpl> selectPrintTplListByPrinter(EmisPrintTpl emisPrintTpl)
{
return emisPrintTplMapper.selectPrintTplListByPrinter(emisPrintTpl);
}
}

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisPrintTplMapper">
<resultMap type="EmisPrintTpl" id="EmisPrintTplResult">
<result property="id" column="id" />
<result property="code" column="code" />
@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tplEncData" column="tpl_enc_data" />
<result property="tplPdfData" column="tpl_pdf_data" />
<result property="tplPicUrl" column="tpl_pic_url" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
@ -28,11 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEmisPrintTplVo">
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_enc_data, tpl_pdf_data, tpl_pic_url, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_print_tpl
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_pdf_data, tpl_pic_url, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_print_tpl
</sql>
<select id="selectEmisPrintTplList" parameterType="EmisPrintTpl" resultMap="EmisPrintTplResult">
select id, code, name, version, is_public, merch_id, express_type, tpl_pic_url, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_print_tpl
<include refid="selectEmisPrintTplVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
@ -41,6 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isPublic != null "> and is_public = #{isPublic}</if>
<if test="merchId != null "> and merch_id = #{merchId}</if>
<if test="expressType != null and expressType != ''"> and express_type like concat('%', #{expressType}, '%')</if>
<if test="tplData != null and tplData != ''"> and tpl_data like concat('%', #{tplData}, '%')</if>
<if test="tplEncData != null and tplEncData != ''"> and tpl_enc_data like concat('%', #{tplEncData}, '%')</if>
<if test="tplPdfData != null and tplPdfData != ''"> and tpl_pdf_data like concat('%', #{tplPdfData}, '%')</if>
<if test="tplPicUrl != null and tplPicUrl != ''"> and tpl_pic_url like concat('%', #{tplPicUrl}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="status != null "> and status = #{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>
@ -53,13 +59,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by create_time desc
</select>
<select id="selectPrintTplListByPrinter" parameterType="EmisPrintTpl" resultMap="EmisPrintTplResult">
select id, code, name, version,express_type,tpl_enc_data from emis_print_tpl where del_flag='0'
order by order_num desc
</select>
<select id="selectEmisPrintTplById" parameterType="Long" resultMap="EmisPrintTplResult">
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_enc_data, tpl_pdf_data, tpl_pic_url, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
select id, code, name, version, is_public, merch_id, express_type, tpl_data, tpl_enc_data, tpl_pdf_data, tpl_pic_url, order_num, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_print_tpl a
where a.id = #{id}
</select>
<insert id="insertEmisPrintTpl" parameterType="EmisPrintTpl">
insert into emis_print_tpl
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -74,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tplEncData != null and tplEncData != ''">tpl_enc_data,</if>
<if test="tplPdfData != null and tplPdfData != ''">tpl_pdf_data,</if>
<if test="tplPicUrl != null and tplPicUrl != ''">tpl_pic_url,</if>
<if test="orderNum != null">order_num,</if>
<if test="status != null">status,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
@ -83,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">remark,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null and code != ''">#{code},</if>
@ -96,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tplEncData != null and tplEncData != ''">#{tplEncData},</if>
<if test="tplPdfData != null and tplPdfData != ''">#{tplPdfData},</if>
<if test="tplPicUrl != null and tplPicUrl != ''">#{tplPicUrl},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
@ -105,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</trim>
</insert>
<update id="updateEmisPrintTpl" parameterType="EmisPrintTpl">
@ -121,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tplEncData != null and tplEncData != ''">tpl_enc_data = #{tplEncData},</if>
<if test="tplPdfData != null and tplPdfData != ''">tpl_pdf_data = #{tplPdfData},</if>
<if test="tplPicUrl != null and tplPicUrl != ''">tpl_pic_url = #{tplPicUrl},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
@ -139,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteEmisPrintTplByIds" parameterType="String">
delete from emis_print_tpl where id in
delete from emis_print_tpl where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>