|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.pj.current.config.MyConfig;
|
|
|
import com.pj.current.config.WxConfig;
|
|
|
import com.pj.current.netty.command.constants.CommandType;
|
|
|
import com.pj.current.netty.command.handler.IHandler;
|
|
@@ -35,6 +36,7 @@ import com.pj.project.tb_venues.TbVenues;
|
|
|
import com.pj.project.tb_venues.TbVenuesService;
|
|
|
import com.pj.project.wx.WxService;
|
|
|
import com.pj.project.wx.bo.MsgDataBO;
|
|
|
+import com.pj.project4sp.sms.DuanXinBaoSMSService;
|
|
|
import com.pj.project4sp.spcfg.SpCfgUtil;
|
|
|
import com.pj.utils.cache.RedisUtil;
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
@@ -79,6 +81,11 @@ public class HealthlogHandler implements IHandler {
|
|
|
@Resource
|
|
|
private TbCarVisitRecordService tbCarVisitRecordService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private MyConfig myConfig;
|
|
|
+ @Resource
|
|
|
+ private DuanXinBaoSMSService duanXinBaoSMSService;
|
|
|
+
|
|
|
@Override
|
|
|
public CommandType commandType() {
|
|
|
return CommandType.UPLOAD_HEALTH_LOG;
|
|
@@ -114,7 +121,7 @@ public class HealthlogHandler implements IHandler {
|
|
|
tbPersonFilingService.save(tbPersonFiling);
|
|
|
taskService.addTask(new Base64ToImage(RandomUtil.randomNumbers(10), 50, tbPersonFiling.getId(), dto.getPicture()));
|
|
|
//分发人员信息到其他终端
|
|
|
- if (!needJudge){
|
|
|
+ if (!needJudge) {
|
|
|
taskService.addTask(new DelayIsuued(RandomUtil.randomNumbers(11), 4000, tbPersonFiling.getId(), sn));
|
|
|
}
|
|
|
}
|
|
@@ -181,8 +188,10 @@ public class HealthlogHandler implements IHandler {
|
|
|
MsgDataBO msgDataBO = new MsgDataBO("您收到一条人员体温异常提醒", dto.getName(), dto.getTemperature(), now, "请及时处理");
|
|
|
//todo 触发体温预警
|
|
|
managers.forEach(tbManager -> {
|
|
|
- String detailUrl = wxConfig.getReportDetail() + "?=" + record.getId() + "&openid=" + tbManager.getOpenid();
|
|
|
- wxService.sendTemplateMsg(wxConfig.getTemperatureErrorTemplate(), tbManager.getOpenid(), msgDataBO, detailUrl);
|
|
|
+ if (wxConfig.isEnable()) {
|
|
|
+ String detailUrl = wxConfig.getReportDetail() + "?=" + record.getId() + "&openid=" + tbManager.getOpenid();
|
|
|
+ wxService.sendTemplateMsg(wxConfig.getTemperatureErrorTemplate(), tbManager.getOpenid(), msgDataBO, detailUrl);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
if (StrUtil.isNotEmpty(healthStatus) && !healthStatus.equals(TbPersonVisitRecord.HealthEnum.GREEN.getStatus())) {
|
|
@@ -190,9 +199,15 @@ public class HealthlogHandler implements IHandler {
|
|
|
// todo 黄码,红码预警
|
|
|
MsgDataBO msgDataBO = new MsgDataBO("您收到一条人员健康码异常提醒", dto.getName(), now, tbTerminal.getName(), healthStatus, tbVenues.getName(), "请及时处理");
|
|
|
//todo 触发体温预警
|
|
|
+ String smsContent = "[" + SpCfgUtil.getSmsSign() + "]" + tbDept.getName() + tbPersonFiling.getName() + "人员在" + tbVenues.getName() + "核验结果为" + healthStatus + ",请马上介入处置(核验时间:" + DateUtil.now() + ")";
|
|
|
managers.forEach(tbManager -> {
|
|
|
- String detailUrl = wxConfig.getReportDetail() + "?=" + record.getId() + "&openid=" + tbManager.getOpenid();
|
|
|
- wxService.sendTemplateMsg(wxConfig.getTemperatureErrorTemplate(), tbManager.getOpenid(), msgDataBO, detailUrl);
|
|
|
+ if (myConfig.isSmsEnable()) {
|
|
|
+ duanXinBaoSMSService.sendSMS(tbManager.getPhone(), smsContent);
|
|
|
+ }
|
|
|
+ if (wxConfig.isEnable()) {
|
|
|
+ String detailUrl = wxConfig.getReportDetail() + "?=" + record.getId() + "&openid=" + tbManager.getOpenid();
|
|
|
+ wxService.sendTemplateMsg(wxConfig.getTemperatureErrorTemplate(), tbManager.getOpenid(), msgDataBO, detailUrl);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|