|
|
|
@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -65,9 +66,9 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
public int save(SchemeSearchParam param) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(param.getSchemeNo()));
|
|
|
|
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
OrganizationAssert.isEmpty(list, SystemEnv.getHtmlLabelName(547137, user.getLanguage()));
|
|
|
|
|
List<SchemePO> schemePOS = getSchemeMapper().selectByParams(param.getSubcompanyid(), param.getSchemeName());
|
|
|
|
|
OrganizationAssert.isEmpty(schemePOS, "同一分部下方案名称不允许重复");
|
|
|
|
|
OrganizationAssert.isEmpty(schemePOS, SystemEnv.getHtmlLabelName(547153,user.getLanguage()));
|
|
|
|
|
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
|
|
|
|
|
return getSchemeMapper().insertIgnoreNull(schemePO);
|
|
|
|
|
}
|
|
|
|
@ -80,10 +81,10 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
String oldSchemeNo = getSchemeMapper().getSchemeByID(schemePO.getId()).getSchemeNo();
|
|
|
|
|
if (!oldSchemeNo.equals(schemePO.getSchemeNo())) {
|
|
|
|
|
List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(schemePO.getSchemeNo()));
|
|
|
|
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
OrganizationAssert.isEmpty(list, SystemEnv.getHtmlLabelName(547137, user.getLanguage()));
|
|
|
|
|
List<SchemePO> schemePOS = getSchemeMapper().selectByParams(param.getSubcompanyid(), param.getSchemeName());
|
|
|
|
|
OrganizationAssert.isEmpty(schemePOS, SystemEnv.getHtmlLabelName(547153,user.getLanguage()));
|
|
|
|
|
}
|
|
|
|
|
List<SchemePO> schemePOS = getSchemeMapper().selectByParams(param.getSubcompanyid(), param.getSchemeName());
|
|
|
|
|
OrganizationAssert.isEmpty(schemePOS, "同一分部下方案名称不允许重复");
|
|
|
|
|
return getSchemeMapper().updateScheme(schemePO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -98,7 +99,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteByIds(Collection<Long> ids) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
|
|
|
|
OrganizationAssert.notEmpty(ids, SystemEnv.getHtmlLabelName(547138,user.getLanguage()));
|
|
|
|
|
return getSchemeMapper().deleteByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -108,8 +109,8 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
SearchConditionItem schemeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "方案名称", "schemeName");
|
|
|
|
|
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "方案编号", "schemeNo");
|
|
|
|
|
SearchConditionItem schemeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, 547127, "schemeName");
|
|
|
|
|
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, 547131, "schemeNo");
|
|
|
|
|
conditionItems.add(schemeNameCondition);
|
|
|
|
|
conditionItems.add(schemeNoCondition);
|
|
|
|
|
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
|
|
|
@ -124,18 +125,18 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
List<SearchConditionItem> selectItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
SearchConditionItem schemeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "方案名称", "schemeName");
|
|
|
|
|
SearchConditionItem schemeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, 547127, "schemeName");
|
|
|
|
|
schemeNameCondition.setRules("required|string");
|
|
|
|
|
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "方案编号", "schemeNo");
|
|
|
|
|
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, 547131, "schemeNo");
|
|
|
|
|
schemeNoCondition.setRules("required|string");
|
|
|
|
|
SearchConditionItem subCompanyIdItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "所属分部", "164", "subCompanyId", "");
|
|
|
|
|
SearchConditionItem textareaItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 200, "方案说明", "schemeDescription");
|
|
|
|
|
SearchConditionItem subCompanyIdItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, 547128, "164", "subCompanyId", "");
|
|
|
|
|
SearchConditionItem textareaItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 200, 547129, "schemeDescription");
|
|
|
|
|
|
|
|
|
|
// 编辑状态下赋值操作
|
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
|
if (!StringUtil.isEmpty(id)) {
|
|
|
|
|
SchemePO schemePO = getSchemeMapper().getSchemeByID(Integer.parseInt(id));
|
|
|
|
|
OrganizationAssert.notNull(schemePO, "选择的数据不存在,或数据已删除");
|
|
|
|
|
OrganizationAssert.notNull(schemePO, SystemEnv.getHtmlLabelName(547154,user.getLanguage()));
|
|
|
|
|
schemeNameCondition.setValue(schemePO.getSchemeName());
|
|
|
|
|
schemeNoCondition.setValue(schemePO.getSchemeNo());
|
|
|
|
|
textareaItem.setValue(schemePO.getSchemeDescription());
|
|
|
|
@ -156,7 +157,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, List<MenuBtn>> getTableBtn() {
|
|
|
|
|
return MenuBtn.getCommonBtnDatas();
|
|
|
|
|
return MenuBtn.getCommonBtnDatas(user.getLanguage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -168,8 +169,8 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
List<String> asList = Arrays.asList(jclRoleLevels.split(","));
|
|
|
|
|
treeDataList = treeDataList.stream().filter(item->asList.contains(item.getSubCompanyId())).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
List<TypeTreeVO> childList = treeDataList.stream().map(e -> TypeTreeVO.builder().domid(e.getKey()).key(Long.parseLong(e.getKey())).name(e.getStatus() == 0 ? e.getTitle() : e.getTitle() + "(已禁用)").build()).collect(Collectors.toList());
|
|
|
|
|
TypeTreeVO build = TypeTreeVO.builder().childs(childList).haschild(true).domid("-1").key(-1L).name("全部方案").build();
|
|
|
|
|
List<TypeTreeVO> childList = treeDataList.stream().map(e -> TypeTreeVO.builder().domid(e.getKey()).key(Long.parseLong(e.getKey())).name(e.getStatus() == 0 ? e.getTitle() : e.getTitle() + "("+SystemEnv.getHtmlLabelName(547155,user.getLanguage())+")").build()).collect(Collectors.toList());
|
|
|
|
|
TypeTreeVO build = TypeTreeVO.builder().childs(childList).haschild(true).domid("-1").key(-1L).name(SystemEnv.getHtmlLabelName(547140,user.getLanguage())).build();
|
|
|
|
|
List<TypeTreeVO> typeTreeVOS = new ArrayList<>();
|
|
|
|
|
typeTreeVOS.add(build);
|
|
|
|
|
return typeTreeVOS;
|
|
|
|
|