Ver código fonte

Merge remote-tracking branch 'origin/master'

lenovodn 2 anos atrás
pai
commit
6038a395ec
43 arquivos alterados com 2900 adições e 172 exclusões
  1. 48 0
      jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/HttpUtils.java
  2. 22 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/Constant.java
  3. 17 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/HisController.java
  4. 14 13
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MedicalInsuranceDrugsController.java
  5. 178 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MidIncidentVisitDetailLogController.java
  6. 178 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MidIncidentVisitLogController.java
  7. 1 16
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AdvanceWarningAudit.java
  8. 19 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AdviceDetailsVO.java
  9. 8 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AfterwardsAuditDetail.java
  10. 8 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/DiagnosesVO.java
  11. 0 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsRuleInfo.java
  12. 25 19
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsuranceDrugs.java
  13. 6 20
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAudit.java
  14. 16 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAuditDetail.java
  15. 195 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentVisitDetailLog.java
  16. 90 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentVisitLog.java
  17. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentVisitDetailLogMapper.java
  18. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentVisitLogMapper.java
  19. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentVisitDetailLogMapper.xml
  20. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentVisitLogMapper.xml
  21. 40 25
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/FactorEnchangeFactory.java
  22. 165 22
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/RuleEngine.java
  23. 95 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/dict/DictUtil.java
  24. 9 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/plugin/InterfItemListPlugin.java
  25. 86 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/projectcache/HisMedicalProjectCache.java
  26. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMedicalInsuranceDrugsService.java
  27. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentVisitDetailLogService.java
  28. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentVisitLogService.java
  29. 111 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsuranceDrugsServiceImpl.java
  30. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentVisitDetailLogServiceImpl.java
  31. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentVisitLogServiceImpl.java
  32. 375 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitDetailLogList.vue
  33. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitDetailLog_menu_insert.sql
  34. 234 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitLogList.vue
  35. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitLog_menu_insert.sql
  36. 274 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogForm.vue
  37. 84 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogModal.Style#Drawer.vue
  38. 60 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogModal.vue
  39. 154 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogForm.vue
  40. 84 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogModal.Style#Drawer.vue
  41. 60 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogModal.vue
  42. 27 21
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java
  43. 36 0
      jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/SpelTest.java

+ 48 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/HttpUtils.java

@@ -184,4 +184,52 @@ public class HttpUtils {
         }
         return result;
     }
+
+    public static String getIPAddress(HttpServletRequest request) {
+        String ip = null;
+        //X-Forwarded-For:Squid 服务代理
+        String ipAddresses = request.getHeader("X-Forwarded-For");
+        log.info("IPWEIOriginal"+ipAddresses);
+        if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            //X-Real-IP:nginx服务代理
+            ipAddresses = request.getHeader("X-Original-Forwarded-For");
+            log.info("IPWEIOriginal"+request.getHeader(" X-Original-Forwarded-For"));
+        }
+        if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            //Proxy-Client-IP:apache 服务代理
+            ipAddresses = request.getHeader("Proxy-Client-IP");
+            log.info("IPWEIipapache"+request.getHeader("Proxy-Client-IP"));
+        }
+
+        if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            //WL-Proxy-Client-IP:weblogic 服务代理
+            ipAddresses = request.getHeader("WL-Proxy-Client-IP");
+            log.info("IPWEIweblogic"+request.getHeader("WL-Proxy-Client-IP"));
+        }
+
+        if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            //HTTP_CLIENT_IP:有些代理服务器
+            ipAddresses = request.getHeader("HTTP_CLIENT_IP");
+            log.info("IPWEIHTTP_CLIENT_IP"+request.getHeader("HTTP_CLIENT_IP"));
+        }
+
+        if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            //X-Real-IP:nginx服务代理
+            ipAddresses = request.getHeader("X-Real-IP");
+            log.info("IPWEInginx"+request.getHeader("X-Real-IP"));
+        }
+
+        //有些网络通过多层代理,那么获取到的ip就会有多个,一般都是通过逗号(,)分割开来,并且第一个ip为客户端的真实IP
+        if (ipAddresses != null && ipAddresses.length() != 0) {
+            ip = ipAddresses.split(",")[0];
+
+        }
+
+        //还是不能获取到,最后再通过request.getRemoteAddr();获取
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
+            ip = request.getRemoteAddr();
+            log.info("IPWEIRemoteAddr"+request.getRemoteAddr());
+        }
+        return ip;
+    }
 }

+ 22 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/Constant.java

@@ -45,4 +45,26 @@ public class Constant {
     public static final String OR = "||";
 
     public static final Integer WARING_EVENT_ATTR_ID = -1;
+    //
+    public static final String PROJECT_CODE_KEY = "project_code";
+    public static final String PROJECT_NAME_KEY = "project_name";
+    //医保编码的key
+    public static final String MEDICAL_PROJECT_CODE_KEY = "medical_project_code";
+    //医保名称的key
+    public static final String MEDICAL_PROJECT_NAME_KEY = "medical_project_name";
+    //医院诊断编码的key
+    public static final String DIAGNOSE_CODE_KEY = "diagnose_code";
+    //医院诊断名称的key
+    public static final String DIAGNOSE_NAME_KEY = "diagnose_name";
+    //医保诊断编码的key
+    public static final String MEDICAL_DIAGNOSE_CODE_KEY = "medical_diagnose_code";
+    //医保诊断名称的key
+    public static final String MEDICAL_DIAGNOSE_NAME_KEY = "medical_diagnose_name";
+    //医院和医保字段转换缓存key
+    public static final String HIS_MEDICAL_DICT_KEY = "HIS_MEDICAL_DICT_KEY";
+
+    //医保中心编码和名称的映射关系
+    public static final String MEDICAL_CODE_NAME_KEY = "MEDICAL_CODE_NAME_KEY";
+    public static final String PROJECT_TYPE_KEY = "project_type";
+//    public static final String PROJECT_CODE_KEY = "project_code";
 }

+ 17 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/HisController.java

@@ -1,5 +1,9 @@
 package org.jeecg.modules.medical.controller;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.map.MapUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,9 +15,11 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.config.sign.util.HttpUtils;
 import org.jeecg.modules.medical.entity.AdvanceWarningVO;
 import org.jeecg.modules.medical.entity.Audit;
 import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
+import org.jeecg.modules.medical.ruleengine.RuleEngine;
 import org.jeecg.modules.medical.service.IAuditService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -29,6 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
+import java.util.Map;
 
 /**
 * @Description: audit
@@ -36,13 +43,15 @@ import java.util.Arrays;
 * @Date:   2023-04-23
 * @Version: V1.0
 */
