fix(工序出站打印接口):处理质检等级转换
This commit is contained in:
parent
1803f52cc0
commit
8b1b766604
@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.foreverwin.iep.common.constant.BaseConstants;
|
||||
import com.foreverwin.iep.integration.constant.Msg;
|
||||
@ -321,6 +322,18 @@ public class PrintServiceImpl implements PrintService {
|
||||
//为便于异常时,获取到实际的模板,此时再次赋值
|
||||
String printerName = pr.getPrintName();
|
||||
Integer labelQty = pr.getLabelQty();
|
||||
List<Map<String, Object>> printDataList = pr.getPrintData();
|
||||
// 处理质检等级转换
|
||||
if (CollectionUtils.isNotEmpty(printDataList)) {
|
||||
for (Map<String, Object> map : printDataList) {
|
||||
if (map.get("INSPECTION_LEVEL") != null) {
|
||||
String inspecLevelStr = String.valueOf(map.get("INSPECTION_LEVEL"));
|
||||
// 获取 insLevel 对应的数据字典 INSPEC_LEVEL 中的描述(OK;NG;A级等);
|
||||
String insLevelDesc = StringUtils.isNotBlank(printerMapper.getLevelDesc(site, "INSPEC_LEVEL", inspecLevelStr)) ? printerMapper.getLevelDesc(site, "INSPEC_LEVEL", inspecLevelStr) : inspecLevelStr;
|
||||
map.put("INSPECTION_LEVEL", insLevelDesc);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 调用doPrint的,都是直接打印,所以次数固定传1就行了。如果有记录就加1,如果没有就用传的值
|
||||
String printContent = savePrintLog(pr, printQueueName, 1, labelQty, null);
|
||||
processAndSendPrintData(site, printContent, printerName, printQueueName);
|
||||
|
||||
@ -26,4 +26,6 @@ public interface PrinterMapper extends BaseMapper<Printer> {
|
||||
List<String> selectPrinter(@Param("site") String site, @Param("printScenario") String printScenario, @Param("operation") String operation, @Param("resource") String resource);
|
||||
|
||||
List<String> readTemplateCodeList(@Param("site") String site, @Param("customerCode") String customerCode, @Param("fabNo") String fabNo, @Param("operation") String operation);
|
||||
|
||||
String getLevelDesc(@Param("site") String site, @Param("dictType") String dictType, @Param("level") String level);
|
||||
}
|
||||
|
||||
@ -44,4 +44,14 @@
|
||||
and pr.CUSTOMER_CODE = #{customerCode}
|
||||
and pr.STATUS = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="getLevelDesc" resultType="java.lang.String">
|
||||
select
|
||||
sdi.DESCRIPTION
|
||||
from momx.sys_dict_item sdi
|
||||
where sdi.TENANT_ID = #{site}
|
||||
and sdi.DICT_TYPE = #{dictType}
|
||||
and sdi.DEL_FLAG = '0'
|
||||
and sdi.ITEM_VALUE = #{level}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user