|
|
@ -2,6 +2,7 @@ package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysLabelTemplateService;
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysLabelTemplateService;
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
@ -18,7 +19,6 @@ import cn.estsh.i3plus.pojo.platform.repository.SysLabelTemplateRepository;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
@ -94,9 +94,9 @@ public class SysLabelTemplateService implements ISysLabelTemplateService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ApiOperation(value = "软删除打印模板")
|
|
|
|
@ApiOperation(value = "软删除打印模板")
|
|
|
|
public void deleteWeaklySysLabelTemplateById(Long id,String userName) {
|
|
|
|
public void deleteWeaklySysLabelTemplateById(Long id, String userName) {
|
|
|
|
sysLabelTemplateRDao.deleteWeaklyById(id,userName);
|
|
|
|
sysLabelTemplateRDao.deleteWeaklyById(id, userName);
|
|
|
|
sysLabelTemplateParamRDao.deleteWeaklyByProperty("templateId", id,userName);
|
|
|
|
sysLabelTemplateParamRDao.deleteWeaklyByProperty("templateId", id, userName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -114,6 +114,9 @@ public class SysLabelTemplateService implements ISysLabelTemplateService {
|
|
|
|
//暂时根据id和模板代码作为唯一性校验
|
|
|
|
//暂时根据id和模板代码作为唯一性校验
|
|
|
|
StringBuffer where = new StringBuffer();
|
|
|
|
StringBuffer where = new StringBuffer();
|
|
|
|
HqlPack.getNumNOEqualPack(sysLabelTemplate.getId(), "id", where);
|
|
|
|
HqlPack.getNumNOEqualPack(sysLabelTemplate.getId(), "id", where);
|
|
|
|
|
|
|
|
// FIX 原始是删除 后改成软删 导致唯一校验存在问题
|
|
|
|
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", where);
|
|
|
|
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isValid", where);
|
|
|
|
HqlPack.getStringEqualPack(sysLabelTemplate.getTemplateCode(), "templateCode", where);
|
|
|
|
HqlPack.getStringEqualPack(sysLabelTemplate.getTemplateCode(), "templateCode", where);
|
|
|
|
int count = sysLabelTemplateRDao.findByHqlWhereCount(where.toString());
|
|
|
|
int count = sysLabelTemplateRDao.findByHqlWhereCount(where.toString());
|
|
|
|
if (count > 0) {
|
|
|
|
if (count > 0) {
|
|
|
@ -156,20 +159,20 @@ public class SysLabelTemplateService implements ISysLabelTemplateService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysLabelTemplate> listSysLabelTemplateDetail(SysLabelTemplate template) {
|
|
|
|
public List<SysLabelTemplate> listSysLabelTemplateDetail(SysLabelTemplate template) {
|
|
|
|
List<SysLabelTemplate> list = sysLabelTemplateRDao.findByHqlWhere(CoreHqlPack.packBeanSysLabelTemplate(template));
|
|
|
|
List<SysLabelTemplate> list = sysLabelTemplateRDao.findByHqlWhere(CoreHqlPack.packBeanSysLabelTemplate(template));
|
|
|
|
if(list != null && list.size() > 0){
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
List<Long> ids = new ArrayList<>(list.size());
|
|
|
|
List<Long> ids = new ArrayList<>(list.size());
|
|
|
|
list.forEach(tmp -> ids.add(tmp.getId()));
|
|
|
|
list.forEach(tmp -> ids.add(tmp.getId()));
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(ids,"templateId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(ids, "templateId", packBean);
|
|
|
|
List<SysLabelTemplateParam> paramList = sysLabelTemplateParamRDao.findByHqlWhere(packBean);
|
|
|
|
List<SysLabelTemplateParam> paramList = sysLabelTemplateParamRDao.findByHqlWhere(packBean);
|
|
|
|
|
|
|
|
|
|
|
|
if(paramList != null && paramList.size() > 0){
|
|
|
|
if (paramList != null && paramList.size() > 0) {
|
|
|
|
for (SysLabelTemplateParam param : paramList) {
|
|
|
|
for (SysLabelTemplateParam param : paramList) {
|
|
|
|
for (SysLabelTemplate temp : list) {
|
|
|
|
for (SysLabelTemplate temp : list) {
|
|
|
|
if(temp.getId().equals(param.getTemplateId())){
|
|
|
|
if (temp.getId().equals(param.getTemplateId())) {
|
|
|
|
List<SysLabelTemplateParam> params = temp.getLabelTemplateParamList();
|
|
|
|
List<SysLabelTemplateParam> params = temp.getLabelTemplateParamList();
|
|
|
|
if(params == null){
|
|
|
|
if (params == null) {
|
|
|
|
params = new ArrayList<>();
|
|
|
|
params = new ArrayList<>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
params.add(param);
|
|
|
|
params.add(param);
|
|
|
|