|
|
|
@ -5,8 +5,8 @@ import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.TreeData;
|
|
|
|
|
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
|
|
|
|
import com.engine.organization.entity.scheme.SchemeTreeData;
|
|
|
|
|
import com.engine.organization.entity.scheme.dto.SchemeDTO;
|
|
|
|
|
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
|
|
|
|
|
import com.engine.organization.entity.scheme.po.SchemePO;
|
|
|
|
@ -14,8 +14,10 @@ import com.engine.organization.entity.scheme.vo.SchemeTableVO;
|
|
|
|
|
import com.engine.organization.mapper.scheme.SchemeMapper;
|
|
|
|
|
import com.engine.organization.service.SchemeService;
|
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
|
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.detach.DetachUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
@ -122,6 +124,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
schemeNameCondition.setRules("required|string");
|
|
|
|
|
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "方案编号", "schemeNo");
|
|
|
|
|
schemeNoCondition.setRules("required|string");
|
|
|
|
|
SearchConditionItem subCompanyIdItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 2, false, "所属分部", "164", "subCompanyId", "");
|
|
|
|
|
SearchConditionItem textareaItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 200, "方案说明", "schemeDescription");
|
|
|
|
|
|
|
|
|
|
// 编辑状态下赋值操作
|
|
|
|
@ -132,6 +135,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
schemeNameCondition.setValue(schemePO.getSchemeName());
|
|
|
|
|
schemeNoCondition.setValue(schemePO.getSchemeNo());
|
|
|
|
|
textareaItem.setValue(schemePO.getSchemeDescription());
|
|
|
|
|
OrganizationBrowserUtil.assignBrowser(user, Util.null2String(schemePO.getSubCompanyId()), 164, subCompanyIdItem);
|
|
|
|
|
|
|
|
|
|
// 编辑状态下,编号只读
|
|
|
|
|
// schemeNoCondition.setViewAttr(1);
|
|
|
|
@ -139,6 +143,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
|
|
|
|
|
selectItems.add(schemeNoCondition);
|
|
|
|
|
selectItems.add(schemeNameCondition);
|
|
|
|
|
selectItems.add(subCompanyIdItem);
|
|
|
|
|
selectItems.add(textareaItem);
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
|
|
|
|
apiDatas.put("condition", addGroups);
|
|
|
|
@ -152,18 +157,15 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TypeTreeVO> getTreeData() {
|
|
|
|
|
ArrayList<TreeData> treeDataList = getSchemeMapper().getTreeData();
|
|
|
|
|
TypeTreeVO build = TypeTreeVO.builder()
|
|
|
|
|
.childs(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()))
|
|
|
|
|
.haschild(true)
|
|
|
|
|
.domid("-1")
|
|
|
|
|
.key(-1L)
|
|
|
|
|
.name("全部方案").build();
|
|
|
|
|
List<SchemeTreeData> treeDataList = getSchemeMapper().getTreeData();
|
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
|
if(detachUtil.isDETACH()){
|
|
|
|
|
String jclRoleLevels = detachUtil.getJclRoleLevels();
|
|
|
|
|
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> typeTreeVOS = new ArrayList<>();
|
|
|
|
|
typeTreeVOS.add(build);
|
|
|
|
|
return typeTreeVOS;
|
|
|
|
@ -188,6 +190,13 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
if (StringUtils.isNotBlank(no)) {
|
|
|
|
|
sqlWhere += " AND scheme_no " + dbType.like(no);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
|
if (detachUtil.isDETACH()) {
|
|
|
|
|
String jclRoleLevels = detachUtil.getJclRoleLevels();
|
|
|
|
|
sqlWhere += " and subcompanyid in (" + jclRoleLevels + ")";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sqlWhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|