zhaowenxuan
9 天以前 1f1410ec21358c69b678af86c561f435ad83ab9d
ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java
@@ -8,8 +8,10 @@
import com.ltkj.common.enums.DataSourceType;
import com.ltkj.db.DataSourceConfig;
import com.ltkj.db.DataSourceContextHolder;
import com.ltkj.hosp.domain.DictCommonHisConfig;
import com.ltkj.hosp.domain.DictHosp;
import com.ltkj.hosp.mapper.TestMapper;
import com.ltkj.hosp.service.DictCommonHisConfigService;
import com.ltkj.hosp.service.IDictHospService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -43,6 +45,10 @@
@Api(tags = "PC端 积木报表接口集")
@Slf4j
public class JimuController {
    @Autowired
    private DictCommonHisConfigService dictCommonHisConfigService;
//    @Value("${jimu.path}")
    private static  String value;
@@ -135,8 +141,9 @@
    @GetMapping("/getBingZhong")
    public String getBingZhongInfo(@RequestParam("start") String start, @RequestParam("end") String end,@RequestParam(required = true,value = "hospId") String hospId){
        try {
            dataSourceConfig.addDataSource(hospId);
            DataSourceContextHolder.setDataSourceKey(hospId);
            DictCommonHisConfig hisConfig = dictCommonHisConfigService.getOne(new LambdaQueryWrapper<DictCommonHisConfig>().eq(DictCommonHisConfig::getHospital, hospId));
            dataSourceConfig.addDataSource(hisConfig.getDbName());
            DataSourceContextHolder.setDataSourceKey(hisConfig.getDbName());
            JSONObject object = JSONUtil.createObj();
            object.putOpt("data",testMapper.getBingZhongInfo(start,end));
            return JSONUtil.toJsonStr(object);