曹妃甸动火作业搬到港务局3

cmt1.0
limingyu 2023-12-05 13:45:52 +08:00
parent ff9dc890bf
commit 335d1e04fd
13 changed files with 234 additions and 10 deletions

View File

@ -859,7 +859,7 @@ public class AppHotWorkApplicationController extends BaseController {
}
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile);
// Smb.sshSftp(file, fileName, Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile);
hotUser.put("AUTOGRAPH",Const.FILEPATHYHTP + pd.get("CORPINFO_ID").toString() + "/" + ffile + "/" + fileName);
}

View File

@ -0,0 +1,92 @@
package com.zcloud.controller.mq;
import com.alibaba.fastjson.JSON;
import com.zcloud.controller.app.highriskwork.AppHotworkCfdController;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
import com.zcloud.service.mq.LogService;
import com.zcloud.service.mq.SendMessageService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Warden;
import com.zcloud.util.mq.MqUtil;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
/**
* topic tag DEMO
* wangxuan
* www.zcloudchina.com
*/
@Component
@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}",
topic = "${mq.topic.eightWork}",
selectorType = SelectorType.TAG)
public class EightWorkListener implements RocketMQListener<String> {
// @Resource
// private AppConfinedSpaceController appConfinedSpaceController;
// @Resource
// private AppElectricityController appElectricityController;
@Resource
private AppHotworkCfdController appHotworkCfdController;
@Resource
private SendMessageService sendMessageService;
@Resource
private LogService logService;
@Resource
private MqMessageLogMapper mqMessageLogMapper;
@Override
public void onMessage(String message) {
TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
PageData log = data.getPd();
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
log.put("CREATE_TIME", DateUtil.getTime());
log.put("PRODUCER_NAME",data.getProducer_name());
log.put("TYPE","1");
try {
System.out.println("消费者:" + data.toString());
Date limit_date = MqUtil.dateFormat(data.getTime_stamp());
if (limit_date.getTime() - new Date().getTime() > 1000) {
sendMessageService.SendDelayQueue(data);
log.put("DIGESTION_FLAG","0");
} else {
switch (data.getMessage()){
case "confined-space":
System.out.println("受限空间模块消费");
// appConfinedSpaceController.cancel(data.getData());
break;
case "electricity":
System.out.println("临时用电模块消费");
// appElectricityController.cancel(data.getData());
break;
case "hot-work":
System.out.println("动火模块消费");
appHotworkCfdController.cancel(data.getData());
break;
default:
System.out.println("异常模块不消费");
throw new RuntimeException("未找到对应的消费者");
}
log.put("DIGESTION_FLAG","1");
}
mqMessageLogMapper.save(log);
} catch (Exception e) {
e.printStackTrace();
logService.saveErrorMessage(log,e.getMessage());
throw new RuntimeException(e);
}
}
}

View File

@ -0,0 +1,32 @@
package com.zcloud.controller.mq;
import com.alibaba.fastjson.JSON;
import com.zcloud.dto.TenCorpDto;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
/**
* topic tag DEMO
* wangxuan
* www.zcloudchina.com
*/
@Component
@RocketMQMessageListener(consumerGroup = "${mq.group.info}",
topic = "${mq.topic.info}",
selectorType = SelectorType.TAG)
public class MqListener implements RocketMQListener<String> {
@Override
public void onMessage(String message) {
TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
try {
System.out.println("2消费者:" + data.toString());
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
}

View File

@ -0,0 +1,51 @@
package com.zcloud.controller.mq;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.Response;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.service.mq.SendMessageService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
/**
*
* wangxuan
* www.zcloudchina.com
*/
public class SendController extends BaseController {
@Resource
private SendMessageService sendMessageService;
public Response sendMessage(@RequestParam("tenCorpDto") TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.sendMessage(tenCorpDto);
} catch (Exception e) {
e.printStackTrace();
}
return Response.OK();
}
public Response timelyQueue(@RequestBody TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.sendMessage(tenCorpDto);
} catch (Exception e) {
e.printStackTrace();
}
return Response.OK();
}
public Response SendDelayQueue(@RequestBody TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.SendDelayQueue(tenCorpDto);
return Response.OK();
} catch (Exception e) {
e.printStackTrace();
return Response.ERROR(e.getMessage());
}
}
}

View File

@ -4,6 +4,7 @@ import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.service.bus.SpecialUserService;
import com.zcloud.service.specialoperation.PersonnelManagementCfdService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
@ -29,6 +30,8 @@ public class AppPersonnelManagementCfdController extends BaseController {
@Autowired
private PersonnelManagementCfdService personnelmanagementCfdService;
@Autowired
private SpecialUserService specialUserService;
/**
* @param
@ -100,9 +103,10 @@ public class AppPersonnelManagementCfdController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", pd.get("CORPINFO_ID")); //企业ID
page.setPd(pd);
List<PageData> varList = personnelmanagementCfdService.namelist(pd); //列出PersonnelManagement列表
String endday = DateUtil.getDay();
PageData getPD = new PageData();
getPD.put("endday",endday);
List<PageData> varList = specialUserService.nameListAll(getPD);
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);

View File

@ -66,5 +66,7 @@ public interface SpecialUserMapper{
* @throws Exception
*/
void deleteTem(PageData pd);
List<PageData> nameListAll(PageData getPD);
}

View File

@ -68,5 +68,6 @@ public interface SpecialUserService{
*/
public void deleteTem(PageData pd)throws Exception;
List<PageData> nameListAll(PageData getPD)throws Exception;
}

View File

@ -94,5 +94,10 @@ public class SpecialUserServiceImpl implements SpecialUserService{
public void deleteTem(PageData pd)throws Exception{
specialuserMapper.deleteTem(pd);
}
@Override
public List<PageData> nameListAll(PageData getPD) throws Exception {
return specialuserMapper.nameListAll(getPD);
}
}

View File

@ -16,7 +16,7 @@ public class MqUtil {
if (time_difference < 0){
return 0;
}
if (time_difference > 2*60*60*1000){
if (time_difference > 2 * 60 * 60 * 1000){
return 18;
}
if (time_difference > 60 * 60 * 1000){

View File

@ -69,3 +69,22 @@ smb.port=22
smb.user=root
smb.password=Zcloud@zcloud88888
smb.basePath=/mnt/qgfile/file/
#Mq\u914D\u7F6E
rocketmq.consumer.group2=edu-admin-edit
rocketmq.consumer.group1=edu-admin-add
#rocketmq.name-server=10.0.140.141:9876
rocketmq.name-server=192.168.0.70:9876
rocketmq.producer.group=libmiddle
rocketmq.producer.send-message-timeout=3000
rocketmq.producer.compress-message-body-threshold=4096
rocketmq.producer.max-message-size=4194304
rocketmq.producer.retry-times-when-send-failed=3
rocketmq.producer.retry-next-server=true
rocketmq.producer.retry-times-when-send-async-failed=3
## topic \u524D\u7F00
mq.topic.info=info
mq.topic.eightWork=eightWork
mq.group.info=scheduled_tasks
mq.group.eightWork=scheduled_tasks_eightWork

View File

@ -2,9 +2,9 @@ spring.application.name=qa-prevention-gwj
server.port=8091
#??
spring.profiles.active=local
#spring.profiles.active=local
#??
#spring.profiles.active=dev
spring.profiles.active=dev
#??
#spring.profiles.active=master

View File

@ -251,6 +251,24 @@
and f.SPECIAL_NUMBER = #{SPECIAL_NUMBER}
</if>
</select>
<select id="nameListAll" parameterType="pd" resultType="pd">
select
concat(f.USERNAME,' ',f.SPECIAL_NUMBER) NAME
from
<include refid="tableName"></include> f
left join SYS_USER u on u.USER_ID = f.USER_ID
left join oa_department dept on dept.DEPARTMENT_ID = u.DEPARTMENT_ID
where f.ISDELETE = '0'
<if test="UNIT_ID != null and UNIT_ID != ''"><!-- 人员类型 -->
and f.UNIT_ID = #{UNIT_ID}
</if>
<if test="endday != null and endday !=''">
and f.VALIDITY_TIME_END <![CDATA[ >= ]]> #{endday}
</if>
order by f.CREATTIME desc
</select>
<!-- 删除-->
<delete id="deleteTem" parameterType="pd">
delete from

View File

@ -4,7 +4,7 @@
<!--表名 -->
<sql id="tableName">
BUS_PERSONNELMANAGEMENT
BUS_PERSONNELMANAGEMENT_CFD
</sql>
<!--数据字典表名 -->
@ -158,7 +158,7 @@
<include refid="tableName"></include> f
left join sys_dictionaries a on a.DICTIONARIES_ID = f.JOB_TYPE
left join bus_corp_info b on b.CORPINFO_ID = f.CORPINFO_ID
left join `qa-cfd-regulatory`.bus_units r on r.UNITS_ID = f.UNITS_ID
left join `qa-gwj-regulatory`.bus_units r on r.UNITS_ID = f.UNITS_ID
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
@ -201,7 +201,7 @@
left join sys_dictionaries a on a.DICTIONARIES_ID = f.JOB_TYPE
left join bus_corp_info b on b.CORPINFO_ID = f.CORPINFO_ID
left join bus_units r on r.UNITS_ID = f.UNITS_ID
left join bus_units_cfd r on r.UNITS_ID = f.UNITS_ID
where f.ISDELETE = '0'
<if test="CORPINFO_ID != null and ORPINFO_ID != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}