冲突处理
dev
ic_excellent 2023-07-24 16:55:38 +08:00
commit f0e99efd26
11 changed files with 62 additions and 46 deletions

View File

@ -2,6 +2,7 @@ package aiyh.utils.recordset;
import com.alibaba.druid.sql.SQLUtils; import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.parser.ParserException; import com.alibaba.druid.sql.parser.ParserException;
import com.icbc.api.internal.apache.http.E;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import java.util.Objects; import java.util.Objects;
@ -27,7 +28,7 @@ public class FormatSqlUtil {
} }
try { try {
return SQLUtils.format(sql, dbType); return SQLUtils.format(sql, dbType);
} catch (ParserException e) { } catch (Exception e) {
return toSqlString(sql); return toSqlString(sql);
} }
} }

View File

@ -7,6 +7,7 @@ import aiyh.utils.response_deal.entity.ResponseConfigValueChange;
import aiyh.utils.response_deal.exception.ResponseException; import aiyh.utils.response_deal.exception.ResponseException;
import aiyh.utils.response_deal.intfaces.DataChangeInterface; import aiyh.utils.response_deal.intfaces.DataChangeInterface;
import aiyh.utils.response_deal.mapper.ConfigMapper; import aiyh.utils.response_deal.mapper.ConfigMapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -33,7 +34,7 @@ public class DataChangeProcess {
private static final ConfigMapper CONFIG_MAPPER = Util.getMapper(ConfigMapper.class); 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 { static {
try { try {
@ -87,6 +88,7 @@ public class DataChangeProcess {
if(!cusText.startsWith("select ")){ if(!cusText.startsWith("select ")){
throw new ResponseException("When you select custom sql, you are not allowed to perform dangerous operations other than 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<>()); String tempValue = CONFIG_MAPPER.executeCusQuerySql(cusText, param,new HashMap<>());
responseConfigValueChange.setJsonData(tempValue); responseConfigValueChange.setJsonData(tempValue);
return ""; return "";

View File

@ -20,7 +20,7 @@ public class TypeChangeProcess {
public static final Map<Integer, Function<Object,Object>> MODE_METHOD_MAP = new HashMap<>(); public static final Map<Integer, Function<Object,Object>> MODE_METHOD_MAP = new HashMap<>();
public static final Logger logger = Util.getLogger(); public static final Logger logger = Util.getLogger("json_util");
static { static {
try { try {

View File

@ -4,6 +4,7 @@ import aiyh.utils.ApiResult;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException; import aiyh.utils.excention.CustomerException;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil; 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.XkHospitalCommonDataAsyncService;
import com.api.xuanran.wang.xk_hospital.data_async.service.impl.XkHospitalCommonDataAsyncServiceImpl; import com.api.xuanran.wang.xk_hospital.data_async.service.impl.XkHospitalCommonDataAsyncServiceImpl;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -42,7 +43,7 @@ public class CommonDataAsyncController {
if(StrUtil.isBlank(configId) || StrUtil.isBlank(type)){ if(StrUtil.isBlank(configId) || StrUtil.isBlank(type)){
throw new CustomerException("configId or type can not be empty!"); 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); service.async(configId, type, params);
return ApiResult.successNoData(); return ApiResult.successNoData();
}catch (Exception e){ }catch (Exception e){

View File

@ -5,6 +5,7 @@ import aiyh.utils.Util;
import aiyh.utils.response_deal.mapper.ConfigMapper; import aiyh.utils.response_deal.mapper.ConfigMapper;
import com.api.xuanran.wang.xk_hospital.data_async.mapper.XkHospitalDataAsyncMapper; import com.api.xuanran.wang.xk_hospital.data_async.mapper.XkHospitalDataAsyncMapper;
import com.engine.common.service.impl.ThemeServiceImpl; import com.engine.common.service.impl.ThemeServiceImpl;
import ln.LN;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import weaver.hrm.company.DepartmentComInfo; import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.resource.ResourceComInfo; import weaver.hrm.resource.ResourceComInfo;
@ -55,6 +56,8 @@ public class XkHospitalCommonDefinition {
**/ **/
protected static ResourceComInfo RESOURCE_COM_INFO = null; protected static ResourceComInfo RESOURCE_COM_INFO = null;
protected final LN ln = new LN();
static { static {
try { try {
RESOURCE_COM_INFO = new ResourceComInfo(); RESOURCE_COM_INFO = new ResourceComInfo();

View File

@ -8,6 +8,7 @@ import aiyh.utils.response_deal.intfaces.RowDefinitionCallback;
import aiyh.utils.response_deal.mapper.ConfigMapper; import aiyh.utils.response_deal.mapper.ConfigMapper;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil; import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import com.api.xuanran.wang.xk_hospital.data_async.definitions.XkHospitalCommonDefinition; import com.api.xuanran.wang.xk_hospital.data_async.definitions.XkHospitalCommonDefinition;
import ln.LN;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -41,6 +42,10 @@ public class HrmDepartmentRowDefinition extends XkHospitalCommonDefinition imple
if(StrUtil.isBlank(dataId)){ if(StrUtil.isBlank(dataId)){
int nextId = -1; int nextId = -1;
if(HRM_RESOURCE.equals(table)){ if(HRM_RESOURCE.equals(table)){
int licenseNum = ln.CkHrmnum();
if(licenseNum < 1){
throw new CustomerException("当前可用license数量不足!");
}
nextId = Util.getNextHrmId(); nextId = Util.getNextHrmId();
}else if(DEPARTMENT.equals(table)){ }else if(DEPARTMENT.equals(table)){
nextId = Util.getNextDepartmentId(); nextId = Util.getNextDepartmentId();

View File

@ -1,7 +1,6 @@
package weaver.weilin.zhu.asc.workflow; package weaver.weilin.zhu.asc.workflow;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.httpUtil.HttpArgsType;
import aiyh.utils.httpUtil.ResponeVo; import aiyh.utils.httpUtil.ResponeVo;
import aiyh.utils.httpUtil.util.HttpUtils; import aiyh.utils.httpUtil.util.HttpUtils;
import com.alibaba.fastjson.JSONArray; 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.CusActionPostInterface;
import weaver.weilin.zhu.common.voucher.action.ResultMessageUtil; import weaver.weilin.zhu.common.voucher.action.ResultMessageUtil;
import javax.ws.rs.core.MediaType;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -58,7 +58,7 @@ public class VoucherPushAction implements CusActionPostInterface {
String requestURL = Util.null2String(Prop.getPropValue("AscVoucher", "url")); String requestURL = Util.null2String(Prop.getPropValue("AscVoucher", "url"));
Map<String,String> headerMap = new HashMap<>(); Map<String,String> headerMap = new HashMap<>();
headerMap.put("Content-Type", HttpArgsType.APPLICATION_JSON); headerMap.put("Content-Type", MediaType.APPLICATION_JSON);
HttpUtils httpUtils = new HttpUtils(); HttpUtils httpUtils = new HttpUtils();
@ -111,7 +111,7 @@ public class VoucherPushAction implements CusActionPostInterface {
CommonUtil commonUtil = new CommonUtil(); CommonUtil commonUtil = new CommonUtil();
logger.info("日志信息:[" + JSONObject.toJSONString(logMap) + "]"); logger.info("日志信息:[" + logMap.toString() + "]");
commonUtil.insertNewDataToMode(modeid,"uf_interface_log",logMap); commonUtil.insertNewDataToMode(modeid,"uf_interface_log",logMap);

View File

@ -1,7 +1,7 @@
package weaver.weilin.zhu.xyzq.scheduled.entity; package weaver.weilin.zhu.xyzq.scheduled.entity;
import aiyh.utils.entity.FieldViewInfo;
import lombok.Data; import lombok.Data;
import weaver.weilin.zhu.common.util.FieldDetailInfo;
/** /**
* *
@ -15,7 +15,7 @@ public class SyncConfigDetailDao {
/** /**
* *
*/ */
private FieldViewInfo modeField; private FieldDetailInfo modeField;
/** /**
* *

View File

@ -36,6 +36,7 @@ public interface OrganizationSyncSqlMapper {
id = @Id(value = Integer.class,methodId = 2) id = @Id(value = Integer.class,methodId = 2)
) )
}) })
@CaseConversion(value = false)
SyncConfigDao getConfigurationByKeyId(@ParamMapper("keyId") int keyId); SyncConfigDao getConfigurationByKeyId(@ParamMapper("keyId") int keyId);
/** /**

View File

@ -431,7 +431,7 @@ public class ToolUtilNew extends ToolUtil{
public static String getModeTableById(int modeId){ public static String getModeTableById(int modeId){
RecordSet rs = new RecordSet(); 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 Util.null2String(rs.getString(1));
} }
return ""; return "";

View File

@ -74,42 +74,45 @@ public class XkHospitalTest extends BaseTest {
@Test @Test
public void testC(){ public void testC(){
String json = "{\n" + String json = "{\n" +
"\t\"ID\":\"主键\",\n" + " \"ID\":\"主键\",\n" +
"\t\"GroupID\":\"test_yl_01\",\n" + " \"GroupID\":\"test_yl_01\",\n" +
"\t\"GroupCode\":\"test_yl_dm_03\",\n" + " \"GroupCode\":\"test_yl_dm_03\",\n" +
"\t\"GroupName\":\"医疗组名称1\",\n" + " \"GroupName\":\"医疗组名称1\",\n" +
"\t\"DeptCode\":\"test03\",\n" + " \"DeptCode\":\"test03\",\n" +
"\t\"DeptName\":\"测试科室03\",\n" + " \"DeptName\":\"测试科室03\",\n" +
"\t\"WardCode\":\"病区代码\",\n" + " \"WardCode\":\"testbq_dm_1\",\n" +
"\t\"WardName\":\"病区名称\",\n" + " \"WardName\":\"测试主表病区名称1\",\n" +
"\t\"Ward_BedNumber\":\"病区床位数int类型\",\n" + " \"Ward_BedNumber\":\"病区床位数int类型\",\n" +
"\t\"IsDelete\":\"是否停用bool类型\",\n" + " \"IsDelete\":\"是否停用bool类型\",\n" +
"\t\"Remark\":\"备注\",\n" + " \"Remark\":\"备注\",\n" +
"\t\"Wards\":[\t\n" + " \"Wards\":[\n" +
"\t\t{\t\t\t\n" + " {\n" +
"\t\t\t\"ID\":\"1\",\n" + " \"ID\":\"1\",\n" +
"\t\t\t\"WardCode\":\"bq_01\",\n" + " \"WardCode\":\"bq_01\",\n" +
"\t\t\t\"WardName\":\"病区名称01_2_3\"\n" + " \"WardName\":\"病区名称01_2_3\"\n" +
"\t\t},{\t\t\t\n" + " },\n" +
"\t\t\t\"ID\":\"2\",\n" + " {\n" +
"\t\t\t\"WardCode\":\"bq_03\",\n" + " \"ID\":\"2\",\n" +
"\t\t\t\"WardName\":\"病区名称02_1_3\"\n" + " \"WardCode\":\"bq_03\",\n" +
"\t\t}\n" + " \"WardName\":\"病区名称02_1_3\"\n" +
"\t],\n" + " }\n" +
"\t\"WardHeads\":[\n" + " ],\n" +
"\t\t{\n" + " \"WardHeads\":[\n" +
"\t\t\t\"ID\":\"1\",\n" + " {\n" +
"\t\t\t\"EmplCode\":\"TEST10\",\n" + " \"ID\":\"1\",\n" +
"\t\t\t\"EmplName\":\"傻逼01\",\n" + " \"EmplCode\":\"TEST10\",\n" +
"\t\t\t\"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + " \"EmplName\":\"傻逼01\",\n" +
"\t\t},{\n" + " \"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" +
"\t\t\t\"ID\":\"2\",\n" + " },\n" +
"\t\t\t\"EmplCode\":\"TEST10\",\n" + " {\n" +
"\t\t\t\"EmplName\":\"傻逼02\",\n" + " \"ID\":\"2\",\n" +
"\t\t\t\"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" + " \"EmplCode\":\"TEST10\",\n" +
"\t\t}\n" + " \"EmplName\":\"傻逼02\",\n" +
"\t]\n" + " \"Category\":\"人员分组,当人员为主治和住院医师时使用\"\n" +
"}\n"; " }\n" +
" ]\n" +
"}";
System.out.println(json);
Map map = JSONObject.parseObject(json, Map.class); Map map = JSONObject.parseObject(json, Map.class);
Util.null2DefaultStr(null,""); Util.null2DefaultStr(null,"");
service.async("4bce0693734d","common", map); service.async("4bce0693734d","common", map);