提交代码
parent
d5008959b0
commit
d57b016f25
|
@ -6,7 +6,7 @@ package com.ruoyi.common.enums;
|
|||
* @author JiangYuQi
|
||||
*/
|
||||
public enum TemplateMessageEnum {
|
||||
|
||||
SERVER_ERROR("_YCnCRtgbtFNNg_78koc8nbFl2gWjeaWFHXV7WV1if8","服务异常通知"),
|
||||
TROUBLE_SUBMIT("f3saBGJCnUAjXHw1KooxEQOOiKEHlQxLIK-sPDgoL_E", "隐患整改通知"),
|
||||
TROUBLE_HANDLE("6mGOWPXS3l5a5fzXd9GIV9_IkEfZmeJ_6G2P_SQkWnU", "隐患处理完成通知"),
|
||||
ROUBLE_EXPIRED_ZG("f3saBGJCnUAjXHw1KooxESpSdHMrh5liznpsbWZV8oA", "隐患整改超时通知"),
|
||||
|
|
|
@ -140,6 +140,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
return !isNull(object);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 判断一个对象是否非空
|
||||
*
|
||||
* @param object Object
|
||||
* @return true:非空 false:空
|
||||
*/
|
||||
public static boolean isNotEmpty(Object object)
|
||||
{
|
||||
return !isNull(object) && !"".equals(object);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 判断一个对象是否是数组类型(Java基本型别的数组)
|
||||
*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.flowable.listener;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.config.WechatAccountConfig;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
|
@ -88,13 +89,18 @@ public class GlobalEventListener extends AbstractFlowableEngineEventListener {
|
|||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(event.getProcessInstanceId()).singleResult();
|
||||
String startUserId = processInstance.getStartUserId();
|
||||
SysUser sysUser = sysUserMapper.selectUserById(Convert.toLong(startUserId));
|
||||
Map<String, Object> map = flowBusinessKeyService.selectLastCommentByProcInsId(processInstance.getId());
|
||||
String nodeName = "工程审批";
|
||||
if(map!=null){
|
||||
nodeName += Convert.toStr(map.get("commentResult"),"");
|
||||
}
|
||||
//模板数据
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
.toUser(this.getMsgId(sysUser.getPhonenumber()))
|
||||
.templateId(TemplateMessageEnum.APPLY_DEFAULT.getId()).build();
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing14", this.getMsgProName(Convert.toLong(processInstance.getBusinessKey()))));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing1", processInstance.getProcessDefinitionName()));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing2", "申请审批通过"));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing2", nodeName));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time4", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,processInstance.getStartTime())));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", sysUser.getNickName()+"["+this.getMsgDepName(sysUser.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
|
@ -123,6 +129,11 @@ public class GlobalEventListener extends AbstractFlowableEngineEventListener {
|
|||
if(StringUtils.isNotEmpty(candidateUsers) || StringUtils.isNotEmpty(candidateGroups)){
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(taskEntity.getProcessInstanceId()).singleResult();
|
||||
List<SysUser> sysUserList = flowBusinessKeyService.findFlowTaskUsers(processInstance.getBusinessKey(),candidateUsers,candidateGroups);
|
||||
Map<String, Object> map = flowBusinessKeyService.selectLastCommentByProcInsId(processInstance.getId());
|
||||
String nodeName = "待"+taskEntity.getName();
|
||||
if(map!=null && "驳回".equals(map.get("commentResult"))){
|
||||
nodeName += "工程审批驳回,请重新提交或审批";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(sysUserList)){
|
||||
String startUserId = processInstance.getStartUserId();
|
||||
SysUser sysUser = sysUserMapper.selectUserById(Convert.toLong(startUserId));
|
||||
|
@ -134,7 +145,7 @@ public class GlobalEventListener extends AbstractFlowableEngineEventListener {
|
|||
.templateId(TemplateMessageEnum.APPLY_DEFAULT.getId()).build();
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing14", this.getMsgProName(Convert.toLong(processInstance.getBusinessKey()))));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing1", processInstance.getProcessDefinitionName()));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing2", Objects.equals(taskEntity.getName(),"提交申请")?"申请审批驳回":"待"+taskEntity.getName()));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing2", nodeName));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time4", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,processInstance.getStartTime())));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", sysUser.getNickName()+"["+this.getMsgDepName(sysUser.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
|
@ -238,8 +249,13 @@ public class GlobalEventListener extends AbstractFlowableEngineEventListener {
|
|||
return openIds;
|
||||
}else{
|
||||
List<SysUserOpenid> list = sysUserOpenidMapper.findSysUserOpenidsByUser(userName);
|
||||
List<String> strs = list.stream().map(SysUserOpenid :: getMsgOpenId).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<SysUserOpenid> ids = list.stream().filter(u -> StringUtils.isNotBlank(u.getMsgOpenId())).collect(Collectors.toList());
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
List<String> strs = ids.stream().map(SysUserOpenid :: getMsgOpenId).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
}
|
||||
}
|
||||
//设置30分钟有效期
|
||||
redisCache.setCacheObject(CacheConstants.WX_MPMESSAGE_OPENID +userName,openIds,30, TimeUnit.MINUTES);
|
||||
return openIds;
|
||||
|
@ -278,6 +294,21 @@ public class GlobalEventListener extends AbstractFlowableEngineEventListener {
|
|||
}
|
||||
}catch (Exception e){
|
||||
log.info("出错了...{}",e.getMessage());
|
||||
try {
|
||||
JSONObject jsonObject = JSONObject.parseObject(e.getMessage());
|
||||
if(Objects.equals(jsonObject.getString("errcode"),"40164")){
|
||||
String ip = jsonObject.getString("errmsg").split("ipv6")[0].split(" ")[2];
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
.toUser("oM5rN6Wb8UyBLuTAFNGjnZCeQs1U")
|
||||
.templateId(TemplateMessageEnum.SERVER_ERROR.getId())
|
||||
.build();
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("character_string7", "IP>"+ip));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time6", DateUtils.dateTimeNow()));
|
||||
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,13 @@ public interface IFlowBusinessKeyService {
|
|||
*/
|
||||
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据条件流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> selectLastCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
|
|
|
@ -81,6 +81,16 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
|
|||
return flowBusinessKeyMapper.selectCommentByProcInsId(procInsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> selectLastCommentByProcInsId(String procInsId){
|
||||
return flowBusinessKeyMapper.selectLastCommentByProcInsId(procInsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.quartz.task;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.config.WechatAccountConfig;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
@ -7,8 +8,10 @@ import com.ruoyi.common.core.redis.RedisCache;
|
|||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.MessageTypeEnum;
|
||||
import com.ruoyi.common.enums.TemplateMessageEnum;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.quartz.service.ITaskService;
|
||||
import com.ruoyi.system.domain.SysUserOpenid;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
@ -17,9 +20,7 @@ import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -301,7 +302,7 @@ public class FlowTaskExpiredTask {
|
|||
String minNickTime = Convert.toStr(dataMap.get("minNickTime"));
|
||||
Integer infotype = Convert.toInt(dataMap.get("infotype"));
|
||||
String handlePath = infotype==0?"security":"quality";
|
||||
String infoTypeName = infotype==0?"安全隐患":"安全隐患";
|
||||
String infoTypeName = infotype==0?"安全隐患":"质量隐患";
|
||||
String total = Convert.toStr(dataMap.get("total"));
|
||||
//模板数据
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
|
@ -350,7 +351,7 @@ public class FlowTaskExpiredTask {
|
|||
String minNickTime = Convert.toStr(dataMap.get("minNickTime"));
|
||||
Integer infotype = Convert.toInt(dataMap.get("infotype"));
|
||||
String handlePath = infotype==0?"security":"quality";
|
||||
String infoTypeName = infotype==0?"安全隐患":"安全隐患";
|
||||
String infoTypeName = infotype==0?"安全隐患":"质量隐患";
|
||||
String total = Convert.toStr(dataMap.get("total"));
|
||||
//模板数据
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
|
@ -388,8 +389,13 @@ public class FlowTaskExpiredTask {
|
|||
return openIds;
|
||||
}else{
|
||||
List<Map<String, Object>> list = taskService.findSysUserOpenidsByUser(userName);
|
||||
List<String> strs = list.stream().map(Map -> Map.get("msgOpenId").toString()).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<Map<String, Object>> ids = list.stream().filter(m -> StringUtils.isNotEmpty(m.get("msgOpenId"))).collect(Collectors.toList());
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
List<String> strs = ids.stream().map(Map -> Map.get("msgOpenId").toString()).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
}
|
||||
}
|
||||
//设置30分钟有效期
|
||||
redisCache.setCacheObject(CacheConstants.WX_MPMESSAGE_OPENID +userName,openIds,30, TimeUnit.MINUTES);
|
||||
return openIds;
|
||||
|
@ -428,6 +434,22 @@ public class FlowTaskExpiredTask {
|
|||
}
|
||||
}catch (Exception e){
|
||||
log.info("出错了...{}",e.getMessage());
|
||||
try {
|
||||
JSONObject jsonObject = JSONObject.parseObject(e.getMessage());
|
||||
if(Objects.equals(jsonObject.getString("errcode"),"40164")){
|
||||
String ip = jsonObject.getString("errmsg").split("ipv6")[0].split(" ")[2];
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
.toUser("oM5rN6Wb8UyBLuTAFNGjnZCeQs1U")
|
||||
.templateId(TemplateMessageEnum.SERVER_ERROR.getId())
|
||||
.build();
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("character_string7", "IP>"+ip));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time6", DateUtils.dateTimeNow()));
|
||||
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,13 @@ public interface FlowBusinessKeyMapper {
|
|||
*/
|
||||
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据条件流程Id查询操作日志
|
||||
* @param procInsId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> selectLastCommentByProcInsId(String procInsId);
|
||||
|
||||
/**
|
||||
* 根据流程Id查询表单数据
|
||||
* @param procInsId
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
select * from vw_flow_comment where procInstId = #{procInstId} order by startTime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectLastCommentByProcInsId" parameterType="string" resultType="map">
|
||||
select * from vw_flow_comment where procInstId = #{procInstId} order by startTime DESC limit 1
|
||||
</select>
|
||||
|
||||
<!--查询工作流携带的参数-->
|
||||
<select id="selectFormDatasByProcInsId" parameterType="string" resultType="map">
|
||||
select hv.NAME_ as `name`,hv.TEXT_ as text from act_hi_varinst hv where hv.PROC_INST_ID_ = #{procInstId}
|
||||
|
|
|
@ -12,6 +12,7 @@ const getters = {
|
|||
userId: state => state.user.userId,
|
||||
name: state => state.user.name,
|
||||
nickname: state => state.user.nickname,
|
||||
userPhone: state => state.user.userPhone,
|
||||
dept:state=>state.user.dept,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
|
|
|
@ -5,6 +5,7 @@ const user = {
|
|||
state: {
|
||||
token: getToken(),
|
||||
userId:'',
|
||||
userPhone:'',
|
||||
name: '',
|
||||
nickname: '',
|
||||
avatar: '',
|
||||
|
@ -20,6 +21,9 @@ const user = {
|
|||
SET_USER_ID: (state, id) => {
|
||||
state.userId = id
|
||||
},
|
||||
SET_USER_PHONE: (state, phone) => {
|
||||
state.userPhone = phone
|
||||
},
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
},
|
||||
|
@ -71,6 +75,7 @@ const user = {
|
|||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_USER_ID', user.userId)
|
||||
commit('SET_USER_PHONE', user.phonenumber)
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_NICKNAME', user.nickName)
|
||||
commit("SET_DEPT",user.dept);
|
||||
|
|
|
@ -234,7 +234,7 @@
|
|||
<el-col :span="18">
|
||||
<el-select
|
||||
v-model="scope.row.copySendUser"
|
||||
placeholder="请选择整改人"
|
||||
placeholder="请选择抄送人"
|
||||
style="width: 100%"
|
||||
@change="selectCopySendUser($event, scope.row)"
|
||||
>
|
||||
|
@ -259,12 +259,12 @@
|
|||
<el-col :span="18">
|
||||
<el-select
|
||||
v-model="scope.row.recheckSendUser"
|
||||
placeholder="请选择整改人"
|
||||
placeholder="请选择复检人"
|
||||
style="width: 100%"
|
||||
@change="selectRecheckSendUser($event, scope.row)"
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in findProjectAllUnitUser(scope.row.projectId)"
|
||||
v-for="group in findProjectAllUnitFjUser(scope.row.projectId)"
|
||||
:key="group.unitId + ''"
|
||||
:label="group.unitName + ' [' + group.unitTypeName + '] '"
|
||||
>
|
||||
|
@ -409,9 +409,11 @@ export default {
|
|||
projectDeptOptions: [],
|
||||
projectIds: [],
|
||||
projectUnitUsers: [],
|
||||
userPhoneNumber: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.userPhoneNumber = this.$store.getters.userPhone;
|
||||
this.getList();
|
||||
this.initMyProject();
|
||||
this.$api.publics.getZgsDeptList().then((d) => {
|
||||
|
@ -432,6 +434,7 @@ export default {
|
|||
this.projectUnitUsers.push({
|
||||
projectId: response.rows[0].id,
|
||||
data: d.data,
|
||||
fjdata: d.data,
|
||||
});
|
||||
});
|
||||
} else if (response.rows.length > 1) {
|
||||
|
@ -450,7 +453,25 @@ export default {
|
|||
});
|
||||
this.projectIds.forEach((proj) => {
|
||||
this.$api.publics.selectProjectAllUnitUser({ projectId: proj }).then((d) => {
|
||||
this.projectUnitUsers.push({ projectId: proj, data: d.data });
|
||||
const list = JSON.parse(JSON.stringify(d.data));
|
||||
let fjFlag = false;
|
||||
d.data.forEach((item) => {
|
||||
if (item.userinfoList.length > 0) {
|
||||
item.userinfoList.forEach((u) => {
|
||||
if (u.phonenumber == this.userPhoneNumber) {
|
||||
fjFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!fjFlag) {
|
||||
d.data[0].userinfoList.push({
|
||||
phonenumber: this.userPhoneNumber,
|
||||
nickName: this.$store.getters.nickname,
|
||||
jobTypeName: "集团公司",
|
||||
});
|
||||
}
|
||||
this.projectUnitUsers.push({ projectId: proj, data: list, fjdata: d.data });
|
||||
});
|
||||
});
|
||||
this.smzSspProblemmodifyDraftList = response.rows;
|
||||
|
@ -458,6 +479,7 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//整改人,抄送人
|
||||
findProjectAllUnitUser(projectId) {
|
||||
for (let i = 0; i < this.projectUnitUsers.length; i++) {
|
||||
if (this.projectUnitUsers[i].projectId == projectId) {
|
||||
|
@ -465,6 +487,14 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
//复检人
|
||||
findProjectAllUnitFjUser(projectId) {
|
||||
for (let i = 0; i < this.projectUnitUsers.length; i++) {
|
||||
if (this.projectUnitUsers[i].projectId == projectId) {
|
||||
return this.projectUnitUsers[i].fjdata;
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
@ -690,7 +720,8 @@ export default {
|
|||
id: null,
|
||||
projectId: this.projectOptions.length == 1 ? this.projectOptions[0].id : null,
|
||||
infoType: "0",
|
||||
problemArea: this.projectOptions.length == 1 ? this.projectOptions[0].projectName : null,
|
||||
problemArea:
|
||||
this.projectOptions.length == 1 ? this.projectOptions[0].projectName : null,
|
||||
workParts: null,
|
||||
changeInfo: null,
|
||||
lordSent: null,
|
||||
|
@ -723,7 +754,25 @@ export default {
|
|||
if (!this.projectIds.includes(val)) {
|
||||
this.projectIds.push(row.projectId);
|
||||
this.$api.publics.selectProjectAllUnitUser({ projectId: val }).then((d) => {
|
||||
this.projectUnitUsers.push({ projectId: val, data: d.data });
|
||||
const list = JSON.parse(JSON.stringify(d.data));
|
||||
let fjFlag = false;
|
||||
d.data.forEach((item) => {
|
||||
if (item.userinfoList.length > 0) {
|
||||
item.userinfoList.forEach((u) => {
|
||||
if (u.phonenumber == this.userPhoneNumber) {
|
||||
fjFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!fjFlag) {
|
||||
d.data[0].userinfoList.push({
|
||||
phonenumber: this.userPhoneNumber,
|
||||
nickName: this.$store.getters.nickname,
|
||||
jobTypeName: "集团公司",
|
||||
});
|
||||
}
|
||||
this.projectUnitUsers.push({ projectId: val, data: list, fjdata: d.data });
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < this.projectOptions.length; i++) {
|
||||
|
|
|
@ -234,7 +234,7 @@
|
|||
<el-col :span="18">
|
||||
<el-select
|
||||
v-model="scope.row.copySendUser"
|
||||
placeholder="请选择整改人"
|
||||
placeholder="请选择抄送人"
|
||||
style="width: 100%"
|
||||
@change="selectCopySendUser($event, scope.row)"
|
||||
>
|
||||
|
@ -259,12 +259,12 @@
|
|||
<el-col :span="18">
|
||||
<el-select
|
||||
v-model="scope.row.recheckSendUser"
|
||||
placeholder="请选择整改人"
|
||||
placeholder="请选择复检人"
|
||||
style="width: 100%"
|
||||
@change="selectRecheckSendUser($event, scope.row)"
|
||||
>
|
||||
<el-option-group
|
||||
v-for="group in findProjectAllUnitUser(scope.row.projectId)"
|
||||
v-for="group in findProjectAllUnitFjUser(scope.row.projectId)"
|
||||
:key="group.unitId + ''"
|
||||
:label="group.unitName + ' [' + group.unitTypeName + '] '"
|
||||
>
|
||||
|
@ -409,9 +409,11 @@ export default {
|
|||
projectDeptOptions: [],
|
||||
projectIds: [],
|
||||
projectUnitUsers: [],
|
||||
userPhoneNumber:"",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.userPhoneNumber = this.$store.getters.userPhone;
|
||||
this.getList();
|
||||
this.initMyProject();
|
||||
this.$api.publics.getZgsDeptList().then((d) => {
|
||||
|
@ -432,6 +434,7 @@ export default {
|
|||
this.projectUnitUsers.push({
|
||||
projectId: response.rows[0].id,
|
||||
data: d.data,
|
||||
fjdata: d.data,
|
||||
});
|
||||
});
|
||||
} else if (response.rows.length > 1) {
|
||||
|
@ -450,7 +453,25 @@ export default {
|
|||
});
|
||||
this.projectIds.forEach((proj) => {
|
||||
this.$api.publics.selectProjectAllUnitUser({ projectId: proj }).then((d) => {
|
||||
this.projectUnitUsers.push({ projectId: proj, data: d.data });
|
||||
const list = JSON.parse(JSON.stringify(d.data));
|
||||
let fjFlag = false;
|
||||
d.data.forEach((item) => {
|
||||
if (item.userinfoList.length > 0) {
|
||||
item.userinfoList.forEach((u) => {
|
||||
if (u.phonenumber == this.userPhoneNumber) {
|
||||
fjFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!fjFlag) {
|
||||
d.data[0].userinfoList.push({
|
||||
phonenumber: this.userPhoneNumber,
|
||||
nickName: this.$store.getters.nickname,
|
||||
jobTypeName: "集团公司",
|
||||
});
|
||||
}
|
||||
this.projectUnitUsers.push({ projectId: proj, data: list, fjdata:d.data });
|
||||
});
|
||||
});
|
||||
this.smzSspProblemmodifyDraftList = response.rows;
|
||||
|
@ -458,6 +479,7 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//整改人,抄送人
|
||||
findProjectAllUnitUser(projectId) {
|
||||
for (let i = 0; i < this.projectUnitUsers.length; i++) {
|
||||
if (this.projectUnitUsers[i].projectId == projectId) {
|
||||
|
@ -465,6 +487,14 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
//复检人
|
||||
findProjectAllUnitFjUser(projectId) {
|
||||
for (let i = 0; i < this.projectUnitUsers.length; i++) {
|
||||
if (this.projectUnitUsers[i].projectId == projectId) {
|
||||
return this.projectUnitUsers[i].fjdata;
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
@ -723,7 +753,25 @@ export default {
|
|||
if (!this.projectIds.includes(val)) {
|
||||
this.projectIds.push(row.projectId);
|
||||
this.$api.publics.selectProjectAllUnitUser({ projectId: val }).then((d) => {
|
||||
this.projectUnitUsers.push({ projectId: val, data: d.data });
|
||||
const list = JSON.parse(JSON.stringify(d.data));
|
||||
let fjFlag = false;
|
||||
d.data.forEach((item) => {
|
||||
if (item.userinfoList.length > 0) {
|
||||
item.userinfoList.forEach((u) => {
|
||||
if (u.phonenumber == this.userPhoneNumber) {
|
||||
fjFlag = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!fjFlag) {
|
||||
d.data[0].userinfoList.push({
|
||||
phonenumber: this.userPhoneNumber,
|
||||
nickName: this.$store.getters.nickname,
|
||||
jobTypeName: "集团公司",
|
||||
});
|
||||
}
|
||||
this.projectUnitUsers.push({ projectId: val, data: list,fjdata:d.data });
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < this.projectOptions.length; i++) {
|
||||
|
@ -734,21 +782,6 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
// changeProject(val,row){
|
||||
// if(!this.projectIds.includes(val)){
|
||||
// this.projectIds.push(row.projectId);
|
||||
// this.$api.publics.selectProjectAllUnitUser({projectId: val})
|
||||
// .then((d) => {
|
||||
// this.projectUnitUsers.push({projectId:val,data:d.data});
|
||||
// });
|
||||
// }
|
||||
// for(let i=0;i<this.projectOptions.length;i++){
|
||||
// if(this.projectOptions[i].projectId==val){
|
||||
// row.problemArea = this.projectOptions[i].projectName;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -74,9 +74,9 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除质量整改
|
||||
* 删除安全隐患
|
||||
*/
|
||||
@Log(title = "质量整改", businessType = BusinessType.DELETE)
|
||||
@Log(title = "删除安全隐患", businessType = BusinessType.DELETE)
|
||||
@GetMapping("/removeSafety")
|
||||
public AjaxResult removeSafety(@RequestParam Long id)
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
/**
|
||||
* 删除质量整改
|
||||
*/
|
||||
@Log(title = "质量隐患排查", businessType = BusinessType.DELETE)
|
||||
@Log(title = "删除质量隐患", businessType = BusinessType.DELETE)
|
||||
@GetMapping("/removeQuality")
|
||||
public AjaxResult removeQuality(@RequestParam Long id)
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/addSafety")
|
||||
@Log(title = "安全隐患排查", businessType = BusinessType.INSERT)
|
||||
@Log(title = "新增安全隐患", businessType = BusinessType.INSERT)
|
||||
public AjaxResult addSafety(@RequestBody SmzSspProblemmodify smzSspProblemmodify){
|
||||
return success(smzSspProblemmodifyService.insertSmzSspProblemmodify(smzSspProblemmodify));
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/addSafetyDraft")
|
||||
@Log(title = "安全隐患草稿", businessType = BusinessType.INSERT)
|
||||
@Log(title = "新增安全隐患草稿", businessType = BusinessType.INSERT)
|
||||
public AjaxResult addSafetyDraft(@RequestBody SmzSspProblemmodifyDraft smzSspProblemmodifyDraft){
|
||||
return success(smzSspProblemmodifyDraftService.insertSmzSspProblemmodifyDraft(smzSspProblemmodifyDraft));
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/addQuality")
|
||||
@Log(title = "质量隐患排查", businessType = BusinessType.INSERT)
|
||||
@Log(title = "新增质量隐患", businessType = BusinessType.INSERT)
|
||||
public AjaxResult addQuality(@RequestBody SmzSspProblemmodify smzSspProblemmodify){
|
||||
return success(smzSspProblemmodifyService.insertSmzSspProblemmodify(smzSspProblemmodify));
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/addQualityDraft")
|
||||
@Log(title = "质量隐患草稿", businessType = BusinessType.INSERT)
|
||||
@Log(title = "新增质量隐患草稿", businessType = BusinessType.INSERT)
|
||||
public AjaxResult addQualityDraft(@RequestBody SmzSspProblemmodifyDraft smzSspProblemmodifyDraft){
|
||||
return success(smzSspProblemmodifyDraftService.insertSmzSspProblemmodifyDraft(smzSspProblemmodifyDraft));
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class ProjectProblemmodifyController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/modifyProblem")
|
||||
@Log(title = "问题整改", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "提交问题整改", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult modifyProblem(@RequestBody SmzSspAuditinfo smzSspAuditinfo){
|
||||
return success(smzSspAuditinfoService.insertSmzSspAuditinfo(smzSspAuditinfo));
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ import com.ruoyi.common.core.redis.RedisCache;
|
|||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.domain.SysUserOpenid;
|
||||
import com.ruoyi.system.service.ISysUserOpenidService;
|
||||
import com.ruoyi.web.userLogin.service.IWechatUserLoginService;
|
||||
import liquibase.pro.packaged.S;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -156,6 +159,32 @@ public class WechatUserLoginController extends BaseController {
|
|||
return wechatUserLoginService.updataUser(map);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ISysUserOpenidService sysUserOpenidService;
|
||||
|
||||
/**
|
||||
* 查询公众号消息授权
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/findOpenUserMsgId/{openId}")
|
||||
public AjaxResult findOpenUserMsgId(@PathVariable("openId") String openId){
|
||||
return success(sysUserOpenidService.selectSysUserOpenidByOpenId(openId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公众号消息授权
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/delOpenUserMsgId/{openId}")
|
||||
public AjaxResult delOpenUserMsgId(@PathVariable("openId") String openId){
|
||||
SysUserOpenid sysUserOpenid = sysUserOpenidService.selectSysUserOpenidByOpenId(openId);
|
||||
sysUserOpenid.setUnionid(sysUserOpenid.getMsgOpenId());
|
||||
sysUserOpenid.setMsgOpenId(null);
|
||||
return success(sysUserOpenidService.updateSysUserOpenid(sysUserOpenid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @param request
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.yanzhu.jh.trouble.domain.SmzSspFileinfo;
|
||||
import com.yanzhu.jh.trouble.domain.SmzSspProblemmodify;
|
||||
import com.yanzhu.jh.trouble.mapper.SmzSspProblemmodifyMapper;
|
||||
import com.yanzhu.jh.wxsetting.service.impl.WeChatMessageServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.trouble.mapper.SmzSspAuditinfoMapper;
|
||||
|
@ -22,7 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
* @date 2023-08-07
|
||||
*/
|
||||
@Service
|
||||
public class SmzSspAuditinfoServiceImpl implements ISmzSspAuditinfoService
|
||||
public class SmzSspAuditinfoServiceImpl extends WeChatMessageServiceImpl implements ISmzSspAuditinfoService
|
||||
{
|
||||
@Autowired
|
||||
private SmzSspAuditinfoMapper smzSspAuditinfoMapper;
|
||||
|
@ -75,7 +76,7 @@ public class SmzSspAuditinfoServiceImpl implements ISmzSspAuditinfoService
|
|||
public int insertSmzSspAuditinfo(SmzSspAuditinfo smzSspAuditinfo)
|
||||
{
|
||||
smzSspAuditinfo.setCreateTime(DateUtils.getNowDate());
|
||||
int res = smzSspAuditinfoMapper.insertSmzSspAuditinfo(smzSspAuditinfo);
|
||||
smzSspAuditinfoMapper.insertSmzSspAuditinfo(smzSspAuditinfo);
|
||||
SmzSspProblemmodify smzSspProblemmodify = smzSspProblemmodifyMapper.selectSmzSspProblemmodifyById(smzSspAuditinfo.getMainId());
|
||||
switch (smzSspAuditinfo.getProcessState()){
|
||||
case "0": smzSspProblemmodify.setCheckState(1L); break;
|
||||
|
@ -83,7 +84,10 @@ public class SmzSspAuditinfoServiceImpl implements ISmzSspAuditinfoService
|
|||
case "4": smzSspProblemmodify.setCheckState(4L);smzSspProblemmodify.setUpdateTime(new Date()); break;
|
||||
default:break;
|
||||
}
|
||||
smzSspProblemmodifyMapper.updateSmzSspProblemmodify(smzSspProblemmodify);
|
||||
int res = smzSspProblemmodifyMapper.updateSmzSspProblemmodify(smzSspProblemmodify);
|
||||
if(res>0){
|
||||
super.send(smzSspProblemmodify);
|
||||
}
|
||||
insertSmzSspFileinfo(smzSspAuditinfo);
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -136,6 +136,8 @@ public class WxAuthController extends BaseController {
|
|||
if(sysUserOpenid!=null){
|
||||
sysUserOpenid.setMsgOpenId(openId);
|
||||
sysUserOpenidService.updateSysUserOpenid(sysUserOpenid);
|
||||
//删除缓存
|
||||
redisCache.deleteObject(CacheConstants.WX_MPMESSAGE_OPENID +sysUserOpenid.getLoginName());
|
||||
redisCache.setCacheObject(key,vo.getCode(),5, TimeUnit.MINUTES);
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.jh.wxsetting.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.config.WechatAccountConfig;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
|
@ -68,7 +69,7 @@ public class WeChatMessageServiceImpl {
|
|||
List<WxMpTemplateMessage> list = new ArrayList<>();
|
||||
Long state = smzSspProblemmodify.getCheckState();
|
||||
String handlePath = smzSspProblemmodify.getInfoType()==0?"security":"quality";
|
||||
String infoTypeName = smzSspProblemmodify.getInfoType()==0?"安全隐患":"安全隐患";
|
||||
String infoTypeName = smzSspProblemmodify.getInfoType()==0?"安全隐患":"质量隐患";
|
||||
String infoTypeDict = smzSspProblemmodify.getInfoType()==0?"ssp_aqyhlx":"ssp_zlyhlx";
|
||||
/**
|
||||
* 提交隐患通知整改人
|
||||
|
@ -249,7 +250,7 @@ public class WeChatMessageServiceImpl {
|
|||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", this.getMsgName(surProjectChecking.getCreateBy())+"["+this.getMsgDepName(surProjectChecking.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
}
|
||||
this.send(list,MessageTypeEnum.JPYSSP.getCode());
|
||||
this.send(list,MessageTypeEnum.JPYSSP.getCode()+stateStr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -340,7 +341,7 @@ public class WeChatMessageServiceImpl {
|
|||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", this.getMsgName(surProjectMeasure.getCreateBy())+"["+this.getMsgDepName(surProjectMeasure.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
}
|
||||
this.send(list,MessageTypeEnum.CSCLSP.getCode());
|
||||
this.send(list,MessageTypeEnum.CSCLSP.getCode()+stateStr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -431,7 +432,7 @@ public class WeChatMessageServiceImpl {
|
|||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", this.getMsgName(surProjectMaterialSeal.getCreateBy())+"["+this.getMsgDepName(surProjectMaterialSeal.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
}
|
||||
this.send(list,MessageTypeEnum.CLFYSP.getCode());
|
||||
this.send(list,MessageTypeEnum.CLFYSP.getCode()+stateStr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -506,7 +507,7 @@ public class WeChatMessageServiceImpl {
|
|||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time4", DateUtils.getTime()));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", this.getMsgName(surProjectCheckDetection.getCreateBy())+"["+this.getMsgDepName(surProjectCheckDetection.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
}else{
|
||||
}else if(Objects.equals(PublicStateEnum.AUDITINFO_SHBH.getCode(),stateStr)){
|
||||
/**
|
||||
* 审批驳回
|
||||
* 通知提交人审核驳回
|
||||
|
@ -522,7 +523,7 @@ public class WeChatMessageServiceImpl {
|
|||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("thing10", this.getMsgName(surProjectCheckDetection.getCreateBy())+"["+this.getMsgDepName(surProjectCheckDetection.getDeptId())+"]"));
|
||||
list.add(templateMessage);
|
||||
}
|
||||
this.send(list,MessageTypeEnum.QYFSSP.getCode());
|
||||
this.send(list,MessageTypeEnum.QYFSSP.getCode()+stateStr);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
@ -647,8 +648,13 @@ public class WeChatMessageServiceImpl {
|
|||
return openIds;
|
||||
}else{
|
||||
List<SysUserOpenid> list = sysUserOpenidMapper.findSysUserOpenidsByUser(userName);
|
||||
List<String> strs = list.stream().map(SysUserOpenid :: getMsgOpenId).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<SysUserOpenid> ids = list.stream().filter(u -> StringUtils.isNotBlank(u.getMsgOpenId())).collect(Collectors.toList());
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
List<String> strs = ids.stream().map(SysUserOpenid :: getMsgOpenId).collect(Collectors.toList());
|
||||
openIds = String.join(",",strs);
|
||||
}
|
||||
}
|
||||
//设置30分钟有效期
|
||||
redisCache.setCacheObject(CacheConstants.WX_MPMESSAGE_OPENID +userName,openIds,30, TimeUnit.MINUTES);
|
||||
return openIds;
|
||||
|
@ -662,13 +668,14 @@ public class WeChatMessageServiceImpl {
|
|||
|
||||
/**
|
||||
* 推送模板消息
|
||||
* @param lsit
|
||||
* @param list
|
||||
*/
|
||||
private void send(List<WxMpTemplateMessage> lsit,String messageType){
|
||||
private void send(List<WxMpTemplateMessage> list,String messageType){
|
||||
try {
|
||||
wxSwitch = Convert.toBool(configService.selectConfigByKey("sys.wx.message"),false);
|
||||
if(wxSwitch && StringUtils.isNotEmpty(lsit)){
|
||||
for(WxMpTemplateMessage message:lsit){
|
||||
log.info("微信公众号消息准备就绪...{}...{}...{}",wxSwitch,list.size(),messageType);
|
||||
if(wxSwitch && StringUtils.isNotEmpty(list)){
|
||||
for(WxMpTemplateMessage message:list){
|
||||
if(StringUtils.isNotEmpty(message.getToUser())){
|
||||
String[] toUsers = message.getToUser().split(",");
|
||||
for(String toUser:toUsers){
|
||||
|
@ -679,6 +686,7 @@ public class WeChatMessageServiceImpl {
|
|||
message.setToUser(toUser);
|
||||
wxMpService.getTemplateMsgService().sendTemplateMsg(message);
|
||||
//5分钟内不推送相同类型的消息
|
||||
log.info("微信公众号消息发送成功...{}",key);
|
||||
redisCache.setCacheObject(key,false,5, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
|
@ -687,6 +695,21 @@ public class WeChatMessageServiceImpl {
|
|||
}
|
||||
}catch (Exception e){
|
||||
log.info("出错了...{}",e.getMessage());
|
||||
try {
|
||||
JSONObject jsonObject = JSONObject.parseObject(e.getMessage());
|
||||
if(Objects.equals(jsonObject.getString("errcode"),"40164")){
|
||||
String ip = jsonObject.getString("errmsg").split("ipv6")[0].split(" ")[2];
|
||||
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||
.toUser("oM5rN6Wb8UyBLuTAFNGjnZCeQs1U")
|
||||
.templateId(TemplateMessageEnum.SERVER_ERROR.getId())
|
||||
.build();
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("character_string7", "IP>"+ip));
|
||||
templateMessage.addWxMpTemplateData(new WxMpTemplateData("time6", DateUtils.dateTimeNow()));
|
||||
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,9 +119,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="subDeptId != null and subDeptId >0 "> and c.sub_dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and u.is_del = #{isDel}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT * FROM (
|
||||
SELECT a.*,b.project_id,b.sub_dept_id,g.companyTypeId
|
||||
SELECT a.id,
|
||||
a.cfgid,
|
||||
a.app_id,
|
||||
a.vendors_code,
|
||||
a.workerId,
|
||||
a.laborWorkerId,
|
||||
a.workerCategory,
|
||||
a.qrCode,
|
||||
a.name,
|
||||
a.ethnic,
|
||||
a.nativePlace,
|
||||
a.gender,
|
||||
a.birthDate,
|
||||
a.phone,
|
||||
a.degreeName,
|
||||
a.photo,
|
||||
a.recentPhoto,
|
||||
a.groupId,
|
||||
a.groupName,
|
||||
a.leader,
|
||||
a.workTypeCode,
|
||||
a.workTypeName,
|
||||
a.specWorkType,
|
||||
a.hatCode,
|
||||
a.state,
|
||||
a.enterDate,
|
||||
a.exitDate,
|
||||
a.companyId,
|
||||
a.companyName,
|
||||
a.vendorId,
|
||||
a.teamId,
|
||||
a.teamName,
|
||||
a.enterType,
|
||||
a.other,
|
||||
a.is_del,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,b.project_id,b.sub_dept_id,g.companyTypeId,g.companyName as remark
|
||||
FROM sur_project_attendance_user a,sur_project_attendance_cfg b,view_sur_project_attendance_group g
|
||||
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
|
||||
)
|
||||
|
@ -196,10 +235,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="findYzCurrentAttendanceUser" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select u.companyId,u.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
select u.companyId,g.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
|
||||
from sur_project_attendance_user u
|
||||
left join sur_project_attendance_group g on (u.groupId = g.serverid or u.companyId = g.companyId) and g.cfgid = u.cfgid
|
||||
left join sur_project_attendance_group g on u.groupId = g.serverid and g.cfgid = u.cfgid
|
||||
where u.cfgid=#{cfgid} and u.workerId=#{workerId} ORDER BY u.id desc LIMIT 1
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue