待办任务处理逻辑更新

This commit is contained in:
wulin 2020-11-19 17:53:52 +08:00
parent 0174e78f6f
commit 6276d7edce
20 changed files with 484 additions and 154 deletions

View File

@ -19,6 +19,7 @@ import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.service.SysUserTokenService;
import com.lz.modules.third.entity.ThirdAppConfig;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import com.lz.modules.third.entity.WorkMsg;
import com.lz.modules.third.service.ThirdAppConfigService;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import com.taobao.api.ApiException;
@ -319,20 +320,22 @@ public class DingTalkUtil {
return msg;
}
//发送待办任务
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String title1,
String content1, String title2,
String content2, String title3,
String content3, String singleUrl, String token, String from) {
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, List<WorkMsg> msgs,
String singleUrl, String token, String from,
int type, Long workId) {
String msg = "OK";
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
thirdMsgSendRecord.setMsgType("work_msg");
thirdMsgSendRecord.setStaffId(staff.getId());
thirdMsgSendRecord.setMsgTitle(title1 + "#" + title2 + "#" + title3);
thirdMsgSendRecord.setMsgTitle("待办任务");
thirdMsgSendRecord.setAppId(appid);
thirdMsgSendRecord.setHeadText(title);
thirdMsgSendRecord.setMsgContent(content1 + "#" + content2 + "#" + content3);
thirdMsgSendRecord.setMsgContent(JSONObject.toJSONString(msgs));
thirdMsgSendRecord.setMsgUrl(singleUrl);
thirdMsgSendRecord.setWorkType(type);
thirdMsgSendRecord.setEmployeeId(staff.getEmployeeId());
thirdMsgSendRecord.setWorkId(workId);
thirdMsgSendRecord.setStatus(0);
try{
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/add");
@ -343,22 +346,16 @@ public class DingTalkUtil {
req.setUrl(singleUrl);
req.setSourceName(from);
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title1);
obj3.setContent(content1);
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title2);
obj3.setContent(content2);
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title3);
obj3.setContent(content3);
for (WorkMsg workMsg:msgs
) {
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(workMsg.getTitle());
obj3.setContent(workMsg.getContent());
}
req.setFormItemList(list2);
OapiWorkrecordAddResponse rsp = client.execute(req, token);
logger.info("钉钉待办任务请求返回{}", rsp.getBody());
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
@ -383,6 +380,37 @@ public class DingTalkUtil {
return msg;
}
//发送待办任务
public String updateWorkMSG(ThirdMsgSendRecord thirdMsgSendRecord, String token) {
String msg = "OK";
try{
logger.info("更新待办任务处理{}", thirdMsgSendRecord);
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/update");
OapiWorkrecordUpdateRequest req = new OapiWorkrecordUpdateRequest();
req.setUserid(thirdMsgSendRecord.getEmployeeId());
req.setRecordId(thirdMsgSendRecord.getTaskId());
OapiWorkrecordUpdateResponse rsp = client.execute(req, token);
logger.info("钉钉更新待办任务请求返回{}", rsp.getBody());
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
if(json.getIntValue("errcode") == 0){
//thirdMsgSendRecord.setTaskId(json.getString("record_id"));
thirdMsgSendRecord.setStatus(8);
thirdMsgSendRecordService.insertThirdMsgSendRecord(thirdMsgSendRecord);
}else{
logger.info("更新待办任务失败");
}
logger.info("发送消息{}", thirdMsgSendRecord);
}catch (ApiException e) {
e.printStackTrace();
logger.info("更新待办任务异常");
msg = thirdMsgSendRecord.getRemark();
}
return msg;
}
public R getUserIdByCode(String code, String token) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo");

View File

@ -30,4 +30,5 @@ public interface FlowChangeMapper extends BaseMapper<FlowChange> {
int deleteFlowChangeById(@Param("id")Long id);
FlowChange selectFlowChangeByRecordIdAndToIdAndType(@Param("recordId") Long recordId, @Param("toStaffId") Long toStaffId, @Param("type") int type);
}

