ltkj-admin/src/main/java/com/ltkj/web/controller/app/WxloginController.java
@@ -16,9 +16,12 @@ import com.ltkj.framework.config.UserHoder; import com.ltkj.hosp.domain.GetPhone; import com.ltkj.hosp.domain.TjCustomer; import com.ltkj.hosp.domain.TjOrder; import com.ltkj.hosp.domain.Wxuser; import com.ltkj.hosp.service.IAbucoderWxuserService; import com.ltkj.hosp.service.ITjCustomerService; import com.ltkj.hosp.service.ITjOrderRemarkService; import com.ltkj.hosp.service.ITjOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -28,6 +31,7 @@ import okhttp3.Response; import org.aspectj.bridge.MessageWriter; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -65,6 +69,11 @@ @Resource private IAbucoderWxuserService wxuserService; @Autowired private ITjOrderService orderService; @Resource private ITjOrderRemarkService remarkService; @Value("${xcx.appid}") private String appid; @@ -212,6 +221,65 @@ return AjaxResult.error(); } @PostMapping("/wx/wenzhenxinxi") @ApiOperation("小程序问诊信息") public AjaxResult wenzhenxinxi(@RequestBody String json) { cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json); String idCard = entries.getStr("idCard"); TjCustomer tjCustomer = customerService.getTjCustomerByCusIdCard(idCard); if(null != tjCustomer){ List<Map<String, Object>> mapList = new ArrayList<>(); LambdaQueryWrapper<TjOrder> wq=new LambdaQueryWrapper<>(); wq.eq(TjOrder::getUserId, tjCustomer.getCusId()); List<TjOrder> list = orderService.list(wq); if(null != list && !list.isEmpty()){ for (TjOrder order : list) { Map<String, Object> map = new HashMap<>(); if(order.getPacId().equals("0")){ map.put("pacName","普通体检"); }else { map.put("pacName",orderService.getpacName(order.getPacId())); } map.put("zjq",orderService.gettjzj(order.getOrderId())); map.put("tjsj",order.getCreateTime()); map.put("tjxm",remarkService.getTjxm(order.getTjNumber())); int czwj = remarkService.panduaniscunzaiweijian(order.getTjNumber()); int sfwc = remarkService.panduaniswancheng(order.getTjNumber()); Date checkTime = order.getCheckTime(); Date reportTime = order.getReportTime(); Integer heshouStatus = order.getHeshouStatus(); Date lastTime = order.getPrintLastTime(); if (czwj == 0) { map.put("tjzt","未检"); } if (czwj > 0) { map.put("tjzt","在检"); } if (sfwc == 0) { map.put("tjzt","已完成"); } if (null != checkTime) { map.put("tjzt","已审核"); } if (null != reportTime) { map.put("tjzt","生成报告"); } if (1 == heshouStatus) { map.put("tjzt","报告核收"); } if (null != lastTime) { map.put("tjzt","已打印"); } mapList.add(map); } return AjaxResult.success(mapList); } } return AjaxResult.error("暂无问诊记录"); } /** * 发送请求用code换取sessionKey和相关信息 * ltkj-admin/src/test/java/zjhTest.java
@@ -3,6 +3,7 @@ import com.ltkj.LtkjApplication;import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.TjJcycxm; import com.ltkj.hosp.idutil.IdUtils; import com.ltkj.system.service.ISysConfigService; import jodd.util.StringUtil; import lombok.extern.slf4j.Slf4j; import org.junit.Test; @@ -50,24 +51,32 @@ @Value("${token.secret_key}") private String secret; @Autowired private ISysConfigService configService; @Test public void test() throws InterruptedException { // // ExecutorService executorService = Executors.newFixedThreadPool(20); // 20个线程池 // Set<String> numbers = Collections.synchronizedSet(new HashSet<>()); // 线程安全的Set,存放生成的编号 // // 并发执行 // for (int i = 0; i < 20; i++) { // executorService.execute(() -> { // try { // String number = idUtils.getNewTjNumberRedisLock(); // 调用获取编号的方法 // numbers.add(number); // 添加到 Set // } catch (RuntimeException e) { // throw new RuntimeException(e); // } // }); // } // System.out.println(numbers); // executorService.shutdown(); // 关闭线程池 ExecutorService executorService = Executors.newFixedThreadPool(20); // 20个线程池 Set<String> numbers = Collections.synchronizedSet(new HashSet<>()); // 线程安全的Set,存放生成的编号 // 并发执行 for (int i = 0; i < 20; i++) { executorService.execute(() -> { try { String number = idUtils.getNewTjNumberRedisLock(); // 调用获取编号的方法 numbers.add(number); // 添加到 Set } catch (RuntimeException e) { throw new RuntimeException(e); } }); } System.out.println(numbers); executorService.shutdown(); // 关闭线程池 // String regex = configService.selectConfigByKey("jcycxmzz"); // String input = "右侧颈总动脉可见范围4.2x1.3mm斑块;左侧颈内动脉可见范围7.8x1.5mm斑块,余管腔内未见明显异常回声,CDFI:其内彩色血流充盈良好,血流速度正常"; // String[] split = input.replaceAll("\n", "").split(regex); // System.out.println(split); } ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
@@ -445,4 +445,17 @@ @Select("SELECT COUNT(*) FROM tj_order a WHERE a.deleted=0 AND " + "(a.firm_id=#{compId} OR a.team_no=#{teamNo}) AND a.pac_id=#{pacId}") Integer getTjTeamSelectRecordCount(@Param("teamNo") String teamNo,@Param("compId") String compId,@Param("pacId") String pacId); @Select(" SELECT aa.pacname pacname FROM (\n" + " SELECT TRIM(a.pac_name) pacname FROM tj_package a WHERE a.pac_id=#{pacId}\n" + " \n" + " UNION \n" + " \n" + " SELECT TRIM(b.dw_dept_name) pacname FROM tj_dw_grouping b WHERE b.id=#{pacId}) aa GROUP BY aa.pacname\n" + " ") String getpacName(String pacId); @Select(" SELECT SUM(a.paid_in) FROM tj_flowing_water a WHERE a.deleted=0 AND a.pay_stasus=1 AND a.order_id=#{orderId} ") String gettjzj(Long orderId); } ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderRemarkMapper.java
@@ -327,4 +327,11 @@ @Select("call newpacsJianChaData(#{tjnumber,mode=IN},0)") List<TjOrderRemark> newpacsJianChaData(String tjnumber); @Select(" SELECT CONCAT(CONCAT('共',COUNT(*),'项'),': '," + "TRIM(GROUP_CONCAT(b.pro_name ORDER BY b.pro_name SEPARATOR ' | '))) AS xmm" + " FROM tj_order_remark a LEFT JOIN tj_project b ON b.pro_id=a.pro_id" + " WHERE a.tj_number=#{tjNumber} AND a.type !=2 AND a.deleted=0") String getTjxm(String tjNumber); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjOrderRemarkService.java
@@ -108,4 +108,6 @@ void csymxmxzqtyybcjk(String tjNum, String proId, String yy, String orgType, String czy, String czydm); List<TjOrderRemark> newpacsJianChaData(String tjNumber); String getTjxm(String tjNumber); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjOrderService.java
@@ -205,4 +205,8 @@ Integer getTjTeamSelectRecordCount(String teamNo, String compId, String pacId); String getpacName(String pacId); String gettjzj(Long orderId); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjOrderRemarkServiceImpl.java
@@ -224,4 +224,9 @@ return mapper.newpacsJianChaData(tjNumber); } @Override public String getTjxm(String tjNumber) { return mapper.getTjxm(tjNumber); } } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjOrderServiceImpl.java
@@ -519,4 +519,14 @@ public Integer getTjTeamSelectRecordCount(String teamNo, String compId, String pacId) { return tjOrderMapper.getTjTeamSelectRecordCount(teamNo, compId, pacId); } @Override public String getpacName(String pacId) { return tjOrderMapper.getpacName( pacId); } @Override public String gettjzj(Long orderId) { return tjOrderMapper.gettjzj(orderId); } }