|
|
|
@ -2,12 +2,14 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesTemplateService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.MesPcnConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplate;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesLabelTemplateParam;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateParamRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesLabelTemplateRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import org.apache.shiro.util.CollectionUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -31,21 +33,19 @@ public class MesTemplateServiceImpl implements IMesTemplateService {
|
|
|
|
|
private MesLabelTemplateParamRepository mesLabelTemplateParamRDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesLabelTemplate getMesLabelTemplate(String templateCode) {
|
|
|
|
|
public MesLabelTemplate getMesLabelTemplate(String templateCode,String organizeCode) {
|
|
|
|
|
// 根据标签模板代码,查询【MES_标签模板表】,获取对应的方法代码
|
|
|
|
|
MesLabelTemplate labelTemplate = mesLabelTemplateRDao.getByProperty(
|
|
|
|
|
new String[]{MesPcnConstWords.IS_VALID, MesPcnConstWords.IS_DELETED, "templateCode"},
|
|
|
|
|
new Object[]{CommonEnumUtil.IS_VAILD.VAILD.getValue(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), templateCode});
|
|
|
|
|
new String[]{MesPcnConstWords.IS_VALID, MesPcnConstWords.IS_DELETED, "templateCode", MesPcnExtConstWords.ORGANIZE_CODE},
|
|
|
|
|
new Object[]{CommonEnumUtil.IS_VAILD.VAILD.getValue(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), templateCode,organizeCode});
|
|
|
|
|
|
|
|
|
|
if (labelTemplate == null) {
|
|
|
|
|
MesPcnException.throwMesBusiException("标签模板代码【%s】在标签模板表不存在!", templateCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据模板代码查询模板参数信息
|
|
|
|
|
List<MesLabelTemplateParam> templateParamList = mesLabelTemplateParamRDao.findByProperty(new String[]{"templateCode",
|
|
|
|
|
MesPcnConstWords.IS_VALID, MesPcnConstWords.IS_DELETED},
|
|
|
|
|
new Object[]{templateCode, CommonEnumUtil.IS_VAILD.VAILD.getValue(),
|
|
|
|
|
CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()});
|
|
|
|
|
List<MesLabelTemplateParam> templateParamList = mesLabelTemplateParamRDao.findByProperty(new String[]{"templateCode", MesPcnConstWords.IS_VALID, MesPcnConstWords.IS_DELETED,MesPcnExtConstWords.ORGANIZE_CODE},
|
|
|
|
|
new Object[]{templateCode, CommonEnumUtil.IS_VAILD.VAILD.getValue(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),organizeCode});
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(templateParamList)) {
|
|
|
|
|
MesPcnException.throwMesBusiException("标签模板代码【%s】在标签模板明细表不存在!", templateCode);
|
|
|
|
|