| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private ITjOrderRemarkService remarkService; |
| | | |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | |
| | | @Value("${xcx.appid}") |
| | | private String appid; |
| | |
| | | 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(); |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | |
| | | } |
| | | |
| | | 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("暂无记录"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |