zhaowenxuan
2025-05-19 6859e991130a26b2a1e393f6a2ce8b89a1bdfd41
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java
@@ -16,6 +16,7 @@
import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
import com.ltkj.hosp.domain.DictHosp;
import com.ltkj.hosp.domain.TjJcycxm;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.domain.TjProject;
import com.ltkj.hosp.mapper.TestMapper;
import com.ltkj.hosp.service.*;
@@ -387,42 +388,51 @@
    @GetMapping ("/tjjcycxm")//同步his项目单价信息
//    @PreAuthorize("@ss.hasPermi('system:config:tbhisproprice')")
    @ApiOperation (value = "tjjcycxm")
    public AjaxResult tjjcycxm() {
    public AjaxResult tjjcycxm(@ApiParam("体检号") @RequestParam(required = false)String tjh) {
        String yqbm = configService.selectConfigByKey("common_api_service_hospbm");
        List<String> jc = orderService.getJianChaTjNum();
        if (null != jc && !jc.isEmpty()) {
            for (String s : jc) {
                jcycxmService.deletedByTjh(s);
                List<LtkjExamJcsqd> list = jcsqdService.getLtkjJcsqdByTjh(s);
                if(null !=list && !list.isEmpty()){
                    for (LtkjExamJcsqd jcsqd : list) {
                        if(StringUtil.isNotBlank(jcsqd.getJgzt())){
                            String[] split = jcsqd.getJgzt().replaceAll("\n", "").split("。|;|;");
                            for (String jg : split) {
                                if(StringUtil.isNotBlank(jg) && !jg.contains("未见异常")
                                        && !jg.contains("未见明显异常") && !jg.contains("未见占位") && !jg.contains("未见")
                                        && !jg.contains("未见明显")&& !jg.contains("正常")&& !jg.contains("双侧椎间孔无狭窄")&& !jg.contains("无殊")){
                                    TjJcycxm jcycxm=new TjJcycxm();
                                    jcycxm.setTjh(s);
                                    jcycxm.setYqid(yqbm);
                                    String[] split1 = jcsqd.getJcxmid().split(";");
                                    jcycxm.setProId(split1[0]);
                                    jcycxm.setProName(jcsqd.getJcxmmc());
                                    jcycxm.setCreateTime(new Date());
                                    jcycxm.setJcjg(jg);
                                    jcycxmService.save(jcycxm);
                                }
                            }
                        }
                    }
        if(StringUtil.isNotBlank(tjh)){
            extracted(tjh, yqbm);
        }else {
            List<String> jc = orderService.getJianChaTjNum();
            if (null != jc && !jc.isEmpty()) {
                for (String s : jc) {
                    extracted(s, yqbm);
                }
            }
        }
        return AjaxResult.success();
    }
    private void extracted(String s, String yqbm) {
        TjOrder order = orderService.getOrderByTjNum(s);
        jcycxmService.deletedByTjh(order.getCardId());
        List<LtkjExamJcsqd> list = jcsqdService.getLtkjJcsqdByTjh(order.getCardId());
        if(null !=list && !list.isEmpty()){
            for (LtkjExamJcsqd jcsqd : list) {
                if(StringUtil.isNotBlank(jcsqd.getJgzt())){
                    String regex = configService.selectConfigByKey("jcycxmzz");
                    if(StringUtil.isBlank(regex)) regex= "。|;|;|,|,";
                    System.out.println("jcycxmzz值为"+regex);
                    String[] split = jcsqd.getJgzt().replaceAll("\n", "").split(regex);
                    for (String jg : split) {
                        if(StringUtil.isNotBlank(jg) && !jg.contains("未见异常")
                                && !jg.contains("未见明显异常") && !jg.matches("\\d+")  && !jg.contains("未见占位") && !jg.contains("未见")
                                && !jg.contains("未见明显")&& !jg.contains("正常")&& !jg.contains("双侧椎间孔无狭窄")&& !jg.contains("无殊")){
                            TjJcycxm jcycxm=new TjJcycxm();
                            jcycxm.setTjh(s);
                            jcycxm.setYqid(yqbm);
                            String[] split1 = jcsqd.getJcxmid().split(";");
                            jcycxm.setProId(split1[0]);
                            jcycxm.setProName(jcsqd.getJcxmmc());
                            jcycxm.setCreateTime(new Date());
                            jcycxm.setJcjg(jg);
                            jcycxmService.save(jcycxm);
                        }
                    }
                }
            }
        }
    }
}