lige
2023-12-13 fd1f0a356eb828503bec075a471f8860b601cd0b
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCheckController.java
@@ -96,7 +96,6 @@
    private LtkjHysqdService ltkjHysqdService;
    @GetMapping("/getOperationPermissionsByTjNum")
    @ApiOperation(value = "(初审页面  和 医生页面)根据体检号获取是否可操作权限接口  true可操作  反之不可")
    public AjaxResult getOperationPermissionsByTjNum(@ApiParam(value = "体检号") @RequestParam String tjNumber) {
@@ -275,6 +274,8 @@
                    confirmLog.setTjNum(tjNumber);
                    confirmLog.setStatus(status);
                    confirmLogService.save(confirmLog);
                    asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, 0, null, null, null));
                    asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, 1, null, null, null));
                    return AjaxResult.success("操作成功");
                }
                return AjaxResult.error("操作失败");
@@ -286,45 +287,45 @@
    /**
     * 同步数据接口
     * 同步sql server数据到本地数据库数据接口
     */
    @GetMapping("/dataSynchronization")
    @ApiOperation(value = "同步数据接口")
    @Transactional
    public AjaxResult dataSynchronization(@RequestParam String tjNumber){
    @ApiOperation(value = "同步sql server数据到本地数据库数据接口")
    public AjaxResult dataSynchronization(@RequestParam String tjNumber) {
        List<LtkjHysqd> one = testMapper.getHysqdByTmh(tjNumber);
        DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
        for (LtkjHysqd hysqd : one) {
            ltkjHysqdService.save(hysqd);
            List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(hysqd.getTmh());
        if (one!=null){
            DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
            for (LtkjHybgd hybgd : one1) {
                ltkjHybgdService.save(hybgd);
            }
            ltkjHysqdService.saveBatch(one);
            DynamicDataSourceContextHolder.clearDataSourceType();
            for (LtkjHysqd ltkjHysqd : one) {
                List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(ltkjHysqd.getTmh());
                if (one1!=null){
                    DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                    ltkjHybgdService.saveBatch(one1);
                    DynamicDataSourceContextHolder.clearDataSourceType();
                }
            }
        }
        DynamicDataSourceContextHolder.clearDataSourceType();
        List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber);
        DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
        for (LtkjExamJcsqd examJcsqd : one2) {
            ltkjExamJcsqdService.save(examJcsqd);
            List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(examJcsqd.getTmh());
        if (one2!=null){
            DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
            for (LtkjExamJcbgd examJcbgd : one3) {
                ltkjExamJcbgdService.save(examJcbgd);
            }
            ltkjExamJcsqdService.saveBatch(one2);
            DynamicDataSourceContextHolder.clearDataSourceType();
            for (LtkjExamJcsqd ltkjExamJcsqd : one2) {
                List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(ltkjExamJcsqd.getTmh());
                if (one3!=null){
                    DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                    ltkjExamJcbgdService.saveBatch(one3);
                    DynamicDataSourceContextHolder.clearDataSourceType();
                }
            }
        }
        DynamicDataSourceContextHolder.clearDataSourceType();
        return AjaxResult.success();
        return AjaxResult.success("同步成功");
    }
    /**
     * 查询体检记录客户列表
@@ -493,7 +494,7 @@
    @GetMapping("/updateCheckType")
    @ApiOperation(value = "总检点击体检信息详情")
    public AjaxResult updateCheckType(@ApiParam(value = "客户体检号") @RequestParam String tjNumber) {
        if(redisCache.hasKey("updateCheckType"+tjNumber)) {
        if (redisCache.hasKey("updateCheckType" + tjNumber)) {
            List<Map<String, Object>> cacheMapValue = redisCache.getCacheMapValue("updateCheckType" + tjNumber, tjNumber);
            return AjaxResult.success(cacheMapValue);
        }
@@ -526,9 +527,9 @@
                if (null != tjOrderDetails && tjOrderDetails.size() > 0) {
                    for (TjOrderDetail tjOrderDetail : tjOrderDetails) {
                        final TjProject byId = projectService.selectTjProjectByProId(tjOrderDetail.getProId());
                        if(null==byId){
                        if (null == byId) {
                            detailService.removeById(tjOrderDetail.getOrderDetailId());
                        }else {
                        } else {
                            tjOrderDetail.setProject(byId);
                        }
                        List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId()));
@@ -538,13 +539,13 @@
                            tjOrderDetail.setStandard(list2.get(0));
                        } else {
                            final int ageType = StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday()));
                            TjStandard tjStandard1=tjStandardService.getListBySexAndType(customer.getCusSex(),ageType, String.valueOf(tjOrderDetail.getProId()));
                            TjStandard tjStandard1 = tjStandardService.getListBySexAndType(customer.getCusSex(), ageType, String.valueOf(tjOrderDetail.getProId()));
                            tjOrderDetail.setStandard(tjStandard1);
                        }
                    }
                    String summary = remark.getSummary();
                    if (null != summary) {
                          String[] split = summary.split(";");
                        String[] split = summary.split(";");
//                        List<Long> longList = new ArrayList<>();
//                        for (String str : split) {
//                            if(!"".equals(str)){