公司/分部BUG修复 编制方案接口
parent
3578a0f166
commit
b212122007
@ -0,0 +1,13 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/staffplan")
|
||||
public class StaffPlanController extends com.engine.organization.web.StaffPlanController {
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.engine.organization.entity.staff.bo;
|
||||
|
||||
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
|
||||
import com.engine.organization.entity.staff.po.StaffPlanPO;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffPlanBO {
|
||||
public static StaffPlanPO convertParamToPO(StaffPlanSearchParam param, Long employeeId) {
|
||||
if (param == null) {
|
||||
return null;
|
||||
}
|
||||
return StaffPlanPO.builder()
|
||||
.id(param.getId())
|
||||
.planNo(param.getPlanNo())
|
||||
.planName(param.getPlanName())
|
||||
.planYear(param.getPlanYear())
|
||||
.timeStart(param.getTimeStart())
|
||||
.timeEnd(param.getTimeEnd())
|
||||
.companyId(param.getCompanyId())
|
||||
.description(param.getDescription())
|
||||
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 0 : 1)
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
.build();
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.engine.organization.entity.staff.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StaffPlanSearchParam {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String planNo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String planName;
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
private Integer planYear;
|
||||
/**
|
||||
* 时间开始
|
||||
*/
|
||||
private Date timeStart;
|
||||
/**
|
||||
* 时间结束
|
||||
*/
|
||||
private Date timeEnd;
|
||||
/**
|
||||
* 适用公司
|
||||
*/
|
||||
private String companyId;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Boolean forbiddenTag;
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.engine.organization.entity.staff.vo;
|
||||
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508",
|
||||
fields = "t.id, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
|
||||
fromSql = "FROM jcl_org_staffplan t ",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
}
|
||||
)
|
||||
public class StaffPlanTableVO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@OrganizationTableColumn(text = "编号", width = "16%", column = "planNo")
|
||||
private String planNo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@OrganizationTableColumn(text = "名称", width = "16%", column = "planName")
|
||||
private String planName;
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
@OrganizationTableColumn(text = "年度", width = "16%", column = "planYear")
|
||||
private Integer planYear;
|
||||
/**
|
||||
* 时间开始
|
||||
*/
|
||||
@OrganizationTableColumn(text = "时间开始", width = "16%", column = "timeStart")
|
||||
private Date timeStart;
|
||||
/**
|
||||
* 时间结束
|
||||
*/
|
||||
@OrganizationTableColumn(text = "时间结束", width = "16%", column = "timeEnd")
|
||||
private Date timeEnd;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@OrganizationTableColumn(text = "状态", width = "16%", column = "forbiddenTag")
|
||||
private Integer forbiddenTag;
|
||||
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.staff.StaffPlanMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.staff.po.StaffPlanPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="plan_no" property="planNo"/>
|
||||
<result column="plan_name" property="planName"/>
|
||||
<result column="plan_year" property="planYear"/>
|
||||
<result column="time_start" property="timeStart"/>
|
||||
<result column="time_end" property="timeEnd"/>
|
||||
<result column="company_id" property="companyId"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="forbidden_tag" property="forbiddenTag"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.plan_no
|
||||
, t.plan_name
|
||||
, t.plan_year
|
||||
, t.time_start
|
||||
, t.time_end
|
||||
, t.company_id
|
||||
, t.description
|
||||
, t.forbidden_tag
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
<select id="getStaffPlanByID" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_staffplan t where id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listByNo" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_staffplan t where plan_no = #{planNo} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updateStaffPlan" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
|
||||
update jcl_org_staffplan
|
||||
<set>
|
||||
creator=#{creator},
|
||||
update_time=#{updateTime},
|
||||
plan_no=#{planNo},
|
||||
plan_name=#{planName},
|
||||
plan_year=#{planYear},
|
||||
time_start=#{timeStart},
|
||||
time_end=#{timeEnd},
|
||||
company_id=#{companyId},
|
||||
description=#{description},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_staffplan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="planNo != null ">
|
||||
plan_no,
|
||||
</if>
|
||||
<if test="planName != null ">
|
||||
plan_name,
|
||||
</if>
|
||||
<if test="planYear != null ">
|
||||
plan_year,
|
||||
</if>
|
||||
<if test="timeStart != null ">
|
||||
time_start,
|
||||
</if>
|
||||
<if test="timeEnd != null ">
|
||||
time_end,
|
||||
</if>
|
||||
<if test="companyId != null ">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="description != null ">
|
||||
description,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="planNo != null ">
|
||||
#{planNo},
|
||||
</if>
|
||||
<if test="planName != null ">
|
||||
#{planName},
|
||||
</if>
|
||||
<if test="planYear != null ">
|
||||
#{planYear},
|
||||
</if>
|
||||
<if test="timeStart != null ">
|
||||
#{timeStart},
|
||||
</if>
|
||||
<if test="timeEnd != null ">
|
||||
#{timeEnd},
|
||||
</if>
|
||||
<if test="companyId != null ">
|
||||
#{companyId},
|
||||
</if>
|
||||
<if test="description != null ">
|
||||
#{description},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
|
||||
update jcl_org_staffplan
|
||||
<set>
|
||||
forbidden_tag=#{forbiddenTag},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_staffplan
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,74 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface StaffPlanService {
|
||||
/**
|
||||
* 编制方案列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listPage(StaffPlanSearchParam params);
|
||||
|
||||
/**
|
||||
* 新增编制方案
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int saveStaffPlan(StaffPlanSearchParam param);
|
||||
|
||||
/**
|
||||
* 更新编制方案信息
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int updateStaffPlan(StaffPlanSearchParam param);
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
int updateForbiddenTagById(StaffPlanSearchParam params);
|
||||
|
||||
/**
|
||||
* 根据ID批量删除编制方案
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
int deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取搜索条件
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getSearchCondition(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 获取新增、编辑表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取列表页面按钮信息
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getHasRight();
|
||||
}
|
@ -0,0 +1,235 @@
|
||||
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.api.browser.bean.SearchConditionOption;
|
||||
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.staff.bo.StaffPlanBO;
|
||||
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
|
||||
import com.engine.organization.entity.staff.po.StaffPlanPO;
|
||||
import com.engine.organization.entity.staff.vo.StaffPlanTableVO;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||
import com.engine.organization.service.StaffPlanService;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
||||
|
||||
private StaffPlanMapper getStaffPlanMapper() {
|
||||
return MapperProxyFactory.getProxy(StaffPlanMapper.class);
|
||||
}
|
||||
|
||||
private CompMapper getCompMapper() {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(StaffPlanSearchParam params) {
|
||||
OrganizationWeaTable<StaffPlanTableVO> table = new OrganizationWeaTable<>(user, StaffPlanTableVO.class);
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(params, (long) user.getUID());
|
||||
String sqlWhere = buildSqlWhere(staffPlanPO);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveStaffPlan(StaffPlanSearchParam param) {
|
||||
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(param.getPlanNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
return getStaffPlanMapper().insertIgnoreNull(staffPlanPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateStaffPlan(StaffPlanSearchParam param) {
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForbiddenTagById(StaffPlanSearchParam params) {
|
||||
StaffPlanPO staffPlanPO = StaffPlanPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
return getStaffPlanMapper().updateForbiddenTagById(staffPlanPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getStaffPlanMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem planNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "planNo");
|
||||
// 名称
|
||||
SearchConditionItem planNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "planName");
|
||||
// 年度
|
||||
SearchConditionItem planYearItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "年度", "179", "planYear", "");
|
||||
// 时间开始
|
||||
SearchConditionItem timeStartItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 2, "时间开始", "timeStart");
|
||||
// 时间结束
|
||||
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 2, "时间结束", "timeEnd");
|
||||
// 适用公司
|
||||
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "companyId", "162", "planYear", "compBrowser");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
|
||||
// 状态
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
|
||||
SearchConditionOption disableOption = new SearchConditionOption("false", "禁用");
|
||||
selectOptions.add(enableOption);
|
||||
selectOptions.add(disableOption);
|
||||
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "禁用标记", "forbiddenTag");
|
||||
|
||||
|
||||
conditionItems.add(planNoItem);
|
||||
conditionItems.add(planNameItem);
|
||||
conditionItems.add(planYearItem);
|
||||
conditionItems.add(timeStartItem);
|
||||
conditionItems.add(timeEndItem);
|
||||
conditionItems.add(companyIdtItem);
|
||||
conditionItems.add(descriptionItem);
|
||||
conditionItems.add(forbiddenTagItem);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem planNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "planNo");
|
||||
planNoItem.setRules("required|string");
|
||||
// 名称
|
||||
SearchConditionItem planNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "planName");
|
||||
planNameItem.setRules("required|string");
|
||||
// 年度
|
||||
SearchConditionItem planYearItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "年度", "178", "planYear", "");
|
||||
planYearItem.setRules("required|string");
|
||||
// 时间开始
|
||||
SearchConditionItem timeStartItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 3, "时间开始", "timeStart");
|
||||
timeStartItem.setRules("required|string");
|
||||
// 时间结束
|
||||
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 3, "时间结束", "timeEnd");
|
||||
timeEndItem.setRules("required|string");
|
||||
// 适用公司
|
||||
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "companyId", "162", "planYear", "compBrowser");
|
||||
companyIdtItem.setRules("required|string");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
|
||||
|
||||
// 编辑状态下赋值操作
|
||||
String id = Util.null2String(params.get("id"));
|
||||
if (!StringUtil.isEmpty(id)) {
|
||||
StaffPlanPO staffPlanPO = getStaffPlanMapper().getStaffPlanByID(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(staffPlanPO, "选择的数据不存在,或数据已删除");
|
||||
planNoItem.setValue(staffPlanPO.getPlanNo());
|
||||
planNameItem.setValue(staffPlanPO.getPlanName());
|
||||
planYearItem.setValue(staffPlanPO.getPlanYear());
|
||||
timeStartItem.setValue(staffPlanPO.getTimeStart());
|
||||
timeEndItem.setValue(staffPlanPO.getTimeEnd());
|
||||
|
||||
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(QueryParam.builder().ids(staffPlanPO.getCompanyId().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(maps);
|
||||
companyIdtItem.setBrowserConditionParam(browserBean);
|
||||
|
||||
descriptionItem.setValue(staffPlanPO.getDescription());
|
||||
|
||||
// 编辑状态下,编号只读
|
||||
planNoItem.setViewAttr(1);
|
||||
}
|
||||
|
||||
selectItems.add(planNoItem);
|
||||
selectItems.add(planNameItem);
|
||||
selectItems.add(planYearItem);
|
||||
selectItems.add(timeStartItem);
|
||||
selectItems.add(timeEndItem);
|
||||
selectItems.add(companyIdtItem);
|
||||
selectItems.add(descriptionItem);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
* @param staffPlanPO
|
||||
* @return
|
||||
*/
|
||||
private String buildSqlWhere(StaffPlanPO staffPlanPO) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where t.delete_type ='0' ";
|
||||
String planNo = staffPlanPO.getPlanNo();
|
||||
if (StringUtils.isNotBlank(planNo)) {
|
||||
sqlWhere += " AND t.plan_no " + dbType.like(planNo);
|
||||
}
|
||||
String planName = staffPlanPO.getPlanName();
|
||||
if (StringUtils.isNotBlank(planName)) {
|
||||
sqlWhere += " AND t.plan_name " + dbType.like(planName);
|
||||
}
|
||||
Integer planYear = staffPlanPO.getPlanYear();
|
||||
if (null != planYear) {
|
||||
sqlWhere += " AND t.plan_year = '" + planYear + "'";
|
||||
}
|
||||
Date timeStart = staffPlanPO.getTimeStart();
|
||||
if (null != timeStart) {
|
||||
sqlWhere += " AND t.time_start = '" + timeStart + "'";
|
||||
}
|
||||
Date timeEnd = staffPlanPO.getTimeEnd();
|
||||
if (null != timeEnd) {
|
||||
sqlWhere += " AND t.time_end = '" + timeEnd + "'";
|
||||
}
|
||||
String companyId = staffPlanPO.getDescription();
|
||||
if (StringUtils.isNotBlank(companyId)) {
|
||||
sqlWhere += " AND t.companyId = '" + companyId + "'";
|
||||
}
|
||||
|
||||
String description = staffPlanPO.getDescription();
|
||||
if (StringUtils.isNotBlank(description)) {
|
||||
sqlWhere += " AND t.description " + dbType.like(description);
|
||||
}
|
||||
Integer forbiddenTag = staffPlanPO.getForbiddenTag();
|
||||
if (null != forbiddenTag) {
|
||||
sqlWhere += " AND t.forbidden_tag = '" + forbiddenTag + "'";
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
|
||||
import com.engine.organization.service.StaffPlanService;
|
||||
import com.engine.organization.service.impl.StaffPlanServiceImpl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffPlanWrapper extends Service {
|
||||
private StaffPlanService getStaffPlanService(User user) {
|
||||
return ServiceUtil.getService(StaffPlanServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编制方案列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> listPage(StaffPlanSearchParam params) {
|
||||
return getStaffPlanService(user).listPage(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增编制方案
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public int saveStaffPlan(StaffPlanSearchParam param) {
|
||||
return getStaffPlanService(user).saveStaffPlan(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新编制方案
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public int updateStaffPlan(StaffPlanSearchParam param) {
|
||||
return getStaffPlanService(user).updateStaffPlan(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
public int updateForbiddenTagById(StaffPlanSearchParam params) {
|
||||
return getStaffPlanService(user).updateForbiddenTagById(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID批量删除
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
public int deleteByIds(@Param("ids") Collection<Long> ids) {
|
||||
return getStaffPlanService(user).deleteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取搜索条件
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
return getStaffPlanService(user).getSearchCondition(params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取新增表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
return getStaffPlanService(user).getForm(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表页面按钮信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getHasRight() {
|
||||
return getStaffPlanService(user).getHasRight();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue