履职记录上传履职清单任务多选。
This commit is contained in:
parent
175101f924
commit
74e19b584b
|
|
@ -13,7 +13,7 @@ public class AddPerformRecordDto {
|
|||
private String listdetailid;
|
||||
|
||||
@NotNull(message = "清单不能为空")
|
||||
@ApiModelProperty(value = "清单id",required = true)
|
||||
@ApiModelProperty(value = "清单id 多个逗号隔开",required = true)
|
||||
private String listfactorid;
|
||||
|
||||
@NotNull(message = "用户不能为空")
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ public class CodeGenerator {
|
|||
public static String packgerParent = "com.rzyc";
|
||||
|
||||
//mysql相关信息
|
||||
public static String url = "jdbc:mysql://121.40.106.103:3306/inventory_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false";
|
||||
public static String url = "jdbc:mysql://42.193.40.239:33063/inventory_23?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false";
|
||||
public static String DriverName = "com.mysql.cj.jdbc.Driver";
|
||||
public static String Username = "rzyc";
|
||||
public static String Password = "admin@rzyc2022.com##";
|
||||
public static String Username = "zyjy";
|
||||
public static String Password = "eaNCBySJdHLb23GW";
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.rzyc.enums;
|
||||
|
||||
/**
|
||||
* 履职记录目标类型 1、履职清单 2、履职任务
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 13:41
|
||||
*/
|
||||
public enum ListTargerType {
|
||||
|
||||
|
||||
LIST(1),
|
||||
TASK(2);
|
||||
|
||||
private Integer type;
|
||||
|
||||
ListTargerType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
|
@ -86,6 +86,9 @@ public interface OATaskMapper extends BaseMapper<OATask> {
|
|||
/*任务详情*/
|
||||
OATask findById(@Param("taskId") String taskId);
|
||||
|
||||
/*未完成的履职任务*/
|
||||
List<OATask> notFinishTasks(@Param("otcIds") List<String> otcIds);
|
||||
|
||||
/*未完成的履职任务*/
|
||||
List<OATask> notFinishTask(@Param("otcId") String otcId);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,4 +63,7 @@ public interface ListDetailMapper {
|
|||
|
||||
String selectIdByTaskId(@Param("oaTaskId")String oaTaskId);
|
||||
|
||||
/*查询所有*/
|
||||
List<ListDetail> findAll();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.rzyc.mapper.user;
|
||||
|
||||
import com.rzyc.model.user.ListRelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 履职关联 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2023-08-16
|
||||
*/
|
||||
@Repository
|
||||
public interface ListRelationMapper extends BaseMapper<ListRelation> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package com.rzyc.model.user;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 履职关联
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2023-08-16
|
||||
*/
|
||||
@TableName("list_relation")
|
||||
@ApiModel(value="ListRelation对象", description="履职关联")
|
||||
public class ListRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "关联id")
|
||||
@TableId("relation_id")
|
||||
private String relationId;
|
||||
|
||||
@ApiModelProperty(value = "履职记录id")
|
||||
@TableField("detail_id")
|
||||
private String detailId;
|
||||
|
||||
@ApiModelProperty(value = "目标id")
|
||||
@TableField("target_id")
|
||||
private String targetId;
|
||||
|
||||
@ApiModelProperty(value = "目标类型 1、履职清单 2、履职任务")
|
||||
@TableField("target_type")
|
||||
private Integer targetType;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@TableField("create_by")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@TableField("modify_by")
|
||||
private String modifyBy;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("modify_time")
|
||||
private Date modifyTime;
|
||||
|
||||
public String getRelationId() {
|
||||
return relationId;
|
||||
}
|
||||
|
||||
public void setRelationId(String relationId) {
|
||||
this.relationId = relationId;
|
||||
}
|
||||
public String getDetailId() {
|
||||
return detailId;
|
||||
}
|
||||
|
||||
public void setDetailId(String detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
public String getTargetId() {
|
||||
return targetId;
|
||||
}
|
||||
|
||||
public void setTargetId(String targetId) {
|
||||
this.targetId = targetId;
|
||||
}
|
||||
public Integer getTargetType() {
|
||||
return targetType;
|
||||
}
|
||||
|
||||
public void setTargetType(Integer targetType) {
|
||||
this.targetType = targetType;
|
||||
}
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public String getModifyBy() {
|
||||
return modifyBy;
|
||||
}
|
||||
|
||||
public void setModifyBy(String modifyBy) {
|
||||
this.modifyBy = modifyBy;
|
||||
}
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ListRelation{" +
|
||||
"relationId=" + relationId +
|
||||
", detailId=" + detailId +
|
||||
", targetId=" + targetId +
|
||||
", targetType=" + targetType +
|
||||
", createBy=" + createBy +
|
||||
", createTime=" + createTime +
|
||||
", modifyBy=" + modifyBy +
|
||||
", modifyTime=" + modifyTime +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
|
@ -342,6 +342,21 @@
|
|||
</select>
|
||||
|
||||
|
||||
<!--未完成的履职任务-->
|
||||
<select id="notFinishTasks" resultMap="BaseResultMap">
|
||||
SELECT * FROM OATask ot
|
||||
WHERE ot.`TaskType` = '履职任务'
|
||||
and ot.del_state = 1
|
||||
AND ot.`OTCId` in
|
||||
<foreach collection="otcIds" item="otcId" separator="," close=")" open="(">
|
||||
#{otcId}
|
||||
</foreach>
|
||||
AND ot.`StartDate` < NOW()
|
||||
AND ot.`IsFinish` = '否'
|
||||
ORDER BY ot.`StartDate` DESC;
|
||||
</select>
|
||||
|
||||
|
||||
<!--未完成的履职任务-->
|
||||
<select id="notFinishTask" resultMap="BaseResultMap">
|
||||
SELECT * FROM OATask ot
|
||||
|
|
|
|||
|
|
@ -472,6 +472,12 @@
|
|||
|
||||
<!--履职详情-->
|
||||
<select id="countListDetail" resultType="java.lang.Long">
|
||||
SELECT COUNT(*) FROM list_relation lr
|
||||
WHERE lr.`target_id` = #{listFactorId}
|
||||
</select>
|
||||
|
||||
<!--履职详情-->
|
||||
<select id="countListDetailV1" resultType="java.lang.Long">
|
||||
SELECT count(*) FROM ListDetail ld
|
||||
WHERE ld.ListFactorId = #{listFactorId}
|
||||
and ld.del_state = 1
|
||||
|
|
@ -509,4 +515,9 @@
|
|||
ModifiedBy = #{chinaName}
|
||||
where ListDetailId = #{listdetailid}
|
||||
</update>
|
||||
|
||||
<!--查询所有-->
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT * FROM `listdetail` ld
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
<?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.rzyc.mapper.user.ListRelationMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.rzyc.model.user.ListRelation">
|
||||
<id column="relation_id" property="relationId" />
|
||||
<result column="detail_id" property="detailId" />
|
||||
<result column="target_id" property="targetId" />
|
||||
<result column="target_type" property="targetType" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="modify_by" property="modifyBy" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
relation_id, detail_id, target_id, target_type, create_by, create_time, modify_by, modify_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -568,9 +568,14 @@ public class BaseController {
|
|||
@Autowired
|
||||
protected EntUserCredentialMapper entUserCredentialMapper;
|
||||
|
||||
//app使用帮助
|
||||
@Autowired
|
||||
protected AppHelpVersionMapper appHelpVersionMapper;
|
||||
|
||||
//履职记录关联信息
|
||||
@Autowired
|
||||
protected ListRelationMapper listRelationMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 岗位不需要的字符串
|
||||
|
|
@ -2307,6 +2312,8 @@ public class BaseController {
|
|||
|
||||
for (UserDepart userDepart : userDeparts){
|
||||
|
||||
userDepart.setPostName(userDepart.getUnitName()+userDepart.getPostName()+"("+userDepart.getUserName()+")");
|
||||
|
||||
|
||||
Integer completion = 0;
|
||||
/**
|
||||
|
|
@ -2373,7 +2380,8 @@ public class BaseController {
|
|||
if(StringUtils.isNotBlank(userId)){
|
||||
SysUser sysUser = sysUserMapper.findById(userId);
|
||||
if(null != sysUser){
|
||||
chinaName = sysUser.getChinaname();
|
||||
// chinaName = sysUser.getChinaname();
|
||||
chinaName = sysUser.getSysuserid();
|
||||
}
|
||||
}
|
||||
return chinaName;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.common.utils.TypeConversion;
|
|||
import com.common.utils.encryption.PasswdFactory;
|
||||
import com.common.utils.model.SingleResult;
|
||||
import com.rzyc.enums.DelState;
|
||||
import com.rzyc.enums.ListTargerType;
|
||||
import com.rzyc.model.*;
|
||||
import com.rzyc.model.check.ChkBillDetailWithBLOBs;
|
||||
import com.rzyc.model.ent.SysEnterprise;
|
||||
|
|
@ -1152,4 +1153,32 @@ public class DataController extends com.rzyc.controller.BaseController {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理履职记录
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 15:11
|
||||
*/
|
||||
@ApiOperation(value = "处理履职记录", notes = "处理履职记录")
|
||||
@RequestMapping(value = "/listRelation", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public SingleResult<String> listRelation()throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
List<ListDetail> details = listDetailMapper.findAll();
|
||||
for (ListDetail listDetail : details){
|
||||
ListRelation relation = new ListRelation();
|
||||
relation.setRelationId(RandomNumber.getUUid());
|
||||
relation.setDetailId(listDetail.getListdetailid());
|
||||
relation.setTargetId(listDetail.getListfactorid());
|
||||
relation.setTargetType(ListTargerType.LIST.getType());
|
||||
relation.setCreateTime(new Date());
|
||||
relation.setCreateBy("导入");
|
||||
relation.setModifyTime(new Date());
|
||||
relation.setModifyTime(new Date());
|
||||
relation.setModifyBy("导入");
|
||||
listRelationMapper.insert(relation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1215,6 +1215,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
@ApiOperation(value = "新增履职记录", notes = "新增履职记录")
|
||||
@PostMapping(value = "addPerformRecord")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
public SingleResult<String> addPerformRecord(@Valid @RequestBody AddPerformRecordDto addPerformRecordDto)throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
ListDetailWithBLOBs listDetail = new ListDetailWithBLOBs();
|
||||
|
|
@ -1232,22 +1233,22 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
listDetail.setTaskId(addPerformRecordDto.getTaskId());
|
||||
listDetail.setIsfinish(IsFinish.YES.getFinish());
|
||||
listDetail.setDelState(DelState.NOT_DEL.getState());
|
||||
|
||||
listDetailMapper.insert(listDetail);
|
||||
|
||||
//清单id 多个逗号隔开
|
||||
String listfactorid = addPerformRecordDto.getListfactorid();
|
||||
|
||||
//清单id
|
||||
String listfactorid = listDetail.getListfactorid();
|
||||
|
||||
//记录履职记录
|
||||
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorid);
|
||||
if(null != listFactor){
|
||||
String content = "新增履职记录:"+addPerformRecordDto.getWorkcnt();
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
}
|
||||
//新增履职修改记录 和 新增履职关联信息
|
||||
addFacotrRelation(listfactorid,addPerformRecordDto.getWorkcnt(),listDetail.getListdetailid(),chinaName);
|
||||
|
||||
//多个清单id 修改履职清单完成进度
|
||||
if(StringUtils.isNotBlank(listfactorid)){
|
||||
String[] listfactorids = listfactorid.split(",");
|
||||
for(String str : listfactorids){
|
||||
//修改履职档案完成情况
|
||||
factorProgres(listfactorid);
|
||||
factorProgres(str);
|
||||
}
|
||||
}
|
||||
|
||||
//如果是通过任务添加的履职信息 修改任务状态
|
||||
String taskId = addPerformRecordDto.getTaskId();
|
||||
|
|
@ -1260,15 +1261,58 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
//修改任务状态
|
||||
changeTaskState(oaTask,listfactorid);
|
||||
}
|
||||
//新增履职记录关联
|
||||
addListRelation(listDetail.getListdetailid(),str,ListTargerType.TASK.getType());
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增履职修改记录 和 新增履职关联信息
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 14:02
|
||||
*/
|
||||
private void addFacotrRelation(String listfactorid,String workcnt,String listdetailid,String chinaName)throws Exception{
|
||||
//清单id
|
||||
//清单id
|
||||
if(StringUtils.isNotBlank(listfactorid)){
|
||||
String[] listfactorids = listfactorid.split(",");
|
||||
|
||||
//记录履职记录
|
||||
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorids[0]);
|
||||
if(null != listFactor){
|
||||
String content = "新增履职记录:"+workcnt;
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
}
|
||||
//新增履职记录关联
|
||||
for (String str : listfactorids){
|
||||
addListRelation(listdetailid,str,ListTargerType.LIST.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增履职记录关联
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 14:11
|
||||
*/
|
||||
private void addListRelation(String listdetailid,String targetId,Integer targetType)throws Exception{
|
||||
ListRelation relation = new ListRelation();
|
||||
relation.setRelationId(RandomNumber.getUUid());
|
||||
relation.setDetailId(listdetailid);
|
||||
relation.setTargetId(targetId);
|
||||
relation.setTargetType(targetType);
|
||||
relation.setCreateBy(getUserId());
|
||||
relation.setCreateTime(new Date());
|
||||
relation.setModifyBy(getUserId());
|
||||
relation.setModifyTime(new Date());
|
||||
listRelationMapper.insert(relation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
* @return
|
||||
|
|
@ -1379,18 +1423,22 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
*/
|
||||
@LoginAuth
|
||||
@ApiOperation(value = "未完成的履职任务", notes = "未完成的履职任务")
|
||||
@ApiImplicitParam(name = "factorId",value = "清单id")
|
||||
@ApiImplicitParam(name = "factorId",value = "清单id 多个逗号隔开")
|
||||
@PostMapping(value = "factorTask/{factorId}")
|
||||
@ResponseBody
|
||||
public MultiResult<OATask> factorTask(@PathVariable String factorId)throws Exception{
|
||||
MultiResult<OATask> result = new MultiResult<>();
|
||||
List<OATask> tasks = oaTaskMapper.notFinishTask(factorId);
|
||||
String[] strs = factorId.split(",");
|
||||
List<String> factorIds = Arrays.asList(strs);
|
||||
if(null != factorIds && factorIds.size() > 0){
|
||||
List<OATask> tasks = oaTaskMapper.notFinishTasks(factorIds);
|
||||
if(tasks.size() > 0 ){
|
||||
result.setData(tasks);
|
||||
}else{
|
||||
result.setCode(Code.NO_DATA.getCode());
|
||||
result.setMessage(Message.NO_DATA);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user