jh-dependencies/pom.xml
@@ -75,6 +75,7 @@ <justauth.version>1.0.8</justauth.version> <jimureport.version>1.7.8</jimureport.version> <xercesImpl.version>2.12.2</xercesImpl.version> <jackson-dataformat-xml.version>2.14.0</jackson-dataformat-xml.version> <weixin-java.version>4.6.0</weixin-java.version> </properties> @@ -623,6 +624,11 @@ <artifactId>xercesImpl</artifactId> <version>${xercesImpl.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> <version>${jackson-dataformat-xml.version}</version> </dependency> </dependencies> </dependencyManagement> jh-framework/jh-common/src/main/java/cn/lihu/jh/framework/common/util/date/DateUtils.java
@@ -3,6 +3,7 @@ import cn.hutool.core.date.LocalDateTimeUtil; import java.time.*; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; @@ -175,4 +176,10 @@ return LocalDateTimeUtil.isSameDay(date, LocalDateTime.now().minusDays(1)); } public static String getCurTimeString() { DateTimeFormatter formatter = DateTimeFormatter.ofPattern(FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); LocalDateTime now = LocalDateTime.now(); return now.format(formatter); } } jh-framework/jh-spring-boot-starter-security/src/main/java/cn/lihu/jh/framework/security/core/LoginUser.java
@@ -20,6 +20,7 @@ public static final String INFO_KEY_NICKNAME = "nickname"; public static final String INFO_KEY_DEPT_ID = "deptId"; public static final String INFO_KEY_HIS_ID = "hisId"; /** * ç¨æ·ç¼å· jh-framework/jh-spring-boot-starter-security/src/main/java/cn/lihu/jh/framework/security/core/util/SecurityFrameworkUtils.java
@@ -102,6 +102,17 @@ } /** * è·å¾å½åç¨æ·çHis Idï¼ä»ä¸ä¸æä¸ * * @return hisId */ @Nullable public static String getLoginUserHisId() { LoginUser loginUser = getLoginUser(); return loginUser != null ? MapUtil.getStr(loginUser.getInfo(), LoginUser.INFO_KEY_HIS_ID) : null; } /** * è·å¾å½åç¨æ·çé¨é¨ç¼å·ï¼ä»ä¸ä¸æä¸ * * @return é¨é¨ç¼å· jh-module-ecg/jh-module-ecg-biz/pom.xml
@@ -126,6 +126,11 @@ </dependency> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> <version>${openfeign.version}</version> jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java
@@ -18,4 +18,6 @@ String wardCode; String wardDesc; String bedNo; Integer source; String applyNo; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/ExmRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,47 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public class ExmRequest { private String authorOrganization; private String requestId; private String patientType; private Item item; @JacksonXmlProperty(localName = "AuthorOrganization") public String getAuthorOrganization() { return authorOrganization; } public void setAuthorOrganization(String authorOrganization) { this.authorOrganization = authorOrganization; } @JacksonXmlProperty(localName = "RequestId") public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } @JacksonXmlProperty(localName = "PatientType") public String getPatientType() { return patientType; } public void setPatientType(String patientType) { this.patientType = patientType; } @JacksonXmlProperty(localName = "Item") public Item getItem() { return item; } public void setItem(Item item) { this.item = item; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/HisFeeConfirmReqBody.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,31 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; @JacksonXmlRootElement(localName = "BSXml") public class HisFeeConfirmReqBody { private MsgHeader msgHeader; private ExmRequest exmRequest; @JacksonXmlProperty(localName = "MsgHeader") public MsgHeader getMsgHeader() { return msgHeader; } public void setMsgHeader(MsgHeader msgHeader) { this.msgHeader = msgHeader; } @JacksonXmlProperty(localName = "ExmRequest") public ExmRequest getExmRequest() { return exmRequest; } public void setExmRequest(ExmRequest exmRequest) { this.exmRequest = exmRequest; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/HisFeeConfirmRespResult.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; @JacksonXmlRootElement(localName = "BSXml") public class HisFeeConfirmRespResult { private MsgRespHeader msgHeader; @JacksonXmlProperty(localName = "MsgHeader") public MsgRespHeader getMsgHeader() { return msgHeader; } public void setMsgHeader(MsgRespHeader msgHeader) { this.msgHeader = msgHeader; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/Item.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public class Item { private String itemCode; private String itemStatus; private String exeOrganization; private String exeDeptName; private String exeDept; private String exeDoctor; private String exeDoctorName; private String exeDateTime; @JacksonXmlProperty(localName = "ItemCode") public String getItemCode() { return itemCode; } public void setItemCode(String itemCode) { this.itemCode = itemCode; } @JacksonXmlProperty(localName = "ItemStatus") public String getItemStatus() { return itemStatus; } public void setItemStatus(String itemStatus) { this.itemStatus = itemStatus; } @JacksonXmlProperty(localName = "ExeOrganization") public String getExeOrganization() { return exeOrganization; } public void setExeOrganization(String exeOrganization) { this.exeOrganization = exeOrganization; } @JacksonXmlProperty(localName = "ExeDeptName") public String getExeDeptName() { return exeDeptName; } public void setExeDeptName(String exeDeptName) { this.exeDeptName = exeDeptName; } @JacksonXmlProperty(localName = "ExeDept") public String getExeDept() { return exeDept; } public void setExeDept(String exeDept) { this.exeDept = exeDept; } @JacksonXmlProperty(localName = "ExeDoctor") public String getExeDoctor() { return exeDoctor; } public void setExeDoctor(String exeDoctor) { this.exeDoctor = exeDoctor; } @JacksonXmlProperty(localName = "ExeDoctorName") public String getExeDoctorName() { return exeDoctorName; } public void setExeDoctorName(String exeDoctorName) { this.exeDoctorName = exeDoctorName; } @JacksonXmlProperty(localName = "ExeDateTime") public String getExeDateTime() { return exeDateTime; } public void setExeDateTime(String exeDateTime) { this.exeDateTime = exeDateTime; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/MsgHeader.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,37 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public class MsgHeader { private String sender; private String msgType; private String msgVersion; @JacksonXmlProperty(localName = "Sender") public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; } @JacksonXmlProperty(localName = "MsgType") public String getMsgType() { return msgType; } public void setMsgType(String msgType) { this.msgType = msgType; } @JacksonXmlProperty(localName = "MsgVersion") public String getMsgVersion() { return msgVersion; } public void setMsgVersion(String msgVersion) { this.msgVersion = msgVersion; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/MsgRespHeader.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@ package cn.lihu.jh.module.ecg.feign; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public class MsgRespHeader { private String status; private String detail; @JacksonXmlProperty(localName = "Status") public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } @JacksonXmlProperty(localName = "Detail") public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/RemoteDataService.java
@@ -12,4 +12,10 @@ @RequestParam("urid") String urid, @RequestParam("pwd") String pwd, @RequestBody RestApiReqBodyVo bodyVo); @PostMapping(value="/hai/HttpEntry/", produces = MediaType.APPLICATION_XML_VALUE/*, consumes = MediaType.APPLICATION_JSON_VALUE*/) public HisFeeConfirmRespResult httpFeeApi( @RequestParam("service") String service, @RequestParam("urid") String urid, @RequestParam("pwd") String pwd, @RequestBody HisFeeConfirmReqBody bodyVo); } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/feign/dto/AppointmentExternal.java
@@ -9,6 +9,7 @@ import java.util.Date; public class AppointmentExternal { @JsonProperty private String ReqIdeApplyno; private String ReqStatus; private String ReqCodeItemclass; @@ -19,6 +20,7 @@ private String OutMedNO; private String InMedNO; private String VisitNum; @JsonProperty private String AdmTypeCode; private String AdmTypeDesc; private String AdmStatus; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -73,7 +73,6 @@ AppointmentDO appointment = BeanUtils.toBean(createReqVO, AppointmentDO.class); appointment.setBookTime( LocalDateTime.now() ); appointment.setBookSrc( 1 ); try { appointmentMapper.insert(appointment); @@ -203,6 +202,7 @@ appointmentDO.setBookId(appointmentExternal.getReqIdeApplyno()); appointmentDO.setBookCheckType(getCorrespondingCheckType(appointmentExternal.getPlanDefItemList().getPlanDefItem().getPlanDefItemcode())); appointmentDO.setBookTime(DateUtils.ofUTC(appointmentExternal.getReqAuthoredOn())); // å¼åæ¶é´ appointmentDO.setBookSrc( getBookSource(appointmentExternal.getAdmTypeCode()) ); // å å¼åçæ åµï¼æ²¡æé¢çº¦æ¶é´ if (null != appointmentExternal.getReqExtBooktime() ) { @@ -212,8 +212,7 @@ appointmentDO.setBookTimeslot((bookStartTime.getHour() * 100 + bookStartTime.getMinute()) * 10000 + bookEndTime.getHour() * 100 + bookEndTime.getMinute()); } appointmentDO.setBookSrc(0); appointmentDO.setPaid(1); appointmentDO.setPaid( 0 ); // TODO curAppointDOList.add( appointmentDO ); } @@ -264,6 +263,19 @@ } return newSeqNo; } private Integer getBookSource(String admTypeCode) { if (admTypeCode.equals("AMB")) // é¨è¯ return 1; else if (admTypeCode.equals("EMER")) // æ¥è¯ return 2; else if (admTypeCode.equals("PHY")) // 使£ return 3; else if (admTypeCode.equals("IMP")) // ä½é¢ return 4; return 1; } private Integer getCorrespondingCheckType(String strPlanDefItemcode) { @@ -324,6 +336,8 @@ patDetails.setWardCode( appointment.getPatWardCode() ); patDetails.setWardDesc( appointment.getPatWardDesc() ); patDetails.setBedNo( appointment.getPatBedNo() ); patDetails.setSource( appointment.getPatSrc() ); patDetails.setApplyNo( appointment.getApplyNo() ); return patDetails; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -3,6 +3,7 @@ import cn.lihu.jh.framework.common.pojo.CommonResult; import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils; import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.JobRecordSaveReqVO; import cn.lihu.jh.module.ecg.dal.dataobject.appointment.AppointmentDO; import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO; import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO; @@ -14,11 +15,16 @@ import cn.lihu.jh.module.ecg.enums.DevRentStateEnum; import cn.lihu.jh.module.ecg.enums.DevStateEnum; import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; import cn.lihu.jh.module.ecg.feign.*; import cn.lihu.jh.module.ecg.feign.dto.AppointmentExternal; import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.io.Console; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; @@ -35,6 +41,8 @@ import javax.annotation.Resource; import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.lihu.jh.framework.common.util.date.DateUtils.getCurTimeString; import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*; /** @@ -48,6 +56,9 @@ @Resource QueueServiceTxFunctions queueServiceTxFunctions; @Resource private RemoteDataService remoteDataService; @Resource private DevRentMapper devRentMapper; @@ -74,8 +85,9 @@ Long userId = SecurityFrameworkUtils.getLoginUserId(); String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); String userHisId = SecurityFrameworkUtils.getLoginUserHisId(); // åæ · å¨é¢çº¦ç¡®å®æ¶ å°±è¿å ¥ [dev_rent] è¡¨äº // åæ · å¨é¢çº¦ç¡®è®¤æ¶ å°±è¿å ¥ [dev_rent] è¡¨äº Long rent_id = createReqVO.getId(); List<Integer> jobTypeList = new ArrayList<Integer>(); @@ -141,6 +153,8 @@ procAffinityWhenRoutineFinish( firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes() ); } // 确费å¤ç feeConfirm(firstOnStageQueueItem, userHisId, userNickname); return CommonResult.success(rent_id); } @@ -814,5 +828,79 @@ } } private void feeConfirm(QueueDO queueItem, String hisId, String userNickname, Boolean isFeeConfirmCancel) throws JsonProcessingException { PatDetails patDetails = queueItem.getPatDetails(); HisFeeConfirmReqBody hisFeeConfirmReqBody = new HisFeeConfirmReqBody(); MsgHeader msgHeader = new MsgHeader(); msgHeader.setMsgType("ODS_2212"); msgHeader.setMsgVersion("3.0"); msgHeader.setSender("ECG"); hisFeeConfirmReqBody.setMsgHeader(msgHeader); Item item = new Item(); item.setItemCode( getHisCheckCode(queueItem.getBookCheckType()) ); // item.setItemStatus( isFeeConfirmCancel? "6" : "5" ); // item.setExeOrganization("47162057-2"); item.setExeDeptName("å¿çµç§"); item.setExeDept("å¿çµç§"); item.setExeDoctor( hisId ); // item.setExeDoctorName( userNickname ); // item.setExeDateTime( getCurTimeString() ); // ExmRequest exmRequest = new ExmRequest(); exmRequest.setAuthorOrganization("47162057-2"); exmRequest.setRequestId( patDetails.getApplyNo() ); // exmRequest.setPatientType( getPatientType(patDetails.getSource()) ); // exmRequest.setItem(item); hisFeeConfirmReqBody.setExmRequest(exmRequest); HisFeeConfirmRespResult result = remoteDataService.httpFeeApi("UpdateExmRequestStatus", "ECG", "ECG", hisFeeConfirmReqBody); result.getMsgHeader().getStatus(); } private String getHisCheckCode(Integer checkType) { if (100 == checkType) return "691133607"; else if (200 == checkType) return "201605"; else if (300 == checkType) return "200327"; else if (400 == checkType) return "201652"; else if (500 == checkType) return "502490914"; else if (600 == checkType) return "419562119"; else if (700 == checkType) return "201604"; else if (800 == checkType) return "1202042"; else if (900 == checkType) return "1202058"; else if (1000 == checkType) return "1202065"; else if (1100 == checkType) return "559542128"; else if (1200 == checkType) return "590244511"; else if (1300 == checkType) return "666454217"; else if (1400 == checkType) return "720791490"; else if (1500 == checkType) return "720792077"; return "691133607"; } String getPatientType( Integer patientSource ) { if (1 == patientSource || 2 == patientSource) return "01"; else if (3 == patientSource) return "03"; else if (4 == patientSource) return "04"; return "01"; } } jh-module-ecg/jh-module-ecg-biz/src/test/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImplTest.java
@@ -5,6 +5,12 @@ import cn.lihu.jh.module.ecg.dal.mysql.appointment.AppointmentMapper; import cn.lihu.jh.framework.common.pojo.PageResult; import cn.lihu.jh.module.ecg.feign.ExmRequest; import cn.lihu.jh.module.ecg.feign.HisFeeConfirmReqBody; import cn.lihu.jh.module.ecg.feign.Item; import cn.lihu.jh.module.ecg.feign.MsgHeader; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.junit.Test; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -53,4 +59,32 @@ System.out.println("Domain: " + Integer.valueOf(domain)); } } @Test public void test2() throws JsonProcessingException { HisFeeConfirmReqBody hisFeeConfirmReqBody = new HisFeeConfirmReqBody(); MsgHeader msgHeader = new MsgHeader(); msgHeader.setMsgType("ODS_2212"); msgHeader.setMsgVersion("3.0"); msgHeader.setSender("ECG"); hisFeeConfirmReqBody.setMsgHeader(msgHeader); Item item = new Item(); item.setItemCode("559542128"); item.setItemStatus("5"); item.setExeOrganization("47162057-2"); item.setExeDeptName("å¿çµç§"); item.setExeDept("å¿çµç§"); item.setExeDoctor("0457"); item.setExeDoctorName("å¾å°è±"); item.setExeDateTime("2024-11-21 16:28:28"); ExmRequest exmRequest = new ExmRequest(); exmRequest.setAuthorOrganization("47162057-2"); exmRequest.setRequestId("815769404"); exmRequest.setPatientType("01"); exmRequest.setItem(item); hisFeeConfirmReqBody.setExmRequest(exmRequest); XmlMapper xmlMapper = new XmlMapper(); String xml = xmlMapper.writeValueAsString(hisFeeConfirmReqBody); System.out.println(xml); } } jh-module-system/jh-module-system-api/src/main/java/cn/lihu/jh/module/system/api/user/dto/AdminUserRespDTO.java
@@ -48,5 +48,5 @@ * HISç³»ç»ä¸ç¨æ·ç¼å· * */ private Integer hisId; private String hisId; } jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/controller/admin/user/vo/user/UserRespVO.java
@@ -57,7 +57,7 @@ private String avatar; @Schema(description = "Hisç¨æ·ç¼å·", example = "9999") private Integer hisId; private String hisId; @Schema(description = "ç¶æï¼åè§ CommonStatusEnum æä¸¾ç±»", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty(value = "å¸å·ç¶æ", converter = DictConvert.class) jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/controller/admin/user/vo/user/UserSaveReqVO.java
@@ -65,7 +65,7 @@ private String avatar; @Schema(description = "HISç¼å·", example = "9999") private Integer hisId; private String hisId; // ========== ä» ãåå»ºãæ¶ï¼éè¦ä¼ éçåæ®µ ========== jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/dal/dataobject/user/AdminUserDO.java
@@ -82,7 +82,7 @@ * HISç³»ç»ä¸ç¨æ·ç¼å· * */ private Integer hisId; private String hisId; /** * å¸å·ç¶æ * jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/service/oauth2/OAuth2TokenServiceImpl.java
@@ -191,7 +191,9 @@ if (userType.equals(UserTypeEnum.ADMIN.getValue())) { AdminUserDO user = adminUserService.getUser(userId); return MapUtil.builder(LoginUser.INFO_KEY_NICKNAME, user.getNickname()) .put(LoginUser.INFO_KEY_DEPT_ID, StrUtil.toStringOrNull(user.getDeptId())).build(); .put(LoginUser.INFO_KEY_DEPT_ID, StrUtil.toStringOrNull(user.getDeptId())) .put(LoginUser.INFO_KEY_HIS_ID, user.getHisId()) .build(); } else if (userType.equals(UserTypeEnum.MEMBER.getValue())) { // 注æï¼ç®å Member ææ¶ä¸è¯»åï¼å¯ä»¥æéå®ç° return Collections.emptyMap();