diff --git a/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java b/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java index 0a6303b..a52a5f8 100644 --- a/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java +++ b/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java @@ -2,6 +2,7 @@ package aiyh.utils.recordset; import com.alibaba.druid.sql.SQLUtils; import com.alibaba.druid.sql.parser.ParserException; +import com.icbc.api.internal.apache.http.E; import weaver.conn.RecordSet; import java.util.Objects; @@ -27,7 +28,7 @@ public class FormatSqlUtil { } try { return SQLUtils.format(sql, dbType); - } catch (ParserException e) { + } catch (Exception e) { return toSqlString(sql); } } diff --git a/src/main/java/aiyh/utils/response_deal/process/DataChangeProcess.java b/src/main/java/aiyh/utils/response_deal/process/DataChangeProcess.java index bd57840..5b54b70 100644 --- a/src/main/java/aiyh/utils/response_deal/process/DataChangeProcess.java +++ b/src/main/java/aiyh/utils/response_deal/process/DataChangeProcess.java @@ -7,6 +7,7 @@ import aiyh.utils.response_deal.entity.ResponseConfigValueChange; import aiyh.utils.response_deal.exception.ResponseException; import aiyh.utils.response_deal.intfaces.DataChangeInterface; import aiyh.utils.response_deal.mapper.ConfigMapper; +import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; @@ -33,7 +34,7 @@ public class DataChangeProcess { private static final ConfigMapper CONFIG_MAPPER = Util.getMapper(ConfigMapper.class); - public static final Logger logger = Util.getLogger(); + public static final Logger logger = Util.getLogger("json_util"); static { try { @@ -87,6 +88,7 @@ public class DataChangeProcess { if(!cusText.startsWith("select ")){ throw new ResponseException("When you select custom sql, you are not allowed to perform dangerous operations other than SELECT !!!"); } + logger.info(Util.logStr("cus sql : {}, params : {}", cusText, JSONObject.toJSONString(param))); String tempValue = CONFIG_MAPPER.executeCusQuerySql(cusText, param,new HashMap<>()); responseConfigValueChange.setJsonData(tempValue); return ""; diff --git a/src/main/java/aiyh/utils/response_deal/process/TypeChangeProcess.java b/src/main/java/aiyh/utils/response_deal/process/TypeChangeProcess.java index d691497..5c88327 100644 --- a/src/main/java/aiyh/utils/response_deal/process/TypeChangeProcess.java +++ b/src/main/java/aiyh/utils/response_deal/process/TypeChangeProcess.java @@ -20,7 +20,7 @@ public class TypeChangeProcess { public static final Map> MODE_METHOD_MAP = new HashMap<>(); - public static final Logger logger = Util.getLogger(); + public static final Logger logger = Util.getLogger("json_util"); static { try { diff --git a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java index 4f07883..711ddb2 100644 --- a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java +++ b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java @@ -4,6 +4,7 @@ import aiyh.utils.ApiResult; import aiyh.utils.Util; import aiyh.utils.excention.CustomerException; import aiyh.utils.tool.cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; import com.api.xuanran.wang.xk_hospital.data_async.service.XkHospitalCommonDataAsyncService; import com.api.xuanran.wang.xk_hospital.data_async.service.impl.XkHospitalCommonDataAsyncServiceImpl; import io.swagger.v3.oas.annotations.parameters.RequestBody; @@ -42,7 +43,7 @@ public class CommonDataAsyncController { if(StrUtil.isBlank(configId) || StrUtil.isBlank(type)){ throw new CustomerException("configId or type can not be empty!"); } - logger.info(Util.logStr("configId : {}, type : {}, params : {}", configId, type, params)); + logger.info(Util.logStr("configId : {}, type : {}, params : {}", configId, type, JSONObject.toJSONString(params))); service.async(configId, type, params); return ApiResult.successNoData(); }catch (Exception e){ diff --git a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/XkHospitalCommonDefinition.java b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/XkHospitalCommonDefinition.java index e447d77..18086ab 100644 --- a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/XkHospitalCommonDefinition.java +++ b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/XkHospitalCommonDefinition.java @@ -5,6 +5,7 @@ import aiyh.utils.Util; import aiyh.utils.response_deal.mapper.ConfigMapper; import com.api.xuanran.wang.xk_hospital.data_async.mapper.XkHospitalDataAsyncMapper; import com.engine.common.service.impl.ThemeServiceImpl; +import ln.LN; import org.apache.log4j.Logger; import weaver.hrm.company.DepartmentComInfo; import weaver.hrm.resource.ResourceComInfo; @@ -55,6 +56,8 @@ public class XkHospitalCommonDefinition { **/ protected static ResourceComInfo RESOURCE_COM_INFO = null; + protected final LN ln = new LN(); + static { try { RESOURCE_COM_INFO = new ResourceComInfo(); diff --git a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/row/HrmDepartmentRowDefinition.java b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/row/HrmDepartmentRowDefinition.java index 50ac6fe..b80a2d8 100644 --- a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/row/HrmDepartmentRowDefinition.java +++ b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/definitions/row/HrmDepartmentRowDefinition.java @@ -8,6 +8,7 @@ import aiyh.utils.response_deal.intfaces.RowDefinitionCallback; import aiyh.utils.response_deal.mapper.ConfigMapper; import aiyh.utils.tool.cn.hutool.core.util.StrUtil; import com.api.xuanran.wang.xk_hospital.data_async.definitions.XkHospitalCommonDefinition; +import ln.LN; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; @@ -41,6 +42,10 @@ public class HrmDepartmentRowDefinition extends XkHospitalCommonDefinition imple if(StrUtil.isBlank(dataId)){ int nextId = -1; if(HRM_RESOURCE.equals(table)){ + int licenseNum = ln.CkHrmnum(); + if(licenseNum < 1){ + throw new CustomerException("当前可用license数量不足!"); + } nextId = Util.getNextHrmId(); }else if(DEPARTMENT.equals(table)){ nextId = Util.getNextDepartmentId(); diff --git a/src/main/java/weaver/weilin/zhu/asc/workflow/VoucherPushAction.java b/src/main/java/weaver/weilin/zhu/asc/workflow/VoucherPushAction.java index 31d6f7d..0f30b6a 100644 --- a/src/main/java/weaver/weilin/zhu/asc/workflow/VoucherPushAction.java +++ b/src/main/java/weaver/weilin/zhu/asc/workflow/VoucherPushAction.java @@ -1,7 +1,6 @@ package weaver.weilin.zhu.asc.workflow; import aiyh.utils.Util; -import aiyh.utils.httpUtil.HttpArgsType; import aiyh.utils.httpUtil.ResponeVo; import aiyh.utils.httpUtil.util.HttpUtils; import com.alibaba.fastjson.JSONArray; @@ -12,6 +11,7 @@ import weaver.weilin.zhu.common.util.CommonUtil; import weaver.weilin.zhu.common.voucher.action.CusActionPostInterface; import weaver.weilin.zhu.common.voucher.action.ResultMessageUtil; +import javax.ws.rs.core.MediaType; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -58,7 +58,7 @@ public class VoucherPushAction implements CusActionPostInterface { String requestURL = Util.null2String(Prop.getPropValue("AscVoucher", "url")); Map headerMap = new HashMap<>(); - headerMap.put("Content-Type", HttpArgsType.APPLICATION_JSON); + headerMap.put("Content-Type", MediaType.APPLICATION_JSON); HttpUtils httpUtils = new HttpUtils(); @@ -111,7 +111,7 @@ public class VoucherPushAction implements CusActionPostInterface { CommonUtil commonUtil = new CommonUtil(); - logger.info("日志信息:[" + JSONObject.toJSONString(logMap) + "]"); + logger.info("日志信息:[" + logMap.toString() + "]"); commonUtil.insertNewDataToMode(modeid,"uf_interface_log",logMap); diff --git a/src/main/java/weaver/weilin/zhu/xyzq/scheduled/entity/SyncConfigDetailDao.java b/src/main/java/weaver/weilin/zhu/xyzq/scheduled/entity/SyncConfigDetailDao.java index 0a8a8ba..5468761 100644 --- a/src/main/java/weaver/weilin/zhu/xyzq/scheduled/entity/SyncConfigDetailDao.java +++ b/src/main/java/weaver/weilin/zhu/xyzq/scheduled/entity/SyncConfigDetailDao.java @@ -1,7 +1,7 @@ package weaver.weilin.zhu.xyzq.scheduled.entity; -import aiyh.utils.entity.FieldViewInfo; import lombok.Data; +import weaver.weilin.zhu.common.util.FieldDetailInfo; /** * 兴业证券 @@ -15,7 +15,7 @@ public class SyncConfigDetailDao { /** * 建模模块字段信息 */ - private FieldViewInfo modeField; + private FieldDetailInfo modeField; /** * 接口字段名称 diff --git a/src/main/java/weaver/weilin/zhu/xyzq/scheduled/sqlmapper/OrganizationSyncSqlMapper.java b/src/main/java/weaver/weilin/zhu/xyzq/scheduled/sqlmapper/OrganizationSyncSqlMapper.java index c48721b..dd969ee 100644 --- a/src/main/java/weaver/weilin/zhu/xyzq/scheduled/sqlmapper/OrganizationSyncSqlMapper.java +++ b/src/main/java/weaver/weilin/zhu/xyzq/scheduled/sqlmapper/OrganizationSyncSqlMapper.java @@ -36,6 +36,7 @@ public interface OrganizationSyncSqlMapper { id = @Id(value = Integer.class,methodId = 2) ) }) + @CaseConversion(value = false) SyncConfigDao getConfigurationByKeyId(@ParamMapper("keyId") int keyId); /** diff --git a/src/main/java/weaver/zwl/common/ToolUtilNew.java b/src/main/java/weaver/zwl/common/ToolUtilNew.java index 05c0ee2..6605a91 100644 --- a/src/main/java/weaver/zwl/common/ToolUtilNew.java +++ b/src/main/java/weaver/zwl/common/ToolUtilNew.java @@ -431,7 +431,7 @@ public class ToolUtilNew extends ToolUtil{ public static String getModeTableById(int modeId){ RecordSet rs = new RecordSet(); - if(rs.executeQuery("select wb.tablename from modeInfo m inner join workflow_bill wb on m.formid = wb.id where m.id = ?") && rs.next()){ + if(rs.executeQuery("select wb.tablename from modeInfo m inner join workflow_bill wb on m.formid = wb.id where m.id = ?",modeId) && rs.next()){ return Util.null2String(rs.getString(1)); } return ""; diff --git a/src/test/java/xuanran/wang/xk_hospital/test/XkHospitalTest.java b/src/test/java/xuanran/wang/xk_hospital/test/XkHospitalTest.java index 1afaa31..7926f48 100644 --- a/src/test/java/xuanran/wang/xk_hospital/test/XkHospitalTest.java +++ b/src/test/java/xuanran/wang/xk_hospital/test/XkHospitalTest.java @@ -74,42 +74,45 @@ public class XkHospitalTest extends BaseTest { @Test public void testC(){ String json = "{\n" + - "\t\"ID\":\"主键\",\n" + - "\t\"GroupID\":\"test_yl_01\",\n" + - "\t\"GroupCode\":\"test_yl_dm_03\",\n" + - "\t\"GroupName\":\"医疗组名称1\",\n" + - "\t\"DeptCode\":\"test03\",\n" + - "\t\"DeptName\":\"测试科室03\",\n" + - "\t\"WardCode\":\"病区代码\",\n" + - "\t\"WardName\":\"病区名称\",\n" + - "\t\"Ward_BedNumber\":\"病区床位数,int类型\",\n" + - "\t\"IsDelete\":\"是否停用,bool类型\",\n" + - "\t\"Remark\":\"备注\",\n" + - "\t\"Wards\":[\t\n" + - "\t\t{\t\t\t\n" + - "\t\t\t\"ID\":\"1\",\n" + - "\t\t\t\"WardCode\":\"bq_01\",\n" + - "\t\t\t\"WardName\":\"病区名称01_2_3\"\n" + - "\t\t},{\t\t\t\n" + - "\t\t\t\"ID\":\"2\",\n" + - "\t\t\t\"WardCode\":\"bq_03\",\n" + - "\t\t\t\"WardName\":\"病区名称02_1_3\"\n" + - "\t\t}\n" + - "\t],\n" + - "\t\"WardHeads\":[\n" + - "\t\t{\n" + - "\t\t\t\"ID\":\"1\",\n" + - "\t\t\t\"EmplCode\":\"TEST10\",\n" + - "\t\t\t\"EmplName\":\"傻逼01\",\n" + - "\t\t\t\"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + - "\t\t},{\n" + - "\t\t\t\"ID\":\"2\",\n" + - "\t\t\t\"EmplCode\":\"TEST10\",\n" + - "\t\t\t\"EmplName\":\"傻逼02\",\n" + - "\t\t\t\"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + - "\t\t}\n" + - "\t]\n" + - "}\n"; + " \"ID\":\"主键\",\n" + + " \"GroupID\":\"test_yl_01\",\n" + + " \"GroupCode\":\"test_yl_dm_03\",\n" + + " \"GroupName\":\"医疗组名称1\",\n" + + " \"DeptCode\":\"test03\",\n" + + " \"DeptName\":\"测试科室03\",\n" + + " \"WardCode\":\"testbq_dm_1\",\n" + + " \"WardName\":\"测试主表病区名称1\",\n" + + " \"Ward_BedNumber\":\"病区床位数,int类型\",\n" + + " \"IsDelete\":\"是否停用,bool类型\",\n" + + " \"Remark\":\"备注\",\n" + + " \"Wards\":[\n" + + " {\n" + + " \"ID\":\"1\",\n" + + " \"WardCode\":\"bq_01\",\n" + + " \"WardName\":\"病区名称01_2_3\"\n" + + " },\n" + + " {\n" + + " \"ID\":\"2\",\n" + + " \"WardCode\":\"bq_03\",\n" + + " \"WardName\":\"病区名称02_1_3\"\n" + + " }\n" + + " ],\n" + + " \"WardHeads\":[\n" + + " {\n" + + " \"ID\":\"1\",\n" + + " \"EmplCode\":\"TEST10\",\n" + + " \"EmplName\":\"傻逼01\",\n" + + " \"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + + " },\n" + + " {\n" + + " \"ID\":\"2\",\n" + + " \"EmplCode\":\"TEST10\",\n" + + " \"EmplName\":\"傻逼02\",\n" + + " \"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + + " }\n" + + " ]\n" + + "}"; + System.out.println(json); Map map = JSONObject.parseObject(json, Map.class); Util.null2DefaultStr(null,""); service.async("4bce0693734d","common", map);