履职变更记录
This commit is contained in:
parent
911f30fbb0
commit
fe0784b9cb
|
|
@ -0,0 +1,60 @@
|
|||
package com.rzyc.bean.user.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author dong
|
||||
* @date 2023-02-09 14:52
|
||||
* @Version V1.0
|
||||
*/
|
||||
public class ListChangePageDto {
|
||||
|
||||
@NotNull(message = "用户不能为空")
|
||||
@ApiModelProperty(value = "用户id",required = true)
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("关键字")
|
||||
private String condition;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
@ApiModelProperty(value = "页码",required = true,example = "1")
|
||||
private Integer page;//当前页
|
||||
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
@ApiModelProperty(value = "每页条数",required = true,example = "10")
|
||||
private Integer pageSize;//每页显示多少条
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public void setCondition(String condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,11 @@ package com.rzyc.mapper.user;
|
|||
|
||||
import com.rzyc.model.user.Listchange;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
|
|
@ -15,4 +18,8 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository
|
||||
public interface ListchangeMapper extends BaseMapper<Listchange> {
|
||||
|
||||
/*变更记录列表*/
|
||||
List<Listchange> listchangeList(@Param("performId") String performId,
|
||||
@Param("condition") String condition);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import java.util.Date;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
|
@ -46,10 +48,12 @@ public class Listchange implements Serializable {
|
|||
@TableField("create_by")
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("modify_time")
|
||||
private Date modifyTime;
|
||||
|
|
@ -58,6 +62,30 @@ public class Listchange implements Serializable {
|
|||
@TableField("modify_by")
|
||||
private String modifyBy;
|
||||
|
||||
@ApiModelProperty(value = "变更人")
|
||||
@TableField(exist = false)
|
||||
private String chinaName;
|
||||
|
||||
@ApiModelProperty(value = "清单内容")
|
||||
@TableField(exist = false)
|
||||
private String factorCnt;
|
||||
|
||||
public String getChinaName() {
|
||||
return chinaName;
|
||||
}
|
||||
|
||||
public void setChinaName(String chinaName) {
|
||||
this.chinaName = chinaName;
|
||||
}
|
||||
|
||||
public String getFactorCnt() {
|
||||
return factorCnt;
|
||||
}
|
||||
|
||||
public void setFactorCnt(String factorCnt) {
|
||||
this.factorCnt = factorCnt;
|
||||
}
|
||||
|
||||
public String getListchangeId() {
|
||||
return listchangeId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,30 @@
|
|||
listchange_id, perform_id, factor_id, user_id, change_content, create_by, create_time, modify_time, modify_by
|
||||
</sql>
|
||||
|
||||
<!--变更记录列表-->
|
||||
<resultMap id="ListchangeResultMap" type="com.rzyc.model.user.Listchange">
|
||||
<id column="listchange_id" property="listchangeId" />
|
||||
<result column="perform_id" property="performId" />
|
||||
<result column="factor_id" property="factorId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="change_content" property="changeContent" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="modify_time" property="modifyTime" />
|
||||
<result column="modify_by" property="modifyBy" />
|
||||
<result column="ChinaName" property="chinaName" />
|
||||
<result column="FactorCnt" property="factorCnt" />
|
||||
</resultMap>
|
||||
|
||||
<!--变更记录列表-->
|
||||
<select id="listchangeList" resultMap="ListchangeResultMap">
|
||||
SELECT su.`ChinaName`, lt.`FactorCnt`, lc.*
|
||||
FROM `listchange` lc
|
||||
LEFT JOIN `listfactor` lt ON lc.`factor_id` = lt.`ListFactorId`
|
||||
LEFT JOIN sysuser su ON lc.`user_id` = su.`SysUserId`
|
||||
WHERE lc.`perform_id` = #{performId}
|
||||
and lc.change_content like #{condition}
|
||||
ORDER BY lc.`create_time` DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1138,6 +1138,30 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 履职变更记录
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/2/9 14:57
|
||||
*/
|
||||
@LoginAuth
|
||||
@ApiOperation(value = "履职变更记录", notes = "履职变更记录")
|
||||
@GetMapping(value = "listChangePage")
|
||||
@ResponseBody
|
||||
public SingleResult<Pager<Listchange>> listChangePage(@Valid ListChangePageDto listChangePageDto)throws Exception{
|
||||
SingleResult<Pager<Listchange>> result = new SingleResult<>();
|
||||
SysUser sysUser = getUser(listChangePageDto.getUserId());
|
||||
String performId = sysUser.getSystitle();
|
||||
String condition = TypeConversion.getCondition(listChangePageDto.getCondition());
|
||||
PageHelper.startPage(listChangePageDto.getPage(), listChangePageDto.getPageSize());
|
||||
Page<Listchange> page = (Page<Listchange>)listchangeMapper.listchangeList(performId,condition);
|
||||
Pager<Listchange> pager = new Pager<>();
|
||||
getDatePage(pager,page);
|
||||
result.setData(pager);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增履职记录
|
||||
* @return
|
||||
|
|
@ -1167,13 +1191,20 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
|
||||
listDetailMapper.insert(listDetail);
|
||||
|
||||
|
||||
//清单id
|
||||
String listfactorid = listDetail.getListfactorid();
|
||||
|
||||
//记录履职记录
|
||||
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorid);
|
||||
if(null != listFactor){
|
||||
String content = "新增履职记录:"+listDetail.getWorkcnt();
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
}
|
||||
|
||||
//修改履职档案完成情况
|
||||
factorProgres(listfactorid);
|
||||
|
||||
|
||||
//如果是通过任务添加的履职信息 修改任务状态
|
||||
String taskId = addPerformRecordDto.getTaskId();
|
||||
if(StringUtils.isNotBlank(taskId)){
|
||||
|
|
@ -1189,6 +1220,8 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
}
|
||||
|
||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -1778,10 +1811,10 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
ListFactor listFactor = new ListFactor();
|
||||
BeanUtils.copyProperties(listFactor,changeFactorDto);
|
||||
|
||||
String userId = getUserId();
|
||||
//操作人
|
||||
String chinaName = getChinaName();
|
||||
listFactor.setCreatedby(chinaName);
|
||||
listFactor.setModifiedby(chinaName);
|
||||
listFactor.setCreatedby(userId);
|
||||
listFactor.setModifiedby(userId);
|
||||
listFactor.setCreatedon(new Date());
|
||||
listFactor.setModifiedon(new Date());
|
||||
|
||||
|
|
@ -1805,19 +1838,25 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
//先修改原清单为删除状态
|
||||
listFactorMapper.delFactor(listFactor.getListfactorid());
|
||||
|
||||
|
||||
|
||||
//修改成功后 在重新新增一条履职清单
|
||||
listFactor.setDelState(DelState.NOT_DEL.getState());
|
||||
listFactor.setListfactorid(RandomNumber.getUUid());
|
||||
listFactorMapper.insert(listFactor);
|
||||
String content = "履职清单:<"+factor.getFactorcnt()+">修改为:<"+listFactor.getFactorcnt()+">";
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
//修改
|
||||
// listFactorMapper.changeFactor(listFactor);
|
||||
}else{
|
||||
|
||||
listFactorMapper.insert(listFactor);
|
||||
|
||||
String content = "新增履职清单:"+listFactor.getFactorcnt();
|
||||
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
|
||||
}
|
||||
|
||||
//添加任务
|
||||
String userId = getUserId();
|
||||
addFactorTask(listFactor,userId);
|
||||
|
||||
//修改总体履职进度
|
||||
|
|
@ -1826,9 +1865,25 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void addListChange()throws Exception{
|
||||
/**
|
||||
* 保存履职记录
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2023/2/9 14:21
|
||||
*/
|
||||
public void addListChange(String performId,String factorId,String content)throws Exception{
|
||||
String userId = getUserId();
|
||||
Listchange listchange = new Listchange();
|
||||
listchange.setListchangeId(RandomNumber.getUUid());
|
||||
listchange.setPerformId(performId);
|
||||
listchange.setFactorId(factorId);
|
||||
listchange.setChangeContent(content);
|
||||
listchange.setUserId(userId);
|
||||
listchange.setCreateBy(userId);
|
||||
listchange.setModifyBy(userId);
|
||||
listchange.setCreateTime(new Date());
|
||||
listchange.setModifyTime(new Date());
|
||||
listchangeMapper.insert(listchange);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user