diff --git a/docs/表结构SQL/MySQL.sql b/docs/表结构SQL/MySQL.sql index 0c925db3..05a41bd3 100644 --- a/docs/表结构SQL/MySQL.sql +++ b/docs/表结构SQL/MySQL.sql @@ -32,7 +32,7 @@ CREATE TABLE JCL_ORG_GRADE ( grade_name varchar(100) NULL, description text NULL, scheme_id int null, - level_id int null, + level_id varchar(100) null, forbidden_tag int NULL, creator int null, delete_type int null, diff --git a/docs/表结构SQL/Oracle.sql b/docs/表结构SQL/Oracle.sql index d4e9c140..5a867e60 100644 --- a/docs/表结构SQL/Oracle.sql +++ b/docs/表结构SQL/Oracle.sql @@ -33,7 +33,7 @@ CREATE TABLE JCL_ORG_GRADE ( GRADE_NAME NVARCHAR2(100) NULL, DESCRIPTION NVARCHAR2(1000) NULL, SCHEME_ID NUMBER NULL, - LEVEL_ID NUMBER NULL, + LEVEL_ID NVARCHAR2(100) NULL, FORBIDDEN_TAG NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, diff --git a/docs/表结构SQL/SqlServer.sql b/docs/表结构SQL/SqlServer.sql index ec4262a4..001c8821 100644 --- a/docs/表结构SQL/SqlServer.sql +++ b/docs/表结构SQL/SqlServer.sql @@ -32,7 +32,7 @@ CREATE TABLE JCL_ORG_GRADE ( grade_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL, scheme_id int null, - level_id int null, + level_id varchar(100) null, forbidden_tag int NULL, creator int null, delete_type int null, diff --git a/src/com/engine/organization/entity/scheme/po/GradePO.java b/src/com/engine/organization/entity/scheme/po/GradePO.java index 3a303f2d..bc16d400 100644 --- a/src/com/engine/organization/entity/scheme/po/GradePO.java +++ b/src/com/engine/organization/entity/scheme/po/GradePO.java @@ -37,7 +37,7 @@ public class GradePO { /** * 等级方案 */ - private long schemeId; + private Long schemeId; /** * 职等 */ diff --git a/src/com/engine/organization/mapper/scheme/LevelMapper.java b/src/com/engine/organization/mapper/scheme/LevelMapper.java index 94bd12b5..81f4dca1 100644 --- a/src/com/engine/organization/mapper/scheme/LevelMapper.java +++ b/src/com/engine/organization/mapper/scheme/LevelMapper.java @@ -2,10 +2,12 @@ package com.engine.organization.mapper.scheme; import com.engine.organization.entity.scheme.po.LevelPO; +import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; +import java.util.Map; /** * @Author dxfeng @@ -30,6 +32,15 @@ public interface LevelMapper { */ LevelPO getLevelByID(@Param("id") long id); + /** + * 根据ID查询登记方案列表 + * + * @param ids + * @return + */ + @MapKey("id") + List> listLevelsByIds(@Param("ids") Collection ids); + /** * 插入职等 * @param levelPO diff --git a/src/com/engine/organization/mapper/scheme/LevelMapper.xml b/src/com/engine/organization/mapper/scheme/LevelMapper.xml index 5ed33cdb..f8c65a5a 100644 --- a/src/com/engine/organization/mapper/scheme/LevelMapper.xml +++ b/src/com/engine/organization/mapper/scheme/LevelMapper.xml @@ -48,6 +48,18 @@ + + update jcl_org_level diff --git a/src/com/engine/organization/mapper/scheme/SchemeMapper.java b/src/com/engine/organization/mapper/scheme/SchemeMapper.java index ac2d1828..260f9294 100644 --- a/src/com/engine/organization/mapper/scheme/SchemeMapper.java +++ b/src/com/engine/organization/mapper/scheme/SchemeMapper.java @@ -2,10 +2,12 @@ package com.engine.organization.mapper.scheme; import com.engine.organization.entity.scheme.po.SchemePO; +import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; +import java.util.Map; /** * @Author dxfeng @@ -38,7 +40,8 @@ public interface SchemeMapper { * @param ids * @return */ - List listSchemesByIds(@Param("ids") Collection ids); + @MapKey("id") + List> listSchemesByIds(@Param("ids") Collection ids); /** * 新增,忽略null字段 diff --git a/src/com/engine/organization/mapper/scheme/SchemeMapper.xml b/src/com/engine/organization/mapper/scheme/SchemeMapper.xml index f8591a90..aca1edcf 100644 --- a/src/com/engine/organization/mapper/scheme/SchemeMapper.xml +++ b/src/com/engine/organization/mapper/scheme/SchemeMapper.xml @@ -28,18 +28,6 @@ , t.update_time - - + diff --git a/src/com/engine/organization/service/impl/GradeServiceImpl.java b/src/com/engine/organization/service/impl/GradeServiceImpl.java index b31a44e9..592e21fd 100644 --- a/src/com/engine/organization/service/impl/GradeServiceImpl.java +++ b/src/com/engine/organization/service/impl/GradeServiceImpl.java @@ -1,16 +1,20 @@ package com.engine.organization.service.impl; +import com.api.browser.bean.BrowserBean; import com.api.browser.bean.SearchConditionGroup; 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.QueryParam; import com.engine.organization.entity.TopTab; import com.engine.organization.entity.scheme.dto.GradeDTO; import com.engine.organization.entity.scheme.param.GradeSearchParam; import com.engine.organization.entity.scheme.po.GradePO; import com.engine.organization.entity.scheme.vo.GradeTableVO; import com.engine.organization.mapper.scheme.GradeMapper; +import com.engine.organization.mapper.scheme.LevelMapper; +import com.engine.organization.mapper.scheme.SchemeMapper; import com.engine.organization.service.GradeService; import com.engine.organization.util.MenuBtn; import com.engine.organization.util.OrganizationAssert; @@ -37,6 +41,14 @@ public class GradeServiceImpl extends Service implements GradeService { return MapperProxyFactory.getProxy(GradeMapper.class); } + private LevelMapper getLevelMapper() { + return MapperProxyFactory.getProxy(LevelMapper.class); + } + + private SchemeMapper getSchemeMapper() { + return MapperProxyFactory.getProxy(SchemeMapper.class); + } + @Override public Map listPage(Map params) { OrganizationWeaTable table = new OrganizationWeaTable<>(user, GradeTableVO.class); @@ -102,7 +114,7 @@ public class GradeServiceImpl extends Service implements GradeService { gradeNoCondition.setRules("required|string"); SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description"); SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", "schemeBrowser"); - SearchConditionItem levelBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职等", "161", "levelId", "levelBrowser"); + SearchConditionItem levelBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职等", "162", "levelId", "LevelBrowser"); // 编辑状态下赋值操作 String id = Util.null2String(params.get("id")); @@ -115,6 +127,17 @@ public class GradeServiceImpl extends Service implements GradeService { descriptionCondition.setValue(gradePO.getDescription()); schemeBrowserItem.setValue(gradePO.getSchemeId()); levelBrowserItem.setValue(gradePO.getLevelId()); + + BrowserBean schemeBrowserBean = schemeBrowserItem.getBrowserConditionParam(); + List> schemeMaps = getSchemeMapper().listSchemesByIds(QueryParam.builder().ids(gradePO.getSchemeId().toString()).build().getIds()); + schemeBrowserBean.setReplaceDatas(schemeMaps); + schemeBrowserItem.setBrowserConditionParam(schemeBrowserBean); + + BrowserBean levelBrowserBean = levelBrowserItem.getBrowserConditionParam(); + List> levelMaps = getLevelMapper().listLevelsByIds(QueryParam.builder().ids(gradePO.getLevelId()).build().getIds()); + levelBrowserBean.setReplaceDatas(levelMaps); + levelBrowserItem.setBrowserConditionParam(levelBrowserBean); + // 编辑状态下,编号只读 gradeNoCondition.setViewAttr(1); } @@ -169,10 +192,10 @@ public class GradeServiceImpl extends Service implements GradeService { if (StringUtils.isNotBlank(schemeId)) { sqlWhere += " AND t.scheme_id " + dbType.like(schemeId); } - String viewCondition = (String) params.get("viewcondition"); + String viewCondition = (String) params.get("viewCondition"); // -1:全部、0:启用、1:禁用 if (StringUtils.isNotBlank(viewCondition) && !"-1".equalsIgnoreCase(viewCondition)) { - sqlWhere += " AND t.forbidden_tag = '" + schemeId + "'"; + sqlWhere += " AND t.forbidden_tag = '" + viewCondition + "'"; } return sqlWhere; } diff --git a/src/com/engine/organization/service/impl/LevelServiceImpl.java b/src/com/engine/organization/service/impl/LevelServiceImpl.java index dd932201..31350daa 100644 --- a/src/com/engine/organization/service/impl/LevelServiceImpl.java +++ b/src/com/engine/organization/service/impl/LevelServiceImpl.java @@ -1,16 +1,19 @@ package com.engine.organization.service.impl; +import com.api.browser.bean.BrowserBean; import com.api.browser.bean.SearchConditionGroup; 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.QueryParam; import com.engine.organization.entity.TopTab; import com.engine.organization.entity.scheme.dto.LevelDTO; import com.engine.organization.entity.scheme.param.LevelSearchParam; import com.engine.organization.entity.scheme.po.LevelPO; import com.engine.organization.entity.scheme.vo.LevelTableVO; import com.engine.organization.mapper.scheme.LevelMapper; +import com.engine.organization.mapper.scheme.SchemeMapper; import com.engine.organization.service.LevelService; import com.engine.organization.util.MenuBtn; import com.engine.organization.util.OrganizationAssert; @@ -37,12 +40,14 @@ public class LevelServiceImpl extends Service implements LevelService { return MapperProxyFactory.getProxy(LevelMapper.class); } + private SchemeMapper getSchemeMapper() { + return MapperProxyFactory.getProxy(SchemeMapper.class); + } + @Override public Map listPage(Map params) { - System.out.println(params); OrganizationWeaTable table = new OrganizationWeaTable<>(user, LevelTableVO.class); String sqlWhere = buildSqlWhere(params); - System.out.println(sqlWhere); table.setSqlwhere(sqlWhere); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); @@ -115,6 +120,12 @@ public class LevelServiceImpl extends Service implements LevelService { levelNoCondition.setValue(levelPO.getLevelNo()); descriptionCondition.setValue(levelPO.getDescription()); browserItem.setValue(levelPO.getSchemeId()); + + BrowserBean browserBean = browserItem.getBrowserConditionParam(); + List> maps = getSchemeMapper().listSchemesByIds(QueryParam.builder().ids(levelPO.getSchemeId().toString()).build().getIds()); + + browserBean.setReplaceDatas(maps); + browserItem.setBrowserConditionParam(browserBean); // 编辑状态下,编号只读 levelNoCondition.setViewAttr(1); }