职级接口、表结构完善
This commit is contained in:
parent
9a5939fac4
commit
28009eee70
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class GradePO {
|
|||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
private long schemeId;
|
||||
private Long schemeId;
|
||||
/**
|
||||
* 职等
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<Map<String,Object>> listLevelsByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 插入职等
|
||||
* @param levelPO
|
||||
|
|
|
|||
|
|
@ -48,6 +48,18 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listLevelsByIds" resultType="java.util.Map">
|
||||
select
|
||||
id,
|
||||
level_name as name
|
||||
from jcl_org_level t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
|
||||
update jcl_org_level
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -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<SchemePO> listSchemesByIds(@Param("ids") Collection<Long> ids);
|
||||
@MapKey("id")
|
||||
List<Map<String,Object>> listSchemesByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
|
|
|
|||
|
|
@ -28,18 +28,6 @@
|
|||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<select id="listSchemesByIds" parameterType="com.engine.organization.entity.scheme.po.SchemePO"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_scheme t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.scheme.po.SchemePO" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
|
|
@ -52,6 +40,17 @@
|
|||
<include refid="baseColumns"/>
|
||||
from jcl_org_scheme t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
<select id="listSchemesByIds" resultType="java.util.Map">
|
||||
select
|
||||
id,
|
||||
scheme_name as name
|
||||
from jcl_org_scheme t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.SchemePO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
|
|
|
|||
|
|
@ -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<String, Object> listPage(Map<String, Object> params) {
|
||||
OrganizationWeaTable<GradeTableVO> 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<Map<String, Object>> schemeMaps = getSchemeMapper().listSchemesByIds(QueryParam.builder().ids(gradePO.getSchemeId().toString()).build().getIds());
|
||||
schemeBrowserBean.setReplaceDatas(schemeMaps);
|
||||
schemeBrowserItem.setBrowserConditionParam(schemeBrowserBean);
|
||||
|
||||
BrowserBean levelBrowserBean = levelBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<String, Object> listPage(Map<String, Object> params) {
|
||||
System.out.println(params);
|
||||
OrganizationWeaTable<LevelTableVO> 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<Map<String, Object>> maps = getSchemeMapper().listSchemesByIds(QueryParam.builder().ids(levelPO.getSchemeId().toString()).build().getIds());
|
||||
|
||||
browserBean.setReplaceDatas(maps);
|
||||
browserItem.setBrowserConditionParam(browserBean);
|
||||
// 编辑状态下,编号只读
|
||||
levelNoCondition.setViewAttr(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue