待办任务处理逻辑更新
This commit is contained in:
parent
0174e78f6f
commit
6276d7edce
@ -19,6 +19,7 @@ import com.lz.modules.sys.entity.SysUserEntity;
|
|||||||
import com.lz.modules.sys.service.SysUserTokenService;
|
import com.lz.modules.sys.service.SysUserTokenService;
|
||||||
import com.lz.modules.third.entity.ThirdAppConfig;
|
import com.lz.modules.third.entity.ThirdAppConfig;
|
||||||
import com.lz.modules.third.entity.ThirdMsgSendRecord;
|
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.ThirdAppConfigService;
|
||||||
import com.lz.modules.third.service.ThirdMsgSendRecordService;
|
import com.lz.modules.third.service.ThirdMsgSendRecordService;
|
||||||
import com.taobao.api.ApiException;
|
import com.taobao.api.ApiException;
|
||||||
@ -319,20 +320,22 @@ public class DingTalkUtil {
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
//发送待办任务
|
//发送待办任务
|
||||||
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String title1,
|
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, List<WorkMsg> msgs,
|
||||||
String content1, String title2,
|
String singleUrl, String token, String from,
|
||||||
String content2, String title3,
|
int type, Long workId) {
|
||||||
String content3, String singleUrl, String token, String from) {
|
|
||||||
String msg = "OK";
|
String msg = "OK";
|
||||||
|
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
|
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
|
||||||
thirdMsgSendRecord.setMsgType("work_msg");
|
thirdMsgSendRecord.setMsgType("work_msg");
|
||||||
thirdMsgSendRecord.setStaffId(staff.getId());
|
thirdMsgSendRecord.setStaffId(staff.getId());
|
||||||
thirdMsgSendRecord.setMsgTitle(title1 + "#" + title2 + "#" + title3);
|
thirdMsgSendRecord.setMsgTitle("待办任务");
|
||||||
thirdMsgSendRecord.setAppId(appid);
|
thirdMsgSendRecord.setAppId(appid);
|
||||||
thirdMsgSendRecord.setHeadText(title);
|
thirdMsgSendRecord.setHeadText(title);
|
||||||
thirdMsgSendRecord.setMsgContent(content1 + "#" + content2 + "#" + content3);
|
thirdMsgSendRecord.setMsgContent(JSONObject.toJSONString(msgs));
|
||||||
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
||||||
|
thirdMsgSendRecord.setWorkType(type);
|
||||||
|
thirdMsgSendRecord.setEmployeeId(staff.getEmployeeId());
|
||||||
|
thirdMsgSendRecord.setWorkId(workId);
|
||||||
thirdMsgSendRecord.setStatus(0);
|
thirdMsgSendRecord.setStatus(0);
|
||||||
try{
|
try{
|
||||||
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/add");
|
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/add");
|
||||||
@ -343,22 +346,16 @@ public class DingTalkUtil {
|
|||||||
req.setUrl(singleUrl);
|
req.setUrl(singleUrl);
|
||||||
req.setSourceName(from);
|
req.setSourceName(from);
|
||||||
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
|
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
|
||||||
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
|
||||||
list2.add(obj3);
|
for (WorkMsg workMsg:msgs
|
||||||
obj3.setTitle(title1);
|
) {
|
||||||
obj3.setContent(content1);
|
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
||||||
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
list2.add(obj3);
|
||||||
list2.add(obj3);
|
obj3.setTitle(workMsg.getTitle());
|
||||||
obj3.setTitle(title2);
|
obj3.setContent(workMsg.getContent());
|
||||||
obj3.setContent(content2);
|
}
|
||||||
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
|
||||||
list2.add(obj3);
|
|
||||||
obj3.setTitle(title3);
|
|
||||||
obj3.setContent(content3);
|
|
||||||
req.setFormItemList(list2);
|
req.setFormItemList(list2);
|
||||||
OapiWorkrecordAddResponse rsp = client.execute(req, token);
|
OapiWorkrecordAddResponse rsp = client.execute(req, token);
|
||||||
|
|
||||||
|
|
||||||
logger.info("钉钉待办任务请求返回{}", rsp.getBody());
|
logger.info("钉钉待办任务请求返回{}", rsp.getBody());
|
||||||
//插入数据库
|
//插入数据库
|
||||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||||
@ -383,6 +380,37 @@ public class DingTalkUtil {
|
|||||||
return msg;
|
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) {
|
public R getUserIdByCode(String code, String token) {
|
||||||
try {
|
try {
|
||||||
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo");
|
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo");
|
||||||
|
|||||||
@ -30,4 +30,5 @@ public interface FlowChangeMapper extends BaseMapper<FlowChange> {
|
|||||||
int deleteFlowChangeById(@Param("id")Long id);
|
int deleteFlowChangeById(@Param("id")Long id);
|
||||||
|
|
||||||
|
|
||||||
|
FlowChange selectFlowChangeByRecordIdAndToIdAndType(@Param("recordId") Long recordId, @Param("toStaffId") Long toStaffId, @Param("type") int type);
|
||||||
}
|
}
|
||||||
@ -82,4 +82,9 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
|
|
||||||
int batchDeleteByRecordIds(@Param("recordIds")List<Long> recordIds);
|
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);
|
||||||
}
|
}
|
||||||
@ -41,4 +41,6 @@ public interface ResultModelMapper extends BaseMapper<ResultModel> {
|
|||||||
|
|
||||||
int deleteResultModelByGroupId(Long id);
|
int deleteResultModelByGroupId(Long id);
|
||||||
|
|
||||||
|
int updateCoverWeightResultModelById(ResultModel resultModel);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -33,4 +33,6 @@ public interface FlowChangeService extends IService<FlowChange> {
|
|||||||
|
|
||||||
|
|
||||||
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
|
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
|
||||||
|
|
||||||
|
FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type);
|
||||||
}
|
}
|
||||||
@ -76,4 +76,10 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
FlowRecord selectFlowRecordByRecordIdMinIdStatus(Long resultRecordId, Long id, int i);
|
FlowRecord selectFlowRecordByRecordIdMinIdStatus(Long resultRecordId, Long id, int i);
|
||||||
|
|
||||||
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(Long id, int flowProcess);
|
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);
|
||||||
}
|
}
|
||||||
@ -79,5 +79,10 @@ public class FlowChangeServiceImpl extends ServiceImpl<FlowChangeMapper, FlowCha
|
|||||||
flowChangeMapper.insertFlowChange(flowChange);
|
flowChangeMapper.insertFlowChange(flowChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type){
|
||||||
|
return flowChangeMapper.selectFlowChangeByRecordIdAndToIdAndType(recordId, toStaffId, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import com.lz.modules.flow.service.FlowRecordService;
|
|||||||
import com.lz.modules.performance.req.AssessTaskReq;
|
import com.lz.modules.performance.req.AssessTaskReq;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
|
import lombok.Builder;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -205,5 +206,19 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
return flowRecordMapper.selectFlowRecordByRecordIdFlowProcess(id,flowProcess);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,7 +133,7 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
|
|||||||
resultModelMapper.insertResultModel(resultModel);
|
resultModelMapper.insertResultModel(resultModel);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
resultModelMapper.updateResultModelById(resultModel);
|
resultModelMapper.updateCoverWeightResultModelById(resultModel);
|
||||||
if(resultModel.getIsDelete() != null && resultModel.getIsDelete().intValue() == 1){
|
if(resultModel.getIsDelete() != null && resultModel.getIsDelete().intValue() == 1){
|
||||||
delCount--;
|
delCount--;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,10 @@ import com.lz.modules.app.service.DepartmentsService;
|
|||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffOccupationService;
|
import com.lz.modules.app.service.StaffOccupationService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
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.FlowRecord;
|
||||||
import com.lz.modules.flow.entity.FlowStart;
|
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.FlowRecordService;
|
||||||
import com.lz.modules.flow.service.FlowStartService;
|
import com.lz.modules.flow.service.FlowStartService;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
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.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import com.lz.modules.third.entity.ThirdAppConfig;
|
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.ThirdAppConfigService;
|
||||||
|
import com.lz.modules.third.service.ThirdMsgSendRecordService;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -79,11 +84,15 @@ public class DingtalkBusiness {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowStartService flowStartService;
|
private FlowStartService flowStartService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowChangeService flowChangeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ThirdMsgSendRecordService thirdMsgSendRecordService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
StaffDao staffDao;
|
StaffDao staffDao;
|
||||||
|
|
||||||
List<ThreadSendMessage> threadSendMessages = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
@Value("${dingtalk.appid}")
|
@Value("${dingtalk.appid}")
|
||||||
private String appid;
|
private String appid;
|
||||||
@ -272,7 +281,6 @@ public class DingtalkBusiness {
|
|||||||
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
||||||
|
|
||||||
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
|
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
|
||||||
threadSendMessages.add(threadSendMessage);//防止提前回收
|
|
||||||
Thread thread = new Thread(threadSendMessage);
|
Thread thread = new Thread(threadSendMessage);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
@ -365,6 +373,24 @@ public class DingtalkBusiness {
|
|||||||
this.appid = appid;
|
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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
|
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
|
||||||
@ -387,60 +413,133 @@ public class DingtalkBusiness {
|
|||||||
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
||||||
"&container_type=work_platform&app_id=0_" +
|
"&container_type=work_platform&app_id=0_" +
|
||||||
appid + "&redirect_type=jump&redirect_url=" + url;
|
appid + "&redirect_type=jump&redirect_url=" + url;
|
||||||
|
|
||||||
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
|
||||||
//发送制定目标通知
|
//发送制定目标通知
|
||||||
StaffEntity entity = new StaffEntity();
|
logger.info("目标制定");
|
||||||
entity.setId(info.getId());
|
sendNotic(info.getId(), info.getEmployeeId(),
|
||||||
entity.setEmployeeId(info.getEmployeeId());
|
"目标制定", info.getFlowStart().getName(),
|
||||||
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
||||||
"任务内容", "目标制定",
|
|
||||||
"考核名称", info.getFlowStart().getName(),
|
|
||||||
"被考核人", info.getResultRecord().getStaffName(),
|
|
||||||
url, token, "霖梓控股");
|
|
||||||
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
|
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
|
||||||
//发送开始评分通知
|
//发送开始评分通知
|
||||||
StaffEntity entity = new StaffEntity();
|
logger.info("结果录入");
|
||||||
entity.setId(info.getId());
|
sendNotic(info.getId(), info.getEmployeeId(),
|
||||||
entity.setEmployeeId(info.getEmployeeId());
|
"结果录入", info.getFlowStart().getName(),
|
||||||
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
||||||
"任务内容", "结果录入",
|
|
||||||
"考核名称", info.getFlowStart().getName(),
|
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.URGING.getType()){
|
||||||
"被考核人", info.getResultRecord().getStaffName(),
|
//绩效催办
|
||||||
url, token, "霖梓控股");
|
logger.info("绩效催办");
|
||||||
}else{
|
}else {
|
||||||
//流程流转通知
|
//流程流转通知
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
|
||||||
if(flowRecords.size() == 0){
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.TRANSFER.getType()){//转交
|
||||||
//任务结束
|
//转交
|
||||||
}else{
|
logger.info("转交待办任务处理");
|
||||||
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
|
||||||
@Override
|
info.getId(), 0);
|
||||||
public Long apply(FlowRecord flowRecord) {
|
ThirdMsgSendRecord thirdMsgSendRecord =
|
||||||
return flowRecord.getApprovalStaffId();
|
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{
|
}else{
|
||||||
logger.info("ThreadSendMessage token无效"); ;
|
logger.info("ThreadSendMessage token无效"); ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
threadSendMessages.remove(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,4 +30,9 @@ public interface ThirdMsgSendRecordMapper extends BaseMapper<ThirdMsgSendRecord>
|
|||||||
int deleteThirdMsgSendRecordById(@Param("id")Long id);
|
int deleteThirdMsgSendRecordById(@Param("id")Long id);
|
||||||
|
|
||||||
|
|
||||||
|
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
||||||
|
@Param("workId") Long workId,
|
||||||
|
@Param("staffId") Long staffId,
|
||||||
|
@Param("workType") int workType,
|
||||||
|
@Param("status") int status);
|
||||||
}
|
}
|
||||||
@ -1,73 +1,109 @@
|
|||||||
package com.lz.modules.third.entity;
|
package com.lz.modules.third.entity;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
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 lombok.Data;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 菜单权限表
|
|
||||||
* </p>*第三方消息发送记录
|
* </p>*第三方消息发送记录
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-08-19
|
* @since 2020-11-19
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("third_msg_send_record")
|
@TableName("third_msg_send_record")
|
||||||
|
@ApiModel(value = "第三方消息发送记录")
|
||||||
public class ThirdMsgSendRecord implements java.io.Serializable {
|
public class ThirdMsgSendRecord implements java.io.Serializable {
|
||||||
//
|
//
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
//
|
//
|
||||||
|
@ApiModelProperty(value = "", name = "isDelete")
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
//
|
//
|
||||||
private Date createTime;
|
@ApiModelProperty(value = "", name = "gmtCreate")
|
||||||
|
private Date gmtCreate;
|
||||||
//
|
//
|
||||||
private Date updateTime;
|
@ApiModelProperty(value = "", name = "gmtModified")
|
||||||
//消息类型:text,image,voice,file,link,oa,markdown,action_card
|
private Date gmtModified;
|
||||||
|
//消息类型:text,image,voice,file,link,oa,markdown,action_card,work_msg待办任务
|
||||||
|
@ApiModelProperty(value = "消息类型:text,image,voice,file,link,oa,markdown,action_card,work_msg待办任务", name = "msgType")
|
||||||
private String msgType;
|
private String msgType;
|
||||||
//消息头背景色 oa消息中才有
|
//消息头背景色 oa消息中才有
|
||||||
|
@ApiModelProperty(value = "消息头背景色 oa消息中才有", name = "headBgcolor")
|
||||||
private String headBgcolor;
|
private String headBgcolor;
|
||||||
//消息头部标题,最多10个字符 oa消息中,action_card的title
|
//消息头部标题,最多10个字符 oa消息中,action_card的title
|
||||||
|
@ApiModelProperty(value = "消息头部标题,最多10个字符 oa消息中,action_card的title", name = "headText")
|
||||||
private String headText;
|
private String headText;
|
||||||
//消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title
|
//消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title
|
||||||
|
@ApiModelProperty(value = "消息标题,oa中的消息体的消息头,link,markdown,action_card的single_title", name = "msgTitle")
|
||||||
private String msgTitle;
|
private String msgTitle;
|
||||||
//消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容
|
//消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容
|
||||||
|
@ApiModelProperty(value = "消息内容,text,link,oa正文,markdown的markdown内容,action_card的markdown内容", name = "msgContent")
|
||||||
private String msgContent;
|
private String msgContent;
|
||||||
//image,voice,file消息的文件附件id
|
//image,voice,file消息的文件附件id
|
||||||
|
@ApiModelProperty(value = "image,voice,file消息的文件附件id", name = "mediaId")
|
||||||
private Long mediaId;
|
private Long mediaId;
|
||||||
//voice消息的时常信息 不超过60秒
|
//voice消息的时常信息 不超过60秒
|
||||||
|
@ApiModelProperty(value = "voice消息的时常信息 不超过60秒", name = "duration")
|
||||||
private String duration;
|
private String duration;
|
||||||
//link、oa的message_url,action_card的single_url
|
//link、oa的message_url,action_card的single_url
|
||||||
|
@ApiModelProperty(value = "link、oa的message_url,action_card的single_url", name = "msgUrl")
|
||||||
private String msgUrl;
|
private String msgUrl;
|
||||||
//link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式
|
//link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式
|
||||||
|
@ApiModelProperty(value = "link,oa中的图片,如果使用钉钉中的资源ID,请用@资源id的形式", name = "picUrl")
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
//oa的pc端url
|
//oa的pc端url
|
||||||
|
@ApiModelProperty(value = "oa的pc端url", name = "pcUrl")
|
||||||
private String pcUrl;
|
private String pcUrl;
|
||||||
//oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个
|
//oa中的消息体,json,Array串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}],最多显示6个
|
||||||
|
@ApiModelProperty(value = "oa中的消息体,json,Array串[{\"key\":\"说明A\",\"value\":\"值A\"},{\"key\":\"说明B\",\"value\":\"值B\"}],最多显示6个", name = "form")
|
||||||
private String form;
|
private String form;
|
||||||
//oa中的单文本信息的数目
|
//oa中的单文本信息的数目
|
||||||
|
@ApiModelProperty(value = "oa中的单文本信息的数目", name = "richNum")
|
||||||
private String richNum;
|
private String richNum;
|
||||||
//oa中的单文本信息的单位
|
//oa中的单文本信息的单位
|
||||||
|
@ApiModelProperty(value = "oa中的单文本信息的单位", name = "richUnit")
|
||||||
private String richUnit;
|
private String richUnit;
|
||||||
//oa中显示的附件数目,不做校验只展示
|
//oa中显示的附件数目,不做校验只展示
|
||||||
|
@ApiModelProperty(value = "oa中显示的附件数目,不做校验只展示", name = "fileCount")
|
||||||
private String fileCount;
|
private String fileCount;
|
||||||
//oa中的自定义作者
|
//oa中的自定义作者
|
||||||
|
@ApiModelProperty(value = "oa中的自定义作者", name = "author")
|
||||||
private String author;
|
private String author;
|
||||||
//action_card独立跳转是按钮的排列0是竖向排列 1是横向排列
|
//action_card独立跳转是按钮的排列0是竖向排列 1是横向排列
|
||||||
|
@ApiModelProperty(value = "action_card独立跳转是按钮的排列0是竖向排列 1是横向排列", name = "actionCardBtnOrientation")
|
||||||
private String actionCardBtnOrientation;
|
private String actionCardBtnOrientation;
|
||||||
//action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}]
|
//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;
|
private String actionCardBtnList;
|
||||||
//lz_staff id
|
//lz_staff id
|
||||||
|
@ApiModelProperty(value = "lz_staff id", name = "staffId")
|
||||||
private Long staffId;
|
private Long staffId;
|
||||||
//发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回
|
//发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回
|
||||||
|
@ApiModelProperty(value = "发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回", name = "status")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//应用ID
|
//应用ID
|
||||||
|
@ApiModelProperty(value = "应用ID", name = "appId")
|
||||||
private String appId;
|
private String appId;
|
||||||
//钉钉返回的任务id
|
//钉钉返回的任务id
|
||||||
|
@ApiModelProperty(value = "钉钉返回的任务id", name = "taskId")
|
||||||
private String taskId;
|
private String taskId;
|
||||||
//备注,一些说明
|
//备注,一些说明
|
||||||
|
@ApiModelProperty(value = "备注,一些说明", name = "remark")
|
||||||
private String 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
|
* @return
|
||||||
@ -102,41 +138,41 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Date getCreateTime() {
|
public Date getGmtCreate() {
|
||||||
return createTime;
|
return gmtCreate;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param createTime
|
* @param gmtCreate
|
||||||
*/
|
*/
|
||||||
public void setCreateTime(Date createTime) {
|
public void setGmtCreate(Date gmtCreate) {
|
||||||
this.createTime = createTime;
|
this.gmtCreate = gmtCreate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Date getUpdateTime() {
|
public Date getGmtModified() {
|
||||||
return updateTime;
|
return gmtModified;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param updateTime
|
* @param gmtModified
|
||||||
*/
|
*/
|
||||||
public void setUpdateTime(Date updateTime) {
|
public void setGmtModified(Date gmtModified) {
|
||||||
this.updateTime = updateTime;
|
this.gmtModified = gmtModified;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息类型:text,image,voice,file,link,oa,markdown,action_card
|
* 消息类型:text,image,voice,file,link,oa,markdown,action_card,work_msg待办任务
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getMsgType() {
|
public String getMsgType() {
|
||||||
return msgType;
|
return msgType;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 消息类型:text,image,voice,file,link,oa,markdown,action_card
|
* 消息类型:text,image,voice,file,link,oa,markdown,action_card,work_msg待办任务
|
||||||
* @param msgType
|
* @param msgType
|
||||||
*/
|
*/
|
||||||
public void setMsgType(String msgType) {
|
public void setMsgType(String msgType) {
|
||||||
@ -458,13 +494,58 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
this.remark = remark;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ThirdMsgSendRecord{" +
|
return "ThirdMsgSendRecord{" +
|
||||||
",id=" + id +
|
",id=" + id +
|
||||||
",isDelete=" + isDelete +
|
",isDelete=" + isDelete +
|
||||||
",createTime=" + createTime +
|
",gmtCreate=" + gmtCreate +
|
||||||
",updateTime=" + updateTime +
|
",gmtModified=" + gmtModified +
|
||||||
",msgType=" + msgType +
|
",msgType=" + msgType +
|
||||||
",headBgcolor=" + headBgcolor +
|
",headBgcolor=" + headBgcolor +
|
||||||
",headText=" + headText +
|
",headText=" + headText +
|
||||||
@ -487,6 +568,9 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
",appId=" + appId +
|
",appId=" + appId +
|
||||||
",taskId=" + taskId +
|
",taskId=" + taskId +
|
||||||
",remark=" + remark +
|
",remark=" + remark +
|
||||||
|
",workId=" + workId +
|
||||||
|
",workType=" + workType +
|
||||||
|
",employeeId=" + employeeId +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13
src/main/java/com/lz/modules/third/entity/WorkMsg.java
Normal file
13
src/main/java/com/lz/modules/third/entity/WorkMsg.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,4 +36,6 @@ public interface ThirdMsgSendRecordService extends IService<ThirdMsgSendRecord>
|
|||||||
PageUtils queryPage(Map<String, Object> params);
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
void insert(ThirdMsgSendRecord thirdMsgSendRecord);
|
void insert(ThirdMsgSendRecord thirdMsgSendRecord);
|
||||||
|
|
||||||
|
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId, Long staffId, int workType, int status);
|
||||||
}
|
}
|
||||||
@ -85,4 +85,15 @@ public class ThirdMsgSendRecordServiceImpl extends ServiceImpl<ThirdMsgSendRecor
|
|||||||
thirdMsgSendRecordMapper.insert(thirdMsgSendRecord);
|
thirdMsgSendRecordMapper.insert(thirdMsgSendRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId,
|
||||||
|
Long staffId,
|
||||||
|
int workType,
|
||||||
|
int status){
|
||||||
|
return thirdMsgSendRecordMapper.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(workId,
|
||||||
|
staffId,
|
||||||
|
workType,
|
||||||
|
status);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,5 +99,9 @@
|
|||||||
update lz_flow_change set is_delete = 1 where id=#{id} limit 1
|
update lz_flow_change set is_delete = 1 where id=#{id} limit 1
|
||||||
</update>
|
</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>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -295,5 +295,20 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
</update>
|
</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>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,26 @@
|
|||||||
update lz_result_model set is_delete = 1 where evaluation_group_id=#{id}
|
update lz_result_model set is_delete = 1 where evaluation_group_id=#{id}
|
||||||
</update>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
<resultMap id="BaseResultMap" type="com.lz.modules.third.entity.ThirdMsgSendRecord">
|
<resultMap id="BaseResultMap" type="com.lz.modules.third.entity.ThirdMsgSendRecord">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="is_delete" property="isDelete"/>
|
<result column="is_delete" property="isDelete"/>
|
||||||
<result column="create_time" property="createTime"/>
|
<result column="gmt_create" property="gmtCreate"/>
|
||||||
<result column="update_time" property="updateTime"/>
|
<result column="gmt_modified" property="gmtModified"/>
|
||||||
<result column="msg_type" property="msgType"/>
|
<result column="msg_type" property="msgType"/>
|
||||||
<result column="head_bgcolor" property="headBgcolor"/>
|
<result column="head_bgcolor" property="headBgcolor"/>
|
||||||
<result column="head_text" property="headText"/>
|
<result column="head_text" property="headText"/>
|
||||||
@ -30,90 +30,94 @@
|
|||||||
<result column="app_id" property="appId"/>
|
<result column="app_id" property="appId"/>
|
||||||
<result column="task_id" property="taskId"/>
|
<result column="task_id" property="taskId"/>
|
||||||
<result column="remark" property="remark"/>
|
<result column="remark" property="remark"/>
|
||||||
|
<result column="work_id" property="workId"/>
|
||||||
|
<result column="work_type" property="workType"/>
|
||||||
|
<result column="employee_id" property="employeeId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<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>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectThirdMsgSendRecordById" resultType="ThirdMsgSendRecord" >
|
<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>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertThirdMsgSendRecord" parameterType="ThirdMsgSendRecord" useGeneratedKeys="true" keyProperty="id" >
|
<insert id="insertThirdMsgSendRecord" parameterType="ThirdMsgSendRecord" useGeneratedKeys="true" keyProperty="id" >
|
||||||
insert into third_msg_send_record(
|
insert into third_msg_send_record(
|
||||||
<if test="createTime != null">create_time, </if>
|
<if test="msgType != null">msg_type, </if>
|
||||||
<if test="updateTime != null">update_time, </if>
|
<if test="headBgcolor != null">head_bgcolor, </if>
|
||||||
<if test="msgType != null">msg_type, </if>
|
<if test="headText != null">head_text, </if>
|
||||||
<if test="headBgcolor != null">head_bgcolor, </if>
|
<if test="msgTitle != null">msg_title, </if>
|
||||||
<if test="headText != null">head_text, </if>
|
<if test="msgContent != null">msg_content, </if>
|
||||||
<if test="msgTitle != null">msg_title, </if>
|
<if test="mediaId != null">media_id, </if>
|
||||||
<if test="msgContent != null">msg_content, </if>
|
<if test="duration != null">duration, </if>
|
||||||
<if test="mediaId != null">media_id, </if>
|
<if test="msgUrl != null">msg_url, </if>
|
||||||
<if test="duration != null">duration, </if>
|
<if test="picUrl != null">pic_url, </if>
|
||||||
<if test="msgUrl != null">msg_url, </if>
|
<if test="pcUrl != null">pc_url, </if>
|
||||||
<if test="picUrl != null">pic_url, </if>
|
<if test="form != null">form, </if>
|
||||||
<if test="pcUrl != null">pc_url, </if>
|
<if test="richNum != null">rich_num, </if>
|
||||||
<if test="form != null">form, </if>
|
<if test="richUnit != null">rich_unit, </if>
|
||||||
<if test="richNum != null">rich_num, </if>
|
<if test="fileCount != null">file_count, </if>
|
||||||
<if test="richUnit != null">rich_unit, </if>
|
<if test="author != null">author, </if>
|
||||||
<if test="fileCount != null">file_count, </if>
|
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
|
||||||
<if test="author != null">author, </if>
|
<if test="actionCardBtnList != null">action_card_btn_list, </if>
|
||||||
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
|
<if test="staffId != null">staff_id, </if>
|
||||||
<if test="actionCardBtnList != null">action_card_btn_list, </if>
|
<if test="status != null">status, </if>
|
||||||
<if test="staffId != null">staff_id, </if>
|
<if test="appId != null">app_id, </if>
|
||||||
<if test="status != null">status, </if>
|
<if test="taskId != null">task_id, </if>
|
||||||
<if test="appId != null">app_id, </if>
|
<if test="remark != null">remark, </if>
|
||||||
<if test="taskId != null">task_id, </if>
|
<if test="workId != null">work_id, </if>
|
||||||
<if test="remark != null">remark, </if>
|
<if test="workType != null">work_type, </if>
|
||||||
is_delete,
|
<if test="employeeId != null">employee_id, </if>
|
||||||
gmt_create,
|
is_delete,
|
||||||
gmt_modified
|
gmt_create,
|
||||||
|
gmt_modified
|
||||||
)values(
|
)values(
|
||||||
<if test="createTime != null">#{ createTime}, </if>
|
<if test="msgType != null">#{ msgType}, </if>
|
||||||
<if test="updateTime != null">#{ updateTime}, </if>
|
<if test="headBgcolor != null">#{ headBgcolor}, </if>
|
||||||
<if test="msgType != null">#{ msgType}, </if>
|
<if test="headText != null">#{ headText}, </if>
|
||||||
<if test="headBgcolor != null">#{ headBgcolor}, </if>
|
<if test="msgTitle != null">#{ msgTitle}, </if>
|
||||||
<if test="headText != null">#{ headText}, </if>
|
<if test="msgContent != null">#{ msgContent}, </if>
|
||||||
<if test="msgTitle != null">#{ msgTitle}, </if>
|
<if test="mediaId != null">#{ mediaId}, </if>
|
||||||
<if test="msgContent != null">#{ msgContent}, </if>
|
<if test="duration != null">#{ duration}, </if>
|
||||||
<if test="mediaId != null">#{ mediaId}, </if>
|
<if test="msgUrl != null">#{ msgUrl}, </if>
|
||||||
<if test="duration != null">#{ duration}, </if>
|
<if test="picUrl != null">#{ picUrl}, </if>
|
||||||
<if test="msgUrl != null">#{ msgUrl}, </if>
|
<if test="pcUrl != null">#{ pcUrl}, </if>
|
||||||
<if test="picUrl != null">#{ picUrl}, </if>
|
<if test="form != null">#{ form}, </if>
|
||||||
<if test="pcUrl != null">#{ pcUrl}, </if>
|
<if test="richNum != null">#{ richNum}, </if>
|
||||||
<if test="form != null">#{ form}, </if>
|
<if test="richUnit != null">#{ richUnit}, </if>
|
||||||
<if test="richNum != null">#{ richNum}, </if>
|
<if test="fileCount != null">#{ fileCount}, </if>
|
||||||
<if test="richUnit != null">#{ richUnit}, </if>
|
<if test="author != null">#{ author}, </if>
|
||||||
<if test="fileCount != null">#{ fileCount}, </if>
|
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
|
||||||
<if test="author != null">#{ author}, </if>
|
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
|
||||||
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
|
<if test="staffId != null">#{ staffId}, </if>
|
||||||
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
|
<if test="status != null">#{ status}, </if>
|
||||||
<if test="staffId != null">#{ staffId}, </if>
|
<if test="appId != null">#{ appId}, </if>
|
||||||
<if test="status != null">#{ status}, </if>
|
<if test="taskId != null">#{ taskId}, </if>
|
||||||
<if test="appId != null">#{ appId}, </if>
|
<if test="remark != null">#{ remark}, </if>
|
||||||
<if test="taskId != null">#{ taskId}, </if>
|
<if test="workId != null">#{ workId}, </if>
|
||||||
<if test="remark != null">#{ remark}, </if>
|
<if test="workType != null">#{ workType}, </if>
|
||||||
0,
|
<if test="employeeId != null">#{ employeeId}, </if>
|
||||||
now(),
|
0,
|
||||||
now()
|
now(),
|
||||||
|
now()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<update id="updateThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
|
<update id="updateThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
|
||||||
update
|
update
|
||||||
third_msg_send_record
|
third_msg_send_record
|
||||||
<trim prefix="set" suffixOverrides=",">
|
<trim prefix="set" suffixOverrides=",">
|
||||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
||||||
<if test="msgType != null">msg_type = #{msgType},</if>
|
<if test="msgType != null">msg_type = #{msgType},</if>
|
||||||
<if test="headBgcolor != null">head_bgcolor = #{headBgcolor},</if>
|
<if test="headBgcolor != null">head_bgcolor = #{headBgcolor},</if>
|
||||||
<if test="headText != null">head_text = #{headText},</if>
|
<if test="headText != null">head_text = #{headText},</if>
|
||||||
@ -135,7 +139,10 @@
|
|||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="appId != null">app_id = #{appId},</if>
|
<if test="appId != null">app_id = #{appId},</if>
|
||||||
<if test="taskId != null">task_id = #{taskId},</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>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -144,11 +151,10 @@
|
|||||||
|
|
||||||
<update id="updateCoverThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
|
<update id="updateCoverThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
|
||||||
update
|
update
|
||||||
third_msg_send_record
|
third_msg_send_record
|
||||||
set
|
set
|
||||||
is_delete = #{isDelete},
|
is_delete = #{isDelete},
|
||||||
create_time = #{createTime},
|
gmt_create = #{gmtCreate},
|
||||||
update_time = #{updateTime},
|
|
||||||
msg_type = #{msgType},
|
msg_type = #{msgType},
|
||||||
head_bgcolor = #{headBgcolor},
|
head_bgcolor = #{headBgcolor},
|
||||||
head_text = #{headText},
|
head_text = #{headText},
|
||||||
@ -170,15 +176,22 @@
|
|||||||
status = #{status},
|
status = #{status},
|
||||||
app_id = #{appId},
|
app_id = #{appId},
|
||||||
task_id = #{taskId},
|
task_id = #{taskId},
|
||||||
remark = #{remark}
|
remark = #{remark},
|
||||||
|
work_id = #{workId},
|
||||||
|
work_type = #{workType},
|
||||||
|
employee_id = #{employeeId}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<update id="deleteThirdMsgSendRecordById" parameterType="java.lang.Long">
|
<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>
|
</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>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ public class MysqlMain {
|
|||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
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>();
|
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user