View File

@ -82,4 +82,9 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
int batchDeleteByRecordIds(@Param("recordIds")List<Long> recordIds);
List<FlowRecord> selectAndOrFlowRecordsById(@Param("flowRecordId") Long flowRecordId, @Param("recordId") Long recordId);
List<FlowRecord> selectLastFlowRecordsById(@Param("recordId") Long recordId);
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(@Param("recordId") Long recordId, @Param("flowIndex") int flowIndex);
}

View File

@ -41,4 +41,6 @@ public interface ResultModelMapper extends BaseMapper<ResultModel> {
int deleteResultModelByGroupId(Long id);
int updateCoverWeightResultModelById(ResultModel resultModel);
}

View File

@ -33,4 +33,6 @@ public interface FlowChangeService extends IService<FlowChange> {
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type);
}

View File

@ -76,4 +76,10 @@ public interface FlowRecordService extends IService<FlowRecord> {
FlowRecord selectFlowRecordByRecordIdMinIdStatus(Long resultRecordId, Long id, int i);
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(Long id, int flowProcess);
//获取同一个节点下面的或签或者会签
List<FlowRecord> selectAndOrFlowRecordsById(Long flowRecordId, Long recordId);
//获取最后流程同一个小节点的所有数据
List<FlowRecord> selectLastFlowRecordsById(Long recordId);
//获取制定步骤一个小节点的所有数据
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex);
}

View File

@ -79,5 +79,10 @@ public class FlowChangeServiceImpl extends ServiceImpl<FlowChangeMapper, FlowCha
flowChangeMapper.insertFlowChange(flowChange);
}
@Override
public FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type){
return flowChangeMapper.selectFlowChangeByRecordIdAndToIdAndType(recordId, toStaffId, type);
}
}

View File

@ -16,6 +16,7 @@ import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -205,5 +206,19 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.selectFlowRecordByRecordIdFlowProcess(id,flowProcess);
}
@Override
public List<FlowRecord> selectAndOrFlowRecordsById(Long flowRecordId, Long recordId){
return flowRecordMapper.selectAndOrFlowRecordsById(flowRecordId, recordId);
}
@Override
public List<FlowRecord> selectLastFlowRecordsById(Long recordId){
return flowRecordMapper.selectLastFlowRecordsById(recordId);
}
@Override
public List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex){
return flowRecordMapper.selectLastFlowRecordsByIdAndFlowIndex(recordId, flowIndex);
}
}

View File

@ -133,7 +133,7 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
resultModelMapper.insertResultModel(resultModel);
}else{
resultModelMapper.updateResultModelById(resultModel);
resultModelMapper.updateCoverWeightResultModelById(resultModel);
if(resultModel.getIsDelete() != null && resultModel.getIsDelete().intValue() == 1){
delCount--;
}

View File

@ -13,8 +13,10 @@ import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffOccupationService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.FlowChange;
import com.lz.modules.flow.entity.FlowRecord;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.FlowChangeService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
@ -24,7 +26,10 @@ import com.lz.modules.sys.entity.SysUserTokenEntity;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import com.lz.modules.third.entity.ThirdAppConfig;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import com.lz.modules.third.entity.WorkMsg;
import com.lz.modules.third.service.ThirdAppConfigService;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -79,11 +84,15 @@ public class DingtalkBusiness {
@Autowired
private FlowStartService flowStartService;
@Autowired
private FlowChangeService flowChangeService;
@Autowired
private ThirdMsgSendRecordService thirdMsgSendRecordService;
@Resource
StaffDao staffDao;
List<ThreadSendMessage> threadSendMessages = new ArrayList<>();
@Value("${dingtalk.appid}")
private String appid;
@ -272,7 +281,6 @@ public class DingtalkBusiness {
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
threadSendMessages.add(threadSendMessage);//防止提前回收
Thread thread = new Thread(threadSendMessage);
thread.start();
@ -365,6 +373,24 @@ public class DingtalkBusiness {
this.appid = appid;
}
private void sendNotic(Long staffId, String employeeId,
String content1, String content2, String content3,
String token, String url, Long recordId){
StaffEntity entity = new StaffEntity();
entity.setId(staffId);
entity.setEmployeeId(employeeId);
List<WorkMsg> msgs = new ArrayList<>();
WorkMsg workMsg = new WorkMsg("任务内容", content1);
msgs.add(workMsg);
workMsg = new WorkMsg("考核名称", content2);
msgs.add(workMsg);
workMsg = new WorkMsg("被考核人", content3);
msgs.add(workMsg);
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
msgs,
url, token, "霖梓控股", 1, recordId);
}
@Override
public void run() {
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
@ -387,60 +413,133 @@ public class DingtalkBusiness {
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
"&container_type=work_platform&app_id=0_" +
appid + "&redirect_type=jump&redirect_url=" + url;
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
//发送制定目标通知
StaffEntity entity = new StaffEntity();
entity.setId(info.getId());
entity.setEmployeeId(info.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", "目标制定",
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
logger.info("目标制定");
sendNotic(info.getId(), info.getEmployeeId(),
"目标制定", info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
//发送开始评分通知
StaffEntity entity = new StaffEntity();
entity.setId(info.getId());
entity.setEmployeeId(info.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", "结果录入",
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
}else{
logger.info("结果录入");
sendNotic(info.getId(), info.getEmployeeId(),
"结果录入", info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.URGING.getType()){
//绩效催办
logger.info("绩效催办");
}else {
//流程流转通知
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
if(flowRecords.size() == 0){
//任务结束
}else{
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
@Override
public Long apply(FlowRecord flowRecord) {
return flowRecord.getApprovalStaffId();
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.TRANSFER.getType()){//转交
//转交
logger.info("转交待办任务处理");
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
info.getId(), 0);
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(), flowChange.getApprovalId(), 1, 0);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
//发送待办任务到新指定人员转交过来一定会有数据
sendNotic(info.getId(), info.getEmployeeId(),
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
//跳过
logger.info("跳过待办任务处理");
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
info.getId(), 1);
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowChange.getApprovalId(), 1, 0);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
List<FlowRecord> flowRecords = flowRecordService.selectAndOrFlowRecordsById(flowChange.getFlowRecordId(), info.getResultRecord().getId());
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
if(flowRecords.size() > 0){
if(flowRecords.get(0).getType().intValue() == 1){
//或签
logger.info("或签,需要更新该节点下所有人员的待办任务");
for (FlowRecord flowRecord:flowRecords
) {
if(flowRecord.getApprovalStaffId().longValue() != info.getId()){
logger.info("更新非直接跳关人员的待办任务人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
flowRecord.getApprovalStaffName());
thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowRecord.getApprovalStaffId(), 1, 0);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
}
}
}
}
}else{
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
if(flowRecords.size() > 0){//给下一步骤需要处理的人发送待办任务
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
@Override
public Long apply(FlowRecord flowRecord) {
return flowRecord.getApprovalStaffId();
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
) {
sendNotic(staffSimpleInfo.getId(), staffSimpleInfo.getEmployeeId(),
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}
}
//取消上一步骤发送的待办任务
if(flowRecords.size() == 0){//任务结束了
flowRecords = flowRecordService.selectLastFlowRecordsById(info.getResultRecord().getId());
}else{
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(info.getResultRecord().getId()
, flowRecords.get(0).getFlowIndex().intValue() - 1);//获取上一步的数据
}
logger.info("查询到可能需要更新的待办任务数量{}", flowRecords.size());
if(flowRecords.size() > 0){
for (FlowRecord flowRecord:flowRecords
) {
if(flowRecord.getStatus().intValue() == 1){
logger.info("将要更新人员的待办任务人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
flowRecord.getApprovalStaffName());
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowRecord.getApprovalStaffId(), 1, 0);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}else{
logger.info("无需更新待办任务");
}
}
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
) {
StaffEntity entity = new StaffEntity();
entity.setId(staffSimpleInfo.getId());
entity.setEmployeeId(staffSimpleInfo.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", flowRecords.get(0).getFlowName(),
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
}
}
}
}
}else{
logger.info("ThreadSendMessage token无效"); ;
}
}
threadSendMessages.remove(this);
}
}
}

View File

@ -30,4 +30,9 @@ public interface ThirdMsgSendRecordMapper extends BaseMapper<ThirdMsgSendRecord>
int deleteThirdMsgSendRecordById(@Param("id")Long id);
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
@Param("workId") Long workId,
@Param("staffId") Long staffId,
@Param("workType") int workType,
@Param("status") int status);
}

View File

@ -1,73 +1,109 @@
package com.lz.modules.third.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-19
* @since 2020-11-19
*/
@Data
@TableName("third_msg_send_record")
@ApiModel(value = "第三方消息发送记录")
public class ThirdMsgSendRecord implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//
@ApiModelProperty(value = "", name = "isDelete")
private Integer isDelete;
//
private Date createTime;
@ApiModelProperty(value = "", name = "gmtCreate")
private Date gmtCreate;
//
private Date updateTime;
//消息类型textimagevoicefilelinkoamarkdownaction_card
@ApiModelProperty(value = "", name = "gmtModified")
private Date gmtModified;
//消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
@ApiModelProperty(value = "消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务", name = "msgType")
private String msgType;
//消息头背景色 oa消息中才有
@ApiModelProperty(value = "消息头背景色 oa消息中才有", name = "headBgcolor")
private String headBgcolor;
//消息头部标题最多10个字符 oa消息中action_card的title
@ApiModelProperty(value = "消息头部标题最多10个字符 oa消息中action_card的title", name = "headText")
private String headText;
//消息标题oa中的消息体的消息头link,markdown,action_card的single_title
@ApiModelProperty(value = "消息标题oa中的消息体的消息头link,markdown,action_card的single_title", name = "msgTitle")
private String msgTitle;
//消息内容textlinkoa正文markdown的markdown内容action_card的markdown内容
@ApiModelProperty(value = "消息内容textlinkoa正文markdown的markdown内容action_card的markdown内容", name = "msgContent")
private String msgContent;
//imagevoicefile消息的文件附件id
@ApiModelProperty(value = "imagevoicefile消息的文件附件id", name = "mediaId")
private Long mediaId;
//voice消息的时常信息 不超过60秒
@ApiModelProperty(value = "voice消息的时常信息 不超过60秒", name = "duration")
private String duration;
//linkoa的message_urlaction_card的single_url
@ApiModelProperty(value = "link、oa的message_urlaction_card的single_url", name = "msgUrl")
private String msgUrl;
//linkoa中的图片如果使用钉钉中的资源ID请用@资源id的形式
@ApiModelProperty(value = "linkoa中的图片如果使用钉钉中的资源ID请用@资源id的形式", name = "picUrl")
private String picUrl;
//oa的pc端url
@ApiModelProperty(value = "oa的pc端url", name = "pcUrl")
private String pcUrl;
//oa中的消息体jsonArray串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}]最多显示6个
@ApiModelProperty(value = "oa中的消息体jsonArray串[{\"key\":\"说明A\",\"value\":\"值A\"},{\"key\":\"说明B\",\"value\":\"值B\"}]最多显示6个", name = "form")
private String form;
//oa中的单文本信息的数目
@ApiModelProperty(value = "oa中的单文本信息的数目", name = "richNum")
private String richNum;
//oa中的单文本信息的单位
@ApiModelProperty(value = "oa中的单文本信息的单位", name = "richUnit")
private String richUnit;
//oa中显示的附件数目不做校验只展示
@ApiModelProperty(value = "oa中显示的附件数目不做校验只展示", name = "fileCount")
private String fileCount;
//oa中的自定义作者
@ApiModelProperty(value = "oa中的自定义作者", name = "author")
private String author;
//action_card独立跳转是按钮的排列0是竖向排列 1是横向排列
@ApiModelProperty(value = "action_card独立跳转是按钮的排列0是竖向排列 1是横向排列", name = "actionCardBtnOrientation")
private String actionCardBtnOrientation;
//action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}]
@ApiModelProperty(value = "action_card独立跳转的jsonarray [{\"tilte\":\"A按钮\",\"action_url\":\"A按钮链接\"},{\"tilte\":\"B按钮\",\"action_url\":\"B按钮链接\"}]", name = "actionCardBtnList")
private String actionCardBtnList;
//lz_staff id
@ApiModelProperty(value = "lz_staff id", name = "staffId")
private Long staffId;
//发送状态0新建1已发送2处理中3已送达4未读5已读6发送失败7撤回
@ApiModelProperty(value = "发送状态0新建1已发送2处理中3已送达4未读5已读6发送失败7撤回", name = "status")
private Integer status;
//应用ID
@ApiModelProperty(value = "应用ID", name = "appId")
private String appId;
//钉钉返回的任务id
@ApiModelProperty(value = "钉钉返回的任务id", name = "taskId")
private String taskId;
//备注一些说明
@ApiModelProperty(value = "备注,一些说明", name = "remark")
private String remark;
//消息任务对应的工作ID
@ApiModelProperty(value = "消息任务对应的工作ID", name = "workId")
private Long workId;
//1表示绩效待办...
@ApiModelProperty(value = "1表示绩效待办...", name = "workType")
private Integer workType;
//第三方用户所在组织id
@ApiModelProperty(value = "第三方用户所在组织id", name = "employeeId")
private String employeeId;
/**
*
* @return
@ -102,41 +138,41 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
*
* @return
*/
public Date getCreateTime() {
return createTime;
public Date getGmtCreate() {
return gmtCreate;
}
/**
*
* @param createTime
* @param gmtCreate
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
*
* @return
*/
public Date getUpdateTime() {
return updateTime;
public Date getGmtModified() {
return gmtModified;
}
/**
*
* @param updateTime
* @param gmtModified
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
/**
* 消息类型textimagevoicefilelinkoamarkdownaction_card
* 消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
* @return
*/
public String getMsgType() {
return msgType;
}
/**
* 消息类型textimagevoicefilelinkoamarkdownaction_card
* 消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
* @param msgType
*/
public void setMsgType(String msgType) {
@ -458,13 +494,58 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
this.remark = remark;
}
/**
* 消息任务对应的工作ID
* @return
*/
public Long getWorkId() {
return workId;
}
/**
* 消息任务对应的工作ID
* @param workId
*/
public void setWorkId(Long workId) {
this.workId = workId;
}
/**
* 1表示绩效待办...
* @return
*/
public Integer getWorkType() {
return workType;
}
/**
* 1表示绩效待办...
* @param workType
*/
public void setWorkType(Integer workType) {
this.workType = workType;
}
/**
* 第三方用户所在组织id
* @return
*/
public String getEmployeeId() {
return employeeId;
}
/**
* 第三方用户所在组织id
* @param employeeId
*/
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
@Override
public String toString() {
return "ThirdMsgSendRecord{" +
",id=" + id +
",isDelete=" + isDelete +
",createTime=" + createTime +
",updateTime=" + updateTime +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",msgType=" + msgType +
",headBgcolor=" + headBgcolor +
",headText=" + headText +
@ -487,6 +568,9 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
",appId=" + appId +
",taskId=" + taskId +
",remark=" + remark +
",workId=" + workId +
",workType=" + workType +
",employeeId=" + employeeId +
"}";
}
}

View File

@ -0,0 +1,13 @@
package com.lz.modules.third.entity;
import lombok.Data;
@Data
public class WorkMsg {
private String title;
private String content;
public WorkMsg(String title, String content){
this.title = title;
this.content = content;
}
}

View File

@ -36,4 +36,6 @@ public interface ThirdMsgSendRecordService extends IService<ThirdMsgSendRecord>
PageUtils queryPage(Map<String, Object> params);
void insert(ThirdMsgSendRecord thirdMsgSendRecord);
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId, Long staffId, int workType, int status);
}

View File

@ -85,4 +85,15 @@ public class ThirdMsgSendRecordServiceImpl extends ServiceImpl<ThirdMsgSendRecor
thirdMsgSendRecordMapper.insert(thirdMsgSendRecord);
}
@Override
public ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId,
Long staffId,
int workType,
int status){
return thirdMsgSendRecordMapper.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(workId,
staffId,
workType,
status);
}
}

View File

@ -99,5 +99,9 @@
update lz_flow_change set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectFlowChangeByRecordIdAndToIdAndType" resultType="FlowChange" >
select * from lz_flow_change where record_id=#{recordId} and to_approval_id = #{toStaffId} and type = #{type} and is_delete = 0 limit 1
</select>
</mapper>

View File

@ -295,5 +295,20 @@
)
</update>
<select id="selectAndOrFlowRecordsById" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = (
select flow_index from lz_flow_record where is_delete = 0 and id=#{flowRecordId}) and record_id = #{recordId}
</select>
<select id="selectLastFlowRecordsById" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = (
select flow_index from lz_flow_record where is_delete = 0 and record_id = #{recordId} order by flow_index desc limit 1
) and record_id = #{recordId}
</select>
<select id="selectLastFlowRecordsByIdAndFlowIndex" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = #{flowIndex} and record_id = #{recordId}
</select>
</mapper>

View File

@ -121,6 +121,26 @@
update lz_result_model set is_delete = 1 where evaluation_group_id=#{id}
</update>
<update id="updateCoverWeightResultModelById" parameterType="ResultModel" >
update
lz_result_model
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="name != null">name = #{name},</if>
<if test="evaluationGroupId != null">evaluation_group_id = #{evaluationGroupId},</if>
<if test="type != null">type = #{type},</if>
<if test="maxCount != null">max_count = #{maxCount},</if>
<if test="calculateId != null">calculate_id = #{calculateId},</if>
<if test="gradeStatus != null">grade_status = #{gradeStatus},</if>
<if test="gradeGroupId != null">grade_group_id = #{gradeGroupId},</if>
<if test="orderBy != null">order_by = #{orderBy}</if>
</trim>
weight = #{weight},
,gmt_modified = now()
where id = #{id}
</update>
</mapper>

View File

@ -6,8 +6,8 @@
<resultMap id="BaseResultMap" type="com.lz.modules.third.entity.ThirdMsgSendRecord">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="msg_type" property="msgType"/>
<result column="head_bgcolor" property="headBgcolor"/>
<result column="head_text" property="headText"/>
@ -30,90 +30,94 @@
<result column="app_id" property="appId"/>
<result column="task_id" property="taskId"/>
<result column="remark" property="remark"/>
<result column="work_id" property="workId"/>
<result column="work_type" property="workType"/>
<result column="employee_id" property="employeeId"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, create_time AS createTime, update_time AS updateTime, msg_type AS msgType, head_bgcolor AS headBgcolor, head_text AS headText, msg_title AS msgTitle, msg_content AS msgContent, media_id AS mediaId, duration AS duration, msg_url AS msgUrl, pic_url AS picUrl, pc_url AS pcUrl, form AS form, rich_num AS richNum, rich_unit AS richUnit, file_count AS fileCount, author AS author, action_card_btn_orientation AS actionCardBtnOrientation, action_card_btn_list AS actionCardBtnList, staff_id AS staffId, status AS status, app_id AS appId, task_id AS taskId, remark AS remark
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, msg_type AS msgType, head_bgcolor AS headBgcolor, head_text AS headText, msg_title AS msgTitle, msg_content AS msgContent, media_id AS mediaId, duration AS duration, msg_url AS msgUrl, pic_url AS picUrl, pc_url AS pcUrl, form AS form, rich_num AS richNum, rich_unit AS richUnit, file_count AS fileCount, author AS author, action_card_btn_orientation AS actionCardBtnOrientation, action_card_btn_list AS actionCardBtnList, staff_id AS staffId, status AS status, app_id AS appId, task_id AS taskId, remark AS remark, work_id AS workId, work_type AS workType, employee_id AS employeeId
</sql>
<select id="selectThirdMsgSendRecordById" resultType="ThirdMsgSendRecord" >
select * from third_msg_send_record where id=#{id} and is_delete = 0 limit 1
select * from third_msg_send_record where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertThirdMsgSendRecord" parameterType="ThirdMsgSendRecord" useGeneratedKeys="true" keyProperty="id" >
insert into third_msg_send_record(
<if test="createTime != null">create_time, </if>
<if test="updateTime != null">update_time, </if>
<if test="msgType != null">msg_type, </if>
<if test="headBgcolor != null">head_bgcolor, </if>
<if test="headText != null">head_text, </if>
<if test="msgTitle != null">msg_title, </if>
<if test="msgContent != null">msg_content, </if>
<if test="mediaId != null">media_id, </if>
<if test="duration != null">duration, </if>
<if test="msgUrl != null">msg_url, </if>
<if test="picUrl != null">pic_url, </if>
<if test="pcUrl != null">pc_url, </if>
<if test="form != null">form, </if>
<if test="richNum != null">rich_num, </if>
<if test="richUnit != null">rich_unit, </if>
<if test="fileCount != null">file_count, </if>
<if test="author != null">author, </if>
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
<if test="actionCardBtnList != null">action_card_btn_list, </if>
<if test="staffId != null">staff_id, </if>
<if test="status != null">status, </if>
<if test="appId != null">app_id, </if>
<if test="taskId != null">task_id, </if>
<if test="remark != null">remark, </if>
is_delete,
gmt_create,
gmt_modified
<if test="msgType != null">msg_type, </if>
<if test="headBgcolor != null">head_bgcolor, </if>
<if test="headText != null">head_text, </if>
<if test="msgTitle != null">msg_title, </if>
<if test="msgContent != null">msg_content, </if>
<if test="mediaId != null">media_id, </if>
<if test="duration != null">duration, </if>
<if test="msgUrl != null">msg_url, </if>
<if test="picUrl != null">pic_url, </if>
<if test="pcUrl != null">pc_url, </if>
<if test="form != null">form, </if>
<if test="richNum != null">rich_num, </if>
<if test="richUnit != null">rich_unit, </if>
<if test="fileCount != null">file_count, </if>
<if test="author != null">author, </if>
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
<if test="actionCardBtnList != null">action_card_btn_list, </if>
<if test="staffId != null">staff_id, </if>
<if test="status != null">status, </if>
<if test="appId != null">app_id, </if>
<if test="taskId != null">task_id, </if>
<if test="remark != null">remark, </if>
<if test="workId != null">work_id, </if>
<if test="workType != null">work_type, </if>
<if test="employeeId != null">employee_id, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="createTime != null">#{ createTime}, </if>
<if test="updateTime != null">#{ updateTime}, </if>
<if test="msgType != null">#{ msgType}, </if>
<if test="headBgcolor != null">#{ headBgcolor}, </if>
<if test="headText != null">#{ headText}, </if>
<if test="msgTitle != null">#{ msgTitle}, </if>
<if test="msgContent != null">#{ msgContent}, </if>
<if test="mediaId != null">#{ mediaId}, </if>
<if test="duration != null">#{ duration}, </if>
<if test="msgUrl != null">#{ msgUrl}, </if>
<if test="picUrl != null">#{ picUrl}, </if>
<if test="pcUrl != null">#{ pcUrl}, </if>
<if test="form != null">#{ form}, </if>
<if test="richNum != null">#{ richNum}, </if>
<if test="richUnit != null">#{ richUnit}, </if>
<if test="fileCount != null">#{ fileCount}, </if>
<if test="author != null">#{ author}, </if>
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="status != null">#{ status}, </if>
<if test="appId != null">#{ appId}, </if>
<if test="taskId != null">#{ taskId}, </if>
<if test="remark != null">#{ remark}, </if>
0,
now(),
now()
<if test="msgType != null">#{ msgType}, </if>
<if test="headBgcolor != null">#{ headBgcolor}, </if>
<if test="headText != null">#{ headText}, </if>
<if test="msgTitle != null">#{ msgTitle}, </if>
<if test="msgContent != null">#{ msgContent}, </if>
<if test="mediaId != null">#{ mediaId}, </if>
<if test="duration != null">#{ duration}, </if>
<if test="msgUrl != null">#{ msgUrl}, </if>
<if test="picUrl != null">#{ picUrl}, </if>
<if test="pcUrl != null">#{ pcUrl}, </if>
<if test="form != null">#{ form}, </if>
<if test="richNum != null">#{ richNum}, </if>
<if test="richUnit != null">#{ richUnit}, </if>
<if test="fileCount != null">#{ fileCount}, </if>
<if test="author != null">#{ author}, </if>
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="status != null">#{ status}, </if>
<if test="appId != null">#{ appId}, </if>
<if test="taskId != null">#{ taskId}, </if>
<if test="remark != null">#{ remark}, </if>
<if test="workId != null">#{ workId}, </if>
<if test="workType != null">#{ workType}, </if>
<if test="employeeId != null">#{ employeeId}, </if>
0,
now(),
now()
)
</insert>
<update id="updateThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
update
third_msg_send_record
third_msg_send_record
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="msgType != null">msg_type = #{msgType},</if>
<if test="headBgcolor != null">head_bgcolor = #{headBgcolor},</if>
<if test="headText != null">head_text = #{headText},</if>
@ -135,7 +139,10 @@
<if test="status != null">status = #{status},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="remark != null">remark = #{remark}</if>
<if test="remark != null">remark = #{remark},</if>
<if test="workId != null">work_id = #{workId},</if>
<if test="workType != null">work_type = #{workType},</if>
<if test="employeeId != null">employee_id = #{employeeId}</if>
</trim>
,gmt_modified = now()
where id = #{id}
@ -144,11 +151,10 @@
<update id="updateCoverThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
update
third_msg_send_record
set
third_msg_send_record
set
is_delete = #{isDelete},
create_time = #{createTime},
update_time = #{updateTime},
gmt_create = #{gmtCreate},
msg_type = #{msgType},
head_bgcolor = #{headBgcolor},
head_text = #{headText},
@ -170,15 +176,22 @@
status = #{status},
app_id = #{appId},
task_id = #{taskId},
remark = #{remark}
remark = #{remark},
work_id = #{workId},
work_type = #{workType},
employee_id = #{employeeId}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteThirdMsgSendRecordById" parameterType="java.lang.Long">
update third_msg_send_record set is_delete = 1 where id=#{id} limit 1
update third_msg_send_record set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus" resultType="ThirdMsgSendRecord" >
select * from third_msg_send_record where work_id=#{workId} and staff_id = #{staffId}
and work_type = #{workType} and status=#{status} and is_delete = 0 limit 1
</select>
</mapper>

View File

@ -126,7 +126,7 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_result_detail"));
list.add(new TablesBean("third_msg_send_record"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();