|
@@ -272,47 +272,51 @@ public class EnterInquiryTask extends AbstractTask{
|
|
|
}
|
|
|
try{
|
|
|
//从平台获取企业商机,保存到本地
|
|
|
+ String ids = "";
|
|
|
List<InquiryEnRemind> downs = getForList("/inquiry/public/enremind?vendUU="+enterpriseMap.get("EN_UU"), InquiryEnRemind.class);
|
|
|
if(!CollectionUtils.isEmpty(downs)){
|
|
|
ContextHolder.setDataSize(downs.size());
|
|
|
- saveInquiryEnRemind(downs);
|
|
|
+ ids = saveInquiryEnRemind(downs);
|
|
|
}
|
|
|
// 回执
|
|
|
- onReplySuccess(downs, enterpriseMap.get("EN_UU"));
|
|
|
+ onReplySuccess(ids, enterpriseMap.get("EN_UU"));
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void onReplySuccess(List<InquiryEnRemind> downs, Object en_uu) {
|
|
|
- String idStr = CollectionUtil.getKeyString(downs);
|
|
|
+ private void onReplySuccess(String ids, Object en_uu) {
|
|
|
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
|
|
map.set("vendUU", String.valueOf(en_uu));
|
|
|
- map.set("ids", idStr);
|
|
|
- if(!StringUtils.isEmpty(idStr)){
|
|
|
+ map.set("ids", ids);
|
|
|
+ if(!StringUtils.isEmpty(ids)){
|
|
|
post("/inquiry/public/enremind/back", map);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveInquiryEnRemind(List<InquiryEnRemind> downs) throws Exception {
|
|
|
+ private String saveInquiryEnRemind(List<InquiryEnRemind> downs) throws Exception {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
Map<String, Object> model = new HashMap<String, Object>();
|
|
|
model.put("inquiryEnRemind", downs);
|
|
|
try{
|
|
|
String sql = SqlTemplate.fromXmlFile("database/template/inquiryEnRemind.xml", model);
|
|
|
jdbcTemplate.execute(sql);
|
|
|
+ sb.append(CollectionUtil.getKeyString(downs));
|
|
|
}catch (Exception e){
|
|
|
- for(int i = 0; i < downs.size(); i=i+2){
|
|
|
+ for(int i = 0; i < downs.size(); i=i+1){
|
|
|
try {
|
|
|
- List<InquiryEnRemind> tempList = downs.subList(i,i+2);
|
|
|
+ List<InquiryEnRemind> tempList = downs.subList(i,i+1);
|
|
|
model.put("inquiryEnRemind", tempList);
|
|
|
String sql = SqlTemplate.fromXmlFile("database/template/inquiryEnRemind.xml", model);
|
|
|
jdbcTemplate.execute(sql);
|
|
|
+ sb.append(downs.get(i).getId() + ",");
|
|
|
}catch (Exception e1){
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ return sb.substring(0, sb.length()-2);
|
|
|
}
|
|
|
|
|
|
}
|