履职记录上传
This commit is contained in:
parent
74e19b584b
commit
57d5ad97f8
|
|
@ -1,11 +1,31 @@
|
|||
package com.rzyc.bean;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 履职清单的履职记录完成情况
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 17:08
|
||||
*/
|
||||
public class FactorTime {
|
||||
|
||||
@ApiModelProperty("时间")
|
||||
private Date changeTime;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String relationId;
|
||||
|
||||
public String getRelationId() {
|
||||
return relationId;
|
||||
}
|
||||
|
||||
public void setRelationId(String relationId) {
|
||||
this.relationId = relationId;
|
||||
}
|
||||
|
||||
public Date getChangeTime() {
|
||||
return changeTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,5 +158,8 @@ public interface OATaskMapper extends BaseMapper<OATask> {
|
|||
/*未完成履职任务*/
|
||||
List<OATask> notCompleteTask();
|
||||
|
||||
/*履职记录对于的任务*/
|
||||
List<OATask> detailTasks(@Param("detailId") String detailId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ public interface ListDetailMapper {
|
|||
@Param("condition") String condition,
|
||||
@Param("year") String year);
|
||||
|
||||
/*履职记录详情*/
|
||||
ListDetailWithBLOBs findByDetailId(@Param("detailId") String detailId);
|
||||
|
||||
|
||||
/*修改删除状态*/
|
||||
Integer changeSelState(@Param("listdetailid") String listdetailid,
|
||||
@Param("delState") Integer delState,
|
||||
|
|
|
|||
|
|
@ -94,4 +94,7 @@ public interface ListFactorMapper {
|
|||
|
||||
/*按年份查询*/
|
||||
List<ListFactor> findBySysYear(@Param("sysYear") String sysYear);
|
||||
|
||||
/*履职记录关联的履职清单*/
|
||||
List<ListFactor> detailFactors(@Param("detailId") String detailId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.rzyc.mapper.user;
|
|||
|
||||
import com.rzyc.model.user.ListRelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -17,4 +18,7 @@ import javax.annotation.Resource;
|
|||
@Repository
|
||||
public interface ListRelationMapper extends BaseMapper<ListRelation> {
|
||||
|
||||
/*删除清单记录关系数据*/
|
||||
Integer delByTargetId(@Param("targetId") String targetId, @Param("targetType") Integer targetType );
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.rzyc.model.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.rzyc.model.OATask;
|
||||
import com.rzyc.model.check.BookEntCheck;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -80,8 +81,30 @@ public class ListDetail implements Serializable {
|
|||
@ApiModelProperty("检查记录")
|
||||
private List<BookEntCheck> entChecks = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty("清单列表")
|
||||
private List<ListFactor> factors;
|
||||
|
||||
@ApiModelProperty("任务列表")
|
||||
private List<OATask> tasks;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public List<ListFactor> getFactors() {
|
||||
return factors;
|
||||
}
|
||||
|
||||
public void setFactors(List<ListFactor> factors) {
|
||||
this.factors = factors;
|
||||
}
|
||||
|
||||
public List<OATask> getTasks() {
|
||||
return tasks;
|
||||
}
|
||||
|
||||
public void setTasks(List<OATask> tasks) {
|
||||
this.tasks = tasks;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -679,5 +679,12 @@
|
|||
AND ot.`TaskType` = '履职任务'
|
||||
</select>
|
||||
|
||||
<!--履职记录对于的任务-->
|
||||
<select id="detailTasks" resultMap="BaseResultMap">
|
||||
SELECT ot.* FROM `oatask` ot
|
||||
LEFT JOIN `list_relation` lr ON ot.`OATaskId` = lr.`target_id`
|
||||
WHERE lr.`detail_id` = #{detailId} AND lr.`target_type` = 2
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -446,6 +446,16 @@
|
|||
|
||||
<!--履职详情-->
|
||||
<select id="factorDetail" resultMap="ResultMapWithBLOBs">
|
||||
SELECT ld.*
|
||||
FROM ListDetail ld
|
||||
left join list_relation lr on ld.ListDetailId = lr.detail_id
|
||||
WHERE lr.target_id = #{listFactorId} and lr.target_type = 1
|
||||
and ld.del_state = 1
|
||||
ORDER BY ld.EndTime ASC
|
||||
</select>
|
||||
|
||||
<!--履职详情-->
|
||||
<select id="factorDetailV1" resultMap="ResultMapWithBLOBs">
|
||||
SELECT ld.*,ot.Subject taskName FROM ListDetail ld
|
||||
left join oatask ot on ld.task_id = ot.OATaskId
|
||||
WHERE ld.ListFactorId = #{listFactorId}
|
||||
|
|
@ -500,8 +510,17 @@
|
|||
AND lt.`ListPerformId` = #{performId}
|
||||
AND lt.`SysYear` = #{year}
|
||||
AND ld.del_state = 1
|
||||
ORDER BY ld.`EndTime` DESC
|
||||
ORDER BY ld.`ModifiedOn` DESC
|
||||
</select>
|
||||
|
||||
<!--履职记录详情-->
|
||||
<select id="findByDetailId" resultMap="ResultMapWithBLOBs">
|
||||
SELECT ld.*
|
||||
FROM ListDetail ld
|
||||
WHERE ld.ListDetailId = #{detailId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectIdByTaskId" resultType="java.lang.String">
|
||||
select ListDetailId from ListDetail where task_id = #{oaTaskId}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -495,12 +495,27 @@
|
|||
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
||||
<collection property="factorTimes" ofType="com.rzyc.bean.FactorTime" column="ListFactorId">
|
||||
<result column="changeTime" jdbcType="TIMESTAMP" property="changeTime" />
|
||||
<result column="relation_id" jdbcType="TIMESTAMP" property="relationId" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!--用户履职档案-->
|
||||
<select id="userListFactor" resultMap="FactorResultMap">
|
||||
SELECT lt.ModifiedOn changeTime,lf.* FROM ListFactor lf
|
||||
SELECT lr.`create_time` changeTime,lr.relation_id, lf.*
|
||||
FROM ListFactor lf
|
||||
LEFT JOIN list_relation lr ON lf.ListFactorId = lr.`target_id` AND lr.`target_type` = 1
|
||||
WHERE lf.`ListPerformId` = #{listPerformId}
|
||||
and lf.SysYear = #{time}
|
||||
and lf.del_state = 1
|
||||
ORDER BY lf.`SortId` ASC ,lf.`ListNum` ASC
|
||||
</select>
|
||||
|
||||
|
||||
<!--用户履职档案-->
|
||||
<select id="userListFactorV1" resultMap="FactorResultMap">
|
||||
SELECT lt.ModifiedOn changeTime,lf.*
|
||||
FROM ListFactor lf
|
||||
LEFT JOIN `ListDetail` lt ON lf.ListFactorId = lt.ListFactorId and lt.del_state = 1
|
||||
WHERE lf.`ListPerformId` = #{listPerformId}
|
||||
and lf.SysYear = #{time}
|
||||
|
|
@ -553,6 +568,21 @@
|
|||
|
||||
<!--年履职情况-->
|
||||
<select id="findByYear" resultMap="findByYearMap">
|
||||
SELECT lf.`ListPerformId`,lf.`CheckStandard`,lf.`Frequency`,
|
||||
(SELECT COUNT(*) FROM list_relation lr
|
||||
WHERE lr.target_id = lf.`ListFactorId` and lr.target_type = 1) factorNum
|
||||
FROM ListFactor lf
|
||||
WHERE lf.`ListPerformId` IN
|
||||
<foreach collection="performIds" item="performId" open="(" close=")" separator=",">
|
||||
#{performId}
|
||||
</foreach>
|
||||
AND lf.`SysYear` = #{year}
|
||||
AND lf.del_state = 1
|
||||
ORDER BY lf.`SortId` ASC ,lf.`ListNum` ASC
|
||||
</select>
|
||||
|
||||
<!--年履职情况-->
|
||||
<select id="findByYearV1" resultMap="findByYearMap">
|
||||
SELECT lf.`ListPerformId`,lf.`CheckStandard`,lf.`Frequency`,
|
||||
(SELECT COUNT(*) FROM ListDetail ld
|
||||
WHERE ld.ListFactorId = lf.`ListFactorId` and ld.del_state = 1) factorNum
|
||||
|
|
@ -677,4 +707,12 @@
|
|||
ORDER BY lf.`SortId` ASC ,lf.`ListNum` ASC
|
||||
</select>
|
||||
|
||||
<!--履职记录关联的履职清单-->
|
||||
<select id="detailFactors" resultMap="BaseResultMap">
|
||||
SELECT lt.*
|
||||
FROM `listfactor` lt
|
||||
LEFT JOIN `list_relation` lr ON lt.`ListFactorId` = lr.`target_id`
|
||||
WHERE lr.`detail_id` = #{detailId} AND lr.`target_type` = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -19,4 +19,9 @@
|
|||
relation_id, detail_id, target_id, target_type, create_by, create_time, modify_by, modify_time
|
||||
</sql>
|
||||
|
||||
<!--删除清单记录关系数据-->
|
||||
<delete id="delByTargetId">
|
||||
DELETE FROM list_relation WHERE target_id = #{targetId} AND target_type = #{targetType}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2414,7 +2414,7 @@ public class BaseController {
|
|||
total = 0l;
|
||||
}
|
||||
total++;
|
||||
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorid);
|
||||
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(oaTask.getOtcid());
|
||||
if(null == listFactor.getFrequency()){
|
||||
listFactor.setFrequency(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -682,6 +682,18 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
listDetail.setFactorCnt(listFactor.getFactorcnt());
|
||||
}
|
||||
|
||||
//履职清单
|
||||
List<ListFactor> factors = listFactorMapper.detailFactors(listDetail.getListdetailid());
|
||||
if(null != factors && factors.size() > 0){
|
||||
listDetail.setFactors(factors);
|
||||
}
|
||||
|
||||
//履职任务
|
||||
List<OATask> tasks = oaTaskMapper.detailTasks(listDetail.getListdetailid());
|
||||
if(null != tasks && tasks.size() > 0){
|
||||
listDetail.setTasks(tasks);
|
||||
}
|
||||
|
||||
result.setData(listDetail);
|
||||
}else{
|
||||
result.setCode(Code.NO_DATA.getCode());
|
||||
|
|
@ -1182,6 +1194,39 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 履职记录详情
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 15:50
|
||||
*/
|
||||
@LoginAuth
|
||||
@ApiOperation(value = "履职记录详情", notes = "履职记录详情")
|
||||
@GetMapping(value = "performRecordDetail/{listdetailid}")
|
||||
@ApiImplicitParam(name = "listdetailid",value = "履职记录id",required = true)
|
||||
@ResponseBody
|
||||
public SingleResult<ListDetailWithBLOBs> performRecordDetail(@PathVariable String listdetailid)throws Exception{
|
||||
SingleResult<ListDetailWithBLOBs> result = new SingleResult<>();
|
||||
ListDetailWithBLOBs detail = listDetailMapper.findByDetailId(listdetailid);
|
||||
if(null != detail){
|
||||
|
||||
//履职清单
|
||||
List<ListFactor> factors = listFactorMapper.detailFactors(detail.getListdetailid());
|
||||
if(null != factors && factors.size() > 0){
|
||||
detail.setFactors(factors);
|
||||
}
|
||||
|
||||
//履职任务
|
||||
List<OATask> tasks = oaTaskMapper.detailTasks(detail.getListdetailid());
|
||||
if(null != tasks && tasks.size() > 0){
|
||||
detail.setTasks(tasks);
|
||||
}
|
||||
|
||||
}
|
||||
result.setData(detail);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 履职变更记录
|
||||
* @version v1.0
|
||||
|
|
@ -1238,6 +1283,22 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
//清单id 多个逗号隔开
|
||||
String listfactorid = addPerformRecordDto.getListfactorid();
|
||||
|
||||
//处理清单和任务信息
|
||||
handleFactorAndTask(listfactorid,addPerformRecordDto,listDetail,chinaName);
|
||||
|
||||
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改履职记录之后处理清单和任务信息
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/8/16 16:20
|
||||
*/
|
||||
private void handleFactorAndTask(String listfactorid,AddPerformRecordDto addPerformRecordDto,ListDetailWithBLOBs listDetail,String chinaName)throws Exception{
|
||||
|
||||
//新增履职修改记录 和 新增履职关联信息
|
||||
addFacotrRelation(listfactorid,addPerformRecordDto.getWorkcnt(),listDetail.getListdetailid(),chinaName);
|
||||
|
||||
|
|
@ -1261,12 +1322,14 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
//修改任务状态
|
||||
changeTaskState(oaTask,listfactorid);
|
||||
}
|
||||
|
||||
//先删除清单关联信息
|
||||
listRelationMapper.delByTargetId(listDetail.getListdetailid(),ListTargerType.TASK.getType());
|
||||
//新增履职记录关联
|
||||
addListRelation(listDetail.getListdetailid(),str,ListTargerType.TASK.getType());
|
||||
}
|
||||
}
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1276,7 +1339,6 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
* @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(",");
|
||||
|
|
@ -1287,6 +1349,10 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
String content = "新增履职记录:"+workcnt;
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
}
|
||||
|
||||
//先删除清单关联信息
|
||||
listRelationMapper.delByTargetId(listdetailid,ListTargerType.LIST.getType());
|
||||
|
||||
//新增履职记录关联
|
||||
for (String str : listfactorids){
|
||||
addListRelation(listdetailid,str,ListTargerType.LIST.getType());
|
||||
|
|
@ -1365,9 +1431,12 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
listDetailMapper.changeListDetail(listDetail);
|
||||
|
||||
//清单id
|
||||
String listfactorid = listDetail.getListfactorid();
|
||||
String listfactorid = addPerformRecordDto.getListfactorid();
|
||||
|
||||
//修改履职档案完成情况
|
||||
//处理清单和任务信息
|
||||
handleFactorAndTask(listfactorid,addPerformRecordDto,listDetail,chinaName);
|
||||
|
||||
/*//修改履职档案完成情况
|
||||
factorProgres(listfactorid);
|
||||
|
||||
//如果是通过任务添加的履职信息
|
||||
|
|
@ -1384,7 +1453,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));*/
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user