|
|
@@ -1,7 +1,10 @@
|
|
|
package com.lc.ibps.mq.consumer.rabbit;
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.JsonNode;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.lc.ibps.base.core.constants.StringPool;
|
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
+import com.lc.ibps.base.core.util.Collections;
|
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
@@ -136,7 +139,19 @@ public class RabbitSnapshotMessageQueueConsumer {
|
|
|
this.updateKuaiZhao(procDefKey,zuiZhong,bizKey,baseUrl,reportPath,org);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ }else if("Process_0mn0ekh".equals(procDefKey) && getIpcc()){
|
|
|
+ //供应商考核表同样是将快照放置在子表显示,流程用主表
|
|
|
+ String gyspjbzb = "select id_,parent_id_,zi_gong_ying_shan from t_gysxxxxzb where parent_id_ = '"+ bizKey +"'";
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(gyspjbzb);
|
|
|
+ if(Collections.isNotEmpty(list)){
|
|
|
+ for (Map<String,Object> item: list) {
|
|
|
+ String name = procDefName + (BeanUtils.isEmpty(item.get("zi_gong_ying_shan"))? "":item.get("zi_gong_ying_shan"));
|
|
|
+ bizKey = item.get("id_").toString();
|
|
|
+ this.updateKuaiZhao(procDefKey,name,bizKey,baseUrl,reportPath,org);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
this.updateKuaiZhao(procDefKey,procDefName,bizKey,baseUrl,reportPath,org);
|
|
|
}
|
|
|
}
|
|
|
@@ -147,7 +162,7 @@ public class RabbitSnapshotMessageQueueConsumer {
|
|
|
private void updateKuaiZhao(String procDefKey,String procDefName,String bizKey,String baseUrl,String reportPath,String org){
|
|
|
String url = baseUrl + reportPath + "&print=1&srcType=file¶mString=id_%3D"+bizKey+"&org_="+org;
|
|
|
String name = procDefName + new SimpleDateFormat("yyyyMMddHHmm").format(new Date());
|
|
|
- if (procDefKey.equals("Process_1ek5omy_2")){
|
|
|
+ if (procDefKey.equals("Process_1ek5omy_2")||procDefKey.equals("Process_0mn0ekh")){
|
|
|
name = procDefName;
|
|
|
}
|
|
|
APIResult<AttachmentPo> result = uploadFile.runQianUpload(url , name , StringPool.FileType.Office.PDF );
|
|
|
@@ -157,7 +172,9 @@ public class RabbitSnapshotMessageQueueConsumer {
|
|
|
String sql = "";
|
|
|
if ("Process_1ek5omy_2".equals(procDefKey)){
|
|
|
sql = "update t_wjxzxdjlb set kuai_zhao_='"+result.getData().getId()+"' where id_='"+bizKey+"'";
|
|
|
- }else {
|
|
|
+ }else if("Process_0mn0ekh".equals(procDefKey) && getIpcc()){
|
|
|
+ sql = "update t_gysxxxxzb set kuai_zhao_='"+result.getData().getId()+"' where id_='"+bizKey+"'";
|
|
|
+ }else{
|
|
|
sql = "update t_" + defMap.get("BO_CODE_") + " set kuai_zhao_ = '" + result.getData().getId() + "' where id_ = '"+bizKey+"'";
|
|
|
}
|
|
|
commonDao.execute(sql);
|
|
|
@@ -165,7 +182,23 @@ public class RabbitSnapshotMessageQueueConsumer {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private Boolean getIpcc(){
|
|
|
+ Boolean flg = false;
|
|
|
+ String sql = "select id_,setting from t_ipcc where id_ = '1'";
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) commonDao.query(sql);
|
|
|
+ if(Collections.isNotEmpty(list)){
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ try {
|
|
|
+ String setting = list.get(0).get("setting").toString();
|
|
|
+ JsonNode root = mapper.readTree(setting);
|
|
|
+ flg = root.path("supplier")
|
|
|
+ .asBoolean();
|
|
|
+ }catch (Exception e){
|
|
|
+ LOGGER.warn("全局配置中没有配置Supplier");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flg;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|