|
|
@@ -35,7 +35,7 @@ import java.util.Map;
|
|
|
value = @Queue(value = QueueConstants.Message.QUEUE_NAME_SNAPSHOT)
|
|
|
)
|
|
|
})
|
|
|
-public class RabbitSnapshotMessageQueueConsumer <M extends Message<String>> implements IQueueConsumer<M> {
|
|
|
+public class RabbitSnapshotMessageQueueConsumer {
|
|
|
|
|
|
private static Logger LOGGER = LoggerFactory.getLogger(RabbitSnapshotMessageQueueConsumer.class);
|
|
|
@Autowired
|
|
|
@@ -56,16 +56,12 @@ public class RabbitSnapshotMessageQueueConsumer <M extends Message<String>> impl
|
|
|
@Value("${runqian.base-path}")
|
|
|
protected String runqianBasePath;
|
|
|
|
|
|
-// @Resource
|
|
|
-// private BpmInstHisRepository bpmInstHisRepository;
|
|
|
-
|
|
|
@RabbitHandler
|
|
|
- @Override
|
|
|
- public void popup(M message) {
|
|
|
- LOGGER.warn(message.toString());
|
|
|
+ public void popup(Message<String> message) throws Exception {
|
|
|
String instId = message.getVariables().get("instId").toString();
|
|
|
String userId = message.getVariables().get("userId").toString();
|
|
|
-
|
|
|
+ LOGGER.warn("processing snapshot with instId= " + instId);
|
|
|
+ Thread.sleep(10000);
|
|
|
|
|
|
/*
|
|
|
Step 1: fetch below sql by instId. if record returned, goto step 2,otherwise goto step 3.
|
|
|
@@ -85,12 +81,11 @@ public class RabbitSnapshotMessageQueueConsumer <M extends Message<String>> impl
|
|
|
and then update table t_tsclb with field: "shi_fou_guo_shen"="已完成" "kuai_zhao_": "1166694051567632384"
|
|
|
Step 2.2: update table t_tsclb with field: "shi_fou_guo_shen"="已完成"
|
|
|
|
|
|
- Step 3: waiting 30s and try it again.
|
|
|
+ Step 3: waiting 10s and try it again.
|
|
|
|
|
|
*/
|
|
|
|
|
|
Map<String, Object> hisMap = commonDao.queryOne("SELECT PROC_DEF_KEY_,BIZ_KEY_,PROC_DEF_NAME_ FROM ibps_bpm_inst_his WHERE id_ = '" + instId + "' ");
|
|
|
- //BpmInstHisPo instHis = bpmInstHisRepository.get(superProcInstId);
|
|
|
|
|
|
if (BeanUtils.isNotEmpty(hisMap)){
|
|
|
|
|
|
@@ -106,21 +101,11 @@ public class RabbitSnapshotMessageQueueConsumer <M extends Message<String>> impl
|
|
|
String reportPath = "金通医学实验室管理系统/" + kzMap.get("bao_biao_lu_jing_");
|
|
|
|
|
|
String baseUrl = runqianServer + runqianBasePath + "/reportServlet?action=6&file=";
|
|
|
- // 目前可用type 6:生成报表的pdf文件【默认】 7:生成报表的word文件 3:生成报表的excel文件
|
|
|
- // return `${BASE_URL}demo/reportServlet?action=${type}&file=${encodeURIComponent(reportPath + '/' + src)}
|
|
|
- // &print=1&srcType=file¶mString=${getParams(where)}`
|
|
|
-
|
|
|
- try {
|
|
|
- reportPath = URLEncoder.encode(reportPath, "UTF-8");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ reportPath = URLEncoder.encode(reportPath, "UTF-8");
|
|
|
String url = baseUrl + reportPath + "&print=1&srcType=file¶mString=id_%3D" + hisMap.get("BIZ_KEY_") + "&org_=" + org;
|
|
|
-
|
|
|
String formattedTime = new SimpleDateFormat("yyyyMMddHHmm").format(new Date());
|
|
|
String name = hisMap.get("PROC_DEF_NAME_") + formattedTime ;
|
|
|
|
|
|
-
|
|
|
DefaultPartyUserPo user = new DefaultPartyUserPo();
|
|
|
user.setUserId(userId);
|
|
|
user.setFullname(employeePo.getName());
|
|
|
@@ -135,11 +120,15 @@ public class RabbitSnapshotMessageQueueConsumer <M extends Message<String>> impl
|
|
|
sql.append("update t_").append(kzMap.get("tablekey_")).append(" set shi_fou_guo_shen_ = '已完成' ");
|
|
|
if (result.getState() == 200 && BeanUtils.isNotEmpty(result.getData())) {
|
|
|
sql.append(" , kuai_zhao_ = '").append(result.getData().getId()).append("' ");
|
|
|
+ LOGGER.warn("Generated Snapshot ID=" + result.getData().getId());
|
|
|
}
|
|
|
sql.append(" where id_ = '").append(hisMap.get("BIZ_KEY_")).append("' ");
|
|
|
commonDao.execute(sql.toString());
|
|
|
}
|
|
|
|
|
|
+ } else{
|
|
|
+ LOGGER.warn("can't find any record. it will be tried it again. instId=" +instId);
|
|
|
+ throw new Exception("can't find any record. it will be tried it again.");
|
|
|
}
|
|
|
|
|
|
|