提交 ea8942d4 authored 作者: inroi's avatar inroi

微调

上级 f8d5c5bc
...@@ -96,6 +96,32 @@ public class CategoryDao { ...@@ -96,6 +96,32 @@ public class CategoryDao {
return ""; return "";
} }
private String whereByList(Map<String, String> map) {
StringBuilder where = null;
for (String key : map.keySet()) {
String value = String.valueOf(map.get(key));
if (value != null && value.length() != 0) {
if (where != null) {
if (value.contains(",")) {
where.append(" AND ").append(key).append(" IN (").append(value).append(")");
} else {
where.append(" AND ").append(key).append("='").append(value).append("'");
}
} else {
if (value.contains(",")) {
where = new StringBuilder(key + " IN (" + value + ")");
} else {
where = new StringBuilder(key + "='" + value + "'");
}
}
}
}
if (where != null) {
return ",\"FilterString\":\"" + where + "\"";
}
return "";
}
//添加批量查询 //添加批量查询
private String whereByIds(Map<String, String> map) { private String whereByIds(Map<String, String> map) {
String where = null; String where = null;
...@@ -123,7 +149,7 @@ public class CategoryDao { ...@@ -123,7 +149,7 @@ public class CategoryDao {
if (where != null) { if (where != null) {
where = where + " AND " + key + "='" + value + "'"; where = where + " AND " + key + "='" + value + "'";
} else { } else {
where = key + " IN ('" + value + "')"; where = key + " IN (" + value + ")";
} }
} }
} }
...@@ -336,9 +362,6 @@ public class CategoryDao { ...@@ -336,9 +362,6 @@ public class CategoryDao {
/** /**
* 查询单据体并添加日志 * 查询单据体并添加日志
*
* @return
* @throws Exception
*/ */
public List<List<Object>> selectAndLog(String sFormId, Map<String, String> key, Map<String, String> where, String name) { public List<List<Object>> selectAndLog(String sFormId, Map<String, String> key, Map<String, String> where, String name) {
List<List<Object>> list = null; List<List<Object>> list = null;
...@@ -368,6 +391,36 @@ public class CategoryDao { ...@@ -368,6 +391,36 @@ public class CategoryDao {
return list; return list;
} }
/**
* 查询单据体并添加日志
*/
public List<List<Object>> selectAndLogTo(String sFormId, Map<String, String> key, Map<String, String> where, String name) {
List<List<Object>> list = null;
String content = null;
try {
if (result) {
if (where != null) {
content = "{\"FormId\":\"" + sFormId + "\"," + Stringkey(key) + whereByList(where) + "}";
} else {
content = "{\"FormId\":\"" + sFormId + "\"," + Stringkey(key) + "}";
}
list = client.executeBillQuery(content);
KingdeeLogUtil kingdeeLogUtil = new KingdeeLogUtil();
//记录金蝶云的响应信息
kingdeeLogUtil.KingdeeLog(list, name, content);
} else {
throw new KingdeeConnectException(loginResult);
}
} catch (KingdeeConnectException e) {
throw new KingdeeConnectException(loginResult);
} catch (Exception e) {
e.printStackTrace();
throw new KingdeeConnectException(KingDeeConstant.URL, baseCommonService);
}
return list;
}
public Map<String, List<List<Object>>> selectMap(String sFormId, Map<String, String> key, Map<String, String> where) { public Map<String, List<List<Object>>> selectMap(String sFormId, Map<String, String> key, Map<String, String> where) {
List<List<Object>> list = null; List<List<Object>> list = null;
Map<String, List<List<Object>>> stringListHashMap = new HashMap<String, List<List<Object>>>(); Map<String, List<List<Object>>> stringListHashMap = new HashMap<String, List<List<Object>>>();
......
...@@ -32,7 +32,7 @@ public class ImsProduceOrderCloseApi { ...@@ -32,7 +32,7 @@ public class ImsProduceOrderCloseApi {
} }
public String addReturnResult(List<Map<String, Object>> list, String sFormId) { public String addReturnResult(List<Map<String, Object>> list, String sFormId) {
String erpMo = list.stream().map(m -> String.valueOf(m.get("ERP_MO"))).distinct().collect(Collectors.joining(",")); String erpMo = list.stream().map(m -> "'" + m.get("ERP_MO") + "'").distinct().collect(Collectors.joining(","));
Map<String, String> key = new LinkedHashMap<>(); Map<String, String> key = new LinkedHashMap<>();
//单据头实体主键 //单据头实体主键
......
...@@ -125,6 +125,7 @@ public class ImsWplanServiceImpl extends ServiceImpl<ImsWplanMapper, ImsWplan> i ...@@ -125,6 +125,7 @@ public class ImsWplanServiceImpl extends ServiceImpl<ImsWplanMapper, ImsWplan> i
Map<String, String> idmap = new HashMap<>(); Map<String, String> idmap = new HashMap<>();
//将对应的参数设置成金蝶云的查询条件 //将对应的参数设置成金蝶云的查询条件
idmap.put("FBillNo", poId); idmap.put("FBillNo", poId);
idmap.put("FStatus", "'3', '4'");
//从金蝶云获取对应数据 //从金蝶云获取对应数据
list1 = wplanKingdeeApi.selectAndLog(idmap, null, "ERP工单信息"); list1 = wplanKingdeeApi.selectAndLog(idmap, null, "ERP工单信息");
//将每次获取的数据添加到集合一起返回 //将每次获取的数据添加到集合一起返回
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论