|
@@ -1,10 +1,12 @@
|
|
|
package com.lc.ibps.platform.plan.job;
|
|
package com.lc.ibps.platform.plan.job;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
import com.lc.ibps.base.core.util.JacksonUtil;
|
|
import com.lc.ibps.base.core.util.JacksonUtil;
|
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
|
|
+import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
import com.lc.ibps.cloud.message.util.MessageQueueProductorUtil;
|
|
import com.lc.ibps.cloud.message.util.MessageQueueProductorUtil;
|
|
|
import com.lc.ibps.components.quartz.BaseJob2;
|
|
import com.lc.ibps.components.quartz.BaseJob2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -50,8 +52,67 @@ public class DeviceToDoRemindJob extends BaseJob2 {
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
logger.error("executeCalibrationCheck error!",e);
|
|
logger.error("executeCalibrationCheck error!",e);
|
|
|
}
|
|
}
|
|
|
|
|
+ //恒生医院专用
|
|
|
|
|
+ if(BeanUtils.isNotEmpty(ContextUtil.getSetting())){
|
|
|
|
|
+ JSONObject configMap = JSONObject.parseObject(ContextUtil.getSetting());
|
|
|
|
|
+ String HSYY = configMap.getString("HSYY");
|
|
|
|
|
+ if(BeanUtils.isNotEmpty(HSYY) && HSYY.equals("true")){
|
|
|
|
|
+ try {
|
|
|
|
|
+ executeReagentSupplies();
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ logger.error("executeReagentSupplies error!",e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void executeReagentSupplies() {
|
|
|
|
|
+ //查询一个月后注册证有效期到期的试剂耗材
|
|
|
|
|
+ String sjhcSql = "SELECT ID_,ming_cheng_, zhu_ce_zheng_you_,bian_zhi_bu_men_ FROM t_sjhcjcsjpz WHERE zhu_ce_zheng_you_ = DATE_ADD(CURDATE(), INTERVAL 1 MONTH)";
|
|
|
|
|
+ List<Map<String, Object>> sjhcSqlList = (List<Map<String, Object>>)commonDao.query(sjhcSql);
|
|
|
|
|
+ if (BeanUtils.isNotEmpty(sjhcSqlList)){
|
|
|
|
|
+ String headerString = "您好,试剂耗材%s注册证有效期即将到期,请及时安排人员处理!详细情况如下:";
|
|
|
|
|
+ String format = "【%s】 %s 有效期至 %s";
|
|
|
|
|
+ StringJoiner content = new StringJoiner("<br />").add(headerString);
|
|
|
|
|
+
|
|
|
|
|
+ HashMap<String, String> deptMap = new HashMap<>();//部门对应的推送人
|
|
|
|
|
+ for (Map<String,Object> map : sjhcSqlList){
|
|
|
|
|
+ String deptId = map.get("bian_zhi_bu_men_").toString();
|
|
|
|
|
+ content = new StringJoiner("<br />").add(headerString);
|
|
|
|
|
+ String code = map.get("ID_").toString();
|
|
|
|
|
+ String name = map.get("ming_cheng_").toString();
|
|
|
|
|
+ String expDate = map.get("zhu_ce_zheng_you_").toString();
|
|
|
|
|
+ content.add(String.format(format,code,name,expDate));
|
|
|
|
|
+ String routeString ="/mjwlgl/sjhcgl/sjhcjcsjpz";
|
|
|
|
|
+ List<String> receiver = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ // step1 发系统消息给对应的试剂耗材管理员和专业组组长
|
|
|
|
|
+ this.sendLeaders(deptId,"%s试剂耗材注册证有效期到期提醒",content.toString(),
|
|
|
|
|
+ "sjhcgly",routeString);
|
|
|
|
|
+
|
|
|
|
|
+ // step2 发系统消息给试剂耗材管理员组长
|
|
|
|
|
+ Map<String, Object> map2 = new HashMap<>();
|
|
|
|
|
+ map2.put("skipTypeMsg","{\"skipType\": 3,\"pathInfo\": \""+routeString+"\"}");
|
|
|
|
|
+ String roleAndDeptSql = "SELECT \n" +
|
|
|
|
|
+ " (SELECT ID_ FROM ibps_party_role WHERE ROLE_ALIAS_ = 'sjglxzfzr' LIMIT 1) AS role_id,\n" +
|
|
|
|
|
+ " (SELECT NAME_ FROM ibps_party_position WHERE ID_ = '"+deptId+"' LIMIT 1) AS position_name;";
|
|
|
|
|
+ Map<String, Object> roleMap = commonDao.queryOne(roleAndDeptSql);
|
|
|
|
|
+
|
|
|
|
|
+ String sjglxzfzrSql = "select ID_,NAME_ from ibps_party_employee where JOB_ like '%"+roleMap.get("role_id")+"%'";
|
|
|
|
|
+ List<Map<String, Object>> sjglxzfzrMap = (List<Map<String, Object>>) commonDao.query(sjglxzfzrSql);
|
|
|
|
|
+ if(BeanUtils.isNotEmpty(sjglxzfzrMap)){
|
|
|
|
|
+ for (Map data : sjglxzfzrMap){
|
|
|
|
|
+ receiver.add((String) data.get("ID_"));
|
|
|
|
|
+ }
|
|
|
|
|
+ MessageQueueProductorUtil.send("DeviceToDoRemindJob", "DeviceToDoRemindJob" ,
|
|
|
|
|
+ "inner" , receiver,null , roleMap.get("position_name")+"试剂耗材注册证有效期到期提醒",
|
|
|
|
|
+ String.format(content.toString(),roleMap.get("position_name").toString()), null, null, map2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
private void executeCalibrationCheck() {
|
|
private void executeCalibrationCheck() {
|
|
|
// 设备检定校准到期提醒
|
|
// 设备检定校准到期提醒
|
|
|
String sshjSql = "SELECT she_bei_shi_bie_h,she_bei_ming_cheng_,xiao_zhun_you_xia,bian_zhi_bu_men_ FROM t_sbdj" +
|
|
String sshjSql = "SELECT she_bei_shi_bie_h,she_bei_ming_cheng_,xiao_zhun_you_xia,bian_zhi_bu_men_ FROM t_sbdj" +
|