zjh
2023-12-27 7077fa8ff7f18b2991deafaba9f9dc65d1d27f51
zjh 本地 2023/12/27 -1
5个文件已修改
115 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCheckController.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-common/src/main/java/com/ltkj/common/annotation/RepeatSubmit.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjProject.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/sqlDomain/LtkjHysqd.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCheckController.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ltkj.common.annotation.RepeatSubmit;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.redis.RedisCache;
@@ -12,6 +13,7 @@
import com.ltkj.common.utils.SecurityUtils;
import com.ltkj.common.utils.StringUtils;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.framework.config.UserHoder;
import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.mapper.TestMapper;
@@ -37,6 +39,7 @@
import java.util.stream.Collectors;
import static org.apache.poi.hemf.record.emfplus.HemfPlusRecordType.save;
import static org.apache.poi.hemf.record.emfplus.HemfPlusRecordType.setClipRect;
/**
 * @Author: 西安路泰科技有限公司/赵佳豪
@@ -304,38 +307,43 @@
     */
    @GetMapping("/dataSynchronization")
    @ApiOperation(value = "同步sql server数据到本地数据库数据接口")
    @RepeatSubmit
    public AjaxResult dataSynchronization(@RequestParam String tjNumber) {
        //根据配置调取存储过程 将临时表数据存入预约表2023.12.12
        final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData");
        if ("Y".equals(getInfoFromSqlData)) {
            List<LtkjHysqd> one = testMapper.getHysqdByTmh(tjNumber);
            if (one != null) {
                DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                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();
            TjOrder order = orderService.getOrderByTjNum(tjNumber);
            if (null != order) {
                List<LtkjHysqd> one = testMapper.getHysqdByTmh(order.getCardId());
                if (one != null && one.size() > 0) {
                    DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                    ltkjHysqdService.saveBatch(one);
                    DynamicDataSourceContextHolder.clearDataSourceType();
                    for (LtkjHysqd ltkjHysqd : one) {
                        List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(ltkjHysqd.getTmh());
                        if (one1 != null && one1.size() > 0) {
                            DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                            ltkjHybgdService.saveBatch(one1);
                            DynamicDataSourceContextHolder.clearDataSourceType();
                        }
                    }
                }
            }
            List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber);
            if (one2 != null) {
                DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                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();
                    }
                }
//                List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber);
//                if (one2 != null && one2.size() > 0) {
//                    DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
//                    ltkjExamJcsqdService.saveBatch(one2);
//                    DynamicDataSourceContextHolder.clearDataSourceType();
//                    for (LtkjExamJcsqd ltkjExamJcsqd : one2) {
//                        List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(ltkjExamJcsqd.getTmh());
//                        if (one3 != null && one3.size() > 0) {
//                            DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
//                            ltkjExamJcbgdService.saveBatch(one3);
//                            DynamicDataSourceContextHolder.clearDataSourceType();
//                        }
//                    }
//                }
                testMapper.updateDetailByCall(order.getCardId(), String.valueOf(order.getOrderId()),order.getTjNumber(),UserHoder.getLoginUser().getUserId());
            }
        }
        return AjaxResult.success("同步成功");
