zhaowenxuan
2025-03-13 9a7ee34013ff0a0eb9a65d76ced42b4f13f3e4d4
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysConfigController.java
@@ -3,6 +3,7 @@
import java.text.SimpleDateFormat;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateTime;
@@ -192,23 +193,23 @@
    @GetMapping ("/shoudongtbjyjcwsxmjg")
    @ApiOperation(value = "手动同步检验检查外送项目结果接口")
    public AjaxResult shoudongtbjyjcwsxmjg(@RequestParam @ApiParam(value = "jy检验 jc检查 jyjc检验和检查") String tblx,
                                           @ApiParam(value = "体检号")@RequestParam String tjh) {
        log.info("手动同步检验或检查结果开始->{}",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
                                           @ApiParam(value = "体检号")@RequestParam String tjh, HttpServletRequest request) {
        String hospId = request.getHeader("hospId");
        log.info("手动同步检验或检查结果开始->{}{}",hospId,DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
        try {
            switch (tblx){
                case "jy":
                    tbjianyan(tjh);
                    tbjianyan(tjh,hospId);
                    log.info("当前同步的是->{} 结果","检验");
                    break;
                case "jc":
                    tbjiancha(tjh);
                    tbjiancha(tjh,hospId);
                    log.info("当前同步的是->{} 结果","检查");
                    break;
                case "jyjc":
                    tbjianyan(tjh);
                    tbjiancha(tjh);
                    tbjianyan(tjh,hospId);
                    tbjiancha(tjh,hospId);
                    log.info("当前同步的是->{} 结果","检验检查");
                    break;
                default:
@@ -228,7 +229,7 @@
        return AjaxResult.success();
    }
    private void tbjianyan(String s) {
    private void tbjianyan(String s,String hosp) {
        try {
            List<Aws> awsList = testMapper.getWsxmLtkjHysqdByLisViBySLAVEWS(s);
            if(null !=awsList && !awsList.isEmpty()){
@@ -239,7 +240,7 @@
                awsService.saveBatch(awsList);
                log.info("保存外送项目成功");
            }
            List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s);
            List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s,hosp);
            log.info("原hysqdList->{} 结果", JSONUtil.parseObj(hysqdList));
            List<LtkjHysqd> wssq = testMapper.getWsxmLtkjHysqdByLisVi(s);
            if(null !=wssq && !wssq.isEmpty()){
@@ -272,16 +273,16 @@
    }
    private void tbjiancha(String s) {
    private void tbjiancha(String s,String hosp) {
        String yqbm = configService.selectConfigByKey("common_api_service_hospbm");
        try {
            List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s);
            List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s,hosp);
            if (null != jcsqdList && !jcsqdList.isEmpty()) {
                DynamicDataSourceContextHolder.clearDataSourceType();
                jcsqdService.deletedLtkjJcsqdByTjhAndTmh(s);
                jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s);
                jcsqdService.saveBatch(jcsqdList);
                List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s);
                List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,hosp);
                DynamicDataSourceContextHolder.clearDataSourceType();
                if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList);
                for (LtkjExamJcsqd jcsqd : jcsqdList) {
@@ -322,7 +323,7 @@
    public AjaxResult zx(@RequestParam int day) {
        try {
            List<DictHosp> list = dictHospService.list();
            DateTime dateTime1 = DateUtil.offsetMonth(new Date(), day);
            DateTime dateTime1 = DateUtil.offsetDay(new Date(), day);
            for (DictHosp dictHosp : list) {
                String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret, dictHosp.getHospAreaId(), dictHosp.getHospAreaName(), dateTime1);
                dictHosp.setSecretKey(mallMerchantSecretKey);