|  |  | 
 |  |  | import io.swagger.annotations.ApiImplicitParam; | 
 |  |  | import io.swagger.annotations.ApiImplicitParams; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.util.CollectionUtils; | 
 |  |  | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.concurrent.Executor; | 
 |  |  | import java.util.concurrent.Executors; | 
 |  |  |  | 
 |  |  | 
 |  |  |  * @author smartor | 
 |  |  |  * @date 2023-03-04 | 
 |  |  |  */ | 
 |  |  | @Slf4j | 
 |  |  | @Api(description = "患者档案") | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/smartor/patarchive") | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('smartor:patarchive:list')") | 
 |  |  |     @PostMapping("/list") | 
 |  |  |     public TableDataInfo list(@RequestBody PatArchive patArchive) { | 
 |  |  |         startPage(); | 
 |  |  |         PageUtils.startPageByPost(patArchive.getPageNum(), patArchive.getPageSize()); | 
 |  |  |         List<PatArchive> list = patArchiveService.selectPatArchiveList(patArchive); | 
 |  |  |         return getDataTable(list); | 
 |  |  |     } | 
 |  |  | 
 |  |  |         return success(patArchiveService.selectPatArchiveByPatid(patid)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | //    /** | 
 |  |  | //     * 新增患者档案 | 
 |  |  | //     */ | 
 |  |  | //    @ApiOperation("新增患者档案") | 
 |  |  | //    //@PreAuthorize("@ss.hasPermi('smartor:patarchive:add')") | 
 |  |  | //    @Log(title = "患者档案", businessType = BusinessType.INSERT) | 
 |  |  | //    @PostMapping("/add") | 
 |  |  | //    public AjaxResult add(@RequestBody PatArchive patArchive) { | 
 |  |  | //        return toAjax(patArchiveService.insertPatArchive(patArchive)); | 
 |  |  | //    } | 
 |  |  |     /** | 
 |  |  |      * 新增患者档案 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增患者档案") | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('smartor:patarchive:add')") | 
 |  |  |     @Log(title = "患者档案", businessType = BusinessType.INSERT) | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     public AjaxResult add(@RequestBody PatArchive patArchive) { | 
 |  |  |         return toAjax(patArchiveService.insertPatArchive(patArchive)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 新增患者档案 | 
 |  |  | 
 |  |  |     @ApiOperation("查询患者列表") | 
 |  |  |     @PostMapping("/patInfoByContion") | 
 |  |  |     public TableDataInfo patInfoByCondition(@RequestBody PatArchiveReq patArchive) { | 
 |  |  |         PageUtils.startPageByPost(patArchive.getPageNum(), patArchive.getPageSize()); | 
 |  |  | //       PageUtils.startPageByPost(patArchive.getPageNum(), patArchive.getPageSize()); | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         patArchive.setOrgid(user.getOrgid()); | 
 |  |  |         if (CollectionUtils.isEmpty(patArchive.getLeavehospitaldistrictcodes()) || patArchive.getLeavehospitaldistrictcodes().size() == 0) { | 
 |  |  |             patArchive.setLeavehospitaldistrictcodes(null); | 
 |  |  |         } | 
 |  |  | 
 |  |  |         long count = PageUtils.count(new ISelect() { | 
 |  |  |             @Override | 
 |  |  |             public void doSelect() { | 
 |  |  |                 patArchive.setPn(null); | 
 |  |  |                 patArchive.setPs(null); | 
 |  |  |                 patArchiveService.patInfoByContion(patArchive); | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  | 
 |  |  |     @PostMapping("/exportPatInfo") | 
 |  |  |     public void exportPpatInfo(HttpServletResponse response, @RequestBody PatArchiveReq patArchive) { | 
 |  |  |         startPage(); | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         patArchive.setOrgid(user.getOrgid()); | 
 |  |  |         List<PatArchive> patArchives = patArchiveService.patInfoByContion(patArchive); | 
 |  |  |         if (!CollectionUtils.isEmpty(patArchives)) { | 
 |  |  |             for (int i = 0; i < patArchives.size(); i++) { | 
 |  |  | 
 |  |  |     @PostMapping("/getPatientInfo") | 
 |  |  |     public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) { | 
 |  |  |         PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize()); | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         patArchiveReq.setOrgid(user.getOrgid()); | 
 |  |  |         if (CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) || patArchiveReq.getLeavehospitaldistrictcodes().size() == 0) { | 
 |  |  |             patArchiveReq.setLeavehospitaldistrictcodes(null); | 
 |  |  |         } | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取患者信息") | 
 |  |  |     @PostMapping("/getPatientInfoQC") | 
 |  |  |     public TableDataInfo getPatientInfoQC(@RequestBody PatArchiveReq patArchiveReq) { | 
 |  |  |         PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize()); | 
 |  |  |     public Map<String, Object> getPatientInfoQC(@RequestBody PatArchiveReq patArchiveReq) { | 
 |  |  |         patArchiveReq.setPageNum(PageUtils.getOffset(patArchiveReq.getPageNum(), patArchiveReq.getPageSize())); | 
 |  |  |  | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         patArchiveReq.setOrgid(user.getOrgid()); | 
 |  |  |         if (CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) || patArchiveReq.getLeavehospitaldistrictcodes().size() == 0) { | 
 |  |  |             patArchiveReq.setLeavehospitaldistrictcodes(null); | 
 |  |  |         } | 
 |  |  |         if (CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) || patArchiveReq.getLeaveldeptcodes().size() == 0) { | 
 |  |  |             patArchiveReq.setLeaveldeptcodes(null); | 
 |  |  |         } | 
 |  |  |         System.out.println("--------11111111:" + patArchiveReq); | 
 |  |  |         List<PatArchiveOthreInfo> patientInfo = patArchiveService.getPatientInfoQC(patArchiveReq); | 
 |  |  |         long count = PageUtils.count(new ISelect() { | 
 |  |  |             @Override | 
 |  |  |             public void doSelect() { | 
 |  |  |                 patArchiveService.getPatientInfoQC(patArchiveReq); | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |         return getDataTable2(count, patientInfo); | 
 |  |  |         System.out.println("--------222222:" + patientInfo.size()); | 
 |  |  |         patArchiveReq.setPageSize(null); | 
 |  |  |         patArchiveReq.setPageNum(null); | 
 |  |  |         List<PatArchiveOthreInfo> patientInfoQC = patArchiveService.getPatientInfoQC(patArchiveReq); | 
 |  |  |  | 
 |  |  | //        long count = PageUtils.count(new ISelect() { | 
 |  |  | //            @Override | 
 |  |  | //            public void doSelect() { | 
 |  |  | //                patArchiveService.getPatientInfoQC(patArchiveReq); | 
 |  |  | //            } | 
 |  |  | //        }); | 
 |  |  |         return getDataTable3(patientInfoQC.size(), patientInfo); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |