| | |
| | | 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; |
| | |
| | | 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.*; |
| | |
| | | |
| | | @Resource |
| | | private IAbucoderWxuserService wxuserService; |
| | | @Autowired |
| | | private ITjOrderService orderService; |
| | | |
| | | @Resource |
| | | private ITjOrderRemarkService remarkService; |
| | | |
| | | @Value("${xcx.appid}") |
| | | private String appid; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | 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("暂无问诊记录"); |
| | | } |
| | | |
| | | /** |
| | |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusPhone, phone); |
| | | List<TjCustomer> tjCustomer1 = customerService.list(qw); |
| | | if (tjCustomer1 != null && tjCustomer1.size()>0) { |
| | | if (tjCustomer1 != null && !tjCustomer1.isEmpty()) { |
| | | for (TjCustomer tjCustomer : tjCustomer1) { |
| | | tjCustomer.setConnect(openId); |
| | | customerService.updateById(tjCustomer); |