Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
杜建超 2020-10-21 11:16:14 +08:00
commit 4e89c24e49
19 changed files with 173 additions and 29 deletions

View File

@ -63,6 +63,12 @@ public class StaffRoleController {
}
@RequestMapping("/listByGroupId")
public R listByGroupId(Long id ) {
List<StaffRole> staffRoles = staffRoleService.selectByGroupId(id);
return R.ok().put("staffRoles", staffRoles);
}
/**
* 信息
*/

View File

@ -59,7 +59,7 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
@Override
public void deleteAllRelates() {
departmentsStaffRelateDao.deleteAllRelates();
}
@Override

View File

@ -36,4 +36,6 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
List<EvaluationGroup> seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req);
List<EvaluationGroup> selectEvaluationGroupByIds(@Param("ids") List<Long> ids);
}

View File

@ -40,4 +40,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
List<StaffRole> selectByRole(@Param("departmentLevel") String departmentLevel);
List<StaffRole> selectByCondition(@Param("page") IPage page, @Param("params") Map<String, Object> params);
List<StaffRole> selectByGroupId(@Param("id") Long id);
}

View File

@ -1,10 +1,13 @@
package com.lz.modules.flow.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.context.annotation.ComponentScan;
import java.util.Date;
/**
* <p>
@ -44,6 +47,11 @@ public class EvaluationGroup implements java.io.Serializable {
//排除人员ids逗号隔开
@ApiModelProperty(value = "排除人员ids逗号隔开", name = "outIds")
private String outIds;
@TableField(exist = false)
@ApiModelProperty(value = "参与考核人数", name = "counts")
private int counts;
/**
*
* @return

View File

@ -40,8 +40,8 @@ public class FlowStart implements java.io.Serializable {
@ApiModelProperty(value = "结束时间", name = "endTime")
private Date endTime;
//组id
@ApiModelProperty(value = "组id", name = "groupIds")
private Long groupIds;
@ApiModelProperty(value = "组id,逗号隔开", name = "groupIds")
private String groupIds;
/**
*
* @return
@ -151,14 +151,14 @@ public class FlowStart implements java.io.Serializable {
* 组id
* @return
*/
public Long getGroupIds() {
public String getGroupIds() {
return groupIds;
}
/**
* 组id
* @param groupIds
*/
public void setGroupIds(Long groupIds) {
public void setGroupIds(String groupIds) {
this.groupIds = groupIds;
}

View File

@ -1,35 +1,49 @@
package com.lz.modules.flow.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 菜单权限表
* </p>*流转关系表
* @author quyixiao
* @since 2020-08-23
* @since 2020-10-21
*/
@Data
@TableName("lz_staff_role")
@ApiModel(value = "流转关系表")
public class StaffRole implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//是否删除状态1删除0有效
@ApiModelProperty(value = "是否删除状态1删除0有效", name = "isDelete")
private Integer isDelete;
//创建时间
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
private Date gmtCreate;
//最后修改时间
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
private Date gmtModified;
//员工 id
@ApiModelProperty(value = "员工 id", name = "staffId")
private Long staffId;
//角色
@ApiModelProperty(value = "角色", name = "departmentLevel")
private String departmentLevel;
//角色 id
@ApiModelProperty(value = "角色 id", name = "typeRoleIds")
private String typeRoleIds;
//员工名称
@ApiModelProperty(value = "员工名称", name = "staffName")
private String staffName;
//组id
@ApiModelProperty(value = "组id", name = "evaluationGroupId")
private Long evaluationGroupId;
/**
*
* @return
@ -135,6 +149,36 @@ public class StaffRole implements java.io.Serializable {
this.typeRoleIds = typeRoleIds;
}
/**
* 员工名称
* @return
*/
public String getStaffName() {
return staffName;
}
/**
* 员工名称
* @param staffName
*/
public void setStaffName(String staffName) {
this.staffName = staffName;
}
/**
* 组id
* @return
*/
public Long getEvaluationGroupId() {
return evaluationGroupId;
}
/**
* 组id
* @param evaluationGroupId
*/
public void setEvaluationGroupId(Long evaluationGroupId) {
this.evaluationGroupId = evaluationGroupId;
}
@Override
public String toString() {
return "StaffRole{" +
@ -145,6 +189,8 @@ public class StaffRole implements java.io.Serializable {
",staffId=" + staffId +
",departmentLevel=" + departmentLevel +
",typeRoleIds=" + typeRoleIds +
",staffName=" + staffName +
",evaluationGroupId=" + evaluationGroupId +
"}";
}
}

View File

@ -26,8 +26,8 @@ public class FlowStartDto {
@ApiModelProperty(value = "结束时间", name = "endTime")
private Date endTime;
//组id
@ApiModelProperty(value = "组id", name = "groupIds")
private Long groupIds;
@ApiModelProperty(value = "组id,逗号隔开", name = "groupIds")
private String groupIds;
/**
*
* @return
@ -94,14 +94,14 @@ public class FlowStartDto {
* 组id
* @return
*/
public Long getGroupIds() {
public String getGroupIds() {
return groupIds;
}
/**
* 组id
* @param groupIds
*/
public void setGroupIds(Long groupIds) {
public void setGroupIds(String groupIds) {
this.groupIds = groupIds;
}

View File

@ -40,6 +40,8 @@ public class EvaluationGroupReq implements java.io.Serializable {
private String name;
/**
*
* @return

View File

@ -48,8 +48,8 @@ public class FlowStartReq implements java.io.Serializable {
@ApiModelProperty(value = "结束时间", name = "endTime")
private Date endTime;
//组id
@ApiModelProperty(value = "组id", name = "groupIds")
private Long groupIds;
@ApiModelProperty(value = "组id,逗号隔开", name = "groupIds")
private String groupIds;
/**
*
* @return
@ -159,14 +159,14 @@ public class FlowStartReq implements java.io.Serializable {
* 组id
* @return
*/
public Long getGroupIds() {
public String getGroupIds() {
return groupIds;
}
/**
* 组id
* @param groupIds
*/
public void setGroupIds(Long groupIds) {
public void setGroupIds(String groupIds) {
this.groupIds = groupIds;
}

View File

@ -39,4 +39,6 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req);
List<EvaluationGroup> selectEvaluationGroupByIds(List<Long> ids);
}

View File

@ -47,4 +47,6 @@ public interface StaffRoleService extends IService<StaffRole> {
SysRoleEntity getRole(Long id);
List<SysMenuEntity> selectMenuList();
List<StaffRole> selectByGroupId(Long id);
}

View File

@ -37,6 +37,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
@Autowired
private StaffOccupationService staffOccupationService;
@Autowired
private EvaluationGroupService evaluationGroupService;
@Override
@ -77,6 +80,13 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
public PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req){
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
.doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req));
//下面实时统计考核人数
List<EvaluationGroup> groups = pageUtils.getList();
for (EvaluationGroup group:groups
) {
List<String> ids = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
group.setCounts(ids.size());
}
return pageUtils;
}
@ -110,4 +120,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
List<String> data = staffOccupationService.removeDimissionStaffByStaffIds(distDepStaffIds);
return data;
}
@Override
public List<EvaluationGroup> selectEvaluationGroupByIds(List<Long> ids){
return evaluationGroupMapper.selectEvaluationGroupByIds(ids);
}
}

View File

@ -229,6 +229,12 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
return list;
}
@Override
public List<StaffRole> selectByGroupId(Long id) {
return staffRoleMapper.selectByGroupId(id);
}
public String getSuffix(Map<String, DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap, String departmentId,
Map<String, DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate) {
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId);

View File

@ -31,7 +31,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/evaluationGroup")
@Api(tags="")
@Api(tags="")
public class EvaluationGroupController {
@ -53,9 +53,9 @@ public class EvaluationGroupController {
@GetMapping("/getById")
@ApiOperation("获取考组详情")
@ApiOperation("获取考组详情")
@ApiResponses({@ApiResponse(code=200,message = "成功", response= EvaluationGroupDto.class)})
public R getById(@RequestParam @ApiParam("组id") Long id) {
public R getById(@RequestParam @ApiParam("组id") Long id) {
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
EvaluationGroupDto evaluationGroupDto = new EvaluationGroupDto();
if(evaluationGroup.getDepIds() != null && evaluationGroup.getDepIds().length() > 0){
@ -113,7 +113,7 @@ public class EvaluationGroupController {
@PostMapping("/getGroups")
@ApiOperation("获取考组列表")
@ApiOperation("获取考组列表")
@ApiResponses({@ApiResponse(code=200,message = "成功", response=EvaluationGroup.class)})
public R getGroups(@RequestBody @ApiParam EvaluationGroupReq req) {
PageUtils pageUtils = evaluationGroupService.selectEvaluationGroupByReq(req);
@ -122,7 +122,7 @@ public class EvaluationGroupController {
@PostMapping("/update")
@ApiOperation("编辑考")
@ApiOperation("编辑考")
public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.updateEvaluationGroupById(evaluationGroup);
return R.ok();
@ -130,7 +130,8 @@ public class EvaluationGroupController {
@PostMapping("/save")
@ApiOperation("新增考核组")
@ApiOperation("新增考评组")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = EvaluationGroup.class)})
public R save(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
return R.ok().put("data", evaluationGroup);
@ -138,7 +139,7 @@ public class EvaluationGroupController {
@GetMapping("/delete")
@ApiOperation("删除考")
@ApiOperation("删除考")
public R delete(@RequestParam @ApiParam("组id") Long id) {
resultModelService.deleteResultModelByGroupId(id);
return evaluationGroupService.deleteEvaluationGroupById(id);

View File

@ -5,16 +5,27 @@ import com.alibaba.fastjson.JSONObject;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowStartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/flowStart")
@ -26,6 +37,8 @@ public class FlowStartController {
private FlowStartService flowStartService;
@Autowired
private EvaluationGroupService evaluationGroupService;
@ -43,9 +56,25 @@ public class FlowStartController {
}
@RequestMapping("/save")
public R save(@RequestBody FlowStart flowStart) {
@PostMapping("/save")
@ApiOperation("发起新的考核任务")
public R save(@RequestBody @ApiParam FlowStart flowStart) {
flowStartService.insertFlowStart(flowStart);
//下面开始初始化流程
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
@Override
public Long apply(String s) {
return Long.getLong(s);
}
}).collect(Collectors.toList());
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
Map<String, Long> map = new HashedMap();
for (EvaluationGroup evaluationGroup:evaluationGroups
) {
//下面初始化部门的员工考核流程
//下面初始化考核人员的考核流程
}
return R.ok();
}

View File

@ -96,6 +96,14 @@
<if test="req.name != null and req.name != ''">and name like concat('%', #{req.name} '%') </if>
</select>
<select id="selectEvaluationGroupById" resultType="EvaluationGroup" >
select * from lz_evaluation_group where is_delete = 0 and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

View File

@ -11,12 +11,14 @@
<result column="staff_id" property="staffId"/>
<result column="department_level" property="departmentLevel"/>
<result column="type_role_ids" property="typeRoleIds"/>
<result column="staff_name" property="staffName"/>
<result column="evaluation_group_id" property="evaluationGroupId"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds, staff_name AS staffName, evaluation_group_id AS evaluationGroupId
</sql>
@ -32,6 +34,8 @@
<if test="staffId != null">staff_id, </if>
<if test="departmentLevel != null">department_level, </if>
<if test="typeRoleIds != null">type_role_ids, </if>
<if test="staffName != null">staff_name, </if>
<if test="evaluationGroupId != null">evaluation_group_id, </if>
is_delete,
gmt_create,
gmt_modified
@ -39,6 +43,8 @@
<if test="staffId != null">#{ staffId}, </if>
<if test="departmentLevel != null">#{ departmentLevel}, </if>
<if test="typeRoleIds != null">#{ typeRoleIds}, </if>
<if test="staffName != null">#{ staffName}, </if>
<if test="evaluationGroupId != null">#{ evaluationGroupId}, </if>
0,
now(),
now()
@ -54,7 +60,9 @@
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="departmentLevel != null">department_level = #{departmentLevel},</if>
<if test="typeRoleIds != null">type_role_ids = #{typeRoleIds}</if>
<if test="typeRoleIds != null">type_role_ids = #{typeRoleIds},</if>
<if test="staffName != null">staff_name = #{staffName},</if>
<if test="evaluationGroupId != null">evaluation_group_id = #{evaluationGroupId}</if>
</trim>
,gmt_modified = now()
where id = #{id}
@ -69,7 +77,9 @@
gmt_create = #{gmtCreate},
staff_id = #{staffId},
department_level = #{departmentLevel},
type_role_ids = #{typeRoleIds}
type_role_ids = #{typeRoleIds},
staff_name = #{staffName},
evaluation_group_id = #{evaluationGroupId}
,gmt_modified = now()
where id = #{id}
</update>
@ -79,6 +89,8 @@
update lz_staff_role set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectByStaffId" resultType="com.lz.modules.flow.entity.StaffRole">
select * from lz_staff_role where is_delete = 0 and staff_id = #{staffId} limit 1
</select>
@ -94,6 +106,9 @@
</if>
order by id desc
</select>
<select id="selectByGroupId" resultType="com.lz.modules.flow.entity.StaffRole">
select * from lz_staff_role where is_delete = 0 and evaluation_group_id = #{id}
</select>
</mapper>

View File

@ -78,7 +78,7 @@ public class MysqlMain {
//list.add(new TablesBean("lz_result_model"));
//list.add(new TablesBean("lz_result_score"));
//list.add(new TablesBean("lz_result_taget_lib"));
list.add(new TablesBean("lz_flow_chart_detail_record"));
list.add(new TablesBean("lz_staff_role"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();