6 天以前 | zhaowenxuan | ![]() |
6 天以前 | zhaowenxuan | ![]() |
6 天以前 | zjh | ![]() |
ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java
@@ -2,6 +2,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; @@ -132,8 +133,11 @@ // } // } String cusName = tjCustomer.getCusName(); TjCustomer customer = customerService.getTjCustomerByCusIdCard(cusIdcard); if (StrUtil.isNotBlank(cusName)){ customer.setCusName(cusName); } String key = sysConfigService.selectConfigByKey("sfkqdyhis"); ltkj-admin/src/main/java/com/ltkj/web/controller/app/WxloginController.java
@@ -9,19 +9,18 @@ import com.google.gson.reflect.TypeToken; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.core.domain.entity.SysDept; import com.ltkj.common.utils.StringUtils; import com.ltkj.common.utils.WechatUtil; import com.ltkj.common.utils.sign.Base64; import com.ltkj.framework.config.JwtUtils; 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.domain.*; 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 com.ltkj.system.service.ISysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -74,6 +73,9 @@ @Resource private ITjOrderRemarkService remarkService; @Resource private ISysDeptService deptService; @Value("${xcx.appid}") private String appid; @@ -213,7 +215,7 @@ wq.eq(Wxuser::getOpenid, wxuser.getOpenid()); Wxuser one = wxuserService.getOne(wq); // System.out.println("绑定 ->"+wxuser.getOpenid()+",json = "+json); if (one != null){ if (one != null) { one.setPhone(phone); wxuserService.updateById(one); return AjaxResult.success(); @@ -228,22 +230,22 @@ cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json); String idCard = entries.getStr("idCard"); TjCustomer tjCustomer = customerService.getTjCustomerByCusIdCard(idCard); if(null != tjCustomer){ if (null != tjCustomer) { List<Map<String, Object>> mapList = new ArrayList<>(); LambdaQueryWrapper<TjOrder> wq=new LambdaQueryWrapper<>(); LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); wq.eq(TjOrder::getUserId, tjCustomer.getCusId()); List<TjOrder> list = orderService.list(wq); if(null != list && !list.isEmpty()){ 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())); if (order.getPacId().equals("0")) { map.put("title", "普通体检"); } else { map.put("title", orderService.getpacName(order.getPacId())); } map.put("zjq",orderService.gettjzj(order.getOrderId())); map.put("tjsj",order.getCreateTime()); map.put("tjxm",remarkService.getTjxm(order.getTjNumber())); map.put("price", orderService.gettjzj(order.getOrderId())); map.put("time", order.getCreateTime()); map.put("items", remarkService.getTjxm(order.getTjNumber())); int czwj = remarkService.panduaniscunzaiweijian(order.getTjNumber()); int sfwc = remarkService.panduaniswancheng(order.getTjNumber()); Date checkTime = order.getCheckTime(); @@ -251,25 +253,25 @@ Integer heshouStatus = order.getHeshouStatus(); Date lastTime = order.getPrintLastTime(); if (czwj == 0) { map.put("tjzt","未检"); map.put("status", "未检"); } if (czwj > 0) { map.put("tjzt","在检"); map.put("status", "在检"); } if (sfwc == 0) { map.put("tjzt","已完成"); map.put("status", "已完成"); } if (null != checkTime) { map.put("tjzt","已审核"); map.put("status", "已审核"); } if (null != reportTime) { map.put("tjzt","生成报告"); map.put("status", "生成报告"); } if (1 == heshouStatus) { map.put("tjzt","报告核收"); map.put("status", "报告核收"); } if (null != lastTime) { map.put("tjzt","已打印"); map.put("status", "已打印"); } mapList.add(map); } @@ -278,6 +280,103 @@ } return AjaxResult.error("暂无问诊记录"); } @PostMapping("/wx/tijianjilu") @ApiOperation("小程序体检记录") public AjaxResult tijianjilu(@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<>(); map.put("tjNumber", 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("status", "未检"); } if (czwj > 0) { map.put("status", "在检"); } if (sfwc == 0) { map.put("status", "已完成"); } if (null != checkTime) { map.put("status", "已审核"); } if (null != reportTime) { map.put("status", "生成报告"); } if (1 == heshouStatus) { map.put("status", "报告核收"); } if (null != lastTime) { map.put("status", "已打印"); } mapList.add(map); } return AjaxResult.success(mapList); } } return AjaxResult.error("暂无体检记录"); } @PostMapping("/wx/tijianjiluxiangqing") @ApiOperation("小程序体检记录详情") public AjaxResult tijianjiluxiangqing(@RequestBody String json) { cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json); String tjNumber = entries.getStr("tjNumber"); TjOrder order = orderService.getOrderByTjNum(tjNumber); if (null != order) { TjCustomer tjCustomer = customerService.selectTjCustomerByCusId(order.getUserId()); if (null != tjCustomer) { Map<String, Object> map = new HashMap<>(); map.put("cusName", tjCustomer.getCusName()); map.put("cusSex", tjCustomer.getCusSex()); if (order.getPacId().equals("0")) { map.put("pacName", "普通体检"); } else { map.put("pacName", orderService.getpacName(order.getPacId())); } map.put("price", orderService.gettjzj(order.getOrderId())); map.put("createTime", order.getCreateTime()); List<TjOrderRemark> remarkList = remarkService.getTjOrderRemarkListByTjNum(order.getTjNumber()); List<Map<String, Object>> mapList = new ArrayList<>(); if (null != remarkList && !remarkList.isEmpty()) { for (TjOrderRemark remark : remarkList) { Map<String, Object> map1 = new HashMap<>(); SysDept dept = deptService.getById(remark.getDeptId()); if(null != dept){ map1.put("deptName", dept.getDeptName()); map1.put("officialWeb",dept.getOfficialWeb()); } map1.put("checkStatus", remark.getType()); mapList.add(map1); } map.put("reportlist", mapList); } else { map.put("reportlist", mapList); } return AjaxResult.success(map); } } return AjaxResult.error("暂无记录"); } /** @@ -448,11 +547,11 @@ wq.eq(Wxuser::getOpenid, openId); Wxuser one = wxuserService.getOne(wq); if (one!=null){ if (one != null) { one.setPhone(phone); one.setUpdateTime(new DateTime()); final boolean b = wxuserService.updateById(one); if (b){ if (b) { LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); qw.eq(TjCustomer::getCusPhone, phone); List<TjCustomer> tjCustomer1 = customerService.list(qw); ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -210,6 +210,7 @@ tijianshenqingJinchuan( customer, date, cardId); } catch (Exception e) { log.error("tijianshenqingJinchuanNew方法异常: "+e.getMessage()); throw new RuntimeException(e); } return AjaxResult.success(); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -1214,7 +1214,7 @@ } } catch (Exception e) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); log.error(String.valueOf(e)); log.error("操作失败",e); } finally { lock.unlock(); } @@ -1430,12 +1430,12 @@ else hisApiMethod.tijianshenqingJinchuanNew(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); } catch (Exception e) { log.error("申请单发送失败 ->{}" + String.valueOf(e), e.getMessage()); log.error("申请单发送失败 ->",e); throw new IllegalStateException("申请单发送失败!" + result.get("msg").toString()); } } } catch (Exception e) { log.error("发生错误 ->{}" + String.valueOf(e), e.getMessage()); log.error("发生错误 ->",e); throw new IllegalStateException(); } return AjaxResult.success(tjNumber); ltkj-admin/src/test/java/zjhTest.java
@@ -1,4 +1,5 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import com.ltkj.LtkjApplication;import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.TjJcycxm; @@ -22,6 +23,9 @@ import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; import java.io.BufferedReader; import java.io.InputStreamReader; @@ -34,6 +38,8 @@ import java.io.File; import java.io.IOException; import static com.ltkj.framework.config.MatchUtils.getIdCardBirthDayStr; import static com.ltkj.framework.config.MatchUtils.isIdCard; /** @@ -85,10 +91,37 @@ public static void main(String[] args) throws Exception { String s = "62272219610528411X"; System.out.println(isValidIdCard(s) ? "合法" : "非法"); System.out.println(getBirthDayByIdCard(s)); } public static String getBirthDayByIdCard(String idCard) throws Exception { if (!isIdCard(idCard)) { throw new Exception("身份证不正确"); } // 获取身份证的出生年月日串 String birth = getIdCardBirthDayStr(idCard); // 获取年月日 int year = Integer.parseInt(birth.substring(0, 4)); int month = Integer.parseInt(birth.substring(4, 6)); int day = Integer.parseInt(birth.substring(6, 8)); String sr = year + "-" + month + "-" + day; // 解析为 Date Date date = DateUtil.parse(sr, "yyyy-MM-dd"); // 转换为 LocalDateTime LocalDateTime dateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); // 设置固定时分秒 dateTime = dateTime.withHour(12).withMinute(34).withSecond(56); // 格式化为字符串返回 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); return dateTime.format(formatter); } public static boolean isValidIdCard(String idCardNumber) { // 正则表达式,匹配身份证号码的格式 String regex = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"; ltkj-framework/src/main/java/com/ltkj/framework/config/MatchUtils.java
@@ -338,7 +338,7 @@ /** * @desc 通过身份证获取出生日期的字符串 */ private static String getIdCardBirthDayStr(String idCard) { public static String getIdCardBirthDayStr(String idCard) { // 获取身份证的出生年月日串 if (idCard.length() == FIRST_ID_CARD_LENGTH) { return FIRST_ID_CARD_YEAR + idCard.substring(ID_CARD_YEAR_INDEX, 12); ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java
@@ -173,36 +173,8 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date expirationTime; @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("hospAreaId", getHospAreaId()) .append("hospAreaName", getHospAreaName()) .append("hospid", getHospid()) .append("hospName", getHospName()) .append("code", getCode()) .append("wbm", getWbm()) .append("spell", getSpell()) .append("areaid", getAreaid()) .append("areaName", getAreaName()) .append("mainHospArea", getMainHospArea()) .append("principal", getPrincipal()) .append("phone", getPhone()) .append("plaitBed", getPlaitBed()) .append("openBed", getOpenBed()) .append("buildDate", getBuildDate()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("orderNum", getOrderNum()) .append("effective", getEffective()) .append("createByName", getCreateByName()) .append("updateByName", getUpdateByName()) .append("imgbase64", getImgbase64()) .append("deleted", getDeleted()) .toString(); } /** * 医院简介 */ private String introduction; } ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderRemarkMapper.java
@@ -329,9 +329,8 @@ List<TjOrderRemark> newpacsJianChaData(String tjnumber); @Select(" SELECT CONCAT(CONCAT('共',COUNT(*),'项'),': '," + "TRIM(GROUP_CONCAT(b.pro_name ORDER BY b.pro_name SEPARATOR ' | '))) AS xmm" + @Select(" SELECT b.pro_name 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); List<String> getTjxm(String tjNumber); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjOrderRemarkService.java
@@ -109,5 +109,5 @@ List<TjOrderRemark> newpacsJianChaData(String tjNumber); String getTjxm(String tjNumber); List<String> getTjxm(String tjNumber); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjOrderRemarkServiceImpl.java
@@ -225,7 +225,7 @@ } @Override public String getTjxm(String tjNumber) { public List<String> getTjxm(String tjNumber) { return mapper.getTjxm(tjNumber); } ltkj-hosp/src/main/resources/mapper/TjCustomerMapper.xml
@@ -96,7 +96,7 @@ <select id="selectTjCustomerByCusId" parameterType="Long" resultMap="TjCustomerResult"> <include refid="selectTjCustomerVo"/> where cus_id = #{cusId} and deleted = '0' where cus_id = #{cusId} </select> <insert id="insertTjCustomer" parameterType="TjCustomer" useGeneratedKeys="true" keyProperty="cusId"> ltkj-hosp/src/main/resources/mapper/hosp/DictHospMapper.xml
@@ -31,6 +31,7 @@ <result property="updateByName" column="update_by_name"/> <result property="imgbase64" column="imgBase64"/> <result property="deleted" column="deleted"/> <result property="introduction" column="introduction"/> </resultMap> <sql id="selectDictHospVo"> @@ -59,7 +60,8 @@ create_by_name, update_by_name, imgBase64, deleted deleted, introduction from dict_hosp </sql> @@ -116,6 +118,7 @@ <if test="updateByName != null and updateByName != ''">update_by_name,</if> <if test="imgbase64 != null">imgBase64,</if> <if test="deleted != null">deleted,</if> <if test="introduction != null">introduction,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="hospAreaId != null">#{hospAreaId},</if> @@ -144,6 +147,7 @@ <if test="updateByName != null and updateByName != ''">#{updateByName},</if> <if test="imgbase64 != null">#{imgbase64},</if> <if test="deleted != null">#{deleted},</if> <if test="introduction != null">#{introduction},</if> </trim> </insert> @@ -175,6 +179,7 @@ <if test="updateByName != null and updateByName != ''">update_by_name = #{updateByName},</if> <if test="imgbase64 != null">imgBase64 = #{imgbase64},</if> <if test="deleted != null">deleted = #{deleted},</if> <if test="introduction != null">introduction = #{introduction},</if> </trim> where hosp_area_id = #{hospAreaId} </update> @@ -191,4 +196,4 @@ #{hospAreaId} </foreach> </delete> </mapper> </mapper>