增加功能

This commit is contained in:
jiangs 2025-08-12 14:04:25 +08:00
parent 22e89aaf14
commit 048188674a
15 changed files with 1357 additions and 98 deletions

View File

@ -0,0 +1,16 @@
package com.czlisinterface.system.pojo.InterfaceName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DayMessage {
private String ip;
private String userid;
private String msgid;
private String msg;
private String yljg;
}

View File

@ -0,0 +1,22 @@
package com.czlisinterface.system.pojo.InterfaceName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GetReqInterface {
private String yljg;
private String brdh;
private String brly;
private String dept;
private String sqh;
private String userid;
private Date stime;
private Date etime;
private String bz1;
}

View File

@ -0,0 +1,15 @@
package com.czlisinterface.system.pojo.InterfaceName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SetDict {
private String ip;
private String userid;
private String zdlb;
private String yljg;
}

View File

@ -0,0 +1,19 @@
package com.czlisinterface.system.pojo.InterfaceName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class SetReport {
private String ip;
private String userid;
private String yq;
private Date jyrq;
private String ybh;
private String status;
}

View File

@ -0,0 +1,15 @@
package com.czlisinterface.system.pojo.InterfaceName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SetReqStatus {
private String ip;
private String userid;
private String sqh;
private String status;
}

View File

@ -1,9 +1,11 @@
package com.czlisinterface.system.service.impl; package com.czlisinterface.system.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.czlisinterface.system.pojo.*; import com.czlisinterface.system.pojo.*;
import com.czlisinterface.system.pojo.InterfaceName.*;
import com.czlisinterface.system.service.CommonExt; import com.czlisinterface.system.service.CommonExt;
import com.czlisinterface.system.service.HISInterfaceService; import com.czlisinterface.system.service.HISInterfaceService;
import com.czlisinterface.system.utils.CommonUtil; import com.czlisinterface.system.utils.CommonUtil;
@ -13,10 +15,12 @@ import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.math.BigDecimal;
import java.util.HashMap; import java.util.*;
import java.util.List; import java.util.concurrent.ConcurrentHashMap;
import java.util.Map; import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@Slf4j @Slf4j
public class CommonImpl implements HISInterfaceService { public class CommonImpl implements HISInterfaceService {
@ -24,6 +28,8 @@ public class CommonImpl implements HISInterfaceService {
@Resource @Resource
public CommonExt commonExt; public CommonExt commonExt;
@Resource
CommonUtil commonUtil;
@ -31,6 +37,16 @@ public class CommonImpl implements HISInterfaceService {
@Override @Override
public Result setReqStatus(String param) { public Result setReqStatus(String param) {
log.info("调用了setReqStatus:"+param); log.info("调用了setReqStatus:"+param);
JSONObject jsonObject = JSONUtil.parseObj(param);
SetReqStatus setReqStatus = new SetReqStatus();
setReqStatus.setIp(jsonObject.getStr("ip"));
setReqStatus.setSqh(jsonObject.getStr("sqh"));
setReqStatus.setStatus(jsonObject.getStr("status"));
setReqStatus.setUserid(jsonObject.getStr("userid"));
return setReqStatusM(setReqStatus);
}
public Result setReqStatusM(SetReqStatus setReqStatus){
return new Result("-1","修改状态接口未实现!"); return new Result("-1","修改状态接口未实现!");
} }
@ -38,6 +54,18 @@ public class CommonImpl implements HISInterfaceService {
@Override @Override
public Result setReport(String param) { public Result setReport(String param) {
log.info("调用了setReport:"+param); log.info("调用了setReport:"+param);
JSONObject jsonObject = JSONUtil.parseObj(param);
SetReport setReport = new SetReport();
setReport.setIp(jsonObject.getStr("ip"));
setReport.setYq(jsonObject.getStr("yq"));
setReport.setYbh(jsonObject.getStr("ybh"));
setReport.setUserid(jsonObject.getStr("userid"));
setReport.setStatus(jsonObject.getStr("status"));
setReport.setJyrq(DateUtil.parse(jsonObject.getStr("jyrq"),"yyyy-MM-dd"));
return setReportM(setReport);
}
public Result setReportM(SetReport setReport){
return new Result("-1","发送报告接口未实现!"); return new Result("-1","发送报告接口未实现!");
} }
@ -50,19 +78,23 @@ public class CommonImpl implements HISInterfaceService {
String userid = (String) jsonObject.get("userid"); String userid = (String) jsonObject.get("userid");
String zdlb = (String) jsonObject.get("zdlb"); String zdlb = (String) jsonObject.get("zdlb");
String yljg = (String) jsonObject.get("yljg"); String yljg = (String) jsonObject.get("yljg");
SetDict setDict = new SetDict();
setDict.setIp(ip);
setDict.setUserid(userid);
setDict.setZdlb(zdlb);
setDict.setYljg(yljg);
switch (zdlb){ switch (zdlb){
case "DP": //科室 case "DP": //科室
result = getDictDP(yljg); result = getDictDP(setDict);
break; break;
case "SRD": //人员 case "SRD": //人员
result = getDictSRD(yljg); result = getDictSRD(setDict);
break; break;
case "FEE": //套餐字典 case "FEE": //套餐字典
result = getDictFEE(yljg); result = getDictFEE(setDict);
break; break;
case "WR": //病区 case "WR": //病区
result = getDictWR(yljg); result = getDictWR(setDict);
break; break;
default: default:
break; break;
@ -109,16 +141,27 @@ public class CommonImpl implements HISInterfaceService {
e.printStackTrace(); e.printStackTrace();
return new Result("-1","日期时间格式不正确!"); return new Result("-1","日期时间格式不正确!");
} }
GetReqInterface getReqInterface = new GetReqInterface();
String ksdh = (String) jsonObject.get("dept"); getReqInterface.setBrdh(brdh);
getReqInterface.setBrly(brly);
getReqInterface.setDept(dept);
getReqInterface.setYljg(yljg);
getReqInterface.setSqh(sqh);
getReqInterface.setBz1(bz1);
getReqInterface.setStime(d_stime);
getReqInterface.setEtime(d_etime);
getReqInterface.setUserid(userid);
if(dept != null && !dept.equals("")){ if(dept != null && !dept.equals("")){
result = getReqInfo_ksdh(dept, d_stime, d_etime, userid, yljg); //dept, d_stime, d_etime, userid, yljg
result = getReqInfo_ksdh(getReqInterface);
} }
if(brdh != null && !brdh.equals("")){ if(brdh != null && !brdh.equals("")){
result = getReqInfo_brdh(brdh, brly, d_stime, d_etime, userid, yljg); //brdh, brly, d_stime, d_etime, userid, yljg
result = getReqInfo_brdh(getReqInterface);
} }
if(sqh != null && !sqh.equals("")){ if(sqh != null && !sqh.equals("")){
result = getReqInfo_sqh(sqh, userid); //sqh, userid
result = getReqInfo_sqh(getReqInterface);
} }
if(result != null ) { if(result != null ) {
return result; return result;
@ -133,6 +176,17 @@ public class CommonImpl implements HISInterfaceService {
@Override @Override
public Result dayMessage(String param) { public Result dayMessage(String param) {
log.info("调用了dayMessage接口,入参:{}",param); log.info("调用了dayMessage接口,入参:{}",param);
JSONObject jsonObject = JSONUtil.parseObj(param);
DayMessage dayMessage = new DayMessage();
dayMessage.setIp(jsonObject.getStr("ip"));
dayMessage.setYljg(jsonObject.getStr("yljg"));
dayMessage.setUserid(jsonObject.getStr("userid"));
dayMessage.setMsgid(jsonObject.getStr("msgid"));
dayMessage.setMsg(jsonObject.getStr("msg"));
return dayMessageM(dayMessage);
}
public Result dayMessageM(DayMessage dayMessage){
return new Result("-1","dayMessage接口未实现!"); return new Result("-1","dayMessage接口未实现!");
} }
@ -175,83 +229,182 @@ public class CommonImpl implements HISInterfaceService {
} }
public Result getReqInfo_brdh(String brdh, String brly, Date stime,Date etime,String userId,String yljg){ public Result getReqInfo_brdh(GetReqInterface getReqInterface){
// log.info("ceshi"); // log.info("ceshi");
return new Result("-1","根据病人代码获取病人申请单未定义接口"); return new Result("-1","根据病人代码获取病人申请单未定义接口");
} }
public Result getReqInfo_ksdh(String ksdh,Date stime,Date etime,String userId,String yljg){ public Result getReqInfo_ksdh(GetReqInterface getReqInterface){
return new Result("-1","根据科室获取申请单未定义接口"); return new Result("-1","根据科室获取申请单未定义接口");
} }
public Result getReqInfo_sqh(String sqh,String userId){ public Result getReqInfo_sqh(GetReqInterface getReqInterface){
return new Result("-1","根据条码获取申请单未定义接口"); return new Result("-1","根据条码获取申请单未定义接口");
} }
/** /**
* 获取科室 * 获取科室
* @param yljg * @param setDict
* @return * @return
*/ */
public Result getDictDP(String yljg){ public Result getDictDP(SetDict setDict){
return new Result("-1","获取科室字典接口未定义"); int j = 0;
Result result = getDictDPM(setDict.getYljg());
if (!result.getResultCode().equals("0")) return result;
List<ComDict> comDictList = (List<ComDict>) result.getData();
//对传入的数据进行去重处理
List<ComDict> comDictListNew = comDictList.stream()
.filter(distinctByKeys(ComDict::getZdlb, ComDict::getZddh)) // 传入要去重的字段getter
.collect(Collectors.toList());
List<ComDict> dpList = commonUtil.getComDictList("DP");
for (ComDict comDict : comDictListNew) {
String zddh = comDict.getZddh();
List<ComDict> collect = dpList.stream().filter(comDict1 -> comDict1.getZddh().equals(zddh)).collect(Collectors.toList());
if(collect.size() > 0) continue;
// ComDict comDict2 = new ComDict();
// comDict2.setZdlb("DP");
// comDict2.setZddh(zddh);
// comDict2.setZdmc(zdmc);
// comDict2.setYljg("1");
comDict.setZdbz("N");
String pinyin = PinyinUtil.getFirstLetter(comDict.getZdmc(), ""); //拼音首字母
if(pinyin.length() >= 9){
pinyin = pinyin.substring(0,8);
}
comDict.setZjf(pinyin);
commonUtil.insertComDict(comDict);
j++;
}
return new Result("0","获取科室字典成功!共:"+j+"条数据完成导入!");
}
public Result getDictDPM(String yljg,String ...param){
return new Result("-1","没有重载接口方法!");
} }
/** /**
* 获取套餐字典 * 获取套餐字典
* @param yljg * @param setDict
* @return * @return
*/ */
public Result getDictFEE(String yljg){ public Result getDictFEE(SetDict setDict){
return new Result("-1","获取套餐字典接口未定义"); int j = 0;
Result result = getDictFEEM(setDict.getYljg());
if (!result.getResultCode().equals("0")) return result;
List<XmFee> xmFeeHISList = (List<XmFee>) result.getData();
//对传入的数据进行去重处理
List<XmFee> xmFeeHISListNew = xmFeeHISList.stream()
.filter(distinctByKeys(XmFee::getSfxmdh)) // 传入要去重的字段getter
.collect(Collectors.toList());
List<XmFee> xmFeeList = commonUtil.getXmFeeList();
for (XmFee xmFee : xmFeeHISListNew) {
List<XmFee> collect = xmFeeList.stream().filter(xmFee1 -> xmFee1.getSfxmdh().equals(xmFee.getSfxmdh())).collect(Collectors.toList());
if(collect.size() > 0) continue;
String pinyin = PinyinUtil.getFirstLetter(xmFee.getSfxmmc(), ""); //拼音首字母
if(pinyin.length() >= 9){
pinyin = pinyin.substring(0,8);
}
xmFee.setZjf(pinyin);
xmFee.setXmlb("HIS");
xmFee.setBz(xmFee.getSfxmmc());
commonUtil.insertXmFee(xmFee);
j++;
}
return new Result("-1","获取收费项目套餐成功,共:"+j+"条数据导入成功!");
}
public Result getDictFEEM(String yljg,String ...param){
return new Result("-1","没有重载接口方法!");
} }
/** /**
* 获取人员字典 * 获取人员字典
* @param yljg * @param setDict
* @return * @return
*/ */
public Result getDictSRD(String yljg){ public Result getDictSRD(SetDict setDict){
return new Result("-1","获取人员字典接口未定义"); int j = 0;
//List<ComDict> comDictList = getDictSRDM(setDict.getYljg());
Result result = getDictSRDM(setDict.getYljg());
if (!result.getResultCode().equals("0")) return result;
List<ComDict> comDictList = (List<ComDict>) result.getData();
//对传入的数据进行去重处理
List<ComDict> comDictListNew = comDictList.stream()
.filter(distinctByKeys(ComDict::getZdlb, ComDict::getZddh)) // 传入要去重的字段getter
.collect(Collectors.toList());
List<ComDict> dpList = commonUtil.getComDictList("SRD");
for (ComDict comDict : comDictListNew) {
String zddh = comDict.getZddh();
List<ComDict> collect = dpList.stream().filter(comDict1 -> comDict1.getZddh().equals(zddh)).collect(Collectors.toList());
if(collect.size() > 0) continue;
String pinyin = PinyinUtil.getFirstLetter(comDict.getZdmc(), ""); //拼音首字母
if(pinyin.length() >= 9){
pinyin = pinyin.substring(0,8);
}
comDict.setZdbz("N");
comDict.setZjf(pinyin);
commonUtil.insertComDict(comDict);
j++;
}
return new Result("0","获取人员字典成功!共:"+j+"条数据完成导入!");
}
public Result getDictSRDM(String yljg,String ...param){
return new Result("-1","没有重载接口方法!");
} }
/** /**
* 获取病区字典 * 获取病区字典
* @param yljg * @param setDict
* @return * @return
*/ */
public Result getDictWR(String yljg){ public Result getDictWR(SetDict setDict){
return new Result("-1","获取病区字典接口未定义"); int j = 0;
} //List<ComDict> comDictList = getDictWRM(setDict.getYljg());
Result result = getDictWRM(setDict.getYljg());
if (!result.getResultCode().equals("0")) return result;
/** List<ComDict> comDictList = (List<ComDict>) result.getData();
* 在当前类及其父类(直到CommonImpl)中查找指定名称和参数的方法 //对传入的数据进行去重处理
* @param clazz 当前类的Class对象 List<ComDict> comDictListNew = comDictList.stream()
* @param methodName 方法名 .filter(distinctByKeys(ComDict::getZdlb, ComDict::getZddh)) // 传入要去重的字段getter
* @return 找到的方法,未找到则返回null .collect(Collectors.toList());
*/ List<ComDict> dpList = commonUtil.getComDictList("WR");
private Method findMethodInHierarchy(Class<?> clazz, String methodName) { for (ComDict comDict : comDictListNew) {
// 遍历类的继承链,直到CommonImpl为止(不包括Object) String zddh = comDict.getZddh();
while (clazz != null && !clazz.equals(Object.class)) { List<ComDict> collect = dpList.stream().filter(comDict1 -> comDict1.getZddh().equals(zddh)).collect(Collectors.toList());
try { if(collect.size() > 0) continue;
// 查找当前类中参数为String的public/protected/default/private方法 String pinyin = PinyinUtil.getFirstLetter(comDict.getZdmc(), ""); //拼音首字母
Method method = clazz.getDeclaredMethod(methodName, String.class); if(pinyin.length() >= 9){
// 允许访问私有/保护方法 pinyin = pinyin.substring(0,8);
method.setAccessible(true);
return method;
} catch (NoSuchMethodException e) {
// 当前类未找到,继续查找父类
clazz = clazz.getSuperclass();
// 若父类不是CommonImpl或其子类,停止遍历(避免无意义查找)
if (clazz != null && !CommonImpl.class.isAssignableFrom(clazz)) {
break;
}
} }
comDict.setZdbz("N");
comDict.setZjf(pinyin);
commonUtil.insertComDict(comDict);
j++;
} }
return null; return new Result("0","获取病区字典成功!共:"+j+"条数据完成导入!");
} }
public Result getDictWRM(String yljg,String ...param){
return new Result("-1","没有重载接口方法!");
}
public static <T> Predicate<T> distinctByKeys(Function<? super T, ?>... keyExtractors) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
return t -> {
// 提取对象的目标字段,组合成一个"唯一标识"
Object[] keys = Arrays.stream(keyExtractors)
.map(ke -> ke.apply(t))
.toArray();
// 判断这个组合是否已出现过
return seen.add(Arrays.hashCode(keys));
};
}

View File

@ -50,7 +50,7 @@ public class BaskCommonTask implements BaskTask {
} }
public Result sendReport(Date jyrq, String yq, String ybh, String status) { public Result sendReport(Date jyrq, String yq, String ybh, String status,String ...param) {
return null; return null;
} }

View File

@ -128,10 +128,9 @@ public class CommonUtil {
} }
@DSTransactional @DSTransactional
public Result updateSqd(String sqh, String bz2){ public Result updateSqd(String sqh){
UpdateWrapper<LabReqdetail> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<LabReqdetail> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("sqh",sqh); updateWrapper.eq("sqh",sqh);
updateWrapper.eq("bz2",bz2);
LabReqdetail labReqdetail = new LabReqdetail(); LabReqdetail labReqdetail = new LabReqdetail();
labReqdetail.setJjzt("1"); labReqdetail.setJjzt("1");
int update = labReqdetailMapper.update(labReqdetail, updateWrapper); int update = labReqdetailMapper.update(labReqdetail, updateWrapper);

View File

@ -0,0 +1,74 @@
package com.czlisinterface.jldermyy.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApplyOrder {
private String ApplyFormId;
private String UnitId;
private String UnitName;
private String ApplyNo;
private String VisitId;
private String VisitTimes;
private String VisitType;
private String PatientNo;
private String PatientId;
private String CardNo;
private String Name;
private String Sex;
private String Birthday;
private String BedNo;
private String AgeYear;
private String AgeMonth;
private String AgeDay;
private String Address;
private String Tel;
private String Idnumber;
private String DignosisType;
private String DignosisCode;
private String DiagnosisName;
private String OrderDeptId;
private String OrderDeptName;
private String PerformDeptId;
private String PerformDeptName;
private String PatientDeptId;
private String PatientDeptName;
private String PatientWardId;
private String PatientWardName;
private String OrderDoctorId;
private String OrderDoctorName;
private String OrderTime;
private String PerformNurseId;
private String PerformNurseName;
private String IsEmergency;
private String PreCheckTime;
private String GreenChanalType;
private String ApplyFormName;
private String ApplyFormTempleId;
private String ApplyFormType;
private String HistorySummary;
private String Note;
private String Remarks;
private String SrcDataId;
private String SrcSystemId;
private String ApplyFormSrcDataId;
private String DocIndexId;
private String FileType;
private String FileName;
private String OrderRowId;
private String OrderCode;
private String OrderName;
private String SampleTypeCode;
private String SampleTypeName;
private String InGroupNo;
private String Quantity;
private String OrderUnit;
private String Amount;
private String ChargMark;
private String ChargTime;
private String PerformStatus;
}

View File

@ -0,0 +1,14 @@
package com.czlisinterface.jldermyy.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeptList {
private String DeptId;
private String DeptName;
private String IsStop;
}

View File

@ -0,0 +1,18 @@
package com.czlisinterface.jldermyy.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ItemList {
private String ItemCode;
private String ItemName;
private String ItemClass;
private String ItemUnit;
private String ItemPrice;
private String ItemSpec;
private String IsStop;
}

View File

@ -0,0 +1,15 @@
package com.czlisinterface.jldermyy.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class UserList {
private String UserId;
private String UserCode;
private String PersonName;
private String IdNumber;
}

View File

@ -0,0 +1,14 @@
package com.czlisinterface.jldermyy.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class WardList {
private String WardId;
private String WardName;
private String IsStop;
}

View File

@ -0,0 +1,33 @@
package com.czlisinterface.jldermyy.task;
import com.czlisinterface.jldermyy.service.impl.Lisinterface_jldermyy;
import com.czlisinterface.system.pojo.Result;
import com.czlisinterface.system.task.BaskCommonTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import java.util.Date;
@Slf4j
@Configuration
@ConditionalOnProperty(name="lisinterface.task.job",havingValue = "jldermyy_new1")
public class JldermyyTask extends BaskCommonTask {
@Resource
Lisinterface_jldermyy lisinterfaceJldermyy;
@Override
public void execute() {
sendReportTask();
}
@Override
public Result sendReport(Date jyrq, String yq, String ybh, String status, String... param) {
return lisinterfaceJldermyy.sendHISReport(jyrq,yq,ybh,status);
}
}