|
@@ -1219,16 +1219,15 @@ public class YBJServiceImpl implements YBJService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void databaseToYiDaTask() {
|
|
public void databaseToYiDaTask() {
|
|
- List<String> dataMonths = new ArrayList<>();
|
|
|
|
- dataMonths.add(dataMonth);
|
|
|
|
- dataMonths.add(nextDataMonth);
|
|
|
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
|
+ // 数据库当月数据日期
|
|
|
|
+ String dataMonth = currentDate.getYear() +"-"+ String.format("%02d", currentDate.getMonthValue());
|
|
Connection connection = null;
|
|
Connection connection = null;
|
|
PreparedStatement ps = null;
|
|
PreparedStatement ps = null;
|
|
log.info("开始执行数据库更新到宜搭护理计划");
|
|
log.info("开始执行数据库更新到宜搭护理计划");
|
|
ArrayList<Integer> ids = new ArrayList<>();
|
|
ArrayList<Integer> ids = new ArrayList<>();
|
|
- for (int j = 0; j < dataMonths.size(); j++) {
|
|
|
|
int times = 0;
|
|
int times = 0;
|
|
- String formId = getFormId(dataMonths.get(j));
|
|
|
|
|
|
+ String formId = getFormId(dataMonth);
|
|
try {
|
|
try {
|
|
Class.forName(driver);
|
|
Class.forName(driver);
|
|
connection = DriverManager.getConnection(url, username, password);
|
|
connection = DriverManager.getConnection(url, username, password);
|
|
@@ -1239,7 +1238,7 @@ public class YBJServiceImpl implements YBJService {
|
|
"`care_date_text`,`start_time_text`,`end_time_text`,`sign_in_photo`, `sign_in_photo_down`, `sign_in_photo_name`, `sign_out_photo`, " +
|
|
"`care_date_text`,`start_time_text`,`end_time_text`,`sign_in_photo`, `sign_in_photo_down`, `sign_in_photo_name`, `sign_out_photo`, " +
|
|
"`sign_out_photo_down`, `sign_out_photo_name`, `sign_in_longitude`, `sign_in_latitude`, `sign_in_time`, `sign_in_position`, " +
|
|
"`sign_out_photo_down`, `sign_out_photo_name`, `sign_in_longitude`, `sign_in_latitude`, `sign_in_time`, `sign_in_position`, " +
|
|
"`sign_out_longitude`, `sign_out_latitude`, `sign_out_time`, `sign_out_position`, `sign_in_distance`, `sign_out_distance` " +
|
|
"`sign_out_longitude`, `sign_out_latitude`, `sign_out_time`, `sign_out_position`, `sign_in_distance`, `sign_out_distance` " +
|
|
- "FROM `yida_plan_details` where data_month = '" + dataMonths.get(j) + "' AND is_cogradient = '否' AND care_date_text > '2024-12-31' " +
|
|
|
|
|
|
+ "FROM `yida_plan_details` where data_month >= '" + dataMonth + "' AND is_cogradient = '否' AND care_date_text > '2024-12-31' " +
|
|
"AND is_delete = '0' ORDER BY care_date_text ASC,id ASC LIMIT 400";
|
|
"AND is_delete = '0' ORDER BY care_date_text ASC,id ASC LIMIT 400";
|
|
ps = connection.prepareStatement(selectSql);
|
|
ps = connection.prepareStatement(selectSql);
|
|
ResultSet rs = ps.executeQuery(selectSql);
|
|
ResultSet rs = ps.executeQuery(selectSql);
|
|
@@ -1327,7 +1326,6 @@ public class YBJServiceImpl implements YBJService {
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|