修改适配达梦
This commit is contained in:
parent
8c138a7a7c
commit
d57bba9621
|
@ -117,10 +117,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||||
boolean flags = true;
|
|
||||||
if(flags){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try{
|
try{
|
||||||
//重试方法
|
//重试方法
|
||||||
if (null != requestJson) {
|
if (null != requestJson) {
|
||||||
|
|
|
@ -655,13 +655,26 @@ public class GeneralServiceImpl implements GeneralService {
|
||||||
List<HashMap<String, Object>> list = null;
|
List<HashMap<String, Object>> list = null;
|
||||||
try {
|
try {
|
||||||
list = baseDaoUtilImpl.selectWhereList(tablename, defaultOrder, whereCriteria);
|
list = baseDaoUtilImpl.selectWhereList(tablename, defaultOrder, whereCriteria);
|
||||||
|
convertKeysToLowerCase(list);
|
||||||
return BaseResult.getSuccessMessageEntity("查询成功", list);
|
return BaseResult.getSuccessMessageEntity("查询成功", list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("default:selectList{}", e.getMessage());
|
log.error("default:selectList{}", e.getMessage());
|
||||||
return BaseResult.getFailureMessageEntity("查询失败");
|
return BaseResult.getFailureMessageEntity("查询失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//强制转换数据库字段为小写,出问题在说
|
||||||
|
public void convertKeysToLowerCase(List<HashMap<String, Object>> list) {
|
||||||
|
if(list != null && list.size() > 0){
|
||||||
|
for (HashMap<String, Object> map : list) {
|
||||||
|
HashMap<String, Object> lowerCaseMap = new HashMap<>();
|
||||||
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
|
lowerCaseMap.put(entry.getKey().toLowerCase(), entry.getValue());
|
||||||
|
}
|
||||||
|
map.clear(); // 清空原来的Map,避免重复存储
|
||||||
|
map.putAll(lowerCaseMap); // 将转换后的Map全部放回原位
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param jsonObject
|
* @param jsonObject
|
||||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
|
|
@ -467,7 +467,7 @@ where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="alterTableField" resultType="java.lang.Integer">
|
<select id="alterTableField" databaseId="mysql" resultType="java.lang.Integer">
|
||||||
|
|
||||||
ALTER TABLE ${dbName}
|
ALTER TABLE ${dbName}
|
||||||
<choose>
|
<choose>
|
||||||
|
@ -532,6 +532,65 @@ where id = #{id}
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="alterTableField" databaseId="oracle" resultType="java.lang.Integer">
|
||||||
|
|
||||||
|
ALTER TABLE "businesscenter".${dbName}
|
||||||
|
<choose>
|
||||||
|
<when test="filedType == '1'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="dataType == '1'.toString()">
|
||||||
|
add ${enName} bigint(${filedLength}) DEFAULT NULL
|
||||||
|
</when>
|
||||||
|
<when test="dataType == '3'.toString()">
|
||||||
|
drop ${enName}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
MODIFY ${enName} bigint(${filedLength}) DEFAULT NULL
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="filedType == '3'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="dataType == '1'.toString()">
|
||||||
|
add ${enName} varchar(${filedLength}) DEFAULT NULL
|
||||||
|
</when>
|
||||||
|
<when test="dataType == '3'.toString()">
|
||||||
|
drop ${enName}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
MODIFY ${enName} varchar(${filedLength}) DEFAULT NULL
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
|
||||||
|
<when test="filedType == '2'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="dataType == '1'.toString()">
|
||||||
|
add ${enName} decimal(${filedLength}) DEFAULT NULL
|
||||||
|
</when>
|
||||||
|
<when test="dataType == '3'.toString()">
|
||||||
|
drop ${enName}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
MODIFY ${enName} decimal(${filedLength}) DEFAULT NULL
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="filedType == '4'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="dataType == '1'.toString()">
|
||||||
|
add ${enName} datetime DEFAULT NULL
|
||||||
|
</when>
|
||||||
|
<when test="dataType == '3'.toString()">
|
||||||
|
drop ${enName}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
MODIFY ${enName} datetime DEFAULT NULL
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
java.lang.String str = "{\"data\":{\"enablestate\":\"2\",\"user_password\":\"Hzya@1314\",\"gender\":\"12312\",\"user_name\":\"测试用户\",\"modify_time\":1719305835000,\"document_rule_num\":112,\"pk_org\":{\"org_mnecode\":\"1\",\"modify_time\":1718866279000,\"document_rule_num\":4,\"add_status\":\"0\",\"org_address\":\"1\",\"delete_status\":\"1\",\"org_innercode\":\"1\",\"id\":\"f7a8cee35fce4aa8ab266b3c7f125d7d\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"org_name\":\"开发部\",\"sorts\":4,\"document_rule\":\"ZZ-2024-06-20-00004\",\"create_user_id\":\"1\",\"create_time\":1718864103000,\"company_id\":\"Y\",\"org_memo\":\"1\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_tel\":\"1\",\"org_id\":\"Y\",\"org_ncindustry\":\"1\",\"org_fatherorg\":\"c4913dde8da142bab4206fc084269382\",\"org_code\":\"003\",\"org_principal\":\"1\",\"org_countryzone\":\"1\"},\"add_status\":\"0\",\"pwdlevelcode\":\"\",\"user_type\":\"1\",\"user_code\":\"17633965916\",\"delete_status\":\"1\",\"id\":\"d99fe4e1c211450a960f7a1057da0d2c\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":346,\"document_rule\":\"YH-2024-06-25-00112\",\"create_user_id\":\"1\",\"create_time\":1719305229000,\"company_id\":\"Y\",\"user_code_q\":\"KP003\",\"format\":\"ZH-CN\",\"mobile\":\"123123\",\"identityverifycode\":\"静态密码验证\",\"islocked\":\"N\",\"update_status\":\"0\",\"base_doc_type\":\"0\",\"sts\":\"Y\",\"login_name\":\"123123\",\"pwdparam\":\"2024-06-17\",\"org_id\":\"Y\",\"abledate\":\"2024-06-17 00:00:00\",\"isca\":\"Y\",\"contentlang\":\"ZH\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":0,\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7127798c-b731-453a-b3ac-cfe9033eeace\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":1,\\\"description\\\":\\\"OA\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7f965281-df0f-4d2f-b005-07e061fcde49\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"cbc0e105-17c0-4385-8863-8903303edc1f\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"beeedbc6-24c2-4093-9a5e-20fced9fb1b4\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
|
java.lang.String str = "{\"data\":{\"code\":\"test0628\",\"modify_time\":1719544020000,\"document_rule_num\":1,\"mdm_customer_bank\":[{\"create_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"accnum\":\"6234886523676743\",\"formmain_id\":\"-9194252578190768513\",\"create_time\":1719544020000,\"company_id\":\"0\",\"combinenum\":\"001421036014\",\"modify_time\":1719830508000,\"pk_bankdoc\":\"中国人民银行进贤县支行\",\"sts\":\"Y\",\"data_id\":\"5504698360056529043\",\"org_id\":\"0\",\"id\":\"7565801375982767614\",\"modify_user_id\":\"1\",\"data_status\":\"F\",\"sorts\":173}],\"pk_org\":{},\"add_status\":\"0\",\"data_id\":\"9026082101877884176\",\"delete_status\":\"1\",\"custprop_type\":\"项目\",\"id\":\"-9194252578190768513\",\"modify_user_id\":\"1\",\"data_status\":\"F\",\"sorts\":126,\"document_rule\":\"KH-2024-06-28-00001\",\"create_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"create_time\":1719544020000,\"update_status\":\"0\",\"sts\":\"Y\",\"pk_custclass\":\"K01\",\"org_id\":\"0\",\"name\":\"越城区人民医院\"},\"query\":\"[]\",\"header\":\"[]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"23af8d17-7ab9-4d71-b357-6f4d04ac0706\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
|
||||||
A88772 s = new A88772();
|
A88772 s = new A88772();
|
||||||
s.execute(str);
|
s.execute(str);
|
||||||
}
|
}
|
||||||
|
@ -46,30 +46,20 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
|
||||||
|
|
||||||
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
|
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
|
||||||
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
|
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
|
||||||
com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
|
com.alibaba.fastjson.JSONObject mdm_customer = new com.alibaba.fastjson.JSONObject();
|
||||||
ufinterfaceObject.put("billtype", "customer");
|
mdm_customer.put("code",data.getString("code"));
|
||||||
ufinterfaceObject.put("isexchange", "Y");
|
mdm_customer.put("custprop",data.getString("custprop"));
|
||||||
ufinterfaceObject.put("replace", "Y");
|
mdm_customer.put("custstate",data.getString("custstate"));
|
||||||
ufinterfaceObject.put("sender", "OA");
|
mdm_customer.put("enablestate",data.getString("enablestate"));
|
||||||
ufinterfaceObject.put("account", "ycjf");
|
mdm_customer.put("name",data.getString("name"));
|
||||||
ufinterfaceObject.put("groupcode", "ycjf");
|
mdm_customer.put("name",data.getString("name"));
|
||||||
com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
|
mdm_customer.put("name",data.getString("name"));
|
||||||
com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
|
mdm_customer.put("name",data.getString("name"));
|
||||||
billheadObject.put("code", data.get("code"));
|
mdm_customer.put("name",data.getString("name"));
|
||||||
billheadObject.put("custprop", data.get("custprop"));
|
com.alibaba.fastjson.JSONArray datadetail = data.getJSONArray("mdm_customer_bank");
|
||||||
billheadObject.put("custstate", data.get("custstate"));
|
com.alibaba.fastjson.JSONArray mdm_customer_bank = new com.alibaba.fastjson.JSONArray();
|
||||||
billheadObject.put("pk_custclass", data.get("pk_custclass"));
|
bodys.put("mdm_customer", mdm_customer);
|
||||||
billheadObject.put("pk_country", data.get("pk_country"));
|
bodys.put("mdm_customer_bank", mdm_customer_bank);
|
||||||
billheadObject.put("pk_timezone", "P0800");
|
|
||||||
billheadObject.put("pk_format", "ZH-CN");
|
|
||||||
billheadObject.put("enablestate", data.get("enablestate"));
|
|
||||||
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);
|
|
||||||
returnObject.put("bodys",bodys.toJSONString());
|
returnObject.put("bodys",bodys.toJSONString());
|
||||||
return returnObject.toJSONString();
|
return returnObject.toJSONString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue