通用数据jsonobject的key为空情况修复

This commit is contained in:
lvleigang 2024-07-02 09:28:49 +08:00
parent da0773b0cf
commit 8c138a7a7c
2 changed files with 15 additions and 28 deletions

View File

@ -461,6 +461,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
}else{
jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>());
}
jsonObjectList.remove(null);
jsonObjects.add(jsonObjectList);
//保存操作日志
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log","1");

View File

@ -46,41 +46,27 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
com.alibaba.fastjson.JSONObject orger = data.getJSONObject("pk_org");
com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
ufinterfaceObject.put("account", "ycjf");
ufinterfaceObject.put("billtype", "user");
ufinterfaceObject.put("billtype", "customer");
ufinterfaceObject.put("isexchange", "Y");
ufinterfaceObject.put("roottag", "bill");
ufinterfaceObject.put("filename", "user0603");
ufinterfaceObject.put("replace", "Y");
ufinterfaceObject.put("sender", "OA");
ufinterfaceObject.put("account", "ycjf");
ufinterfaceObject.put("groupcode", "ycjf");
com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
billheadObject.put("user_name", data.get("user_name"));
billheadObject.put("user_code", data.get("user_code"));
billheadObject.put("user_password", "Hzya@1314");
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat yyyy = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.text.SimpleDateFormat mmm = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
billheadObject.put("pwdparam", yyyy.format(date));
billheadObject.put("abledate", mmm.format(date));
billheadObject.put("islocked", data.get("islocked"));
billheadObject.put("user_type", data.get("user_type"));
billheadObject.put("base_doc_type", data.get("base_doc_type"));
billheadObject.put("identityverifycode", data.get("identityverifycode"));
if(orger != null ){
billheadObject.put("pk_org", orger.get("org_code"));
}
billheadObject.put("format", data.get("format"));
billheadObject.put("isca", data.get("isca"));
billheadObject.put("code", data.get("code"));
billheadObject.put("custprop", data.get("custprop"));
billheadObject.put("custstate", data.get("custstate"));
billheadObject.put("pk_custclass", data.get("pk_custclass"));
billheadObject.put("pk_country", data.get("pk_country"));
billheadObject.put("pk_timezone", "P0800");
billheadObject.put("pk_format", "ZH-CN");
billheadObject.put("enablestate", data.get("enablestate"));
billheadObject.put("contentlang", data.get("contentlang"));
billheadObject.put("user_code_q", data.get("user_code_q"));
billheadObject.put("name", data.get("name"));
billheadObject.put("pk_group", data.get("pk_group"));
billheadObject.put("pk_org", data.get("pk_org"));
billheadObject.put("taxpayerid", data.get("taxpayerid"));
billObject.put("billhead", billheadObject);
ufinterfaceObject.put("bill", billObject);
bodys.put("ufinterface", ufinterfaceObject);