@@ -356,8 +364,7 @@
                              @ApiParam(value = "姓名)") @RequestParam(required = false) String name,
                              @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime,
                              @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime) {
//        String config = configService.selectConfigByKey("tj_confirm");
        //        String config = configService.selectConfigByKey("tj_confirm");
//        DateTime beginTimes = null;
//        DateTime endTimes = null;
//        if (null != beginTime && null != endTime) {
@@ -492,7 +499,7 @@
                        if (customerService.updateById(customer)) {
                            LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>();
                            wqq.eq(TbTransition::getCusId, customer.getCusIdcard());
                            wqq.eq(TbTransition::getCardId,customer.getCardId());
                            wqq.eq(TbTransition::getCardId, customer.getCardId());
                            transitionService.remove(wqq);
                            asyncService.updateCheckType(tjNumber);
                            return AjaxResult.success("操作成功");
@@ -543,7 +550,7 @@
                parent.put("checkAdvice", one.getCheckAdvice());
                TjProject project = projectService.selectTjProjectByProId(remark.getProId());
                //判断该项目是否需要打印报告
                if ("N".equals(project.getNeedReport())){
                if ("N".equals(project.getNeedReport())) {
                    continue;
                }
                if (null != project) {
@@ -566,7 +573,7 @@
                            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);
                        }
                    }
ltkj-common/src/main/java/com/ltkj/common/annotation/RepeatSubmit.java
@@ -20,7 +20,7 @@
    /**
     * 间隔时间(ms),小于此时间视为重复提交
     */
     int interval() default 200;
     int interval() default 10000;
    /**
     * 提示消息
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjProject.java
@@ -244,6 +244,12 @@
    @ApiModelProperty(value = "是否打报告'Y/N'")
    private String needReport;
    @ApiModelProperty(value = "lis项目编码")
    private String lisXmbm;
    @ApiModelProperty(value = "lis项目名称")
    private String lisXmmc;
    /**
     * 子项目
     */
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TestMapper.java
@@ -1,13 +1,11 @@
package com.ltkj.hosp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.common.annotation.DataSource;
import com.ltkj.common.enums.DataSourceType;
import com.ltkj.hosp.sqlDomain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@@ -76,6 +74,14 @@
    @Select("call pro_his_middle(#{sfzh,mode=IN},#{sfzbm,mode=IN})")
    public void saveTjProByCusId(@Param("sfzh") String sfzh,@Param("sfzbm")String sfzbm);
    @DataSource(value = DataSourceType.MASTER)
    @Select("call tj_update_detatil(#{cardId,mode=IN},#{orderId,mode=IN},#{tjnum,mode=IN},#{dockerId,mode=IN})")
    public void updateDetailByCall(@Param("cardId") String cardId,
                                   @Param("orderId")String orderId,
                                   @Param("tjnum")String tjnum,
                                   @Param("dockerId")String dockerId);
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_exam_jcbgd")
    public List<LtkjExamJcbgd> getExamJcbgd();
@@ -84,7 +90,6 @@
    @Select("SELECT * FROM histjv_exam_jcsqd")
    public List<LtkjExamJcsqd> getExamJcsqd();
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_Ltkj_hybgd")
    public List<LtkjHybgd> getHybgd();
@@ -92,7 +97,6 @@
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_Ltkj_hysqd")
    public List<LtkjHysqd> getHysqd();
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_LTKJVTJPAT where pat_id=#{id}")
@@ -114,7 +118,6 @@
    @Select("SELECT * FROM histjv_exam_jcsqd  where tjh=#{id}")
    public LtkjExamJcsqd getExamJcsqdById(String id);
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_Ltkj_hybgd  where tmh=#{id}")
    public LtkjHybgd getHybgdById(String id);
@@ -122,7 +125,6 @@
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_Ltkj_hysqd  where tmh=#{id}")
    public LtkjHysqd getHysqdById(String id);
    //体检登记接口  调用后  查询收费单据和详情
    @DataSource(value = DataSourceType.SLAVE_HIS)
@@ -132,7 +134,6 @@
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_Ltkj_middle_detail where fead_id=#{id}")
    public List<LtkjMiddleDetail> getMiddleDetailByHeadId(String id);
    //根据体检号  对应的   化验项目    +标本
    @DataSource(value = DataSourceType.SLAVE_HIS)
@@ -144,10 +145,9 @@
    @Select("SELECT * FROM histjv_Ltkj_hybgd where tmh=#{id}")
    public  List<LtkjHybgd> getHybgdByTmh(String id);
    //根据体检号  对应的  检查项目
    @DataSource(value = DataSourceType.SLAVE_HIS)
    @Select("SELECT * FROM histjv_exam_jcsqd where tjh=#{id}")
    @Select("SELECT * FROM histjv_Ltkj_hybgd where tjh=#{id}")
    public List<LtkjExamJcsqd> getExamJcsqdTmh(String id);
    //检查项目对应的检查结果  传上面的接口的结果tmh
@@ -155,4 +155,25 @@
    @Select("SELECT * FROM histjv_exam_jcbgd where tmh=#{id}")
    public List<LtkjExamJcbgd> getExamJcbgdByTjh(String id);
    @DataSource(value = DataSourceType.SLAVE_PACS)
    @Select({"<script> select isnull(fcard_no,'不详') xh,fcard_iD pacCode,pat_name pacName,\n" +
            " (case when patsex_id='0' then '男' when patsex_id='1' then '女' else '未知' end )+';'+brnl detail,\n" +
            " pat_id price , mobile pacRemark" +
            "  from histjv_ltkjvtjpat where 1=1 "+
            " <when test='pacCode!=null'>" +
            "  AND fcard_no = #{pacCode}" +
            "</when>" +
            " <when test='pacName!=null'>" +
            "  AND pat_name = #{pacName}" +
            "</when>" +
            " <when test='pacRemark!=null'>" +
            "  AND mobile = #{pacRemark}" +
            "</when>" +
            "</script>"})
    public List<Map<String,Object>> getTjHyBgList(@Param("pacCode")String pacCode,
                                                  @Param("pacName")String pacName,
                                                  @Param("pacRemark")String pacRemark);
}
ltkj-hosp/src/main/java/com/ltkj/hosp/sqlDomain/LtkjHysqd.java
@@ -11,6 +11,7 @@
public class LtkjHysqd {
    private String tjh;
    private String tmh;
    //标本号
    private String bbbh;
    private String bbmc;
    private String xmid;