ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsServiceController.java
@@ -13,6 +13,8 @@ import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd; import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd; import com.ltkj.system.service.ISysDeptService; import com.sun.jna.platform.win32.WinDef; import com.sun.org.apache.xpath.internal.operations.Bool; import jodd.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -24,6 +26,14 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; /** * @Company: 西安路泰科技有限公司 @@ -49,23 +59,126 @@ @Autowired private LtkjExamJcbgdService ltkjExamJcbgdService; // 体检开检查申请单调用此接口推送给pacs服务 public boolean OrderAdd(String tjNumber) { try { //从体检数据库中查询出申请单数据 调用 pacs webservice 接口 OrderAdd实现申请单推送 HashMap<String, Object> hashMap = new HashMap<>(); if (true){ HashMap<String, Object> result = new HashMap<>(); // result.put("PatientId",0); // result.put("PatType","PatType"); // result.put("Operator","Operator"); // result.put("HisID","HisID"); hashMap.put("Root",result); } return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); }catch (Exception ex) { return false; } } // 体检撤销申请单后调用此接口撤销pacs申请单 public boolean OrderDelete(String tjNumber) { //入参字段 // <PatientId> HIS或体检病人ID </PatientId> // <PatType>病人类型</PatType > // <Operator>操作人工号</Operator> // <HisID>HIS或体检申请单号</HisID> try { //从体检数据库中查询出申请单数据 调用 pacs webservice 接口 OrderAdd实现申请单推送 HashMap<String, Object> hashMap = new HashMap<>(); if (null == null){ HashMap<String, Object> result = new HashMap<>(); result.put("PatientId",0); result.put("PatType","PatType"); result.put("Operator","Operator"); result.put("HisID","HisID"); hashMap.put("Root",result); } return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); }catch (Exception ex) { return false; } } // 陕健医集团调用pacs接口Webservice public boolean ComSjyjtPacs(String inputLine) { String apiUrl = "http://100.100.100.222:8000/WebInterfaceService.asmx"; // 替换为你的API URL try { URL url = new URL(apiUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); // 打印结果 System.out.println(response.toString()); } else { // System.out.println("ComSjyjtPacs陕健医集团调用pacs接口Webservice调用失败!”); } } catch (Exception e) { e.printStackTrace(); } return true; } @PostMapping("InvokeRisService") public String InvokeRisService(String dataSourceName, String action, String message) { String rusue=null; switch (StringUtil.toLowerCase(action) ) { case "qeryorder": return queryOrder(dataSourceName); rusue= queryOrder(dataSourceName); break; case "updateorderstatus": updateOrderstatus(dataSourceName); rusue= updateOrderstatus(dataSourceName); break; case "reportverifyupload": return reportVerifyUpload(dataSourceName); rusue= reportVerifyUpload(dataSourceName); break; } HashMap<String, Object> hashMap = new HashMap<>(); // <Code>执行状态 执行状态 1 成功, 0失败</Code> // <Message>结果消息</Message> HashMap<String, Object> result = new HashMap<>(); if(rusue==null) { result.put("Code", 1); result.put("Message", "接口成功"); } else { result.put("Code", 0); result.put("Message", rusue); } hashMap.put("ResultInfor", result); return XmlUtil.mapToXmlStr(hashMap); } private String updateOrderstatus(@RequestBody String json) { // <PatientId> HIS或体检病人ID </PatientId> // <PatType>病人类型</PatType > ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCheckController.java
@@ -609,17 +609,27 @@ return AjaxResult.success("同步成功"); //同步检查项目给redis缓存现在不用了 // asyncService.updateCheckType(order.getTjNumber()); } // else if(null !=sfkqdshitulianjie && sfkqdshitulianjie.equals("Y")){ // List<Map<String,Object>> maps= testMapper.getCcXZxYyLisJgSt(); // } else if(null !=sfkqdshitulianjie && sfkqdshitulianjie.equals("Y")){ List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(order.getTjNumber()); if(null != hysqdList && !hysqdList.isEmpty()){ for (LtkjHysqd hysqd : hysqdList) { LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(hysqd.getTjh(),hysqd.getTmh()); if (null != jybgid) { ltkjHysqdService.deletedLtkjHysqdByTjhAndTmh(hysqd.getTjh(),hysqd.getTmh()); ltkjHybgdService.deletedLtkjHybgdByTjhAndTmh(hysqd.getTmh()); } if (ltkjHysqdService.save(hysqd)) { List<LtkjHybgd> hybgdList = testMapper.getCcXZxYyLtkjHybgdByLisVi(hysqd.getTmh()); ltkjHybgdService.saveBatch(hybgdList); } } } testMapper.tjUpdateDetatilByVi(order.getTjNumber()); } //化验 testMapper.updateDetailByCall(order.getCardId(), String.valueOf(order.getOrderId()), order.getTjNumber(), UserHoder.getLoginUser().getUserId()); //检查 // jcsqdService.saveLtkjExamJcsqd(order.getCardId()); return AjaxResult.success("同步成功"); } return AjaxResult.error("未查到该人员体检记录"); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -141,17 +141,24 @@ // @Log(title = "客户身份信息", businessType = BusinessType.EXPORT) public AjaxResult getInfoByIdCard(@RequestParam @ApiParam(value = "客户身份证号") String cusIdcard) { if (!"".equals(cusIdcard) && cusIdcard != null) { String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); // String sfjysjh = configService.selectConfigByKey("sfjysjh"); //判断身份证号格式是否正确 // if(cusIdcard.length()==18){ // if (! MatchUtils.isIdCard(cusIdcard)) { // return AjaxResult.error("身份证号码错误"); // } // } // if(cusIdcard.length()==9){ // if (!MatchUtils.cardValidates(cusIdcard)) { // return AjaxResult.error("身份证号码错误"); // } // } if(sfjysfzh.equalsIgnoreCase("Y")){ if(cusIdcard.length()==18){ if (! MatchUtils.isIdCard(cusIdcard)) { return AjaxResult.error("身份证号码错误"); } } if(cusIdcard.length()==9){ if (!MatchUtils.cardValidates(cusIdcard)) { return AjaxResult.error("身份证号码错误"); } } } // Date dates = new Date(); // final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); @@ -446,7 +453,6 @@ if (null == tjCustomer.getCusIdcard() || null == tjCustomer.getCusPhone()) { return AjaxResult.error("请输入身份证号或手机号"); } HisApiGetMethodService hisApiGetMethodService = new HisApiGetMethodService(); Date dates = new Date(); final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); @@ -454,21 +460,32 @@ String cusIdcard = tjCustomer.getCusIdcard(); boolean b = true; String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); String sfjysjh = sysConfigService.selectConfigByKey("sfjysjh"); if (null != tjCustomer.getIdType()) { if (tjCustomer.getIdType().equals("1")) { //判断身份证号格式是否正确 if(sfjysfzh.equalsIgnoreCase("Y")){ if(cusIdcard.length()==18){ b = MatchUtils.isIdCard(cusIdcard); } // else { // b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); // } } } else { if(cusIdcard.length()==9){ b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); } } } else { return AjaxResult.error("请选择证件类型"); } if (!b) return AjaxResult.error("证件号有误"); //判断身份证号格式是否正确 if(sfjysjh.equalsIgnoreCase("Y")){ if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone()))) return AjaxResult.error("手机号错误"); } LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); wq.eq(TjCustomer::getCusIdcard, cusIdcard); @@ -550,12 +567,30 @@ if (null == cusPhone) { return AjaxResult.error("手机号不能为空"); } /*LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); wq.eq(TjCustomer::getCusPhone, cusPhone); TjCustomer customer = tjCustomerService.getOne(wq); if (customer != null) { return AjaxResult.error("该手机号已被使用!"); }*/ String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); String sfjysjh = sysConfigService.selectConfigByKey("sfjysjh"); //判断身份证号格式是否正确 if(sfjysfzh.equalsIgnoreCase("Y")){ if(tjCustomer.getCusIdcard().length()==18){ if (!(MatchUtils.isIdCard(tjCustomer.getCusIdcard()))) return AjaxResult.error("身份证号错误"); } if(tjCustomer.getCusIdcard().length()==9){ if (!MatchUtils.cardValidates(tjCustomer.getCusIdcard())) { return AjaxResult.error("身份证号码错误"); } } } //判断身份证号格式是否正确 if(sfjysjh.equalsIgnoreCase("Y")){ if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone()))) return AjaxResult.error("手机号错误"); } tjCustomer.setCusPhone(cusPhone); tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),"")); if (tjCustomerService.updateById(tjCustomer)) { ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReservationController.java
@@ -15,6 +15,7 @@ import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.alibaba.druid.sql.visitor.functions.Isnull; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -40,10 +41,12 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.annotation.*; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; @@ -60,6 +63,7 @@ @RestController @RequestMapping("/reservation/reservation") @Api(tags = "体检预约管理接口") @Slf4j public class TjReservationController extends BaseController { @Resource private ITjReservationService tjReservationService; @@ -85,12 +89,8 @@ private ITjGroupingProService groupingProService; @Resource private TjAsyncService asyncService; // @Resource // private OrderDelayService delayService; @Autowired private TaskService taskService; @Resource private ITjReportTemplateService reportTemplateService; @Autowired private ISysDictDataService dictDataService; @Autowired @@ -155,7 +155,6 @@ } } } /** @@ -261,10 +260,13 @@ String idCard = tjReservation.getIdCard(); String phoe = tjReservation.getPhoe(); if (null != idCard && null != phoe) { // if (!MatchUtils.isIdCard(idCard) || !MatchUtils.isMobileNO(phoe)) { // if (!MatchUtils.isIdCard(idCard) || !MatchUtils.isMobileNO(phoe)); if (idCard.isEmpty() || phoe.isEmpty()) { wrongList.add(tjReservation.getName()); } else { String str = MatchUtils.translateToPlainStr(tjReservation.getPhoe()); tjReservation.setPhoe(str); //年龄 tjReservation.setAge(String.valueOf(MatchUtils.getAgeByIdCard(tjReservation.getIdCard()))); //出生日期 @@ -276,9 +278,11 @@ tjReservation.setGroupingName(groupingMan.getGroupingName()); tjReservation.setYsPrice(groupingMan.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingMan.getYsPrice()); count+=1; hjMoney = hjMoney.add(groupingMan.getYsPrice()); count += 1; //男组人数 manMoney=manMoney.add(groupingMan.getYsPrice()); manCount+=1; manMoney = manMoney.add(groupingMan.getYsPrice()); manCount += 1; } else if (null != groupingWoMan && groupingWoMan.getSex().equals(String.valueOf(tjReservation.getSex()))) { @@ -286,8 +290,10 @@ tjReservation.setGroupingName(groupingWoMan.getGroupingName()); tjReservation.setYsPrice(groupingWoMan.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingWoMan.getYsPrice()); count+=1; woManMoney=woManMoney.add(groupingWoMan.getYsPrice());woManCount+=1; hjMoney = hjMoney.add(groupingWoMan.getYsPrice()); count += 1; woManMoney = woManMoney.add(groupingWoMan.getYsPrice()); woManCount += 1; } else if (null != groupingWz && groupingWz.getSex().equals(String.valueOf(tjReservation.getSex()))) { @@ -295,7 +301,8 @@ tjReservation.setGroupingName(groupingWz.getGroupingName()); tjReservation.setYsPrice(groupingWz.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingWz.getYsPrice()); count+=1; hjMoney = hjMoney.add(groupingWz.getYsPrice()); count += 1; } @@ -372,6 +379,10 @@ } catch (Exception e) { return AjaxResult.error("分组信息有误请重新分组!"); } String sfjysfzh = configService.selectConfigByKey("sfjysfzh"); String sfjysjh = configService.selectConfigByKey("sfjysjh"); //计算合计 BigDecimal hjMoney = new BigDecimal("0.00"); //男组金额 @@ -381,14 +392,34 @@ int count=0;//总计人数 int manCount=0;//男组人数 int woManCount=0;//女组人数 List<String> ids=new ArrayList<>(); for (TjReservation tjReservation : tjReservations) { String idCard = tjReservation.getIdCard(); String phoe = tjReservation.getPhoe(); if (null != idCard && null != phoe) { // if (!MatchUtils.isIdCard(idCard) || !MatchUtils.isMobileNO(phoe)) { if (idCard.isEmpty() || phoe.isEmpty() || null==tjReservation.getDwxm()) { idCard= idCard.replaceAll("[',,;.。 ‘“]",""); if (!StringUtils.isBlank(idCard) || !StringUtils.isBlank(phoe) || null != tjReservation.getDwxm()) { //将科学计数的手机号转换成文本形式 phoe = MatchUtils.translateToPlainStr(tjReservation.getPhoe()); if(!ids.isEmpty() && ids.contains(tjReservation.getIdCard())){ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return AjaxResult.error("此身份证号: "+tjReservation.getIdCard()+" 重复,请核对后上传!"); } ids.add(tjReservation.getIdCard()); // if (sfjysfzh.equalsIgnoreCase("Y") || sfjysjh.equalsIgnoreCase("Y")) { if ((sfjysfzh.equalsIgnoreCase("Y") && !MatchUtils.isIdCard(idCard)) || (sfjysjh.equalsIgnoreCase("Y") && !MatchUtils.isMobileNO(phoe))) { wrongList.add(tjReservation.getName()); log.info(tjReservation.getName()+idCard+MatchUtils.isIdCard(idCard)+MatchUtils.isMobileNO(phoe)); } else { tjReservation.setPhoe(phoe); //年龄 tjReservation.setAge(String.valueOf(MatchUtils.getAgeByIdCard(tjReservation.getIdCard()))); //出生日期 @@ -402,9 +433,11 @@ tjReservation.setGroupingName(groupingMan.getGroupingName()); tjReservation.setYsPrice(groupingMan.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingMan.getYsPrice()); count+=1; hjMoney = hjMoney.add(groupingMan.getYsPrice()); count += 1; //男组人数 manMoney=manMoney.add(groupingMan.getYsPrice()); manCount+=1; manMoney = manMoney.add(groupingMan.getYsPrice()); manCount += 1; } } @@ -414,8 +447,10 @@ tjReservation.setGroupingName(groupingWoMan.getGroupingName()); tjReservation.setYsPrice(groupingWoMan.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingWoMan.getYsPrice()); count+=1; woManMoney=woManMoney.add(groupingWoMan.getYsPrice());woManCount+=1; hjMoney = hjMoney.add(groupingWoMan.getYsPrice()); count += 1; woManMoney = woManMoney.add(groupingWoMan.getYsPrice()); woManCount += 1; } } for (TjDwGrouping groupingWz : groupingWzs) { @@ -424,12 +459,15 @@ tjReservation.setGroupingName(groupingWz.getGroupingName()); tjReservation.setYsPrice(groupingWz.getYsPrice()); //合计 hjMoney = hjMoney.add(groupingWz.getYsPrice());count+=1; hjMoney = hjMoney.add(groupingWz.getYsPrice()); count += 1; if(tjReservation.getSex()==0){ manMoney=manMoney.add(groupingWz.getYsPrice()); manCount+=1; manMoney = manMoney.add(groupingWz.getYsPrice()); manCount += 1; } if(tjReservation.getSex()==1){ woManMoney=woManMoney.add(groupingWz.getYsPrice());woManCount+=1; woManMoney = woManMoney.add(groupingWz.getYsPrice()); woManCount += 1; } } @@ -445,8 +483,78 @@ }else { wrongList.add(tjReservation.getName()); } } // } // else { // //将科学计数的手机号转换成文本形式 // String str = MatchUtils.translateToPlainStr(tjReservation.getPhoe()); // tjReservation.setPhoe(str); // // //年龄 // tjReservation.setAge(String.valueOf(MatchUtils.getAgeByIdCard(tjReservation.getIdCard()))); // //出生日期 // tjReservation.setBirthday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); // // TjDwDept dwDept = dwDeptService.getOne(new LambdaQueryWrapper<TjDwDept>().eq(TjDwDept::getDwDeptName, tjReservation.getDwxm())); // if (null != dwDept) { // for (TjDwGrouping groupingMan : groupingMans) { // if (null != groupingMan && groupingMan.getSex().equals(String.valueOf(tjReservation.getSex())) && groupingMan.getDwDeptId().equals(dwDept.getId())) { // tjReservation.setGroupingId(groupingMan.getId()); // tjReservation.setGroupingName(groupingMan.getGroupingName()); // tjReservation.setYsPrice(groupingMan.getYsPrice()); // //合计 // hjMoney = hjMoney.add(groupingMan.getYsPrice()); // count += 1; // //男组人数 // manMoney = manMoney.add(groupingMan.getYsPrice()); // manCount += 1; // } // } // // for (TjDwGrouping groupingWoMan : groupingWoMans) { // if (null != groupingWoMan && groupingWoMan.getSex().equals(String.valueOf(tjReservation.getSex())) && groupingWoMan.getDwDeptId().equals(dwDept.getId())) { // tjReservation.setGroupingId(groupingWoMan.getId()); // tjReservation.setGroupingName(groupingWoMan.getGroupingName()); // tjReservation.setYsPrice(groupingWoMan.getYsPrice()); // //合计 // hjMoney = hjMoney.add(groupingWoMan.getYsPrice()); // count += 1; // woManMoney = woManMoney.add(groupingWoMan.getYsPrice()); // woManCount += 1; // } // } // for (TjDwGrouping groupingWz : groupingWzs) { // if (null != groupingWz && groupingWz.getDwDeptId().equals(dwDept.getId())) { // tjReservation.setGroupingId(groupingWz.getId()); // tjReservation.setGroupingName(groupingWz.getGroupingName()); // tjReservation.setYsPrice(groupingWz.getYsPrice()); // //合计 // hjMoney = hjMoney.add(groupingWz.getYsPrice()); // count += 1; // if (tjReservation.getSex() == 0) { // manMoney = manMoney.add(groupingWz.getYsPrice()); // manCount += 1; // } // if (tjReservation.getSex() == 1) { // woManMoney = woManMoney.add(groupingWz.getYsPrice()); // woManCount += 1; // } // // } // } // LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>(); // wq.eq(TjReservation::getIdCard, tjReservation.getIdCard()); // wq.eq(TjReservation::getIsExpire, 2); // TjReservation one = tjReservationService.getOne(wq); // if (null != one) { // yyList.add(one); // } // rightList.add(tjReservation); // } else { // wrongList.add(tjReservation.getName()); // } // } } else { wrongList.add(tjReservation.getName()); } @@ -795,7 +903,17 @@ JSONObject parseObj = JSONUtil.parseObj(payTypeGlTjType); if (null != rightList && !rightList.isEmpty()) { List<String> ids=new ArrayList<>(); for (TjReservation reservation : rightList) { if(!ids.isEmpty() && ids.contains(reservation.getIdCard())){ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return AjaxResult.error("此身份证号: "+reservation.getIdCard()+" 重复,请核对后上传!"); } ids.add(reservation.getIdCard()); TjDwGrouping dwGrouping = dwGroupingService.getById(reservation.getGroupingId()); @@ -860,6 +978,8 @@ compPayService.save(tjCompPay); } // .filter(a-> null != a.getPacId()) Map<String, List<TjReservation>> collect = rightList.stream().collect(Collectors.groupingBy(TjReservation::getPacId)); if(!collect.isEmpty()){ ltkj-admin/src/test/java/zjhTest.java
@@ -9,6 +9,7 @@ import com.ltkj.LtkjApplication; import com.ltkj.common.core.redis.RedisCache; import com.ltkj.common.utils.SecurityUtils; import com.ltkj.common.utils.StringUtils; import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.DictHosp; import com.ltkj.hosp.domain.TjCustomer; @@ -33,6 +34,7 @@ import javax.annotation.Resource; import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.sql.Connection; @@ -46,6 +48,8 @@ import java.net.HttpURLConnection; import java.net.URL; import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Author: 西安路泰科技有限公司/赵佳豪 @@ -129,10 +133,51 @@ public static void main(String[] args) { // System.out.println(DateUtil.date()); // System.out.println(DateUtil.offsetMonth(DateUtil.date(),-1)); String s ="612129197611110029"; String ss ="13335337160"; boolean idCard = MatchUtils.isIdCard(s); System.out.println(idCard); System.out.println(MatchUtils.isMobileNO(ss)); } /** * 将科学计数法文本转换成字符文本 * @param number * @return */ public static String translateToPlainStr(String number) { return getString(number); } private static String getString(String number) { if (null == number || number.trim().length() == 0) { return number; } String regEx="^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$"; // 编译正则表达式 Pattern pattern = Pattern.compile(regEx); // 忽略大小写的写法 // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(number); // 字符串是否与正则表达式相匹配 boolean rs = matcher.matches(); // 判断是否为字符串的科学计数法 if(rs){ // 科学计数法转数字 BigDecimal originValue = new BigDecimal(number); System.out.println("手机号为 ==> " + originValue.toPlainString()); // 数字转字符串 return originValue.toPlainString(); } return number; } public static void forwardUrl(String targetUrl, String forwardUrl) throws Exception { ltkj-common/src/main/java/com/ltkj/common/excelConfig/ExcelUtils.java
@@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.apache.poi.hssf.usermodel.HSSFDataValidation; import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -34,6 +35,7 @@ * 原文链接(不定时增加新功能): https://zyqok.blog.csdn.net/article/details/121994504 */ @SuppressWarnings("unused") @Slf4j public class ExcelUtils { private static final String XLSX = ".xlsx"; @@ -61,6 +63,7 @@ public static <T> List<T> readMultipartFile(MultipartFile mFile, Class<T> clazz) throws Exception { JSONArray array = readMultipartFile(mFile); log.info("array执行出来是:"+array); return getBeanList(array, clazz); } @@ -214,8 +217,9 @@ } // 其余情况根据类型赋值 String fieldClassName = field.getType().getSimpleName(); String name = field.getName(); try { if ("String".equalsIgnoreCase(fieldClassName)) { if ("String".equalsIgnoreCase(fieldClassName) || name.equals("phoe")) { field.set(t, val); } else if ("boolean".equalsIgnoreCase(fieldClassName)) { field.set(t, Boolean.valueOf(val)); @@ -298,6 +302,7 @@ return null; } in.close(); // Workbook zhuanhuanexcel = zhuanhuanexcel(in); return book; } @@ -1005,4 +1010,43 @@ return s.trim(); } private static Workbook zhuanhuanexcel(InputStream inputStream){ Workbook workbook = null; try { workbook = WorkbookFactory.create(inputStream); Sheet sheet = workbook.getSheetAt(0); // 获取第一个Sheet页 for (Row row : sheet) { for (Cell cell : row) { // 检查单元格的类型并转换为文本 switch (cell.getCellType()) { case STRING: System.out.print(cell.getStringCellValue() + "\t"); break; case NUMERIC: System.out.print(cell.getNumericCellValue() + "\t"); break; case BOOLEAN: System.out.print(cell.getBooleanCellValue() + "\t"); break; case FORMULA: System.out.print(cell.getCellFormula() + "\t"); break; default: break; } } System.out.println(); // 换行,表示一行数据结束 } } catch (IOException e) { throw new RuntimeException(e); } finally { try { workbook.close(); } catch (IOException e) { throw new RuntimeException(e); } } return workbook; } } ltkj-framework/src/main/java/com/ltkj/framework/config/MatchUtils.java
@@ -2,6 +2,7 @@ import com.ltkj.common.utils.StringUtils; import java.math.BigDecimal; import java.util.Calendar; import java.util.Collections; import java.util.HashMap; @@ -211,9 +212,9 @@ if (matches && idCardBuilder.length() == SECOND_ID_CARD_LENGTH) { int index = getIdCardCheckIndex(idCardBuilder); // 获取传入身份证的检验码 //String check = String.valueOf(idCardBuilder.charAt(idCardBuilder.length() - 1)); String check = String.valueOf(idCardBuilder.charAt(idCardBuilder.length() - 1)); // 检验码校验 //return StringUtils.equalsIgnoreCase(CHECK_INDEX[index], check); return StringUtils.equalsIgnoreCase(CHECK_INDEX[index], check); } return matches; } @@ -311,7 +312,7 @@ /** * @desc 计算出校验码所在校验码数组的下标值 */ private static int getIdCardCheckIndex(StringBuilder idCardBuilder) { public static int getIdCardCheckIndex(StringBuilder idCardBuilder) { // 判断传入的是17位还是18位身份证号 int length = idCardBuilder.length() == SECOND_ID_CARD_LENGTH ? idCardBuilder.length() - 1 : idCardBuilder.length(); // 计算出校验码 @@ -367,6 +368,34 @@ return nativePlace; } /** * 将excel表中科学计数格式的手机号转成字符串形式 * @param number * @return */ public static String translateToPlainStr(String number) { if (null == number || number.trim().length() == 0) { return number; } String regEx="^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$"; // 编译正则表达式 Pattern pattern = Pattern.compile(regEx); // 忽略大小写的写法 // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(number); // 字符串是否与正则表达式相匹配 boolean rs = matcher.matches(); // 判断是否为字符串的科学计数法 if(rs){ // 科学计数法转数字 BigDecimal originValue = new BigDecimal(number); // System.out.println("手机号为 ==> " + originValue.toPlainString()); // 数字转字符串 return originValue.toPlainString(); } return number; } private static String getNameString(int code) { switch (code) { case 11: ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java
@@ -111,7 +111,7 @@ .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**", "/sqlserver/getdata/**","/api/His/**","/system/config/zx","/system/config/gxxmpym","/system/report/savePdf", "/system/dyjl/saveGjddyjl","/system/dyjl/saveBlGjddyjl","/check/ceshi").permitAll() .antMatchers("/common/uploadImgExe","/common/listExeVal").permitAll() .antMatchers("/common/uploadImgExe","/common/listExeVal","/pacs/InvokeRisService/**").permitAll() .antMatchers("/check/dataSynchronizationApi").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
@@ -84,6 +84,13 @@ @Param("dockerId")String dockerId); @DataSource(value = DataSourceType.MASTER) @Select("call tj_update_detatil_by_vi(#{tjnum,mode=IN}") public void tjUpdateDetatilByVi(@Param("tjnum")String tjnum); @DataSource(value = DataSourceType.MASTER) @Select("call tj_jc_update_detatil(#{cardId,mode=IN},#{orderId,mode=IN},#{tjnum,mode=IN},#{dockerId,mode=IN})") public void updateDetailByTjJcCall(@Param("cardId") String cardId, @Param("orderId")String orderId, @@ -227,6 +234,54 @@ @DataSource(value = DataSourceType.SLAVE_LIS) @Select("SELECT * FROM vi_his_patientresult LIMIT 10") @Select("SELECT * FROM vi_his_patientresult ") List<Map<String, Object>> getCcXZxYyLisJgSt(); @DataSource(value = DataSourceType.SLAVE_LIS) @Select("SELECT\n" + " a.GH_PATIENTNO tjh,\n" + " a.SAMPLEID tmh,\n" + " NULL bbbh,\n" + " NULL bbmc,\n" + " a.SFXMID xmid,\n" + " a.SFXMNAME xmmc,\n" + " a.SENDDATE sqsj,\n" + " a.SENDDOCTOR sqys,\n" + " a.CHECKDATE jgsj,\n" + " a.TXM sqdh,\n" + " a.SENDDOCTOR sqrxm,\n" + " '8001' sqrdm,\n" + " a.AUDITDOCTOR shrxm,\n" + " '已审' jybgjg\n" + " \n" + "FROM\n" + " vi_his_patientinfo a\n" + "WHERE a.HOSPITALID='chkwyy' AND a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum}") List<LtkjHysqd> getCcXZxYyLtkjHysqdByLisVi(String tjNum); @DataSource(value = DataSourceType.SLAVE_LIS) @Select("SELECT\n" + " a.SAMPLEID tmh,\n" + " a.ITEMCODE jcxmid,\n" + " a.ITEMNAME jcxm,\n" + " NULL tdh,\n" + " a.RESULT jyjg,\n" + " a.UNIT jgdw,\n" + " a.RANGEDOWN fwzdz,\n" + " a.RANGEUP fwzgz,\n" + " CONCAT(a.RANGEDOWN,'-',a.RANGEUP) fwz,\n" + " b.CHECKDATE jysj,\n" + " b.CHECKER jyys,\n" + " b.AUDITDATE shsj,\n" + " NULL shys,\n" + " b.AUDITDOCTOR shysmc,\n" + " NULL tpurl,\n" + " a.JUDGE ycbz\n" + "FROM\n" + " vi_his_patientresult a JOIN vi_his_patientinfo b ON b.SAMPLEID=a.SAMPLEID\n" + "WHERE b.HOSPITALID='chkwyy' AND b.PATIENTTYPE=3 AND\n" + " a.SAMPLEID = #{tmh}") List<LtkjHybgd> getCcXZxYyLtkjHybgdByLisVi(String tmh); }