fix:添加托盘打印模板

main
HuangHuiKang 6 days ago
parent 0758f2de3a
commit 0764a9508b

@ -129,9 +129,18 @@ public class ErpPalletController {
if (qrcode != null) {
respVO.setQrcode(qrcode);
}
fillTemplateJson(respVO);
return respVO;
}
private void fillTemplateJson(ErpPalletRespVO respVO) {
if (respVO == null) {
return;
}
respVO.setTemplateJson(palletService.selectPrintTemplate());
}
private ErpPalletRespVO buildPalletRespVO(ErpPalletDO pallet, Map<Long, String> qrcodeMap) {
ErpPalletRespVO respVO = BeanUtils.toBean(pallet, ErpPalletRespVO.class);
fillPackagingInfo(respVO);

@ -88,4 +88,6 @@ public class ErpPalletRespVO {
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "打印模板")
private String templateJson;
}

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.pallet.vo.ErpPalletPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.pallet.ErpPalletDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Collection;
@ -50,4 +51,6 @@ public interface ErpPalletMapper extends BaseMapperX<ErpPalletDO> {
.inIfPresent(ErpPalletDO::getAreaId, containsNullArea ? null : areaIds)
.gt(ErpPalletDO::getProductCount, BigDecimal.ZERO));
}
String selectPrintTemplate(@Param("templateType") Integer templateType);
}

@ -32,4 +32,6 @@ public interface ErpPalletService {
List<ErpPalletDO> getOccupiedPalletList(Collection<Long> productIds, Collection<Long> warehouseIds, Collection<Long> areaIds);
void regenerateCode(Long id, String code) throws UnsupportedEncodingException;
String selectPrintTemplate();
}

@ -39,6 +39,8 @@ import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOC
@Validated
public class ErpPalletServiceImpl implements ErpPalletService {
private static final int ERPPALLET_PRINT_TEMPLATE_TYPE = 8;
@Resource
private ErpPalletMapper palletMapper;
@Resource
@ -142,6 +144,11 @@ public class ErpPalletServiceImpl implements ErpPalletService {
);
}
@Override
public String selectPrintTemplate() {
return palletMapper.selectPrintTemplate(ERPPALLET_PRINT_TEMPLATE_TYPE);
}
private ErpPalletDO validatePalletExists(Long id) {
ErpPalletDO pallet = palletMapper.selectById(id);
if (pallet == null) {

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.erp.dal.mysql.pallet.ErpPalletMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectPrintTemplate" resultType="java.lang.String">
select template_json
from mes_print_template
where deleted = 0
and template_type = #{templateType}
and template_biz_type = 1
</select>
</mapper>
Loading…
Cancel
Save