职级接口、表结构完善

pull/7/MERGE
dxfeng 3 years ago
parent 9a5939fac4
commit 28009eee70

@ -32,7 +32,7 @@ CREATE TABLE JCL_ORG_GRADE (
grade_name varchar(100) NULL, grade_name varchar(100) NULL,
description text NULL, description text NULL,
scheme_id int null, scheme_id int null,
level_id int null, level_id varchar(100) null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,

@ -33,7 +33,7 @@ CREATE TABLE JCL_ORG_GRADE (
GRADE_NAME NVARCHAR2(100) NULL, GRADE_NAME NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
SCHEME_ID NUMBER NULL, SCHEME_ID NUMBER NULL,
LEVEL_ID NUMBER NULL, LEVEL_ID NVARCHAR2(100) NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE 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, grade_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL,
scheme_id int null, scheme_id int null,
level_id int null, level_id varchar(100) null,
forbidden_tag int NULL, forbidden_tag int NULL,
creator int null, creator int null,
delete_type 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 com.engine.organization.entity.scheme.po.LevelPO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author dxfeng * @Author dxfeng
@ -30,6 +32,15 @@ public interface LevelMapper {
*/ */
LevelPO getLevelByID(@Param("id") long id); LevelPO getLevelByID(@Param("id") long id);
/**
* ID
*
* @param ids
* @return
*/
@MapKey("id")
List<Map<String,Object>> listLevelsByIds(@Param("ids") Collection<Long> ids);
/** /**
* *
* @param levelPO * @param levelPO

@ -48,6 +48,18 @@
</if> </if>
</select> </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 id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
update jcl_org_level update jcl_org_level
<set> <set>

@ -2,10 +2,12 @@ package com.engine.organization.mapper.scheme;
import com.engine.organization.entity.scheme.po.SchemePO; import com.engine.organization.entity.scheme.po.SchemePO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author dxfeng * @Author dxfeng
@ -38,7 +40,8 @@ public interface SchemeMapper {
* @param ids * @param ids
* @return * @return
*/ */
List<SchemePO> listSchemesByIds(@Param("ids") Collection<Long> ids); @MapKey("id")
List<Map<String,Object>> listSchemesByIds(@Param("ids") Collection<Long> ids);
/** /**
* null * null

@ -28,18 +28,6 @@
, t.update_time , t.update_time
</sql> </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 id="listByNo" parameterType="com.engine.organization.entity.scheme.po.SchemePO" resultMap="BaseResultMap">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
@ -52,6 +40,17 @@
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_scheme t where id = #{id} AND delete_type = 0 from jcl_org_scheme t where id = #{id} AND delete_type = 0
</select> </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" <insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.SchemePO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true"> keyColumn="id" useGeneratedKeys="true">

@ -1,16 +1,20 @@
package com.engine.organization.service.impl; package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg; import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.TopTab; import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.scheme.dto.GradeDTO; import com.engine.organization.entity.scheme.dto.GradeDTO;
import com.engine.organization.entity.scheme.param.GradeSearchParam; import com.engine.organization.entity.scheme.param.GradeSearchParam;
import com.engine.organization.entity.scheme.po.GradePO; import com.engine.organization.entity.scheme.po.GradePO;
import com.engine.organization.entity.scheme.vo.GradeTableVO; import com.engine.organization.entity.scheme.vo.GradeTableVO;
import com.engine.organization.mapper.scheme.GradeMapper; 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.service.GradeService;
import com.engine.organization.util.MenuBtn; import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationAssert;
@ -37,6 +41,14 @@ public class GradeServiceImpl extends Service implements GradeService {
return MapperProxyFactory.getProxy(GradeMapper.class); return MapperProxyFactory.getProxy(GradeMapper.class);
} }
private LevelMapper getLevelMapper() {
return MapperProxyFactory.getProxy(LevelMapper.class);
}
private SchemeMapper getSchemeMapper() {
return MapperProxyFactory.getProxy(SchemeMapper.class);
}
@Override @Override
public Map<String, Object> listPage(Map<String, Object> params) { public Map<String, Object> listPage(Map<String, Object> params) {
OrganizationWeaTable<GradeTableVO> table = new OrganizationWeaTable<>(user, GradeTableVO.class); OrganizationWeaTable<GradeTableVO> table = new OrganizationWeaTable<>(user, GradeTableVO.class);
@ -102,7 +114,7 @@ public class GradeServiceImpl extends Service implements GradeService {
gradeNoCondition.setRules("required|string"); gradeNoCondition.setRules("required|string");
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description"); SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", "schemeBrowser"); 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")); String id = Util.null2String(params.get("id"));
@ -115,6 +127,17 @@ public class GradeServiceImpl extends Service implements GradeService {
descriptionCondition.setValue(gradePO.getDescription()); descriptionCondition.setValue(gradePO.getDescription());
schemeBrowserItem.setValue(gradePO.getSchemeId()); schemeBrowserItem.setValue(gradePO.getSchemeId());
levelBrowserItem.setValue(gradePO.getLevelId()); 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); gradeNoCondition.setViewAttr(1);
} }
@ -169,10 +192,10 @@ public class GradeServiceImpl extends Service implements GradeService {
if (StringUtils.isNotBlank(schemeId)) { if (StringUtils.isNotBlank(schemeId)) {
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId); sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
} }
String viewCondition = (String) params.get("viewcondition"); String viewCondition = (String) params.get("viewCondition");
// -1:全部、0:启用、1:禁用 // -1:全部、0:启用、1:禁用
if (StringUtils.isNotBlank(viewCondition) && !"-1".equalsIgnoreCase(viewCondition)) { if (StringUtils.isNotBlank(viewCondition) && !"-1".equalsIgnoreCase(viewCondition)) {
sqlWhere += " AND t.forbidden_tag = '" + schemeId + "'"; sqlWhere += " AND t.forbidden_tag = '" + viewCondition + "'";
} }
return sqlWhere; return sqlWhere;
} }

@ -1,16 +1,19 @@
package com.engine.organization.service.impl; package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg; import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.TopTab; import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.scheme.dto.LevelDTO; import com.engine.organization.entity.scheme.dto.LevelDTO;
import com.engine.organization.entity.scheme.param.LevelSearchParam; import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.entity.scheme.po.LevelPO; import com.engine.organization.entity.scheme.po.LevelPO;
import com.engine.organization.entity.scheme.vo.LevelTableVO; import com.engine.organization.entity.scheme.vo.LevelTableVO;
import com.engine.organization.mapper.scheme.LevelMapper; import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.mapper.scheme.SchemeMapper;
import com.engine.organization.service.LevelService; import com.engine.organization.service.LevelService;
import com.engine.organization.util.MenuBtn; import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationAssert;
@ -37,12 +40,14 @@ public class LevelServiceImpl extends Service implements LevelService {
return MapperProxyFactory.getProxy(LevelMapper.class); return MapperProxyFactory.getProxy(LevelMapper.class);
} }
private SchemeMapper getSchemeMapper() {
return MapperProxyFactory.getProxy(SchemeMapper.class);
}
@Override @Override
public Map<String, Object> listPage(Map<String, Object> params) { public Map<String, Object> listPage(Map<String, Object> params) {
System.out.println(params);
OrganizationWeaTable<LevelTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class); OrganizationWeaTable<LevelTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class);
String sqlWhere = buildSqlWhere(params); String sqlWhere = buildSqlWhere(params);
System.out.println(sqlWhere);
table.setSqlwhere(sqlWhere); table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false); WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult()); result.putAll(table.makeDataResult());
@ -115,6 +120,12 @@ public class LevelServiceImpl extends Service implements LevelService {
levelNoCondition.setValue(levelPO.getLevelNo()); levelNoCondition.setValue(levelPO.getLevelNo());
descriptionCondition.setValue(levelPO.getDescription()); descriptionCondition.setValue(levelPO.getDescription());
browserItem.setValue(levelPO.getSchemeId()); 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); levelNoCondition.setViewAttr(1);
} }

Loading…
Cancel
Save