Commit 0bd03c6c by 谢海旭

下发门店接口增加模板tpl_singleton字段(单实例多实例配置)校验

1 parent c9145720
package cn.com.glsx.process.modules.model.enums;
public enum SopTplSingletonEnum {
FALSE("多实例", (byte)0), TRUE("单实例", (byte)1);
private String name;
private byte value;
SopTplSingletonEnum(String name, byte value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public byte getValue() {
return value;
}
public void setValue(byte value) {
this.value = value;
}
}
...@@ -14,10 +14,7 @@ import cn.com.glsx.process.modules.converter.SopTplNodeConverter; ...@@ -14,10 +14,7 @@ import cn.com.glsx.process.modules.converter.SopTplNodeConverter;
import cn.com.glsx.process.modules.entity.*; import cn.com.glsx.process.modules.entity.*;
import cn.com.glsx.process.modules.mapper.*; import cn.com.glsx.process.modules.mapper.*;
import cn.com.glsx.process.modules.model.*; import cn.com.glsx.process.modules.model.*;
import cn.com.glsx.process.modules.model.enums.SopInstNodeSkipEnum; import cn.com.glsx.process.modules.model.enums.*;
import cn.com.glsx.process.modules.model.enums.SopInstNodeStatusEnum;
import cn.com.glsx.process.modules.model.enums.SopInstStatusEnum;
import cn.com.glsx.process.modules.model.enums.SopTplNodeSkipableEnum;
import cn.com.glsx.process.modules.rabbitmq.MsgProducer; import cn.com.glsx.process.modules.rabbitmq.MsgProducer;
import cn.com.glsx.process.modules.rabbitmq.RabbitMQConstants; import cn.com.glsx.process.modules.rabbitmq.RabbitMQConstants;
import cn.com.glsx.process.util.FileUploadServerData; import cn.com.glsx.process.util.FileUploadServerData;
...@@ -278,11 +275,13 @@ public class SopInstService { ...@@ -278,11 +275,13 @@ public class SopInstService {
throw new AdminException(ResultEnum.PARAM_ERROR.getCode(), "请选择门店"); throw new AdminException(ResultEnum.PARAM_ERROR.getCode(), "请选择门店");
} }
if (SopTplSingletonEnum.TRUE.getValue() == sopTplDTO.getTplSingleton()) {
List<String> groupIds = sopTplGrants.stream().map(sopTplGrant -> sopTplGrant.getGroupId()).collect(Collectors.toList()); List<String> groupIds = sopTplGrants.stream().map(sopTplGrant -> sopTplGrant.getGroupId()).collect(Collectors.toList());
List<SopTplGrant> grants = sopTplGrantMapper.selectInUseGrants(tplId, groupIds); List<SopTplGrant> grants = sopTplGrantMapper.selectInUseGrants(tplId, groupIds);
if (!CollectionUtils.isEmpty(grants)) { if (!CollectionUtils.isEmpty(grants)) {
throw new AdminException(ResultEnum.PARAM_ERROR.getCode(), String.format("%s已存在该旅程,请确认后重新操作", grants.get(0).getGroupName())); throw new AdminException(ResultEnum.PARAM_ERROR.getCode(), String.format("%s已存在该旅程,请确认后重新操作", grants.get(0).getGroupName()));
} }
}
//新增派发门店记录 //新增派发门店记录
Date date = new Date(); Date date = new Date();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!