| | |
| | | map.put("jbbm",dto.getJbbm()); |
| | | map.put("jbbm1",dto.getJbbm1()); |
| | | map.put("jbbm2",dto.getJbbm2()); |
| | | map.put("tw",dto.getTw()); |
| | | map.put("mb",dto.getMb()); |
| | | map.put("hx",dto.getHx()); |
| | | map.put("bp",dto.getBp()); |
| | | // map.put("tw",dto.getTw()); |
| | | // map.put("mb",dto.getMb()); |
| | | // map.put("hx",dto.getHx()); |
| | | // map.put("bp",dto.getBp()); |
| | | map.put("fzbz",dto.getFzbz()); |
| | | map.put("hzqx",dto.getHzqx()); |
| | | map.put("sfqc",dto.getSfqc()); |
| | | map.put("qchs",dto.getQchs()); |
| | | map.put("sfqj",dto.getSfqj()); |
| | | map.put("ckrq",dto.getCkrq()); |
| | | map.put("jzqk",dto.getJzqk()); |
| | | String post = HttpClientUtils.sendPost(HIS_URL, map); |
| | | return AjaxResult.success(post); |
| | | } |
| | |
| | | |
| | | // @ApiOperation(value = "新增/修改门诊诊断") |
| | | public AjaxResult Outpinimpapply (OutpinimpapplyDto dto) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("his_registration_id", dto.getHisRegistrationId ()); |
| | | map.put ("mzzdid", dto.getMzzdid ()); |
| | | map.put ("sqysbm", dto.getSqysbm ()); |
| | | map.put ("mzksbm", dto.getMzksbm ()); |
| | | map.put ("fbrq", dto.getFbrq ()); |
| | | map.put ("zdrq", dto.getZdrq ()); |
| | | map.put ("czybm", dto.getCzybm ()); |
| | | map.put ("czyksbm", dto.getCzyksbm ()); |
| | | map.put ("zs", dto.getZs ()); |
| | | map.put ("bs", dto.getBs ()); |
| | | map.put ("clyz", dto.getClyz ()); |
| | | map.put ("jws", dto.getJws ()); |
| | | map.put ("tgjc", dto.getTgjc ()); |
| | | map.put ("gms", dto.getGms ()); |
| | | map.put ("jbbm", dto.getJbbm ()); |
| | | map.put ("jbbm1", dto.getJbbm1 ()); |
| | | map.put ("jbbm2", dto.getJbbm2 ()); |
| | | map.put ("tw", dto.getTw ()); |
| | | map.put ("mb", dto.getMb ()); |
| | | map.put ("hx", dto.getHx ()); |
| | | map.put ("bp", dto.getBp ()); |
| | | map.put ("fzbz", dto.getFzbz ()); |
| | | map.put ("hzqx", dto.getHzqx ()); |
| | | map.put ("sfqc", dto.getSfqc ()); |
| | | map.put ("qchs", dto.getQchs ()); |
| | | map.put ("sfqj", dto.getSfqj ()); |
| | | map.put ("ckrq", dto.getCkrq ()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("his_registration_id",dto.getHisRegistrationId()); |
| | | map.put("mzzdid",dto.getMzzdid()); |
| | | map.put("sqysbm",dto.getSqysbm()); |
| | | map.put("mzksbm",dto.getMzksbm()); |
| | | map.put("fbrq",dto.getFbrq()); |
| | | map.put("zdrq",dto.getZdrq()); |
| | | map.put("czybm",dto.getCzybm()); |
| | | map.put("czyksbm",dto.getCzyksbm()); |
| | | map.put("zs",dto.getZs()); |
| | | map.put("bs",dto.getBs()); |
| | | map.put("clyz",dto.getClyz()); |
| | | map.put("jws",dto.getJws()); |
| | | map.put("tgjc",dto.getTgjc()); |
| | | map.put("gms",dto.getGms()); |
| | | map.put("jbbm",dto.getJbbm()); |
| | | map.put("jbbm1",dto.getJbbm1()); |
| | | map.put("jbbm2",dto.getJbbm2()); |
| | | map.put("fzbz",dto.getFzbz()); |
| | | map.put("hzqx",dto.getHzqx()); |
| | | map.put("sfqc",dto.getSfqc()); |
| | | map.put("qchs",dto.getQchs()); |
| | | map.put("sfqj",dto.getSfqj()); |
| | | map.put("jzqk",dto.getJzqk()); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Outpinimpapply", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.dto.QianDaoDto; |
| | | import com.ltkj.hosp.hisDto.OutpinimpapplyDto; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail; |
| | |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethod; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | | import com.ltkj.web.controller.his.HisMzJysqController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | @Autowired |
| | | private HisApiMethodService controller; |
| | | |
| | | /** |
| | | * 查询体检记录列表 |
| | |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | customer.setCardId("0"); |
| | | tjCustomerService.updateById(customer); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if(null !=config && config.equals("Y")){ |
| | | final String date = DateUtil.format(tjOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | OutpinimpapplyDto dto=new OutpinimpapplyDto(); |
| | | dto.setHisRegistrationId(tjOrder.getCardId()); |
| | | dto.setMzzdid(1); |
| | | dto.setSqysbm("00029"); |
| | | dto.setMzksbm("0101"); |
| | | dto.setFbrq(date); |
| | | dto.setZdrq(date); |
| | | dto.setCzybm("00029"); |
| | | dto.setCzyksbm("0101"); |
| | | dto.setZs("健康查体"); |
| | | dto.setBs("不详"); |
| | | dto.setClyz(""); |
| | | dto.setJws(""); |
| | | dto.setTgjc(""); |
| | | dto.setGms(""); |
| | | dto.setJbbm("Z00.001"); |
| | | dto.setJbbm1(""); |
| | | dto.setJbbm2(""); |
| | | dto.setFzbz("1"); |
| | | dto.setHzqx("6"); |
| | | dto.setSfqc("0"); |
| | | dto.setQchs(""); |
| | | dto.setSfqj("0"); |
| | | dto.setJzqk(9); |
| | | controller.Outpinimpapply(dto); |
| | | } |
| | | |
| | | return AjaxResult.success("签离成功!"); |
| | | } else { |
New file |
| | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | import java.sql.SQLException; |
| | | import java.util.Properties; |
| | | |
| | | public class ConfigHandler { |
| | | |
| | | private static final String DB_PROPERTIES_FILE = "D:\\ltkjprojectconf\\config.properties"; |
| | | private static final String DB_URL_KEY = "ip"; |
| | | private static final String DB_PROT_KEY = "prot"; |
| | | private static final String DB_NAME_KEY = "name"; |
| | | private static final String DB_USER_KEY = "username"; |
| | | private static final String DB_PASSWORD_KEY = "password"; |
| | | private Connection connection; |
| | | private Connection connectToDatabase(Properties props) throws SQLException { |
| | | String dbUrl = "jdbc:mysql://"+props.getProperty("ip")+":"+props.getProperty("prot")+"/"+props.getProperty("name")+"" + |
| | | "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8"; |
| | | String dbUser = props.getProperty(DB_USER_KEY); |
| | | String dbPassword = props.getProperty(DB_PASSWORD_KEY); |
| | | // 加载MySQL驱动 |
| | | try { |
| | | Class.forName("com.mysql.cj.jdbc.Driver"); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (connection == null || connection.isClosed()) { |
| | | // 关闭旧的连接 |
| | | if (connection != null) { |
| | | try { |
| | | connection.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // 创建新的数据库连接 |
| | | // connection = DriverManager.getConnection(connectionString, username, password); |
| | | } |
| | | return DriverManager.getConnection(dbUrl, dbUser, dbPassword); |
| | | } |
| | | |
| | | public void modifyConfigAndRefreshDB(String newDbUrl,String prot,String name, String newDbUser, String newDbPassword) throws IOException, SQLException { |
| | | Properties properties = new Properties(); |
| | | properties.load(new FileInputStream(DB_PROPERTIES_FILE)); |
| | | |
| | | // 修改配置 |
| | | properties.setProperty(DB_URL_KEY, newDbUrl); |
| | | properties.setProperty(DB_PROT_KEY, prot); |
| | | properties.setProperty(DB_NAME_KEY, name); |
| | | properties.setProperty(DB_USER_KEY, newDbUser); |
| | | properties.setProperty(DB_PASSWORD_KEY, newDbPassword); |
| | | |
| | | // 更新配置文件 |
| | | properties.store(new FileOutputStream(DB_PROPERTIES_FILE), null); |
| | | |
| | | // 关闭旧的数据库连接,并建立新的连接 |
| | | Connection connection = connectToDatabase(properties); |
| | | // ... 使用新的connection进行数据库操作 ... |
| | | |
| | | // 确保关闭数据库连接 |
| | | if (connection != null && !connection.isClosed()) { |
| | | connection.close(); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ConfigHandler configHandler = new ConfigHandler(); |
| | | try { |
| | | // 假设新的数据库连接信息 |
| | | String newDbUrl = "192.168.0.5"; |
| | | String prot = "3306"; |
| | | String name = "ltkjpeis1"; |
| | | String newDbUser = "root"; |
| | | String newDbPassword = "root"; |
| | | |
| | | configHandler.modifyConfigAndRefreshDB(newDbUrl,prot,name,newDbUser, newDbPassword); |
| | | System.out.println("数据库配置已更新并且数据库连接已刷新。"); |
| | | } catch (IOException | SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.ltkj.LtkjApplication; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjPackage; |
| | |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * @Author: 西安路泰科技有限公司/赵佳豪 |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | |
| | | try { |
| | | forwardUrl("192.168.0.5","www.baidu.com"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // 初始数据库配置 |
| | | String initialUrl = "jdbc:mysql://initial_host:3306/initial_db"; |
| | | String username = "user"; |
| | | String password = "pass"; |
| | | |
| | | // 新数据库配置 |
| | | String newUrl = "jdbc:mysql://new_host:3306/new_db"; |
| | | |
| | | // 更改连接URL |
| | | String urlToUse = initialUrl; // 可以根据需要切换到newUrl |
| | | |
| | | // 创建数据库连接属性 |
| | | Properties props = new Properties(); |
| | | props.setProperty("user", username); |
| | | props.setProperty("password", password); |
| | | |
| | | try { |
| | | // 连接到数据库 |
| | | Connection conn = DriverManager.getConnection(urlToUse, props); |
| | | |
| | | // 使用conn进行数据库操作... |
| | | |
| | | // 关闭连接 |
| | | conn.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | private Integer mzzdid; |
| | | private String sqysbm; |
| | | private String mzksbm; |
| | | @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss") |
| | | private Date fbrq; |
| | | @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss") |
| | | private Date zdrq; |
| | | // @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss") |
| | | private String fbrq; |
| | | // @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss") |
| | | private String zdrq; |
| | | private String czybm; |
| | | private String czyksbm; |
| | | private String zs; |
| | |
| | | private String sfqj; |
| | | @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss") |
| | | private Date ckrq; |
| | | private Integer jzqk; |
| | | } |