| | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjOrder; |
| | | import com.ltkj.hosp.mapper.TjCustomerMapper; |
| | | import com.ltkj.hosp.service.ITjOrderService; |
| | | import com.ltkj.web.controller.system.TjCheckController; |
| | | import com.ltkj.web.controller.system.TjReportController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Company: 西安路泰科技有限公司 |
| | |
| | | private TjCheckController tjCheckController; |
| | | @Autowired |
| | | private TjCustomerMapper tjCustomerMapper; |
| | | @Autowired |
| | | private ITjOrderService tjOrderService; |
| | | |
| | | /** |
| | | * 提供给三方调用的报告查看接口 |
| | |
| | | * @param json |
| | | */ |
| | | @PostMapping("/viewReport") |
| | | public void viewReport(HttpServletResponse response, @RequestBody String json){ |
| | | public void viewReport(HttpServletResponse response, @RequestBody String json) throws IOException { |
| | | JSONObject entries = JSONUtil.parseObj(json); |
| | | String tjNum = entries.getStr("tjNum"); |
| | | LambdaQueryWrapper<TjOrder> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjOrder::getHeshouStatus,1); |
| | | wrapper.eq(TjOrder::getTjNumber,tjNum); |
| | | List<TjOrder> list = tjOrderService.list(wrapper); |
| | | if (list.isEmpty()){ |
| | | return; |
| | | } |
| | | tjReportController.preview(response,true,tjNum); |
| | | } |
| | | |
| | |
| | | @PostMapping("/reportData") |
| | | public AjaxResult reportData(@RequestBody String json){ |
| | | String tjNum = JSONUtil.parseObj(json).getStr("tjNum"); |
| | | LambdaQueryWrapper<TjOrder> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjOrder::getHeshouStatus,1); |
| | | wrapper.eq(TjOrder::getTjNumber,tjNum); |
| | | List<TjOrder> list = tjOrderService.list(wrapper); |
| | | if (list.isEmpty()){ |
| | | return AjaxResult.error("暂无数据!!"); |
| | | } |
| | | JSONObject entries = JSONUtil.parseObj(tjCheckController.updateCheckType(tjNum)); |
| | | removeNullFields(entries); |
| | | return JSONUtil.toBean(entries, AjaxResult.class); |
| | |
| | | JSONObject entries = JSONUtil.parseObj(json); |
| | | String card = entries.getStr("card"); |
| | | // TjCustomer customer = tjCustomerMapper.getCusInfo(card); |
| | | List<TjCustomer> customer = tjCustomerMapper.getCusInfoList(card); |
| | | List<Map<String ,Object>> customer = tjCustomerMapper.getCusInfoList(card); |
| | | return AjaxResult.success(customer); |
| | | } |
| | | |
| | | /** |
| | | * 对于小程序提供 |
| | | * 根据身份证号查询返回体检记录:包含姓名、身份证号、性别、出生日期、年龄、体检号、联系电话,体检日期,报告状态 |
| | | * @param json |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCusInfo") |
| | | public AjaxResult getInfoCus(@RequestBody String json){ |
| | | JSONObject entries = JSONUtil.parseObj(json); |
| | | String card = entries.getStr("card"); |
| | | String name = entries.getStr("name"); |
| | | List<Map<String ,Object>> customer = tjCustomerMapper.getCusInfoListByCardAndName(card,name); |
| | | return AjaxResult.success(customer); |
| | | } |
| | | |