-@Api(tags="check")
+@Api(tags="事中提醒")
 @RestController
 @RequestMapping("/his/check")
 @Slf4j
 public class HisController extends JeecgController<Audit, IAuditService> {
    @Autowired
    private IAuditService auditService;
+   @Autowired
+   private RuleEngine ruleEngine;
 
    /**
     * 分页列表查询
@@ -90,8 +99,13 @@ public class HisController extends JeecgController<Audit, IAuditService> {
     @AutoLog(value = "事中提醒")
     @ApiOperation(value="事中提醒接口", notes="事中提醒接口调用")
     @PostMapping(value = "/midIncidentWarning")
-    public Result<String> midIncidentWarning(@RequestBody MidIncidentWarningVO midIncidentWarningVO) {
-
+    public Result<String> midIncidentWarning(@RequestBody MidIncidentWarningVO midIncidentWarningVO,HttpServletRequest httpServletRequest) {
+        String jsonStr = JSON.toJSONString(midIncidentWarningVO);
+        String ipStr = HttpUtils.getIPAddress(httpServletRequest);
+        log.info("远端请求的服务ip地址:{}", ipStr);
+        log.info("事中提醒接收报文:{}", jsonStr);
+        JSONObject paramMap = JSON.parseObject(jsonStr);
+        ruleEngine.dealMidInterfaceEngin("midIncidentWarning", paramMap, midIncidentWarningVO, ipStr);
         return Result.OK("添加成功!");
     }
 

+ 14 - 13
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MedicalInsuranceDrugsController.java

@@ -50,7 +50,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsuranceDrugs, IMedicalInsuranceDrugsService> {
 	@Autowired
 	private IMedicalInsuranceDrugsService medicalInsuranceDrugsService;
-	
+
 	/**
 	 * 分页列表查询
 	 *
@@ -72,7 +72,7 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
 		IPage<MedicalInsuranceDrugs> pageList = medicalInsuranceDrugsService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -81,13 +81,13 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
 	 */
 	@AutoLog(value = "medical_insurance_drugs-添加")
 	@ApiOperation(value="medical_insurance_drugs-添加", notes="medical_insurance_drugs-添加")
-	@RequiresPermissions("medical:medical_insurance_drugs:add")
+//	@RequiresPermissions("medical:medical_insurance_drugs:add")
 	@PostMapping(value = "/add")
 	public Result<String> add(@RequestBody MedicalInsuranceDrugs medicalInsuranceDrugs) {
 		medicalInsuranceDrugsService.save(medicalInsuranceDrugs);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -96,13 +96,13 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
 	 */
 	@AutoLog(value = "medical_insurance_drugs-编辑")
 	@ApiOperation(value="medical_insurance_drugs-编辑", notes="medical_insurance_drugs-编辑")
-	@RequiresPermissions("medical:medical_insurance_drugs:edit")
+//	@RequiresPermissions("medical:medical_insurance_drugs:edit")
 	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
 	public Result<String> edit(@RequestBody MedicalInsuranceDrugs medicalInsuranceDrugs) {
 		medicalInsuranceDrugsService.updateById(medicalInsuranceDrugs);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -111,13 +111,13 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
 	 */
 	@AutoLog(value = "medical_insurance_drugs-通过id删除")
 	@ApiOperation(value="medical_insurance_drugs-通过id删除", notes="medical_insurance_drugs-通过id删除")
-	@RequiresPermissions("medical:medical_insurance_drugs:delete")
+//	@RequiresPermissions("medical:medical_insurance_drugs:delete")
 	@DeleteMapping(value = "/delete")
 	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
 		medicalInsuranceDrugsService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -126,13 +126,13 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
 	 */
 	@AutoLog(value = "medical_insurance_drugs-批量删除")
 	@ApiOperation(value="medical_insurance_drugs-批量删除", notes="medical_insurance_drugs-批量删除")
-	@RequiresPermissions("medical:medical_insurance_drugs:deleteBatch")
+//	@RequiresPermissions("medical:medical_insurance_drugs:deleteBatch")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
 		this.medicalInsuranceDrugsService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *
@@ -156,7 +156,7 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
     * @param request
     * @param medicalInsuranceDrugs
     */
-    @RequiresPermissions("medical:medical_insurance_drugs:exportXls")
+//    @RequiresPermissions("medical:medical_insurance_drugs:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, MedicalInsuranceDrugs medicalInsuranceDrugs) {
         return super.exportXls(request, medicalInsuranceDrugs, MedicalInsuranceDrugs.class, "medical_insurance_drugs");
@@ -169,10 +169,11 @@ public class MedicalInsuranceDrugsController extends JeecgController<MedicalInsu
     * @param response
     * @return
     */
-    @RequiresPermissions("medical:medical_insurance_drugs:importExcel")
+//    @RequiresPermissions("medical:medical_insurance_drugs:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, MedicalInsuranceDrugs.class);
+		return medicalInsuranceDrugsService.importExcel(request, response);
+//        return super.importExcel(request, response, MedicalInsuranceDrugs.class);
     }
 
 }

+ 178 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MidIncidentVisitDetailLogController.java

@@ -0,0 +1,178 @@
+package org.jeecg.modules.medical.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.medical.entity.MidIncidentVisitDetailLog;
+import org.jeecg.modules.medical.service.IMidIncidentVisitDetailLogService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: mid_incident_visit_detail_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:44
+ * @Version: V1.0
+ */
+@Api(tags="mid_incident_visit_detail_log")
+@RestController
+@RequestMapping("/medical/midIncidentVisitDetailLog")
+@Slf4j
+public class MidIncidentVisitDetailLogController extends JeecgController<MidIncidentVisitDetailLog, IMidIncidentVisitDetailLogService> {
+	@Autowired
+	private IMidIncidentVisitDetailLogService midIncidentVisitDetailLogService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param midIncidentVisitDetailLog
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "mid_incident_visit_detail_log-分页列表查询")
+	@ApiOperation(value="mid_incident_visit_detail_log-分页列表查询", notes="mid_incident_visit_detail_log-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<MidIncidentVisitDetailLog>> queryPageList(MidIncidentVisitDetailLog midIncidentVisitDetailLog,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<MidIncidentVisitDetailLog> queryWrapper = QueryGenerator.initQueryWrapper(midIncidentVisitDetailLog, req.getParameterMap());
+		Page<MidIncidentVisitDetailLog> page = new Page<MidIncidentVisitDetailLog>(pageNo, pageSize);
+		IPage<MidIncidentVisitDetailLog> pageList = midIncidentVisitDetailLogService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param midIncidentVisitDetailLog
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_detail_log-添加")
+	@ApiOperation(value="mid_incident_visit_detail_log-添加", notes="mid_incident_visit_detail_log-添加")
+	@RequiresPermissions("medical:mid_incident_visit_detail_log:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody MidIncidentVisitDetailLog midIncidentVisitDetailLog) {
+		midIncidentVisitDetailLogService.save(midIncidentVisitDetailLog);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param midIncidentVisitDetailLog
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_detail_log-编辑")
+	@ApiOperation(value="mid_incident_visit_detail_log-编辑", notes="mid_incident_visit_detail_log-编辑")
+	@RequiresPermissions("medical:mid_incident_visit_detail_log:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody MidIncidentVisitDetailLog midIncidentVisitDetailLog) {
+		midIncidentVisitDetailLogService.updateById(midIncidentVisitDetailLog);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_detail_log-通过id删除")
+	@ApiOperation(value="mid_incident_visit_detail_log-通过id删除", notes="mid_incident_visit_detail_log-通过id删除")
+	@RequiresPermissions("medical:mid_incident_visit_detail_log:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		midIncidentVisitDetailLogService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_detail_log-批量删除")
+	@ApiOperation(value="mid_incident_visit_detail_log-批量删除", notes="mid_incident_visit_detail_log-批量删除")
+	@RequiresPermissions("medical:mid_incident_visit_detail_log:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.midIncidentVisitDetailLogService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "mid_incident_visit_detail_log-通过id查询")
+	@ApiOperation(value="mid_incident_visit_detail_log-通过id查询", notes="mid_incident_visit_detail_log-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<MidIncidentVisitDetailLog> queryById(@RequestParam(name="id",required=true) String id) {
+		MidIncidentVisitDetailLog midIncidentVisitDetailLog = midIncidentVisitDetailLogService.getById(id);
+		if(midIncidentVisitDetailLog==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(midIncidentVisitDetailLog);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param midIncidentVisitDetailLog
+    */
+    @RequiresPermissions("medical:mid_incident_visit_detail_log:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, MidIncidentVisitDetailLog midIncidentVisitDetailLog) {
+        return super.exportXls(request, midIncidentVisitDetailLog, MidIncidentVisitDetailLog.class, "mid_incident_visit_detail_log");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("medical:mid_incident_visit_detail_log:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, MidIncidentVisitDetailLog.class);
+    }
+
+}

+ 178 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MidIncidentVisitLogController.java

@@ -0,0 +1,178 @@
+package org.jeecg.modules.medical.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.medical.entity.MidIncidentVisitLog;
+import org.jeecg.modules.medical.service.IMidIncidentVisitLogService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: mid_incident_visit_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:36
+ * @Version: V1.0
+ */
+@Api(tags="mid_incident_visit_log")
+@RestController
+@RequestMapping("/medical/midIncidentVisitLog")
+@Slf4j
+public class MidIncidentVisitLogController extends JeecgController<MidIncidentVisitLog, IMidIncidentVisitLogService> {
+	@Autowired
+	private IMidIncidentVisitLogService midIncidentVisitLogService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param midIncidentVisitLog
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "mid_incident_visit_log-分页列表查询")
+	@ApiOperation(value="mid_incident_visit_log-分页列表查询", notes="mid_incident_visit_log-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<MidIncidentVisitLog>> queryPageList(MidIncidentVisitLog midIncidentVisitLog,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<MidIncidentVisitLog> queryWrapper = QueryGenerator.initQueryWrapper(midIncidentVisitLog, req.getParameterMap());
+		Page<MidIncidentVisitLog> page = new Page<MidIncidentVisitLog>(pageNo, pageSize);
+		IPage<MidIncidentVisitLog> pageList = midIncidentVisitLogService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param midIncidentVisitLog
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_log-添加")
+	@ApiOperation(value="mid_incident_visit_log-添加", notes="mid_incident_visit_log-添加")
+	@RequiresPermissions("medical:mid_incident_visit_log:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody MidIncidentVisitLog midIncidentVisitLog) {
+		midIncidentVisitLogService.save(midIncidentVisitLog);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param midIncidentVisitLog
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_log-编辑")
+	@ApiOperation(value="mid_incident_visit_log-编辑", notes="mid_incident_visit_log-编辑")
+	@RequiresPermissions("medical:mid_incident_visit_log:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody MidIncidentVisitLog midIncidentVisitLog) {
+		midIncidentVisitLogService.updateById(midIncidentVisitLog);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_log-通过id删除")
+	@ApiOperation(value="mid_incident_visit_log-通过id删除", notes="mid_incident_visit_log-通过id删除")
+	@RequiresPermissions("medical:mid_incident_visit_log:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		midIncidentVisitLogService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "mid_incident_visit_log-批量删除")
+	@ApiOperation(value="mid_incident_visit_log-批量删除", notes="mid_incident_visit_log-批量删除")
+	@RequiresPermissions("medical:mid_incident_visit_log:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.midIncidentVisitLogService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "mid_incident_visit_log-通过id查询")
+	@ApiOperation(value="mid_incident_visit_log-通过id查询", notes="mid_incident_visit_log-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<MidIncidentVisitLog> queryById(@RequestParam(name="id",required=true) String id) {
+		MidIncidentVisitLog midIncidentVisitLog = midIncidentVisitLogService.getById(id);
+		if(midIncidentVisitLog==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(midIncidentVisitLog);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param midIncidentVisitLog
+    */
+    @RequiresPermissions("medical:mid_incident_visit_log:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, MidIncidentVisitLog midIncidentVisitLog) {
+        return super.exportXls(request, midIncidentVisitLog, MidIncidentVisitLog.class, "mid_incident_visit_log");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("medical:mid_incident_visit_log:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, MidIncidentVisitLog.class);
+    }
+
+}

+ 1 - 16
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AdvanceWarningAudit.java

@@ -36,26 +36,11 @@ public class AdvanceWarningAudit implements Serializable {
 	@TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "主键ID")
     private java.lang.Integer id;
-	/**医保规则ID*/
-	@Excel(name = "医保规则ID", width = 15)
-    @ApiModelProperty(value = "医保规则ID")
-    private java.lang.Integer medicalInsRuleInfoId;
-	/**医保规则编码*/
-	@Excel(name = "医保规则编码", width = 15)
-    @ApiModelProperty(value = "医保规则编码")
-    private java.lang.String medicalInsRuleInfoCode;
-	/**医保规则名称*/
-	@Excel(name = "医保规则名称", width = 15)
-    @ApiModelProperty(value = "医保规则名称")
-    private java.lang.String medicalInsRuleInfoName;
+
 	/**就诊类别;住院/门诊*/
 	@Excel(name = "就诊类别;住院/门诊", width = 15)
     @ApiModelProperty(value = "就诊类别;住院/门诊")
     private java.lang.String treatmentType;
-	/**警示级别*/
-	@Excel(name = "违规等级", width = 15)
-    @ApiModelProperty(value = "违规等级")
-    private java.lang.String reminderLevel;
 	/**提醒类别;事前提醒,事中预警,事后监管*/
 	@Excel(name = "提醒类别;事前提醒,事中预警,事后监管", width = 15)
     @ApiModelProperty(value = "提醒类别;事前提醒,事中预警,事后监管")

+ 19 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AdviceDetailsVO.java

@@ -1,14 +1,27 @@
 package org.jeecg.modules.medical.entity;
 
+import lombok.Data;
+
 /**
  * 医嘱明细接口入参
  */
+@Data
 public class AdviceDetailsVO {
-    private String project_code;		//char	项目编码,正常情况必填,特殊情况,如生化全套等没有医保编码,可放空。
-    private String hospital_code;//	true	char	院内项目编码
+    private String project_code;//char	项目编码,正常情况必填,特殊情况,如生化全套等没有医保编码,可放空。
+//    private String hospital_code;//院内项目编码
     private String project_name;//	true	char	项目名称
+    private String project_type;//项目类型 药品、耗材、诊疗
+    private String medical_project_code;//医保项目编码
+    private String medical_project_name;//医保项目名称
     private String recipe_no;//		char	处方号
     private String invoice_project;//	true	char	发票项目编码
+
+    /**
+     * 费用类别
+     * 床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费、
+     * 中成药费、一般诊疗费、挂号费、其他费;如果目前费用类别与此统计口径有差异,按照目前费用类别提取
+     */
+    private String expense_category;
     private String dose_form;//		char	剂型
     private String medical_specification;//		char	规格
     private Double price;//	true	float	单价,必须使用数值型,如”12.5”
@@ -20,4 +33,8 @@ public class AdviceDetailsVO {
     private String single_dose_unit;//		char	单次用药量剂量单位(项目为药品时非空)
     private Integer dose_day;//		float	药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”
     private String take_frequence;//		char	服用频次
+    private String medical_insurance_mark; //医保标志
+    private String inspection_site;//检查部位
+    private String order_catalog;//医嘱大类
+    private String order_type;//医嘱类别
 }

+ 8 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AfterwardsAuditDetail.java

@@ -108,6 +108,14 @@ public class AfterwardsAuditDetail implements Serializable {
 	@Excel(name = "项目名称", width = 15)
     @ApiModelProperty(value = "项目名称")
     private java.lang.String proejctName;
+    /**项目编码*/
+    @Excel(name = "医保项目编码", width = 15)
+    @ApiModelProperty(value = "医保项目编码")
+    private java.lang.String medicalProejctCode;
+    /**项目名称*/
+    @Excel(name = "医保项目名称", width = 15)
+    @ApiModelProperty(value = "医保项目名称")
+    private java.lang.String medicalProejctName;
 	/**规则处理结果*/
 	@Excel(name = "规则处理结果", width = 15)
     @ApiModelProperty(value = "规则处理结果")

+ 8 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/DiagnosesVO.java

@@ -1,6 +1,12 @@
 package org.jeecg.modules.medical.entity;
 
+import lombok.Data;
+
+@Data
 public class DiagnosesVO {
-    private String diagnose_code;    //true	char	诊断代码(使用医保下发诊断代码(ICD-10))
-    private String diagnose_desc;    //true	char	诊断描述
+    private String diagnose_code;   //医院内部诊断编码
+    private String diagnose_desc;   //医院内部诊断描述
+
+    private String medical_diagnose_code; //true	char	医保诊断代码(使用医保下发诊断代码(ICD-10))
+    private String medical_diagnose_name; //true	char	医保诊断描述
 }

+ 0 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsRuleInfo.java

@@ -45,10 +45,6 @@ public class MedicalInsRuleInfo implements Serializable {
     @Excel(name = "规则编码", width = 15)
     @ApiModelProperty(value = "规则编码")
     private java.lang.String ruleCode;
-	/**功能*/
-	@Excel(name = "功能", width = 15)
-    @ApiModelProperty(value = "功能")
-    private java.lang.String function;
 	/**类别*/
 	@Excel(name = "类别", width = 15)
     @ApiModelProperty(value = "类别")
@@ -94,10 +90,6 @@ public class MedicalInsRuleInfo implements Serializable {
 	@Excel(name = "调用场景;事前提醒、事中预警、事后监管", width = 15)
     @ApiModelProperty(value = "调用场景;事前提醒、事中预警、事后监管")
     private java.lang.String callScenario;
-	/**是否启用*/
-	@Excel(name = "是否启用", width = 15)
-    @ApiModelProperty(value = "是否启用")
-    private java.lang.String enable;
 	/**状态*/
 	@Excel(name = "状态", width = 15)
     @ApiModelProperty(value = "状态")

+ 25 - 19
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MedicalInsuranceDrugs.java

@@ -4,10 +4,8 @@ import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -32,22 +30,28 @@ import lombok.experimental.Accessors;
 public class MedicalInsuranceDrugs implements Serializable {
     private static final long serialVersionUID = 1L;
 
+
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private String id;
+
 	/**医保药品编码;医保目录药品编码*/
-	@Excel(name = "医保药品编码;医保目录药品编码", width = 15)
+	@Excel(name = "医保药品编码", width = 15)
     @ApiModelProperty(value = "医保药品编码;医保目录药品编码")
     private java.lang.String medicineCode;
 	/**医保药品名称;医保目录药品名称*/
-	@Excel(name = "医保药品名称;医保目录药品名称", width = 15)
+	@Excel(name = "医保药品名称", width = 15)
     @ApiModelProperty(value = "医保药品名称;医保目录药品名称")
     private java.lang.String medicineName;
 	/**医院项目编码;医嘱系统中药品的代码*/
-	@Excel(name = "医院项目编码;医嘱系统中药品的代码", width = 15)
+	@Excel(name = "医院项目编码", width = 15)
     @ApiModelProperty(value = "医院项目编码;医嘱系统中药品的代码")
     private java.lang.String itemIdHosp;
 	/**医院项目名称;医嘱系统中药品的名称*/
-	@Excel(name = "医院项目名称;医嘱系统中药品的名称", width = 15)
+	@Excel(name = "医院项目名称", width = 15)
     @ApiModelProperty(value = "医院项目名称;医嘱系统中药品的名称")
-    private java.lang.Integer itemNameHosp;
+    private java.lang.String itemNameHosp;
+
 	/**剂型*/
 	@Excel(name = "剂型", width = 15)
     @ApiModelProperty(value = "剂型")
@@ -65,32 +69,34 @@ public class MedicalInsuranceDrugs implements Serializable {
     @ApiModelProperty(value = "用量")
     private java.lang.String drugUseTotal;
 	/**自付比例;甲类为100%,乙类根据当地实际情况(80%,70%),丙类(0%)*/
-	@Excel(name = "自付比例;甲类为100%,乙类根据当地实际情况(80%,70%),丙类(0%)", width = 15)
+	@TableField(value = "p_type_pct")
+    @Excel(name = "自付比例", width = 15)
     @ApiModelProperty(value = "自付比例;甲类为100%,乙类根据当地实际情况(80%,70%),丙类(0%)")
-    private java.lang.String pTypePct;
+    private java.lang.String ptypePct;
 	/**支付类别;指甲、乙、丙类*/
-	@Excel(name = "支付类别;指甲、乙、丙类", width = 15)
+    @TableField(value = "p_category")
+	@Excel(name = "支付类别", width = 15)
     @ApiModelProperty(value = "支付类别;指甲、乙、丙类")
-    private java.lang.String pCategory;
+    private java.lang.String pcategory;
 	/**备注;药品使用范围、限制性范围备注*/
-	@Excel(name = "备注;药品使用范围、限制性范围备注", width = 15)
+	@Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注;药品使用范围、限制性范围备注")
     private java.lang.String remarks;
 	/**最高限价;物价规定的最高限价*/
-	@Excel(name = "最高限价;物价规定的最高限价", width = 15)
+	@Excel(name = "最高限价", width = 15)
     @ApiModelProperty(value = "最高限价;物价规定的最高限价")
     private java.math.BigDecimal cellingPrice;
 	/**三级医院最高价格;或其他定价规则体现下的最高级别定价*/
-	@Excel(name = "三级医院最高价格;或其他定价规则体现下的最高级别定价", width = 15)
+	@Excel(name = "三级医院最高价格", width = 15)
     @ApiModelProperty(value = "三级医院最高价格;或其他定价规则体现下的最高级别定价")
     private java.math.BigDecimal tertiaryHospPrice;
 	/**二级医院最高价格;或其他定价规则体现下的第二级别定价*/
-	@Excel(name = "二级医院最高价格;或其他定价规则体现下的第二级别定价", width = 15)
+	@Excel(name = "二级医院最高价格", width = 15)
     @ApiModelProperty(value = "二级医院最高价格;或其他定价规则体现下的第二级别定价")
     private java.math.BigDecimal twoHospPrice;
 	/**一级医院最高价格;或其他定价规则体现下的第三级别定价*/
-	@Excel(name = "一级医院最高价格;或其他定价规则体现下的第三级别定价", width = 15)
-    @ApiModelProperty(value = "一级医院最高价格;或其他定价规则体现下的第三级别定价")
+	@Excel(name = "一级医院最高价格", width = 15)
+    @ApiModelProperty(value = "一级医院最高价格")
     private java.math.BigDecimal oneHospPrice;
 	/**创建时间;*/
 	@JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")

+ 6 - 20
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAudit.java

@@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.math.BigDecimal;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableLogic;
@@ -36,30 +37,12 @@ public class MidIncidentAudit implements Serializable {
 	@TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "主键ID")
     private java.lang.Integer id;
-//	/**医保规则ID*/
-//	@Excel(name = "医保规则ID", width = 15)
-//    @ApiModelProperty(value = "医保规则ID")
-//    private java.lang.Integer medicalInsRuleInfoId;
-//	/**医保规则编码*/
-//	@Excel(name = "医保规则编码", width = 15)
-//    @ApiModelProperty(value = "医保规则编码")
-//    private java.lang.String medicalInsRuleInfoCode;
-//	/**医保规则名称*/
-//	@Excel(name = "医保规则名称", width = 15)
-//    @ApiModelProperty(value = "医保规则名称")
-//    private java.lang.String medicalInsRuleInfoName;
+
 	/**就诊类别;住院/门诊*/
 	@Excel(name = "就诊类别;住院/门诊", width = 15)
     @ApiModelProperty(value = "就诊类别;住院/门诊")
     private java.lang.String treatmentType;
-//	/**警示级别*/
-//	@Excel(name = "警示级别", width = 15)
-//    @ApiModelProperty(value = "警示级别")
-//    private java.lang.String reminderLevel;
-//    /**违规等级;0:直接违规  1:重度可疑  2:轻度可疑  3:仅提醒展示*/
-//    @Excel(name = "违规等级", width = 15)
-//    @ApiModelProperty(value = "违规等级")
-//    private java.lang.Integer violationLevel;
+
 	/**提醒类别;事前提醒,事中预警,事后监管*/
 	@Excel(name = "提醒类别;事前提醒,事中预警,事后监管", width = 15)
     @ApiModelProperty(value = "提醒类别;事前提醒,事中预警,事后监管")
@@ -132,4 +115,7 @@ public class MidIncidentAudit implements Serializable {
     @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "更新时间")
     private java.util.Date updateTime;
+
+    @TableField(exist = false)
+    private java.lang.String interfName;
 }

+ 16 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentAuditDetail.java

@@ -33,7 +33,7 @@ public class MidIncidentAuditDetail implements Serializable {
     private static final long serialVersionUID = 1L;
 
 	/**主键ID*/
-	@TableId(type = IdType.ASSIGN_ID)
+	@TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "主键ID")
     private java.lang.Integer id;
 	/**医保规则ID*/
@@ -48,6 +48,12 @@ public class MidIncidentAuditDetail implements Serializable {
 	@Excel(name = "医保规则名称", width = 15)
     @ApiModelProperty(value = "医保规则名称")
     private java.lang.String medicalInsRuleInfoName;
+
+    /**事中提醒工单ID*/
+    @Excel(name = "事中提醒工单ID", width = 15)
+    @ApiModelProperty(value = "事中提醒工单ID")
+    private java.lang.Integer midIncidentAuditId;
+
 	/**就诊类别;住院/门诊*/
 	@Excel(name = "就诊类别;住院/门诊", width = 15)
     @ApiModelProperty(value = "就诊类别;住院/门诊")
@@ -108,6 +114,15 @@ public class MidIncidentAuditDetail implements Serializable {
 	@Excel(name = "项目名称", width = 15)
     @ApiModelProperty(value = "项目名称")
     private java.lang.String proejctName;
+
+    /**项目编码*/
+    @Excel(name = "医保项目编码", width = 15)
+    @ApiModelProperty(value = "医保项目编码")
+    private java.lang.String medicalProejctCode;
+    /**项目名称*/
+    @Excel(name = "医保项目名称", width = 15)
+    @ApiModelProperty(value = "医保项目名称")
+    private java.lang.String medicalProejctName;
 	/**规则处理结果*/
 	@Excel(name = "规则处理结果", width = 15)
     @ApiModelProperty(value = "规则处理结果")

+ 195 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentVisitDetailLog.java

@@ -0,0 +1,195 @@
+package org.jeecg.modules.medical.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: mid_incident_visit_detail_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:44
+ * @Version: V1.0
+ */
+@Data
+@TableName("mid_incident_visit_detail_log")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="mid_incident_visit_detail_log对象", description="mid_incident_visit_detail_log")
+public class MidIncidentVisitDetailLog implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键ID*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键ID")
+    private java.lang.Integer id;
+	/**医保规则ID*/
+	@Excel(name = "医保规则ID", width = 15)
+    @ApiModelProperty(value = "医保规则ID")
+    private java.lang.Integer medicalInsRuleInfoId;
+	/**医保规则编码*/
+	@Excel(name = "医保规则编码", width = 15)
+    @ApiModelProperty(value = "医保规则编码")
+    private java.lang.String medicalInsRuleInfoCode;
+	/**医保规则名称*/
+	@Excel(name = "医保规则名称", width = 15)
+    @ApiModelProperty(value = "医保规则名称")
+    private java.lang.String medicalInsRuleInfoName;
+	/**事中门诊日志表ID*/
+	@Excel(name = "事中门诊日志表ID", width = 15)
+    @ApiModelProperty(value = "事中门诊日志表ID")
+    private java.lang.Integer midIncidentVisitLogId;
+	/**就诊类别;住院/门诊*/
+	@Excel(name = "就诊类别;住院/门诊", width = 15)
+    @ApiModelProperty(value = "就诊类别;住院/门诊")
+    private java.lang.String visitType;
+	/**科室编码*/
+	@Excel(name = "科室编码", width = 15)
+    @ApiModelProperty(value = "科室编码")
+    private java.lang.String medicalDeptCode;
+	/**科室名称*/
+	@Excel(name = "科室名称", width = 15)
+    @ApiModelProperty(value = "科室名称")
+    private java.lang.String medicalDeptName;
+	/**医生姓名*/
+	@Excel(name = "医生姓名", width = 15)
+    @ApiModelProperty(value = "医生姓名")
+    private java.lang.String doctorName;
+	/**主诊医师编码*/
+	@Excel(name = "主诊医师编码", width = 15)
+    @ApiModelProperty(value = "主诊医师编码")
+    private java.lang.String doctorId;
+	/**个人编号*/
+	@Excel(name = "个人编号", width = 15)
+    @ApiModelProperty(value = "个人编号")
+    private java.lang.String patientId;
+	/**患者姓名*/
+	@Excel(name = "患者姓名", width = 15)
+    @ApiModelProperty(value = "患者姓名")
+    private java.lang.String patientName;
+	/**住院号/门诊号*/
+	@Excel(name = "住院号/门诊号", width = 15)
+    @ApiModelProperty(value = "住院号/门诊号")
+    private java.lang.String visitNo;
+	/**医嘱号/处方号*/
+	@Excel(name = "医嘱号/处方号", width = 15)
+    @ApiModelProperty(value = "医嘱号/处方号")
+    private java.lang.String recipeNo;
+	/**项目类型*/
+	@Excel(name = "项目类型", width = 15)
+    @ApiModelProperty(value = "项目类型")
+    private java.lang.String projectType;
+	/**项目编码*/
+	@Excel(name = "项目编码", width = 15)
+    @ApiModelProperty(value = "项目编码")
+    private java.lang.String proejctCode;
+	/**项目名称*/
+	@Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private java.lang.String proejctName;
+	/**医保项目编码*/
+	@Excel(name = "医保项目编码", width = 15)
+    @ApiModelProperty(value = "医保项目编码")
+    private java.lang.String medicalProjectCode;
+	/**医保项目名称*/
+	@Excel(name = "医保项目名称", width = 15)
+    @ApiModelProperty(value = "医保项目名称")
+    private java.lang.String medicalProjectName;
+	/**发票项目编号*/
+	@Excel(name = "发票项目编号", width = 15)
+    @ApiModelProperty(value = "发票项目编号")
+    private java.lang.String invoiceProject;
+	/**费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费*/
+	@Excel(name = "费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费", width = 15)
+    @ApiModelProperty(value = "费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费")
+    private java.lang.String expenseCategory;
+	/**剂型*/
+	@Excel(name = "剂型", width = 15)
+    @ApiModelProperty(value = "剂型")
+    private java.lang.String doseForm;
+	/**规格*/
+	@Excel(name = "规格", width = 15)
+    @ApiModelProperty(value = "规格")
+    private java.lang.String medicalSpecification;
+	/**价格;单价,必须使用数值型,如”12.5”*/
+	@Excel(name = "价格;单价,必须使用数值型,如”12.5”", width = 15)
+    @ApiModelProperty(value = "价格;单价,必须使用数值型,如”12.5”")
+    private java.math.BigDecimal price;
+	/**数量;数量,必须使用数值型,如”10”*/
+	@Excel(name = "数量;数量,必须使用数值型,如”10”", width = 15)
+    @ApiModelProperty(value = "数量;数量,必须使用数值型,如”10”")
+    private java.lang.Integer medicalNumber;
+	/**单位*/
+	@Excel(name = "单位", width = 15)
+    @ApiModelProperty(value = "单位")
+    private java.lang.String doseUnit;
+	/**金额;金额,必须使用数值型,如”50.5”*/
+	@Excel(name = "金额;金额,必须使用数值型,如”50.5”", width = 15)
+    @ApiModelProperty(value = "金额;金额,必须使用数值型,如”50.5”")
+    private java.math.BigDecimal amount;
+	/**用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”*/
+	@Excel(name = "用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”", width = 15)
+    @ApiModelProperty(value = "用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”")
+    private java.lang.Integer useDay;
+	/**单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”*/
+	@Excel(name = "单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”", width = 15)
+    @ApiModelProperty(value = "单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”")
+    private java.lang.Integer singleDoseNumber;
+	/**单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)*/
+	@Excel(name = "单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)", width = 15)
+    @ApiModelProperty(value = "单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)")
+    private java.lang.String singleDoseUnit;
+	/**药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”*/
+	@Excel(name = "药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”", width = 15)
+    @ApiModelProperty(value = "药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”")
+    private java.lang.Integer doseDay;
+	/**服用频次*/
+	@Excel(name = "服用频次", width = 15)
+    @ApiModelProperty(value = "服用频次")
+    private java.lang.String takeFrequence;
+	/**医保标志*/
+	@Excel(name = "医保标志", width = 15)
+    @ApiModelProperty(value = "医保标志")
+    private java.lang.String medicalInsuranceMark;
+	/**检查部位*/
+	@Excel(name = "检查部位", width = 15)
+    @ApiModelProperty(value = "检查部位")
+    private java.lang.String inspectionSite;
+	/**医嘱大类*/
+	@Excel(name = "医嘱大类", width = 15)
+    @ApiModelProperty(value = "医嘱大类")
+    private java.lang.String orderCatalog;
+	/**医嘱类别*/
+	@Excel(name = "医嘱类别", width = 15)
+    @ApiModelProperty(value = "医嘱类别")
+    private java.lang.String orderType;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新时间")
+    private java.util.Date updateTime;
+}

+ 90 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentVisitLog.java

@@ -0,0 +1,90 @@
+package org.jeecg.modules.medical.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: mid_incident_visit_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:36
+ * @Version: V1.0
+ */
+@Data
+@TableName("mid_incident_visit_log")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="mid_incident_visit_log对象", description="mid_incident_visit_log")
+public class MidIncidentVisitLog implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键ID*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private java.lang.Integer id;
+	/**就诊类别;住院/门诊*/
+	@Excel(name = "就诊类别;住院/门诊", width = 15)
+    @ApiModelProperty(value = "就诊类别;住院/门诊")
+    private java.lang.String visitType;
+	/**科室编码*/
+	@Excel(name = "科室编码", width = 15)
+    @ApiModelProperty(value = "科室编码")
+    private java.lang.String medicalDeptCode;
+	/**科室名称*/
+	@Excel(name = "科室名称", width = 15)
+    @ApiModelProperty(value = "科室名称")
+    private java.lang.String medicalDeptName;
+	/**医生姓名*/
+	@Excel(name = "医生姓名", width = 15)
+    @ApiModelProperty(value = "医生姓名")
+    private java.lang.String doctorName;
+	/**主诊医师编码*/
+	@Excel(name = "主诊医师编码", width = 15)
+    @ApiModelProperty(value = "主诊医师编码")
+    private java.lang.String doctorId;
+	/**个人编号*/
+	@Excel(name = "个人编号", width = 15)
+    @ApiModelProperty(value = "个人编号")
+    private java.lang.String patientId;
+	/**患者姓名*/
+	@Excel(name = "患者姓名", width = 15)
+    @ApiModelProperty(value = "患者姓名")
+    private java.lang.String patientName;
+	/**住院号/门诊号*/
+	@Excel(name = "住院号/门诊号", width = 15)
+    @ApiModelProperty(value = "住院号/门诊号")
+    private java.lang.String visitNo;
+	/**医嘱号/处方号*/
+	@Excel(name = "医嘱号/处方号", width = 15)
+    @ApiModelProperty(value = "医嘱号/处方号")
+    private java.lang.String doctorAdviceNo;
+	/**入院日期*/
+	@Excel(name = "入院日期", width = 15, format =  "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "入院日期")
+    private java.util.Date inHospDate;
+	/**诊断编码*/
+	@Excel(name = "诊断编码", width = 15)
+    @ApiModelProperty(value = "诊断编码")
+    private java.lang.String diagnoses;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern =  "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern= "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private java.util.Date createTime;
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentVisitDetailLogMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.medical.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.medical.entity.MidIncidentVisitDetailLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: mid_incident_visit_detail_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:44
+ * @Version: V1.0
+ */
+public interface MidIncidentVisitDetailLogMapper extends BaseMapper<MidIncidentVisitDetailLog> {
+
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/MidIncidentVisitLogMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.medical.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.medical.entity.MidIncidentVisitLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: mid_incident_visit_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:36
+ * @Version: V1.0
+ */
+public interface MidIncidentVisitLogMapper extends BaseMapper<MidIncidentVisitLog> {
+
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentVisitDetailLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.medical.mapper.MidIncidentVisitDetailLogMapper">
+
+</mapper>

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/mapper/xml/MidIncidentVisitLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.medical.mapper.MidIncidentVisitLogMapper">
+
+</mapper>

+ 40 - 25
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/FactorEnchangeFactory.java

@@ -17,6 +17,7 @@ import org.jeecg.modules.medical.entity.FactorCondRela;
 import org.jeecg.modules.medical.entity.FactorEnchance;
 import org.jeecg.modules.medical.entity.MedicalInsRuleInfo;
 import org.jeecg.modules.medical.entity.MidIncidentAudit;
+import org.jeecg.modules.medical.entity.MidIncidentAuditDetail;
 import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
 import org.jeecg.modules.medical.ruleengine.dict.DictUtil;
 import org.jeecg.modules.medical.service.IEventAttrService;
@@ -75,7 +76,7 @@ public class FactorEnchangeFactory {
 
 
 
-    public boolean runFactorEnchange(Integer medicalInfoRuleInfoId, MedicalInsRuleInfo medicalInsRuleInfo, Map<String, Object> localMap, List<Integer> factorEnchanceIdList, List<FactorEnchance> factorEnchanceList) {
+    public boolean runFactorEnchange(Integer medicalInfoRuleInfoId, MedicalInsRuleInfo medicalInsRuleInfo, MidIncidentAudit midIncidentAudit, Map<String, Object> localMap, List<Integer> factorEnchanceIdList, List<FactorEnchance> factorEnchanceList) {
         Map<Integer, FactorEnchance> factorEnchanceMap = factorEnchanceList.stream().collect(Collectors.toMap(FactorEnchance::getId, v -> v, (v1, v2) -> v1));
         boolean result = true;
         for (Integer factorEnchanceId : factorEnchanceIdList) {
@@ -113,7 +114,7 @@ public class FactorEnchangeFactory {
                     result = setLogicalExpressionResultByFactorEnchance(localMap, ioTypeMap, factorEnchance, medicalInsRuleInfo);
                     if(Constant.WARING_EVENT_ATTR_ID == factorEnchance.getEventAttrId()){
                         if(result){
-
+                            insertMidWarningDetail(localMap, medicalInsRuleInfo, midIncidentAudit);
                         }
                     }else {
                         localMap.put(factorEnchance.getEventAttrId().toString(), result);
@@ -135,23 +136,39 @@ public class FactorEnchangeFactory {
         return result;
     }
 
-    public void insertMidWarning(MedicalInsRuleInfo medicalInsRuleInfo){
+    public void insertMidWarningDetail(Map<String,Object> itemMap, MedicalInsRuleInfo medicalInsRuleInfo,MidIncidentAudit midIncidentAudit){
         MidIncidentWarningVO midIncidentWarningVO = RuleEngine.midIncidentWarningVOThreadLocal.get();
-        MidIncidentAudit midIncidentAudit = new MidIncidentAudit();
-        midIncidentAudit.setMedicalDeptCode(midIncidentWarningVO.getMedical_dept_code());
-        midIncidentAudit.setMedicalDeptName(midIncidentWarningVO.getMedical_dept_name());
+        MidIncidentAuditDetail midIncidentAuditDetail = new MidIncidentAuditDetail();
+        midIncidentAuditDetail.setMedicalDeptCode(midIncidentWarningVO.getMedical_dept_code());
+        midIncidentAuditDetail.setMedicalDeptName(midIncidentWarningVO.getMedical_dept_name());
         Date date = new Date(System.currentTimeMillis());
-        midIncidentAudit.setCreateTime(date);
-        midIncidentAudit.setDoctorName(midIncidentWarningVO.getDoctor_name());
-        midIncidentAudit.setDoctorId(midIncidentWarningVO.getDoctor_code());
-        midIncidentAudit.setPatientId(midIncidentWarningVO.getPatient_id());
-        midIncidentAudit.setPatientName(midIncidentWarningVO.getPatient_name());
-        midIncidentAudit.setTreatmentType(medicalInsRuleInfo.getTreatmentType());
-        midIncidentAudit.setNoticeType("事中预警");
+        midIncidentAuditDetail.setCreateTime(date);
+        midIncidentAuditDetail.setDoctorName(midIncidentWarningVO.getDoctor_name());
+        midIncidentAuditDetail.setDoctorId(midIncidentWarningVO.getDoctor_code());
+        midIncidentAuditDetail.setPatientId(midIncidentWarningVO.getPatient_id());
+        midIncidentAuditDetail.setPatientName(midIncidentWarningVO.getPatient_name());
+        midIncidentAuditDetail.setTreatmentType(medicalInsRuleInfo.getTreatmentType());
+        midIncidentAuditDetail.setNoticeType("事中预警");
+        midIncidentAuditDetail.setMedicalInsRuleInfoCode(medicalInsRuleInfo.getRuleCode());
+        midIncidentAuditDetail.setMedicalInsRuleInfoId(medicalInsRuleInfo.getId());
+        midIncidentAuditDetail.setMedicalInsRuleInfoName(medicalInsRuleInfo.getRuleName());
+        midIncidentAuditDetail.setDescription(medicalInsRuleInfo.getDescription());
+        midIncidentAuditDetail.setProejctCode(itemMap.get(Constant.PROJECT_CODE_KEY).toString());
+        midIncidentAuditDetail.setProejctName(itemMap.get(Constant.PROJECT_NAME_KEY).toString());
+        midIncidentAuditDetail.setMedicalProejctCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
+        midIncidentAuditDetail.setMedicalProejctName(itemMap.get(Constant.MEDICAL_PROJECT_NAME_KEY).toString());
+        midIncidentAuditDetail.setOutpatientNumber(midIncidentAudit.getOutpatientNumber());
+        midIncidentAuditDetail.setPrescriptionNumber(midIncidentAudit.getPrescriptionNumber());
+        midIncidentAuditDetail.setProjectType(itemMap.getOrDefault(Constant.PROJECT_TYPE_KEY,"default").toString());
+        midIncidentAuditDetail.setViolationLevel(medicalInsRuleInfo.getViolationLevel());
+        midIncidentAuditDetail.setTreatmentType(medicalInsRuleInfo.getTreatmentType());
+        midIncidentAuditDetail.setMidIncidentAuditId(midIncidentAudit.getId());
         midIncidentAuditService.save(midIncidentAudit);
     }
 
 
+
+
     /**
      * 逻辑表达式
      *
@@ -170,18 +187,16 @@ public class FactorEnchangeFactory {
                 result = false;
             }
             for (FactorCondRela factorCondRela : factorCondRelaList) {
-                if (StringUtils.isNotBlank(factorCondRela.getCondStr())) {
-
-                    Boolean resultTemp = (Boolean) spelUtil.runSpelExpression(localMap, factorCondRela.getCondStr());
-                    if (Constant.AND.equals(factorEnchance.getExtAttr1())) {
-                        result = resultTemp && result;
-                    } else {
-                        result = resultTemp || result;
-                    }
-
-
-                }else{
-
+                if (!StringUtils.isNotBlank(factorCondRela.getCondStr())) {
+                    log.error("未正常生成表达式");
+                    String condStr = spelUtil.getSPELString(factorCondRela, enchanceAttrMap);
+                    factorCondRela.setCondStr(condStr);
+                }
+                Boolean resultTemp = (Boolean) spelUtil.runSpelExpression(localMap, factorCondRela.getCondStr());
+                if (Constant.AND.equals(factorEnchance.getExtAttr1())) {
+                    result = resultTemp && result;
+                } else {
+                    result = resultTemp || result;
                 }
             }
             return result;

+ 165 - 22
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/RuleEngine.java

@@ -1,19 +1,27 @@
 package org.jeecg.modules.medical.ruleengine;
 
 import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.medical.Constant;
+import org.jeecg.modules.medical.entity.AdviceDetailsVO;
+import org.jeecg.modules.medical.entity.DiagnosesVO;
 import org.jeecg.modules.medical.entity.FactorEnchance;
 import org.jeecg.modules.medical.entity.MedicalInsRuleInfo;
 import org.jeecg.modules.medical.entity.MedicalInsRuleProject;
 import org.jeecg.modules.medical.entity.MidIncidentAudit;
+import org.jeecg.modules.medical.entity.MidIncidentAuditDiagnose;
+import org.jeecg.modules.medical.entity.MidIncidentVisitDetailLog;
+import org.jeecg.modules.medical.entity.MidIncidentVisitLog;
 import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
 import org.jeecg.modules.medical.entity.RuleAttr;
 import org.jeecg.modules.medical.entity.RuleFactorRela;
+import org.jeecg.modules.medical.ruleengine.dict.DictUtil;
 import org.jeecg.modules.medical.ruleengine.plugin.InterfItemListPlugin;
 import org.jeecg.modules.medical.service.IEventAttrService;
 import org.jeecg.modules.medical.service.IFactorAttrRelaService;
@@ -21,25 +29,32 @@ import org.jeecg.modules.medical.service.IFactorCondRelaService;
 import org.jeecg.modules.medical.service.IFactorEnchanceService;
 import org.jeecg.modules.medical.service.IMedicalInsRuleInfoService;
 import org.jeecg.modules.medical.service.IMedicalInsRuleProjectService;
+import org.jeecg.modules.medical.service.IMidIncidentAuditDiagnoseService;
 import org.jeecg.modules.medical.service.IMidIncidentAuditService;
+import org.jeecg.modules.medical.service.IMidIncidentVisitDetailLogService;
+import org.jeecg.modules.medical.service.IMidIncidentVisitLogService;
 import org.jeecg.modules.medical.service.IRuleAttrService;
 import org.jeecg.modules.medical.service.IRuleFactorRelaService;
+import org.jeecg.modules.message.websocket.WebSocket;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
+import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 @Slf4j
 @Component
-@ConditionalOnProperty(name = "module", havingValue = Constant.MODULE_RULEENGINE_NAME)
+//@ConditionalOnProperty(name = "module", havingValue = Constant.MODULE_RULEENGINE_NAME)
 public class RuleEngine {
     private List<MedicalInsRuleInfo> medicalInsRuleInfoList = new ArrayList();
     @Autowired
@@ -67,9 +82,23 @@ public class RuleEngine {
     InterfItemListPlugin interfItemListPlugin;
     @Autowired
     IMidIncidentAuditService midIncidentAuditService;
+    @Autowired
+    IMidIncidentAuditDiagnoseService midIncidentAuditDiagnoseService;
+    @Autowired
+    IMidIncidentVisitLogService midIncidentVisitLogService;
+    @Autowired
+    IMidIncidentVisitDetailLogService midIncidentVisitDetailLogService;
+    @Autowired
+    DictUtil dictUtil;
+    @Autowired
+    WebSocket webSocket;
 
     public static ThreadLocal<MidIncidentWarningVO> midIncidentWarningVOThreadLocal = new ThreadLocal<>();
 
+    public static Map<String, Set<Integer>> itemCodeAndRuleIdMap = new HashMap<>();
+    public static Map<String, List<RuleAttr>> interfRuleAttrList = new HashMap<>();
+
+
     @PostConstruct
     public void initMedicalInsRule() {
         List<MedicalInsRuleInfo> medicalInsRuleInfoList = medicalInsRuleInfoService.lambdaQuery().eq(MedicalInsRuleInfo::getState, Constant.EFF_STATE).list();
@@ -95,13 +124,32 @@ public class RuleEngine {
             }
         }
         try {
+
             MemeryPageUtil.batchDeal(medicalInsRuleInfoIdList, 1000, pageDataList -> {
                 List<MedicalInsRuleProject> medicalInsRuleProjectList = medicalInsRuleProjectService.lambdaQuery().in(MedicalInsRuleProject::getMedicineInsRuleInfoId, pageDataList).list();
                 if (CollectionUtil.isNotEmpty(medicalInsRuleProjectList)) {
                     MedicalInsRuleProject medicalInsRuleProject = null;
                     for (int index = 0; index < medicalInsRuleProjectList.size(); index++) {
                         medicalInsRuleProject = medicalInsRuleProjectList.get(index);
-                        setMIDProjectCodeToRedis(medicalInsRuleProject);
+                        if (StringUtils.isNotBlank(medicalInsRuleProject.getProejctCode())) {
+                            if (itemCodeAndRuleIdMap.containsKey(medicalInsRuleProject.getProejctCode())) {
+                                itemCodeAndRuleIdMap.get(medicalInsRuleProject.getProejctCode()).add(medicalInsRuleProject.getMedicineInsRuleInfoId());
+                            } else {
+                                Set<Integer> ruleIdSet = new HashSet<>();
+                                ruleIdSet.add(medicalInsRuleProject.getMedicineInsRuleInfoId());
+                                itemCodeAndRuleIdMap.put(medicalInsRuleProject.getProejctCode(), ruleIdSet);
+                            }
+                        }
+                        if (StringUtils.isNotBlank(medicalInsRuleProject.getCorrelationProjectCode())) {
+                            if (itemCodeAndRuleIdMap.containsKey(medicalInsRuleProject.getCorrelationProjectCode())) {
+                                itemCodeAndRuleIdMap.get(medicalInsRuleProject.getCorrelationProjectCode()).add(medicalInsRuleProject.getMedicineInsRuleInfoId());
+                            } else {
+                                Set<Integer> ruleIdSet = new HashSet<>();
+                                ruleIdSet.add(medicalInsRuleProject.getMedicineInsRuleInfoId());
+                                itemCodeAndRuleIdMap.put(medicalInsRuleProject.getCorrelationProjectCode(), ruleIdSet);
+                            }
+                        }
+//                        setMIDProjectCodeToRedis(medicalInsRuleProject);
                     }
                 }
             });
@@ -109,6 +157,12 @@ public class RuleEngine {
             log.error(e.getMessage(), e);
         }
 
+        List<RuleAttr> ruleAttrList = ruleAttrService.list();
+        interfRuleAttrList = ruleAttrList.stream().collect(Collectors.groupingBy(RuleAttr::getInterfName));
+//        for(Map.Entry<String,List<RuleAttr>> map : interfRuleAttrList.entrySet()){
+//            redisTemplate.opsForValue().append(map.getKey(), JSON.toJSONString(map.getValue()));
+//        }
+
     }
 
     /**
@@ -126,31 +180,109 @@ public class RuleEngine {
 
     public Integer getMIDMedicalId(String itemCode) {
         Object medicineInsRuleId = redisTemplate.opsForHash().get(Constant.MEDICAL_RULE_CACHE_KEY, itemCode);
+//        redisTemplate.opsForSet().add(Constant.MEDICAL_RULE_CACHE_KEY)
         if (null != medicineInsRuleId) {
             return (Integer) medicineInsRuleId;
         }
         return null;
     }
 
-    public Result dealMidInterfaceEngin(String intefName, Map<String, Object> paramMap, MidIncidentWarningVO midIncidentWarningVO) {
+    public Result dealMidInterfaceEngin(String intefName, Map<String, Object> paramMap, MidIncidentWarningVO midIncidentWarningVO, String ipStr) {
         midIncidentWarningVOThreadLocal.set(midIncidentWarningVO);
         try {
-            List<RuleAttr> ruleAttrList = ruleAttrService.lambdaQuery().eq(RuleAttr::getInterfName, intefName).list();
-            List<Integer> medicalInsRuleInfoIdList = getMedicalInsRuleInfoIdByIntef(intefName, paramMap, ruleAttrList);
+            List<RuleAttr> ruleAttrList = interfRuleAttrList.get(intefName);
+            if (null == ruleAttrList) {
+                return Result.error("接口:" + intefName + " 未配置 对应的规则属性");
+            }
+            dictUtil.transferMidIncidentWarningVO(midIncidentWarningVO);
             List<Map<String, Object>> itemList = interfItemListPlugin.findProIntersection(paramMap, ruleAttrList);
 
+            MidIncidentAudit midIncidentAudit = insertMidWarning(midIncidentWarningVO);
+            insertLog(midIncidentWarningVO);
+            midIncidentAudit.setInterfName(intefName);
             for (Map<String, Object> itemMap : itemList) {
-                runEngine(itemMap, medicalInsRuleInfoIdList);
+                Set<Integer> medicalInsRuleInfoIdList = itemCodeAndRuleIdMap.get(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
+                Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
+                if (null != diagnose) {
+                    //获取诊断编码配置的规则ID,加入需要执行的规则
+                    Set<Integer> diagnoseMedicalInsRuleInfoIdList = itemCodeAndRuleIdMap.get(diagnose.toString());
+                    if (CollectionUtil.isNotEmpty(diagnoseMedicalInsRuleInfoIdList)) {
+                        medicalInsRuleInfoIdList.addAll(diagnoseMedicalInsRuleInfoIdList);
+                    }
+                }
+                runEngine(itemMap, medicalInsRuleInfoIdList, midIncidentAudit, ipStr);
             }
-        }finally {
+        } finally {
             midIncidentWarningVOThreadLocal.remove();
         }
 
         return Result.ok();
     }
 
-    public void insertMidWarning(){
-        MidIncidentWarningVO midIncidentWarningVO = RuleEngine.midIncidentWarningVOThreadLocal.get();
+    public void insertLog(MidIncidentWarningVO midIncidentWarningVO) {
+        MidIncidentVisitLog midIncidentVisitLog = new MidIncidentVisitLog();
+        midIncidentVisitLog.setDoctorId(midIncidentWarningVO.getDoctor_code());
+        midIncidentVisitLog.setDoctorName(midIncidentWarningVO.getDoctor_name());
+        midIncidentVisitLog.setVisitNo(midIncidentWarningVO.getVisit_no());
+        midIncidentVisitLog.setPatientId(midIncidentWarningVO.getPatient_id());
+        midIncidentVisitLog.setPatientName(midIncidentWarningVO.getPatient_name());
+        if (CollectionUtil.isNotEmpty(midIncidentWarningVO.getDiagnoses())) {
+            midIncidentVisitLog.setDiagnoses(JSON.toJSONString(midIncidentWarningVO.getDiagnoses()));
+        }
+        midIncidentVisitLog.setDoctorAdviceNo(midIncidentWarningVO.getDoctor_advice_no());
+        try {
+            Date inHospDate = DateUtils.parseDate(midIncidentWarningVO.getIn_hosp_date(), "yyyyMMdd");
+            midIncidentVisitLog.setInHospDate(inHospDate);
+        } catch (ParseException e) {
+            log.error(e.getMessage(), e);
+        }
+        Date now = new Date(System.currentTimeMillis());
+        midIncidentVisitLog.setCreateTime(now);
+        midIncidentVisitLog.setMedicalDeptCode(midIncidentWarningVO.getMedical_dept_code());
+        midIncidentVisitLog.setMedicalDeptName(midIncidentWarningVO.getMedical_dept_name());
+        midIncidentVisitLog.setVisitType(midIncidentWarningVO.getVisit_type());
+        midIncidentVisitLogService.save(midIncidentVisitLog);
+        if (CollectionUtil.isNotEmpty(midIncidentWarningVO.getAdvice_details())) {
+            List<MidIncidentVisitDetailLog> midIncidentVisitDetailLogList = new ArrayList<>();
+            MidIncidentVisitDetailLog midIncidentVisitDetailLog = null;
+            for (AdviceDetailsVO adviceDetailsVO : midIncidentWarningVO.getAdvice_details()) {
+                midIncidentVisitDetailLog = new MidIncidentVisitDetailLog();
+                midIncidentVisitDetailLog.setAmount(new BigDecimal(adviceDetailsVO.getAmount()));
+                midIncidentVisitDetailLog.setCreateTime(now);
+                midIncidentVisitDetailLog.setMidIncidentVisitLogId(midIncidentVisitLog.getId());
+                midIncidentVisitDetailLog.setDoctorId(midIncidentVisitLog.getDoctorId());
+                midIncidentVisitDetailLog.setDoctorName(midIncidentVisitLog.getDoctorName());
+                midIncidentVisitDetailLog.setDoseDay(adviceDetailsVO.getDose_day());
+                midIncidentVisitDetailLog.setDoseForm(adviceDetailsVO.getDose_form());
+                midIncidentVisitDetailLog.setDoseUnit(adviceDetailsVO.getDose_unit());
+                midIncidentVisitDetailLog.setExpenseCategory(adviceDetailsVO.getExpense_category());
+                midIncidentVisitDetailLog.setVisitNo(midIncidentVisitLog.getVisitNo());
+                midIncidentVisitDetailLog.setVisitType(midIncidentVisitLog.getVisitType());
+                midIncidentVisitDetailLog.setInspectionSite(adviceDetailsVO.getInspection_site());
+                midIncidentVisitDetailLog.setInvoiceProject(adviceDetailsVO.getInvoice_project());
+                midIncidentVisitDetailLog.setMedicalInsuranceMark(adviceDetailsVO.getMedical_insurance_mark());
+                midIncidentVisitDetailLog.setMedicalNumber(adviceDetailsVO.getMedical_number());
+                midIncidentVisitDetailLog.setOrderType(adviceDetailsVO.getOrder_type());
+                midIncidentVisitDetailLog.setOrderCatalog(adviceDetailsVO.getOrder_catalog());
+                midIncidentVisitDetailLog.setSingleDoseNumber(adviceDetailsVO.getSingle_dose_number());
+                midIncidentVisitDetailLog.setSingleDoseUnit(adviceDetailsVO.getSingle_dose_unit());
+                midIncidentVisitDetailLog.setMedicalDeptCode(adviceDetailsVO.getMedical_project_code());
+                midIncidentVisitDetailLog.setMedicalProjectName(adviceDetailsVO.getMedical_project_name());
+                midIncidentVisitDetailLog.setTakeFrequence(adviceDetailsVO.getTake_frequence());
+                midIncidentVisitDetailLog.setMedicalSpecification(adviceDetailsVO.getMedical_specification());
+                midIncidentVisitDetailLog.setPrice(new BigDecimal(adviceDetailsVO.getPrice()));
+                midIncidentVisitDetailLog.setRecipeNo(adviceDetailsVO.getRecipe_no());
+                midIncidentVisitDetailLog.setUseDay(adviceDetailsVO.getUse_day());
+                midIncidentVisitDetailLog.setProjectType(adviceDetailsVO.getProject_type());
+                midIncidentVisitDetailLog.setProejctCode(adviceDetailsVO.getProject_code());
+                midIncidentVisitDetailLog.setProejctName(adviceDetailsVO.getProject_name());
+                midIncidentVisitDetailLogList.add(midIncidentVisitDetailLog);
+            }
+            midIncidentVisitDetailLogService.saveBatch(midIncidentVisitDetailLogList);
+        }
+    }
+
+    public MidIncidentAudit insertMidWarning(MidIncidentWarningVO midIncidentWarningVO) {
         MidIncidentAudit midIncidentAudit = new MidIncidentAudit();
         midIncidentAudit.setMedicalDeptCode(midIncidentWarningVO.getMedical_dept_code());
         midIncidentAudit.setMedicalDeptName(midIncidentWarningVO.getMedical_dept_name());
@@ -164,12 +296,31 @@ public class RuleEngine {
         midIncidentAudit.setPrescriptionNumber(midIncidentWarningVO.getDoctor_advice_no());
         midIncidentAudit.setNoticeType("事中预警");
         midIncidentAuditService.save(midIncidentAudit);
+        if (CollectionUtil.isNotEmpty(midIncidentWarningVO.getDiagnoses())) {
+            List<MidIncidentAuditDiagnose> midIncidentAuditDiagnoseList = new ArrayList<>();
+            for (DiagnosesVO diagnosesVO : midIncidentWarningVO.getDiagnoses()) {
+                MidIncidentAuditDiagnose midIncidentAuditDiagnose = new MidIncidentAuditDiagnose();
+                midIncidentAuditDiagnose.setMidIncidentAuditId(midIncidentAudit.getId());
+                midIncidentAuditDiagnose.setDiagnoseCode(diagnosesVO.getDiagnose_code());
+                midIncidentAuditDiagnose.setDiagnoseDesc(diagnosesVO.getDiagnose_desc());
+                midIncidentAuditDiagnose.setMedDiagnoseCode(diagnosesVO.getMedical_diagnose_code());
+                midIncidentAuditDiagnose.setMedDiagnoseDesc(diagnosesVO.getMedical_diagnose_name());
+                midIncidentAuditDiagnose.setCreateTime(date);
+                midIncidentAuditDiagnose.setOutpatientNumber(midIncidentWarningVO.getVisit_no());
+                midIncidentAuditDiagnose.setPrescriptionNumber(midIncidentWarningVO.getDoctor_advice_no());
+                midIncidentAuditDiagnoseList.add(midIncidentAuditDiagnose);
+            }
+            midIncidentAuditDiagnoseService.saveBatch(midIncidentAuditDiagnoseList);
+        }
+
+
+        return midIncidentAudit;
     }
 
     public List<Integer> getMedicalInsRuleInfoIdByIntef(String intefName, Map<String, Object> paramMap, List<RuleAttr> ruleAttrList) {
 
         List<Integer> medicalIdList = new ArrayList<>();
-
+        Map<String, List<Integer>> itemCodeAndRuleIdMap = new HashMap<>();
         for (RuleAttr ruleAttr : ruleAttrList) {
             String itemCode = null;
             if (StringUtils.isNotBlank(ruleAttr.getAttrPath())) {
@@ -223,7 +374,7 @@ public class RuleEngine {
      *
      * @param paramMap
      */
-    public void runEngine(Map<String, Object> paramMap, List<Integer> medicalInsRuleInfoIdList) {
+    public void runEngine(Map<String, Object> paramMap, Set<Integer> medicalInsRuleInfoIdList, MidIncidentAudit midIncidentAudit, String ipStr) {
         LambdaQueryWrapper<RuleFactorRela> query = new LambdaQueryWrapper<RuleFactorRela>();
         query.eq(RuleFactorRela::getDelFlag, CommonConstant.DEL_FLAG_0);
         query.in(RuleFactorRela::getMedicalInsRuleInfoId, medicalInsRuleInfoIdList);
@@ -240,18 +391,10 @@ public class RuleEngine {
                 MedicalInsRuleInfo medicalInsRuleInfo = medicalInsRuleInfoService.getById(medicalRuleInsInfoId);
                 List<FactorEnchance> factorEnchanceListTemp = enchanceTypeMap.get(medicalRuleInsInfoId);
 
-                factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, paramMap, factorEnchangeIdList, factorEnchanceListTemp);
+                factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, midIncidentAudit, paramMap, factorEnchangeIdList, factorEnchanceListTemp);
             }
         }
-    }
-
-    /**
-     * 调用规则引擎之后需要异步通知websocket服务
-     *
-     * @param paramMap
-     */
-    public void sendEnginResultToWebSocket(Map<String, Object> paramMap) {
-
+        webSocket.pushMessage(ipStr, JSON.toJSONString(midIncidentAudit));
     }
 
 

+ 95 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/dict/DictUtil.java

@@ -1,9 +1,13 @@
 package org.jeecg.modules.medical.ruleengine.dict;
 
+import cn.hutool.core.collection.CollectionUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.modules.medical.Constant;
+import org.jeecg.modules.medical.entity.AdviceDetailsVO;
+import org.jeecg.modules.medical.entity.DiagnosesVO;
 import org.jeecg.modules.medical.entity.FactorEnchance;
-import org.jeecg.modules.medical.ruleengine.MedicalEnum;
+import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
 import org.jeecg.modules.medical.service.IMedicineService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -28,41 +32,42 @@ public class DictUtil {
      * 字典页面配置逻辑
      * 当要转换的接口属性路径配置没有.号,则直接把转换参数属性设置到ext_attr2字段上,
      * 如果有.号则设置到ext_attr1上。
+     *
      * @param localMap
      * @param factorEnchance
      * @param medicalInsRuleInfoId
      */
-    public void transferData(Map<String, Object> localMap, FactorEnchance factorEnchance, Integer medicalInsRuleInfoId){
+    public void transferData(Map<String, Object> localMap, FactorEnchance factorEnchance, Integer medicalInsRuleInfoId) {
         String localMapPath = factorEnchance.getExtAttr1();
 
-        if(StringUtils.isNotBlank(localMapPath)){
+        if (StringUtils.isNotBlank(localMapPath)) {
             String[] keyArr = localMapPath.split("\\.");
-            if(keyArr.length == 2) {
+            if (keyArr.length == 2) {
                 Object dataObject = localMap.get(keyArr[0]);
-                if(dataObject instanceof List){
+                if (dataObject instanceof List) {
                     List<Map> dataList = (List<Map>) dataObject;
                     for (Map param : dataList) {
 
                         Object valueKey = param.get(keyArr[1]);
-                        if(null == valueKey){
-                            throw new NullPointerException("要素提取:"+factorEnchance.getId()+" 规则ID:"+medicalInsRuleInfoId+" 配置的对象路径不存在数据属性:"+localMapPath);
+                        if (null == valueKey) {
+                            throw new NullPointerException("要素提取:" + factorEnchance.getId() + " 规则ID:" + medicalInsRuleInfoId + " 配置的对象路径不存在数据属性:" + localMapPath);
                         }
                         Object value = redisTemplate.opsForHash().get(factorEnchance.getEnhanceValue(), valueKey.toString());
-                        if(value == null){
+                        if (value == null) {
                             log.error("要素提取: {} 规则ID: {} 配置的对象路径不存在数据属性: {} 转换的数据类型:{} 字段属性:{} 未匹配到对应的缓存数据,请刷新缓存", factorEnchance.getId(),
                                     medicalInsRuleInfoId, localMapPath, factorEnchance.getEnhanceValue(), valueKey);
                         }
                         Integer outEventAttrId = factorEnchance.getEventAttrId();
                         param.put(outEventAttrId.toString(), value);
                     }
-                }else if(dataObject instanceof Map){
+                } else if (dataObject instanceof Map) {
                     Map dataMap = (Map) dataObject;
                     Object valueKey = dataMap.get(keyArr[1]);
-                    if(null == valueKey){
-                        throw new NullPointerException("要素提取:"+factorEnchance.getId()+" 规则ID:"+medicalInsRuleInfoId+" 配置的对象路径不存在数据属性:"+localMapPath);
+                    if (null == valueKey) {
+                        throw new NullPointerException("要素提取:" + factorEnchance.getId() + " 规则ID:" + medicalInsRuleInfoId + " 配置的对象路径不存在数据属性:" + localMapPath);
                     }
                     Object value = redisTemplate.opsForHash().get(factorEnchance.getEnhanceValue(), valueKey.toString());
-                    if(value == null){
+                    if (value == null) {
                         log.error("要素提取: {} 规则ID: {} 配置的对象路径不存在数据属性: {} 转换的数据类型:{} 字段属性:{} 未匹配到对应的缓存数据,请刷新缓存", factorEnchance.getId(),
                                 medicalInsRuleInfoId, localMapPath, factorEnchance.getEnhanceValue(), valueKey);
                     }
@@ -71,10 +76,10 @@ public class DictUtil {
                 }
 
             }
-        }else{
+        } else {
             Object valueKey = localMap.get(factorEnchance.getExtAttr2());
             Object value = redisTemplate.opsForHash().get(factorEnchance.getEnhanceValue(), valueKey.toString());
-            if(value == null){
+            if (value == null) {
                 log.error("要素提取: {} 规则ID: {} 配置的对象路径不存在数据属性: {} 转换的数据类型:{} 字段属性:{} 未匹配到对应的缓存数据,请刷新缓存", factorEnchance.getId(),
                         medicalInsRuleInfoId, localMapPath, factorEnchance.getEnhanceValue(), valueKey);
             }
@@ -82,4 +87,80 @@ public class DictUtil {
             localMap.put(outEventAttrId.toString(), value);
         }
     }
+
+    /**
+     * 转换医保和医院编码
+     *
+     * @param midIncidentWarningVO
+     */
+    public void transferMidIncidentWarningVO(MidIncidentWarningVO midIncidentWarningVO) {
+        if (CollectionUtil.isNotEmpty(midIncidentWarningVO.getDiagnoses())) {
+            for (DiagnosesVO diagnose : midIncidentWarningVO.getDiagnoses()) {
+                if (null != diagnose.getDiagnose_code()) {
+                    Object value = redisTemplate.opsForHash().get(Constant.HIS_MEDICAL_DICT_KEY, diagnose.getDiagnose_code());
+                    if (value == null) {
+                        log.error("字段未配置该诊断编码映射的医保记录,项目:{}", diagnose);
+                    } else {
+                        value = diagnose.getDiagnose_code();
+                    }
+                    diagnose.setMedical_diagnose_code(value.toString());
+//                        itemMap.put(Constant.MEDICAL_DIAGNOSE_CODE_KEY, value);
+                    Object name = redisTemplate.opsForHash().get(Constant.MEDICAL_CODE_NAME_KEY, value.toString());
+                    if (null != name) {
+                        diagnose.setMedical_diagnose_name(name.toString());
+                    }
+                }
+            }
+        }
+
+        if (CollectionUtil.isNotEmpty(midIncidentWarningVO.getAdvice_details())) {
+            for (AdviceDetailsVO adviceDetailsVO : midIncidentWarningVO.getAdvice_details()) {
+                if (null != adviceDetailsVO.getProject_code()) {
+                    Object value = redisTemplate.opsForHash().get(Constant.HIS_MEDICAL_DICT_KEY, adviceDetailsVO.getProject_code());
+                    if (value == null) {
+                        log.error("字段未配置该项目编码映射的医保记录,项目:{}", adviceDetailsVO);
+                    } else {
+                        value = adviceDetailsVO.getProject_code();
+                    }
+                    adviceDetailsVO.setMedical_project_code(value.toString());
+//                        itemMap.put(Constant.MEDICAL_DIAGNOSE_CODE_KEY, value);
+                    Object name = redisTemplate.opsForHash().get(Constant.MEDICAL_CODE_NAME_KEY, value.toString());
+                    if (null != name) {
+                        adviceDetailsVO.setMedical_project_name(name.toString());
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 转换医保和医院编码
+     *
+     * @param itemMap
+     */
+    public void transferItemMap(Map<String, Object> itemMap) {
+        Object projectCode = itemMap.get(Constant.PROJECT_CODE_KEY);
+        if (null != projectCode) {
+            Object value = redisTemplate.opsForHash().get(Constant.HIS_MEDICAL_DICT_KEY, projectCode.toString());
+            if (value == null) {
+                log.error("字段未配置该项目编码映射的医保记录,项目:{}", itemMap);
+            } else {
+                itemMap.put(Constant.MEDICAL_PROJECT_CODE_KEY, value);
+                Object name = redisTemplate.opsForHash().get(Constant.MEDICAL_CODE_NAME_KEY, projectCode.toString());
+                itemMap.put(Constant.MEDICAL_PROJECT_NAME_KEY, name);
+            }
+        }
+
+        Object diagnoseCode = itemMap.get(Constant.DIAGNOSE_CODE_KEY);
+        if (null != diagnoseCode) {
+            Object value = redisTemplate.opsForHash().get(Constant.HIS_MEDICAL_DICT_KEY, diagnoseCode.toString());
+            if (value == null) {
+                log.error("字段未配置该诊断编码映射的医保记录,项目:{}", itemMap);
+            } else {
+                itemMap.put(Constant.MEDICAL_DIAGNOSE_CODE_KEY, value);
+                Object name = redisTemplate.opsForHash().get(Constant.MEDICAL_CODE_NAME_KEY, diagnoseCode.toString());
+                itemMap.put(Constant.MEDICAL_PROJECT_NAME_KEY, name);
+            }
+        }
+    }
 }

+ 9 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/plugin/InterfItemListPlugin.java

@@ -40,12 +40,11 @@ public class InterfItemListPlugin {
                 }else if(value instanceof Map){
                     Map<String,Object> pathValueMap = (Map) value;
                     Object itemCodeTemp = pathValueMap.get(attrName);
+                    if(null == itemCodeTemp) {
+                        continue;
+                    }
                     if(CollectionUtil.isEmpty(itemList)){
-                        if(null != itemCodeTemp) {
-                            Map<String,Object> itemTempMap = new HashMap<>();
-                            itemTempMap.put(attrName, itemCodeTemp);
-                            itemList.add(itemTempMap);
-                        }
+                        itemList.add(pathValueMap);
                     }else {
                         setItemToList(itemList, itemCodeTemp, attrName);
                     }
@@ -65,13 +64,17 @@ public class InterfItemListPlugin {
             for(Map<String,Object> itemTempMap : itemTempList){
                 temMap = new HashMap<>();
                 temMap.putAll(itemMap);
-                temMap.put(attrName, itemTempMap.get(attrName));
+                temMap.putAll(itemTempMap);
                 resultList.add(temMap);
             }
         }
         return resultList;
     }
 
+    public void setItemToEmptyList(List<Map<String,Object>> itemList, Map<String,Object> paramMap){
+        itemList.add(paramMap);
+    }
+
     public void setItemToList(List<Map<String,Object>> itemList, Object itemName, String attrName){
         for(Map<String,Object> itemMap : itemList){
             itemMap.put(attrName, itemName);

+ 86 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/projectcache/HisMedicalProjectCache.java

@@ -0,0 +1,86 @@
+package org.jeecg.modules.medical.ruleengine.projectcache;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.medical.Constant;
+import org.jeecg.modules.medical.entity.MaterialItems;
+import org.jeecg.modules.medical.entity.MedicalInsuranceDrugs;
+import org.jeecg.modules.medical.entity.TreatmentItems;
+import org.jeecg.modules.medical.service.IMaterialItemsService;
+import org.jeecg.modules.medical.service.IMedicalInsuranceDrugsService;
+import org.jeecg.modules.medical.service.ITreatmentItemsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.List;
+
+/**
+ * 医保和医院项目编码映射
+ */
+@Component
+public class HisMedicalProjectCache {
+    @Autowired
+    RedisTemplate redisTemplate;
+    @Autowired
+    IMedicalInsuranceDrugsService medicalInsuranceDrugsService;
+    @Autowired
+    ITreatmentItemsService treatmentItemsService;
+    @Autowired
+    IMaterialItemsService materialItemsService;
+
+    @PostConstruct
+    public void initHisMedicalProjectCache(){
+        long count = medicalInsuranceDrugsService.count();
+
+        if(count>0) {
+            long pageNum = count / 1000;
+            long modNum = count % 1000;
+            if (modNum > 0) {
+                pageNum = pageNum + 1;
+            }
+            for (int i = 0; i < pageNum; i++) {
+                IPage page = new Page(i, 1000);
+                List<MedicalInsuranceDrugs> medicalInsuranceDrugsList = medicalInsuranceDrugsService.page(page).getRecords();
+                for (MedicalInsuranceDrugs medicalInsuranceDrugs : medicalInsuranceDrugsList) {
+                    redisTemplate.opsForHash().put(Constant.HIS_MEDICAL_DICT_KEY, medicalInsuranceDrugs.getItemIdHosp(), medicalInsuranceDrugs.getMedicineCode());
+                    redisTemplate.opsForHash().put(Constant.MEDICAL_CODE_NAME_KEY, medicalInsuranceDrugs.getMedicineCode(), medicalInsuranceDrugs.getMedicineName());
+                }
+            }
+        }
+        count = treatmentItemsService.count();
+        if(count>0) {
+            long pageNum = count / 1000;
+            long modNum = count % 1000;
+            if (modNum > 0) {
+                pageNum = pageNum + 1;
+            }
+            for (int i = 0; i < pageNum; i++) {
+                IPage page = new Page(i, 1000);
+                List<TreatmentItems> treatmentItemsList = treatmentItemsService.page(page).getRecords();
+                for (TreatmentItems treatmentItems : treatmentItemsList) {
+                    redisTemplate.opsForHash().put(Constant.HIS_MEDICAL_DICT_KEY, treatmentItems.getItemIdHosp(), treatmentItems.getItemId());
+                    redisTemplate.opsForHash().put(Constant.MEDICAL_CODE_NAME_KEY, treatmentItems.getItemId(), treatmentItems.getItemName());
+                }
+            }
+        }
+
+        count = materialItemsService.count();
+        if(count>0) {
+            long pageNum = count / 1000;
+            long modNum = count % 1000;
+            if (modNum > 0) {
+                pageNum = pageNum + 1;
+            }
+            for (int i = 1; i <= pageNum; i++) {
+                IPage page = new Page(i, 1000);
+                List<MaterialItems> materialItemsList = materialItemsService.page(page).getRecords();
+                for (MaterialItems materialItem : materialItemsList) {
+                    redisTemplate.opsForHash().put(Constant.HIS_MEDICAL_DICT_KEY, materialItem.getItemIdHosp(), materialItem.getItemId());
+                    redisTemplate.opsForHash().put(Constant.MEDICAL_CODE_NAME_KEY, materialItem.getItemId(), materialItem.getItemName());
+                }
+            }
+        }
+    }
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMedicalInsuranceDrugsService.java

@@ -1,8 +1,13 @@
 package org.jeecg.modules.medical.service;
 
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.medical.entity.MedicalInsuranceDrugs;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
 /**
  * @Description: medical_insurance_drugs
  * @Author: jeecg-boot
@@ -11,4 +16,18 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IMedicalInsuranceDrugsService extends IService<MedicalInsuranceDrugs> {
 
+    /**
+     * 按照模板导入
+     * @param request
+     * @param response
+     */
+    Result<?> importExcel(HttpServletRequest request, HttpServletResponse response);
+
+
+    /**
+     * 根据医保药品编码获取数据库已经存在的数据
+     * @param medicineCodes
+     * @return
+     */
+    List<MedicalInsuranceDrugs> listByMedicineCodeIn(List<String> medicineCodes);
 }

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentVisitDetailLogService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.medical.service;
+
+import org.jeecg.modules.medical.entity.MidIncidentVisitDetailLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: mid_incident_visit_detail_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:44
+ * @Version: V1.0
+ */
+public interface IMidIncidentVisitDetailLogService extends IService<MidIncidentVisitDetailLog> {
+
+}

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/IMidIncidentVisitLogService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.medical.service;
+
+import org.jeecg.modules.medical.entity.MidIncidentVisitLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: mid_incident_visit_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:36
+ * @Version: V1.0
+ */
+public interface IMidIncidentVisitLogService extends IService<MidIncidentVisitLog> {
+
+}

+ 111 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MedicalInsuranceDrugsServiceImpl.java

@@ -1,11 +1,30 @@
 package org.jeecg.modules.medical.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.math3.geometry.partitioning.BSPTree;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.medical.entity.MedicalInsuranceDrugs;
 import org.jeecg.modules.medical.mapper.MedicalInsuranceDrugsMapper;
 import org.jeecg.modules.medical.service.IMedicalInsuranceDrugsService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.TransactionScoped;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Description: medical_insurance_drugs
@@ -13,7 +32,99 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @Date:   2023-04-23
  * @Version: V1.0
  */
+@Slf4j
+@Transactional
 @Service
 public class MedicalInsuranceDrugsServiceImpl extends ServiceImpl<MedicalInsuranceDrugsMapper, MedicalInsuranceDrugs> implements IMedicalInsuranceDrugsService {
 
+    @Transactional(readOnly = false)
+    @Override
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            // 获取上传文件对象
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<MedicalInsuranceDrugs> list = ExcelImportUtil.importExcel(file.getInputStream(), MedicalInsuranceDrugs.class, params);
+                if (CollectionUtils.isEmpty(list)) {
+                    return Result.error("文件导入失败:没有找到要导入的数据!");
+                }
+                if (list.size() > 10000) {
+                    return Result.error("文件导入失败:不可一次性导入超过10000条数据!");
+                }
+                // 去重
+                list = list.stream().collect(
+                        Collectors.collectingAndThen(
+                                Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MedicalInsuranceDrugs::getMedicineCode))), ArrayList::new
+                        )
+                );
+
+                //检查是否有更新的数据,根据医保药品编码
+                List<String> collect = list.stream().map(MedicalInsuranceDrugs::getMedicineCode).collect(Collectors.toList());
+                List<MedicalInsuranceDrugs> dbExistsList = this.listByMedicineCodeIn(collect);
+                // 更新列表
+                List<MedicalInsuranceDrugs> updateList = new ArrayList<>();
+                // 新增列表
+                List<MedicalInsuranceDrugs> instalList = list;
+                if (!CollectionUtils.isEmpty(dbExistsList)) { // 不为空时, 需要将存在的做更新操作
+                    // 取出交集
+                    updateList = list.stream().filter(
+                            a -> dbExistsList.stream().map(MedicalInsuranceDrugs::getMedicineCode)
+                                    .anyMatch(
+                                            medicineCode -> ObjectUtils.nullSafeEquals(a.getMedicineCode(), medicineCode)
+                                    )
+                    ).collect(Collectors.toList());
+                    // 如果有则需要更新
+                    if (!CollectionUtils.isEmpty(updateList)) {
+                        this.updateBatchById(updateList, 500);
+                    }
+                    // 取出差集
+                    instalList = list.stream().filter(
+                            excelData -> dbExistsList.stream().map(MedicalInsuranceDrugs::getMedicineCode).noneMatch(medicineCode ->
+                                    ObjectUtils.nullSafeEquals(excelData.getMedicineCode(), medicineCode))
+                    ).collect(Collectors.toList());
+                }
+                //update-begin-author:taoyan date:20190528 for:批量插入数据
+                long start = System.currentTimeMillis();
+                if (!CollectionUtils.isEmpty(instalList)) {
+                    this.saveBatch(instalList, 500);
+                }
+
+                //400条 saveBatch消耗时间1592毫秒  循环插入消耗时间1947毫秒
+                //1200条  saveBatch消耗时间3687毫秒 循环插入消耗时间5212毫秒
+                log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
+                //update-end-author:taoyan date:20190528 for:批量插入数据
+                return Result.ok("文件导入成功!数据行数:" + list.size());
+            } catch (Exception e) {
+                //update-begin-author:taoyan date:20211124 for: 导入数据重复增加提示
+                String msg = e.getMessage();
+                log.error(msg, e);
+                if(msg!=null && msg.contains("Duplicate entry")){
+                    return Result.error("文件导入失败:有重复数据!");
+                }else{
+                    return Result.error("文件导入失败:" + e.getMessage());
+                }
+                //update-end-author:taoyan date:20211124 for: 导入数据重复增加提示
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.error("文件导入失败!");
+    }
+
+    @Override
+    public List<MedicalInsuranceDrugs> listByMedicineCodeIn(List<String> medicineCodes) {
+        LambdaQueryWrapper<MedicalInsuranceDrugs> in = Wrappers.<MedicalInsuranceDrugs>lambdaQuery()
+                .in(MedicalInsuranceDrugs::getMedicineCode, medicineCodes);
+        return list(in);
+    }
 }

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentVisitDetailLogServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.medical.service.impl;
+
+import org.jeecg.modules.medical.entity.MidIncidentVisitDetailLog;
+import org.jeecg.modules.medical.mapper.MidIncidentVisitDetailLogMapper;
+import org.jeecg.modules.medical.service.IMidIncidentVisitDetailLogService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: mid_incident_visit_detail_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:44
+ * @Version: V1.0
+ */
+@Service
+public class MidIncidentVisitDetailLogServiceImpl extends ServiceImpl<MidIncidentVisitDetailLogMapper, MidIncidentVisitDetailLog> implements IMidIncidentVisitDetailLogService {
+
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/service/impl/MidIncidentVisitLogServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.medical.service.impl;
+
+import org.jeecg.modules.medical.entity.MidIncidentVisitLog;
+import org.jeecg.modules.medical.mapper.MidIncidentVisitLogMapper;
+import org.jeecg.modules.medical.service.IMidIncidentVisitLogService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: mid_incident_visit_log
+ * @Author: jeecg-boot
+ * @Date:   2023-05-12 09:23:36
+ * @Version: V1.0
+ */
+@Service
+public class MidIncidentVisitLogServiceImpl extends ServiceImpl<MidIncidentVisitLogMapper, MidIncidentVisitLog> implements IMidIncidentVisitLogService {
+
+}

+ 375 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitDetailLogList.vue

@@ -0,0 +1,375 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('mid_incident_visit_detail_log')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <mid-incident-visit-detail-log-modal ref="modalForm" @ok="modalFormOk"></mid-incident-visit-detail-log-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import MidIncidentVisitDetailLogModal from './modules/MidIncidentVisitDetailLogModal'
+
+  export default {
+    name: 'MidIncidentVisitDetailLogList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      MidIncidentVisitDetailLogModal
+    },
+    data () {
+      return {
+        description: 'mid_incident_visit_detail_log管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'医保规则ID',
+            align:"center",
+            dataIndex: 'medicalInsRuleInfoId'
+          },
+          {
+            title:'医保规则编码',
+            align:"center",
+            dataIndex: 'medicalInsRuleInfoCode'
+          },
+          {
+            title:'医保规则名称',
+            align:"center",
+            dataIndex: 'medicalInsRuleInfoName'
+          },
+          {
+            title:'事中门诊日志表ID',
+            align:"center",
+            dataIndex: 'midIncidentVisitLogId'
+          },
+          {
+            title:'就诊类别;住院/门诊',
+            align:"center",
+            dataIndex: 'visitType'
+          },
+          {
+            title:'科室编码',
+            align:"center",
+            dataIndex: 'medicalDeptCode'
+          },
+          {
+            title:'科室名称',
+            align:"center",
+            dataIndex: 'medicalDeptName'
+          },
+          {
+            title:'医生姓名',
+            align:"center",
+            dataIndex: 'doctorName'
+          },
+          {
+            title:'主诊医师编码',
+            align:"center",
+            dataIndex: 'doctorId'
+          },
+          {
+            title:'个人编号',
+            align:"center",
+            dataIndex: 'patientId'
+          },
+          {
+            title:'患者姓名',
+            align:"center",
+            dataIndex: 'patientName'
+          },
+          {
+            title:'住院号/门诊号',
+            align:"center",
+            dataIndex: 'visitNo'
+          },
+          {
+            title:'医嘱号/处方号',
+            align:"center",
+            dataIndex: 'recipeNo'
+          },
+          {
+            title:'项目类型',
+            align:"center",
+            dataIndex: 'projectType'
+          },
+          {
+            title:'项目编码',
+            align:"center",
+            dataIndex: 'proejctCode'
+          },
+          {
+            title:'项目名称',
+            align:"center",
+            dataIndex: 'proejctName'
+          },
+          {
+            title:'医保项目编码',
+            align:"center",
+            dataIndex: 'medicalProjectCode'
+          },
+          {
+            title:'医保项目名称',
+            align:"center",
+            dataIndex: 'medicalProjectName'
+          },
+          {
+            title:'发票项目编号',
+            align:"center",
+            dataIndex: 'invoiceProject'
+          },
+          {
+            title:'费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费',
+            align:"center",
+            dataIndex: 'expenseCategory'
+          },
+          {
+            title:'剂型',
+            align:"center",
+            dataIndex: 'doseForm'
+          },
+          {
+            title:'规格',
+            align:"center",
+            dataIndex: 'medicalSpecification'
+          },
+          {
+            title:'价格;单价,必须使用数值型,如”12.5”',
+            align:"center",
+            dataIndex: 'price'
+          },
+          {
+            title:'数量;数量,必须使用数值型,如”10”',
+            align:"center",
+            dataIndex: 'medicalNumber'
+          },
+          {
+            title:'单位',
+            align:"center",
+            dataIndex: 'doseUnit'
+          },
+          {
+            title:'金额;金额,必须使用数值型,如”50.5”',
+            align:"center",
+            dataIndex: 'amount'
+          },
+          {
+            title:'用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”',
+            align:"center",
+            dataIndex: 'useDay'
+          },
+          {
+            title:'单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”',
+            align:"center",
+            dataIndex: 'singleDoseNumber'
+          },
+          {
+            title:'单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)',
+            align:"center",
+            dataIndex: 'singleDoseUnit'
+          },
+          {
+            title:'药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”',
+            align:"center",
+            dataIndex: 'doseDay'
+          },
+          {
+            title:'服用频次',
+            align:"center",
+            dataIndex: 'takeFrequence'
+          },
+          {
+            title:'医保标志',
+            align:"center",
+            dataIndex: 'medicalInsuranceMark'
+          },
+          {
+            title:'检查部位',
+            align:"center",
+            dataIndex: 'inspectionSite'
+          },
+          {
+            title:'医嘱大类',
+            align:"center",
+            dataIndex: 'orderCatalog'
+          },
+          {
+            title:'医嘱类别',
+            align:"center",
+            dataIndex: 'orderType'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/medical/midIncidentVisitDetailLog/list",
+          delete: "/medical/midIncidentVisitDetailLog/delete",
+          deleteBatch: "/medical/midIncidentVisitDetailLog/deleteBatch",
+          exportXlsUrl: "/medical/midIncidentVisitDetailLog/exportXls",
+          importExcelUrl: "medical/midIncidentVisitDetailLog/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'medicalInsRuleInfoId',text:'医保规则ID'})
+        fieldList.push({type:'string',value:'medicalInsRuleInfoCode',text:'医保规则编码'})
+        fieldList.push({type:'string',value:'medicalInsRuleInfoName',text:'医保规则名称'})
+        fieldList.push({type:'int',value:'midIncidentVisitLogId',text:'事中门诊日志表ID'})
+        fieldList.push({type:'string',value:'visitType',text:'就诊类别;住院/门诊'})
+        fieldList.push({type:'string',value:'medicalDeptCode',text:'科室编码'})
+        fieldList.push({type:'string',value:'medicalDeptName',text:'科室名称'})
+        fieldList.push({type:'string',value:'doctorName',text:'医生姓名'})
+        fieldList.push({type:'string',value:'doctorId',text:'主诊医师编码'})
+        fieldList.push({type:'string',value:'patientId',text:'个人编号'})
+        fieldList.push({type:'string',value:'patientName',text:'患者姓名'})
+        fieldList.push({type:'string',value:'visitNo',text:'住院号/门诊号'})
+        fieldList.push({type:'string',value:'recipeNo',text:'医嘱号/处方号'})
+        fieldList.push({type:'string',value:'projectType',text:'项目类型'})
+        fieldList.push({type:'string',value:'proejctCode',text:'项目编码'})
+        fieldList.push({type:'string',value:'proejctName',text:'项目名称'})
+        fieldList.push({type:'string',value:'medicalProjectCode',text:'医保项目编码'})
+        fieldList.push({type:'string',value:'medicalProjectName',text:'医保项目名称'})
+        fieldList.push({type:'string',value:'invoiceProject',text:'发票项目编号'})
+        fieldList.push({type:'string',value:'expenseCategory',text:'费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费'})
+        fieldList.push({type:'string',value:'doseForm',text:'剂型'})
+        fieldList.push({type:'string',value:'medicalSpecification',text:'规格'})
+        fieldList.push({type:'number',value:'price',text:'价格;单价,必须使用数值型,如”12.5”'})
+        fieldList.push({type:'int',value:'medicalNumber',text:'数量;数量,必须使用数值型,如”10”'})
+        fieldList.push({type:'string',value:'doseUnit',text:'单位'})
+        fieldList.push({type:'number',value:'amount',text:'金额;金额,必须使用数值型,如”50.5”'})
+        fieldList.push({type:'int',value:'useDay',text:'用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”'})
+        fieldList.push({type:'int',value:'singleDoseNumber',text:'单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”'})
+        fieldList.push({type:'string',value:'singleDoseUnit',text:'单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)'})
+        fieldList.push({type:'int',value:'doseDay',text:'药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”'})
+        fieldList.push({type:'string',value:'takeFrequence',text:'服用频次'})
+        fieldList.push({type:'string',value:'medicalInsuranceMark',text:'医保标志'})
+        fieldList.push({type:'string',value:'inspectionSite',text:'检查部位'})
+        fieldList.push({type:'string',value:'orderCatalog',text:'医嘱大类'})
+        fieldList.push({type:'string',value:'orderType',text:'医嘱类别'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitDetailLog_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/medical文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
+VALUES ('2023051209232290440', NULL, 'mid_incident_visit_detail_log', '/medical/midIncidentVisitDetailLogList', 'medical/MidIncidentVisitDetailLogList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232290441', '2023051209232290440', '添加mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232290442', '2023051209232290440', '编辑mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232290443', '2023051209232290440', '删除mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232290444', '2023051209232290440', '批量删除mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232300445', '2023051209232290440', '导出excel_mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209232300446', '2023051209232290440', '导入excel_mid_incident_visit_detail_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_detail_log:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:44', NULL, NULL, 0, 0, '1', 0);

+ 234 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitLogList.vue

@@ -0,0 +1,234 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('mid_incident_visit_log')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <mid-incident-visit-log-modal ref="modalForm" @ok="modalFormOk"></mid-incident-visit-log-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import MidIncidentVisitLogModal from './modules/MidIncidentVisitLogModal'
+
+  export default {
+    name: 'MidIncidentVisitLogList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      MidIncidentVisitLogModal
+    },
+    data () {
+      return {
+        description: 'mid_incident_visit_log管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'就诊类别;住院/门诊',
+            align:"center",
+            dataIndex: 'visitType'
+          },
+          {
+            title:'科室编码',
+            align:"center",
+            dataIndex: 'medicalDeptCode'
+          },
+          {
+            title:'科室名称',
+            align:"center",
+            dataIndex: 'medicalDeptName'
+          },
+          {
+            title:'医生姓名',
+            align:"center",
+            dataIndex: 'doctorName'
+          },
+          {
+            title:'主诊医师编码',
+            align:"center",
+            dataIndex: 'doctorId'
+          },
+          {
+            title:'个人编号',
+            align:"center",
+            dataIndex: 'patientId'
+          },
+          {
+            title:'患者姓名',
+            align:"center",
+            dataIndex: 'patientName'
+          },
+          {
+            title:'住院号/门诊号',
+            align:"center",
+            dataIndex: 'visitNo'
+          },
+          {
+            title:'医嘱号/处方号',
+            align:"center",
+            dataIndex: 'doctorAdviceNo'
+          },
+          {
+            title:'入院日期',
+            align:"center",
+            dataIndex: 'inHospDate',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'诊断编码',
+            align:"center",
+            dataIndex: 'diagnoses'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/medical/midIncidentVisitLog/list",
+          delete: "/medical/midIncidentVisitLog/delete",
+          deleteBatch: "/medical/midIncidentVisitLog/deleteBatch",
+          exportXlsUrl: "/medical/midIncidentVisitLog/exportXls",
+          importExcelUrl: "medical/midIncidentVisitLog/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'visitType',text:'就诊类别;住院/门诊'})
+        fieldList.push({type:'string',value:'medicalDeptCode',text:'科室编码'})
+        fieldList.push({type:'string',value:'medicalDeptName',text:'科室名称'})
+        fieldList.push({type:'string',value:'doctorName',text:'医生姓名'})
+        fieldList.push({type:'string',value:'doctorId',text:'主诊医师编码'})
+        fieldList.push({type:'string',value:'patientId',text:'个人编号'})
+        fieldList.push({type:'string',value:'patientName',text:'患者姓名'})
+        fieldList.push({type:'string',value:'visitNo',text:'住院号/门诊号'})
+        fieldList.push({type:'string',value:'doctorAdviceNo',text:'医嘱号/处方号'})
+        fieldList.push({type:'date',value:'inHospDate',text:'入院日期'})
+        fieldList.push({type:'string',value:'diagnoses',text:'诊断编码'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/MidIncidentVisitLog_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/medical文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
+VALUES ('2023051209238230360', NULL, 'mid_incident_visit_log', '/medical/midIncidentVisitLogList', 'medical/MidIncidentVisitLogList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240361', '2023051209238230360', '添加mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240362', '2023051209238230360', '编辑mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240363', '2023051209238230360', '删除mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240364', '2023051209238230360', '批量删除mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240365', '2023051209238230360', '导出excel_mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2023051209238240366', '2023051209238230360', '导入excel_mid_incident_visit_log', NULL, NULL, 0, NULL, NULL, 2, 'medical:mid_incident_visit_log:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-05-12 09:23:36', NULL, NULL, 0, 0, '1', 0);

+ 274 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogForm.vue

@@ -0,0 +1,274 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="医保规则ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalInsRuleInfoId">
+              <a-input-number v-model="model.medicalInsRuleInfoId" placeholder="请输入医保规则ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医保规则编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalInsRuleInfoCode">
+              <a-input v-model="model.medicalInsRuleInfoCode" placeholder="请输入医保规则编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医保规则名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalInsRuleInfoName">
+              <a-input v-model="model.medicalInsRuleInfoName" placeholder="请输入医保规则名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="事中门诊日志表ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="midIncidentVisitLogId">
+              <a-input-number v-model="model.midIncidentVisitLogId" placeholder="请输入事中门诊日志表ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="就诊类别;住院/门诊" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="visitType">
+              <a-input v-model="model.visitType" placeholder="请输入就诊类别;住院/门诊"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="科室编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalDeptCode">
+              <a-input v-model="model.medicalDeptCode" placeholder="请输入科室编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="科室名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalDeptName">
+              <a-input v-model="model.medicalDeptName" placeholder="请输入科室名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医生姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doctorName">
+              <a-input v-model="model.doctorName" placeholder="请输入医生姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="主诊医师编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doctorId">
+              <a-input v-model="model.doctorId" placeholder="请输入主诊医师编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="个人编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="patientId">
+              <a-input v-model="model.patientId" placeholder="请输入个人编号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="患者姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="patientName">
+              <a-input v-model="model.patientName" placeholder="请输入患者姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="住院号/门诊号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="visitNo">
+              <a-input v-model="model.visitNo" placeholder="请输入住院号/门诊号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医嘱号/处方号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="recipeNo">
+              <a-input v-model="model.recipeNo" placeholder="请输入医嘱号/处方号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="项目类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectType">
+              <a-input v-model="model.projectType" placeholder="请输入项目类型"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="项目编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="proejctCode">
+              <a-input v-model="model.proejctCode" placeholder="请输入项目编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="proejctName">
+              <a-input v-model="model.proejctName" placeholder="请输入项目名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医保项目编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalProjectCode">
+              <a-input v-model="model.medicalProjectCode" placeholder="请输入医保项目编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医保项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalProjectName">
+              <a-input v-model="model.medicalProjectName" placeholder="请输入医保项目名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="发票项目编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoiceProject">
+              <a-input v-model="model.invoiceProject" placeholder="请输入发票项目编号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expenseCategory">
+              <a-input v-model="model.expenseCategory" placeholder="请输入费用类别;床位费、诊查费、检查费、化验费、治疗费、手术费、护理费、卫生材料费、西药费、中药饮片费"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="剂型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doseForm">
+              <a-input v-model="model.doseForm" placeholder="请输入剂型"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalSpecification">
+              <a-input v-model="model.medicalSpecification" placeholder="请输入规格"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="价格;单价,必须使用数值型,如”12.5”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
+              <a-input-number v-model="model.price" placeholder="请输入价格;单价,必须使用数值型,如”12.5”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="数量;数量,必须使用数值型,如”10”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalNumber">
+              <a-input-number v-model="model.medicalNumber" placeholder="请输入数量;数量,必须使用数值型,如”10”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doseUnit">
+              <a-input v-model="model.doseUnit" placeholder="请输入单位"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="金额;金额,必须使用数值型,如”50.5”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
+              <a-input-number v-model="model.amount" placeholder="请输入金额;金额,必须使用数值型,如”50.5”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useDay">
+              <a-input-number v-model="model.useDay" placeholder="请输入用药天数;用药天数(项目为药品时非空),医嘱服用该药品天数,必须使用数值型,如”15”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="singleDoseNumber">
+              <a-input-number v-model="model.singleDoseNumber" placeholder="请输入单次用药量;单次用药量(项目为药品时非空),配合下一个字段的单位,如 50 mg,必须使用数值型,如”50”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="singleDoseUnit">
+              <a-input v-model="model.singleDoseUnit" placeholder="请输入单次用药量剂量单位;单次用药量剂量单位(项目为药品时非空)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doseDay">
+              <a-input-number v-model="model.doseDay" placeholder="请输入药量天数;药量天数(项目为药品时非空),依据医嘱服药要求,所配药品患者可以服用的天数,必须使用数值型,如”5”" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="服用频次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="takeFrequence">
+              <a-input v-model="model.takeFrequence" placeholder="请输入服用频次"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医保标志" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalInsuranceMark">
+              <a-input v-model="model.medicalInsuranceMark" placeholder="请输入医保标志"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="检查部位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionSite">
+              <a-input v-model="model.inspectionSite" placeholder="请输入检查部位"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医嘱大类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCatalog">
+              <a-input v-model="model.orderCatalog" placeholder="请输入医嘱大类"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医嘱类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderType">
+              <a-input v-model="model.orderType" placeholder="请输入医嘱类别"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'MidIncidentVisitDetailLogForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/medical/midIncidentVisitDetailLog/add",
+          edit: "/medical/midIncidentVisitDetailLog/edit",
+          queryById: "/medical/midIncidentVisitDetailLog/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <mid-incident-visit-detail-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></mid-incident-visit-detail-log-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import MidIncidentVisitDetailLogForm from './MidIncidentVisitDetailLogForm'
+
+  export default {
+    name: 'MidIncidentVisitDetailLogModal',
+    components: {
+      MidIncidentVisitDetailLogForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitDetailLogModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <mid-incident-visit-detail-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></mid-incident-visit-detail-log-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import MidIncidentVisitDetailLogForm from './MidIncidentVisitDetailLogForm'
+  export default {
+    name: 'MidIncidentVisitDetailLogModal',
+    components: {
+      MidIncidentVisitDetailLogForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 154 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogForm.vue

@@ -0,0 +1,154 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="就诊类别;住院/门诊" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="visitType">
+              <a-input v-model="model.visitType" placeholder="请输入就诊类别;住院/门诊"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="科室编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalDeptCode">
+              <a-input v-model="model.medicalDeptCode" placeholder="请输入科室编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="科室名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="medicalDeptName">
+              <a-input v-model="model.medicalDeptName" placeholder="请输入科室名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医生姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doctorName">
+              <a-input v-model="model.doctorName" placeholder="请输入医生姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="主诊医师编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doctorId">
+              <a-input v-model="model.doctorId" placeholder="请输入主诊医师编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="个人编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="patientId">
+              <a-input v-model="model.patientId" placeholder="请输入个人编号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="患者姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="patientName">
+              <a-input v-model="model.patientName" placeholder="请输入患者姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="住院号/门诊号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="visitNo">
+              <a-input v-model="model.visitNo" placeholder="请输入住院号/门诊号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="医嘱号/处方号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doctorAdviceNo">
+              <a-input v-model="model.doctorAdviceNo" placeholder="请输入医嘱号/处方号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="入院日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inHospDate">
+              <j-date placeholder="请选择入院日期" v-model="model.inHospDate"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="诊断编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diagnoses">
+              <a-input v-model="model.diagnoses" placeholder="请输入诊断编码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'MidIncidentVisitLogForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/medical/midIncidentVisitLog/add",
+          edit: "/medical/midIncidentVisitLog/edit",
+          queryById: "/medical/midIncidentVisitLog/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <mid-incident-visit-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></mid-incident-visit-log-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import MidIncidentVisitLogForm from './MidIncidentVisitLogForm'
+
+  export default {
+    name: 'MidIncidentVisitLogModal',
+    components: {
+      MidIncidentVisitLogForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/vue/modules/MidIncidentVisitLogModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <mid-incident-visit-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></mid-incident-visit-log-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import MidIncidentVisitLogForm from './MidIncidentVisitLogForm'
+  export default {
+    name: 'MidIncidentVisitLogModal',
+    components: {
+      MidIncidentVisitLogForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 27 - 21
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java

@@ -1,18 +1,21 @@
 package org.jeecg.modules.message.websocket;
 
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import javax.websocket.*;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-
-import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.base.BaseMap;
 import org.jeecg.common.constant.WebsocketConst;
 import org.jeecg.common.modules.redis.client.JeecgRedisClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import lombok.extern.slf4j.Slf4j;
+
+import javax.websocket.OnClose;
+import javax.websocket.OnError;
+import javax.websocket.OnMessage;
+import javax.websocket.OnOpen;
+import javax.websocket.Session;
+import javax.websocket.server.PathParam;
+import javax.websocket.server.ServerEndpoint;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * @Author scott
@@ -23,8 +26,10 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 @ServerEndpoint("/websocket/{userId}")
 public class WebSocket {
-    
-    /**线程安全Map*/
+
+    /**
+     * 线程安全Map
+     */
     private static ConcurrentHashMap<String, Session> sessionPool = new ConcurrentHashMap<>();
 
     /**
@@ -58,24 +63,24 @@ public class WebSocket {
     /**
      * ws推送消息
      *
-     * @param userId
+     * @param ipStr
      * @param message
      */
-    public void pushMessage(String userId, String message) {
+    public void pushMessage(String ipStr, String message) {
         for (Map.Entry<String, Session> item : sessionPool.entrySet()) {
             //userId key值= {用户id + "_"+ 登录token的md5串}
             //TODO vue2未改key新规则,暂时不影响逻辑
-            if (item.getKey().contains(userId)) {
+            if (item.getKey().contains(ipStr)) {
                 Session session = item.getValue();
                 try {
                     //update-begin-author:taoyan date:20211012 for: websocket报错 https://gitee.com/jeecg/jeecg-boot/issues/I4C0MU
-                    synchronized (session){
-                        log.info("【系统 WebSocket】推送单人消息:" + message);
+                    synchronized (session) {
+                        log.info("【系统 WebSocket】推送:{} 单人消息:{}", ipStr, message);
                         session.getBasicRemote().sendText(message);
                     }
                     //update-end-author:taoyan date:20211012 for: websocket报错 https://gitee.com/jeecg/jeecg-boot/issues/I4C0MU
                 } catch (Exception e) {
-                    log.error(e.getMessage(),e);
+                    log.error(e.getMessage(), e);
                 }
             }
         }
@@ -105,12 +110,12 @@ public class WebSocket {
      */
     @OnMessage
     public void onMessage(String message, @PathParam(value = "userId") String userId) {
-        if(!"ping".equals(message) && !WebsocketConst.CMD_CHECK.equals(message)){
+        if (!"ping".equals(message) && !WebsocketConst.CMD_CHECK.equals(message)) {
             log.info("【系统 WebSocket】收到客户端消息:" + message);
-        }else{
+        } else {
             log.debug("【系统 WebSocket】收到客户端消息:" + message);
         }
-        
+
 //        //------------------------------------------------------------------------------
 //        JSONObject obj = new JSONObject();
 //        //业务类型
@@ -133,9 +138,10 @@ public class WebSocket {
         t.printStackTrace();
     }
     //==========【系统 WebSocket接受、推送消息等方法 —— 具体服务节点推送ws消息】========================================================================================
-    
+
 
     //==========【采用redis发布订阅模式——推送消息】========================================================================================
+
     /**
      * 后台发送消息到redis
      *
@@ -174,5 +180,5 @@ public class WebSocket {
         }
     }
     //=======【采用redis发布订阅模式——推送消息】==========================================================================================
-    
+
 }

+ 36 - 0
jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/SpelTest.java

@@ -1,9 +1,15 @@
 package org.jeecg;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import org.jeecg.modules.demo.mock.MockController;
 import org.jeecg.modules.demo.test.entity.JeecgDemo;
 import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
 import org.jeecg.modules.demo.test.service.IJeecgDemoService;
+import org.jeecg.modules.medical.entity.AdviceDetailsVO;
+import org.jeecg.modules.medical.entity.DiagnosesVO;
+import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
 import org.jeecg.modules.medical.ruleengine.SPELUtil;
 import org.jeecg.modules.system.service.ISysDataLogService;
 import org.junit.Assert;
@@ -14,7 +20,9 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
@@ -24,7 +32,35 @@ public class SpelTest {
 
 	@Test
 	public void testSpel(){
+		MidIncidentWarningVO midIncidentWarningVO = new MidIncidentWarningVO();
+		List<DiagnosesVO> diagnosesVOList = new ArrayList<>();
+		DiagnosesVO diagnosesVO = new DiagnosesVO();
+		diagnosesVO.setDiagnose_desc("1111");
+		diagnosesVO.setDiagnose_code("11113");
+		DiagnosesVO diagnosesVO1 = new DiagnosesVO();
+		diagnosesVO1.setDiagnose_desc("1112");
+		diagnosesVO1.setDiagnose_code("11123");
+		diagnosesVOList.add(diagnosesVO);
+		diagnosesVOList.add(diagnosesVO1);
+		midIncidentWarningVO.setDiagnoses(diagnosesVOList);
+		List<AdviceDetailsVO> AdviceDetailsVOList = new ArrayList<>();
+		AdviceDetailsVO detailsVO = new AdviceDetailsVO();
+		detailsVO.setProject_code("women");
+		AdviceDetailsVOList.add(detailsVO);
+		AdviceDetailsVO detailsVO1 = new AdviceDetailsVO();
+		detailsVO1.setProject_code("women111");
+		AdviceDetailsVOList.add(detailsVO1);
+		midIncidentWarningVO.setAdvice_details(AdviceDetailsVOList);
+		String jsonStr = JSON.toJSONString(midIncidentWarningVO);
+		System.out.println(jsonStr);
+		JSONObject dataMap = JSON.parseObject(jsonStr);
 
+		Object list = dataMap.get("advice_details");
+		System.out.println(list instanceof List);
+		List<Map<String,Object>> adviceDetailsList = (List<Map<String, Object>>) list;
+		for(Map<String,Object> adMap : adviceDetailsList){
+			System.out.println(adMap.get("project_code"));
+		}
 	}
 
 }