forked from integrated_whb/integrated_whb
动火作业流程图
parent
4c9801eacf
commit
b1db99346e
|
@ -1198,7 +1198,7 @@ public class AppHiddenController extends BaseController {
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
pd = hiddenService.findById(pd); // 根据ID读取
|
pd = hiddenService.findById(pd); // 根据ID读取
|
||||||
if(pd.getString("CONFIRM_USER")!=null || pd.getString("CONFIRM_USER").equals("undefined")){
|
if(pd.get("CONFIRM_USER")!=null || pd.getString("CONFIRM_USER").equals("undefined")){
|
||||||
pd.put("USER_ID",pd.getString("CONFIRM_USER"));
|
pd.put("USER_ID",pd.getString("CONFIRM_USER"));
|
||||||
PageData user = usersService.findById(pd);
|
PageData user = usersService.findById(pd);
|
||||||
if(user!=null){
|
if(user!=null){
|
||||||
|
|
|
@ -60,4 +60,16 @@ public class AppEightWorkController extends BaseController {
|
||||||
map.put("result",errorInfo);
|
map.put("result",errorInfo);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/checkWork")
|
||||||
|
@ResponseBody
|
||||||
|
public Object checkWork() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
String errorInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
map.put("count",eightWorkService.checkWork(pd));
|
||||||
|
map.put("result",errorInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,4 +266,22 @@ public class AppHotworkController extends BaseController {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**获取动火作业流程
|
||||||
|
* @param
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/getFlowList")
|
||||||
|
@ResponseBody
|
||||||
|
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "获取动火作业流程")
|
||||||
|
public Object getFlowList() throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
List<PageData> flowList = hotworkService.getFlowList(pd);
|
||||||
|
map.put("flowList", flowList);
|
||||||
|
map.put("result", errInfo); //返回结果
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,85 +1,85 @@
|
||||||
package com.zcloud.controller.mq;
|
//package com.zcloud.controller.mq;
|
||||||
|
//
|
||||||
import com.alibaba.fastjson.JSON;
|
//import com.alibaba.fastjson.JSON;
|
||||||
import com.zcloud.dto.TenCorpDto;
|
//import com.zcloud.dto.TenCorpDto;
|
||||||
import com.zcloud.entity.PageData;
|
//import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mapper.dsno2.mq.MqMessageLogMapper;
|
//import com.zcloud.mapper.dsno2.mq.MqMessageLogMapper;
|
||||||
import com.zcloud.service.eightwork.HotworkService;
|
//import com.zcloud.service.eightwork.HotworkService;
|
||||||
import com.zcloud.service.mq.LogService;
|
//import com.zcloud.service.mq.LogService;
|
||||||
import com.zcloud.service.mq.SendMessageService;
|
//import com.zcloud.service.mq.SendMessageService;
|
||||||
import com.zcloud.util.DateUtil;
|
//import com.zcloud.util.DateUtil;
|
||||||
import com.zcloud.util.MqUtil;
|
//import com.zcloud.util.MqUtil;
|
||||||
import com.zcloud.util.Warden;
|
//import com.zcloud.util.Warden;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
import org.apache.rocketmq.spring.annotation.SelectorType;
|
//import org.apache.rocketmq.spring.annotation.SelectorType;
|
||||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
//import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
import javax.annotation.Resource;
|
//import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 说明:消费某个 topic 下指定 tag 的消息 对接课件DEMO
|
// * 说明:消费某个 topic 下指定 tag 的消息 对接课件DEMO
|
||||||
* 作者:wangxuan
|
// * 作者:wangxuan
|
||||||
* 官网:www.zcloudchina.com
|
// * 官网:www.zcloudchina.com
|
||||||
*/
|
// */
|
||||||
@Component
|
//@Component
|
||||||
@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}",
|
//@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}",
|
||||||
topic = "${mq.topic.eightWork}",
|
// topic = "${mq.topic.eightWork}",
|
||||||
selectorType = SelectorType.TAG)
|
// selectorType = SelectorType.TAG)
|
||||||
public class EightWorkListener implements RocketMQListener<String> {
|
//public class EightWorkListener implements RocketMQListener<String> {
|
||||||
|
//
|
||||||
@Resource
|
// @Resource
|
||||||
private SendMessageService sendMessageService;
|
// private SendMessageService sendMessageService;
|
||||||
@Resource
|
// @Resource
|
||||||
private LogService logService;
|
// private LogService logService;
|
||||||
@Resource
|
// @Resource
|
||||||
private MqMessageLogMapper mqMessageLogMapper;
|
// private MqMessageLogMapper mqMessageLogMapper;
|
||||||
@Autowired
|
// @Autowired
|
||||||
private HotworkService hotworkService;
|
// private HotworkService hotworkService;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onMessage(String message) {
|
// public void onMessage(String message) {
|
||||||
TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
|
// TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
|
||||||
PageData log = data.getPd();
|
// PageData log = data.getPd();
|
||||||
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
// log.put("MESSAGE_LOG_ID", Warden.get32UUID());
|
||||||
log.put("CREATE_TIME", DateUtil.getTime());
|
// log.put("CREATE_TIME", DateUtil.getTime());
|
||||||
log.put("PRODUCER_NAME",data.getProducer_name());
|
// log.put("PRODUCER_NAME",data.getProducer_name());
|
||||||
log.put("TYPE","1");
|
// log.put("TYPE","1");
|
||||||
try {
|
// try {
|
||||||
System.out.println("消费者:" + data.toString());
|
// System.out.println("消费者:" + data.toString());
|
||||||
Date limit_date = MqUtil.dateFormat(data.getTime_stamp());
|
// Date limit_date = MqUtil.dateFormat(data.getTime_stamp());
|
||||||
if (limit_date.getTime() - new Date().getTime() > 1000) {
|
// if (limit_date.getTime() - new Date().getTime() > 1000) {
|
||||||
sendMessageService.sendDelayQueue(data);
|
// sendMessageService.sendDelayQueue(data);
|
||||||
log.put("DIGESTION_FLAG","0");
|
// log.put("DIGESTION_FLAG","0");
|
||||||
} else {
|
// } else {
|
||||||
switch (data.getMessage()){
|
// switch (data.getMessage()){
|
||||||
// case "confined-space":
|
//// case "confined-space":
|
||||||
// System.out.println("受限空间模块消费");
|
//// System.out.println("受限空间模块消费");
|
||||||
// confinedSpaceService.cancel(data.getData());
|
//// confinedSpaceService.cancel(data.getData());
|
||||||
|
//// break;
|
||||||
|
//// case "electricity":
|
||||||
|
//// System.out.println("临时用电模块消费");
|
||||||
|
//// electricityService.cancel(data.getData());
|
||||||
|
//// break;
|
||||||
|
// case "hot-work":
|
||||||
|
// System.out.println("动火模块消费");
|
||||||
|
// hotworkService.cancel(data.getData());
|
||||||
// break;
|
// break;
|
||||||
// case "electricity":
|
// default:
|
||||||
// System.out.println("临时用电模块消费");
|
// System.out.println("异常模块不消费");
|
||||||
// electricityService.cancel(data.getData());
|
// throw new RuntimeException("未找到对应的消费者");
|
||||||
// break;
|
// }
|
||||||
case "hot-work":
|
// log.put("DIGESTION_FLAG","1");
|
||||||
System.out.println("动火模块消费");
|
// }
|
||||||
hotworkService.cancel(data.getData());
|
// mqMessageLogMapper.save(log);
|
||||||
break;
|
// } catch (Exception e) {
|
||||||
default:
|
// e.printStackTrace();
|
||||||
System.out.println("异常模块不消费");
|
// logService.saveErrorMessage(log,e.getMessage());
|
||||||
throw new RuntimeException("未找到对应的消费者");
|
// throw new RuntimeException(e);
|
||||||
}
|
// }
|
||||||
log.put("DIGESTION_FLAG","1");
|
// }
|
||||||
}
|
//
|
||||||
mqMessageLogMapper.save(log);
|
//}
|
||||||
} catch (Exception e) {
|
//
|
||||||
e.printStackTrace();
|
|
||||||
logService.saveErrorMessage(log,e.getMessage());
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -21,4 +21,6 @@ public interface HotworkMapper {
|
||||||
List<PageData> listAllMeasures();
|
List<PageData> listAllMeasures();
|
||||||
|
|
||||||
List<PageData> checkWorkCount(PageData pd);
|
List<PageData> checkWorkCount(PageData pd);
|
||||||
|
|
||||||
|
List<PageData> getFlowList(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,5 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface EightWorkService {
|
public interface EightWorkService {
|
||||||
public List<PageData> getTaskSetps(PageData pd);
|
public List<PageData> getTaskSetps(PageData pd);
|
||||||
|
PageData checkWork(PageData pd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,5 @@ public interface HotworkService {
|
||||||
|
|
||||||
void saveGas(PageData pd,MultipartFile[] files) throws Exception;
|
void saveGas(PageData pd,MultipartFile[] files) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> getFlowList(PageData pd)throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,10 @@ public class EightWorkServiceImpl implements EightWorkService {
|
||||||
public List<PageData> getTaskSetps(PageData pd) {
|
public List<PageData> getTaskSetps(PageData pd) {
|
||||||
return eightWorkTaskFlowMapper.getTaskSetps(pd);
|
return eightWorkTaskFlowMapper.getTaskSetps(pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData checkWork(PageData pd) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,10 +149,11 @@ public class HotworkServiceImpl implements HotworkService {
|
||||||
}
|
}
|
||||||
saveNextSigner(work,currentflow);
|
saveNextSigner(work,currentflow);
|
||||||
}else if(pd.getString("APPLY_STATUS").equals("-1")){
|
}else if(pd.getString("APPLY_STATUS").equals("-1")){
|
||||||
work.put("STEP_ID",-1);
|
|
||||||
hotworkMapper.editStep(work);
|
|
||||||
//保存日志
|
//保存日志
|
||||||
saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"-1");
|
saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"-1");
|
||||||
|
|
||||||
|
work.put("STEP_ID",-1);
|
||||||
|
hotworkMapper.editStep(work);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,13 +268,20 @@ public class HotworkServiceImpl implements HotworkService {
|
||||||
sign.put("SIGN_PATH", String.join(",", filePaths));
|
sign.put("SIGN_PATH", String.join(",", filePaths));
|
||||||
sign.put("DESCR", pd.get("DESCR"));
|
sign.put("DESCR", pd.get("DESCR"));
|
||||||
hotworkSignMapper.edit(sign);
|
hotworkSignMapper.edit(sign);
|
||||||
work.put("STEP_ID",-1);
|
|
||||||
hotworkMapper.editStep(work);
|
|
||||||
//保存日志
|
//保存日志
|
||||||
saveLog(work,pd.getString("USER_ID"),"-2");
|
saveLog(work,pd.getString("USER_ID"),"-2");
|
||||||
|
work.put("STEP_ID",-1);
|
||||||
|
hotworkMapper.editStep(work);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getFlowList(PageData pd) throws Exception {
|
||||||
|
pd=findById(pd);
|
||||||
|
return hotworkMapper.getFlowList(pd);
|
||||||
|
}
|
||||||
|
|
||||||
private void saveNextSigner(PageData pd,PageData flow) throws Exception {
|
private void saveNextSigner(PageData pd,PageData flow) throws Exception {
|
||||||
|
|
||||||
pd.put("STEP_ID",flow.get("NEXT_STEP_ID"));
|
pd.put("STEP_ID",flow.get("NEXT_STEP_ID"));
|
||||||
|
|
|
@ -454,9 +454,12 @@
|
||||||
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
|
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
|
||||||
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
|
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
|
||||||
|
|
||||||
left join (select * from(select * from vi_eightwork_flow_log log where log.STATUS != -1 having 1 order by log.ACT_TIME desc
|
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
|
||||||
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.HOTWORK_ID
|
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.HOTWORK_ID
|
||||||
where f.ISDELETE = '0'
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CHECK_NO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
</if>
|
||||||
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
|
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
|
||||||
and exists (
|
and exists (
|
||||||
select 1 from bus_hotwork_sign sign
|
select 1 from bus_hotwork_sign sign
|
||||||
|
@ -467,6 +470,9 @@
|
||||||
and step.STEP_NAME = #{pd.STEP_NAME}
|
and step.STEP_NAME = #{pd.STEP_NAME}
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="pd.STEP_ID != null and pd.STEP_ID != ''"><!-- 关键词检索 -->
|
||||||
|
and log.NEXT_STEP_ID = #{pd.STEP_ID}
|
||||||
|
</if>
|
||||||
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
|
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
|
||||||
and f.CREATOR = #{pd.CREATOR}
|
and f.CREATOR = #{pd.CREATOR}
|
||||||
</if>
|
</if>
|
||||||
|
@ -494,4 +500,29 @@
|
||||||
from
|
from
|
||||||
BUS_HOTWORK_MEASURES
|
BUS_HOTWORK_MEASURES
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getFlowList" resultType="pd">
|
||||||
|
select
|
||||||
|
step.STEP_NAME,
|
||||||
|
user.NAME as ACT_USER_NAME,
|
||||||
|
log.ACT_TIME,
|
||||||
|
log.STATUS,
|
||||||
|
cu.SIGN_USER,
|
||||||
|
cu.STEP_ID as CURRENT_STEP
|
||||||
|
from
|
||||||
|
bus_eightwork_task_flow flow
|
||||||
|
left join bus_eightwork_step step on step.STEP_ID = flow.STEP_ID
|
||||||
|
left join bus_eightwork_flow_log log on log.STEP_ID = flow.STEP_ID and
|
||||||
|
log.WORK_ID = #{HOTWORK_ID}
|
||||||
|
left join sys_user user on user.USER_ID = log.ACT_USER
|
||||||
|
left join (select sign.STEP_ID,GROUP_CONCAT(signer.NAME) sign_user from bus_hotwork_sign sign
|
||||||
|
left join sys_user signer on signer.USER_ID = sign.SIGN_USER_ID where sign.HOTWORK_ID = #{HOTWORK_ID}
|
||||||
|
and sign.SIGN_TIME is null) cu on cu.STEP_ID = step.STEP_ID
|
||||||
|
where
|
||||||
|
flow.TASK_ID = #{TASK_ID}
|
||||||
|
and
|
||||||
|
flow.STEP_ID != 0
|
||||||
|
order by
|
||||||
|
flow.ORDER_BY
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue