|
@@ -77,16 +77,15 @@ public class YBJServiceImpl implements YBJService {
|
|
|
private PlanService planService;
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+//
|
|
|
+// LocalDate currentDate = LocalDate.now();
|
|
|
+// //获取下月1号的日期
|
|
|
+// LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+// // 数据库下月数据日期
|
|
|
+// String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
+// // 数据库当月数据日期
|
|
|
+// String dataMonth = currentDate.getYear() +"-"+ String.format("%02d", currentDate.getMonthValue());
|
|
|
|
|
|
- LocalDate currentDate = LocalDate.now();
|
|
|
- //获取下月1号的日期
|
|
|
- LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
- // 数据库下月数据日期
|
|
|
- String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
- // 数据库当月数据日期
|
|
|
- String dataMonth = currentDate.getYear() +"-"+ String.format("%02d", currentDate.getMonthValue());
|
|
|
- //获取下月月末最后一天日期
|
|
|
- LocalDate lastDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
|
|
|
|
|
|
|
|
|
|
|
@@ -300,7 +299,12 @@ public class YBJServiceImpl implements YBJService {
|
|
|
*/
|
|
|
@Override
|
|
|
public void insertDatabaseTask() {
|
|
|
- log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ //获取下月1号的日期
|
|
|
+ LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
+
|
|
|
+ log.info("创建下月护理计划定时任务生成到数据库:{}", firstDayOfNextMonth);
|
|
|
YDParam ydParam = new YDParam();
|
|
|
|
|
|
ydParam = YDParam.builder()
|
|
@@ -414,13 +418,22 @@ public class YBJServiceImpl implements YBJService {
|
|
|
*/
|
|
|
@Override
|
|
|
public void insertDatabaseNextMonth(String formInstId) {
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ //获取下月1号的日期
|
|
|
+ LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
+ log.info("nextDataMonth:{}",nextDataMonth);
|
|
|
log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
List<Map> dataList = new ArrayList<>();
|
|
|
|
|
|
//获取日期是几号
|
|
|
int dayOfMonth = firstDayOfNextMonth.getDayOfMonth();
|
|
|
+ log.info("dayOfMonth:{}",dayOfMonth);
|
|
|
+
|
|
|
//获取月天数
|
|
|
int daysInMonth = firstDayOfNextMonth.lengthOfMonth();
|
|
|
+ log.info("daysInMonth:{}",daysInMonth);
|
|
|
+
|
|
|
try {
|
|
|
Class.forName(driver);
|
|
|
Connection connection = DriverManager.getConnection(url, username, password);
|
|
@@ -511,6 +524,10 @@ public class YBJServiceImpl implements YBJService {
|
|
|
}
|
|
|
@Override
|
|
|
public void insertDatabaseTaskNew() {
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ //获取下月1号的日期
|
|
|
+ LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
YDParam ydParam = new YDParam();
|
|
|
String formId = getFormId(nextDataMonth);
|
|
@@ -606,131 +623,302 @@ public class YBJServiceImpl implements YBJService {
|
|
|
|
|
|
@Override
|
|
|
public void insertHistory() {
|
|
|
+ long startTime = 1733068800000L;
|
|
|
+ long lastTime = 1734969600000L;
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ // 创建一个Calendar实例并设置为给定的时间戳
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeInMillis(startTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ // 获取第二天0点的时间戳
|
|
|
+ long secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
- YDParam ydParam = new YDParam();
|
|
|
-// String formId = getFormId(nextDataMonth);
|
|
|
- ydParam = YDParam.builder()
|
|
|
- .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM") //获取护理计划
|
|
|
-// .searchFieldJson(JSON.toJSONString(UtilMap.map("selectField_m4hsya94", "未回写")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
- .build();
|
|
|
- ydParam.setPageSize(1);
|
|
|
- long totalCount = ydClient.queryData(ydParam, YDConf.FORM_QUERY.retrieve_search_form).getTotalCount();
|
|
|
- float pageSize = 50;
|
|
|
- ydParam.setCurrentPage(1);
|
|
|
- ydParam.setPageSize((int) pageSize);
|
|
|
- List<Map> dataList = new ArrayList<>();
|
|
|
-
|
|
|
-// dataList = ydService.queryFormData_all(ydParam);
|
|
|
- List<Plan> planCopies = new ArrayList<>();
|
|
|
- for (int page = 1; page <= Math.ceil(totalCount / pageSize); page++) {
|
|
|
- ydParam.setCurrentPage(page);
|
|
|
- //创建护理计划 1次获取50条
|
|
|
- dataList = (List<Map>) ydClient.queryData(ydParam, YDConf.FORM_QUERY.retrieve_search_form).getData();
|
|
|
-
|
|
|
- dataList.forEach(e -> {
|
|
|
- Map formMap = (Map) e.get("formData");
|
|
|
- System.out.println(e);
|
|
|
- //护理人员
|
|
|
- Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
- JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
- JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
- Plan planCopy = new Plan();
|
|
|
- planCopy.setDataMonth(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 7));
|
|
|
- //planCopy.setFormInstId();
|
|
|
- planCopy.setPlanInstId(e.get("formInstanceId").toString());
|
|
|
- planCopy.setCaregiverForm(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
- planCopy.setCaregiverName(jsonObject.get("title").toString());
|
|
|
- planCopy.setCaregiverMember(ObjectUtil.isNotNull(formMap.get("employeeField_lo3pmoi6_id"))?formMap.get("employeeField_lo3pmoi6_id").toString():"");
|
|
|
- planCopy.setCaregiverDepartment(formMap.get("textField_lo3pmoi0").toString());
|
|
|
- planCopy.setCaregiverCard(formMap.get("textField_lombve2g").toString());
|
|
|
- planCopy.setCaregiverPhone(formMap.get("textField_lo3pmoi3").toString());
|
|
|
- if (formMap.get("departmentSelectField_lxzto1e1_id") != null) {
|
|
|
- planCopy.setDepartment(formMap.get("departmentSelectField_lxzto1e1_id").toString());
|
|
|
- }
|
|
|
- //护理对象
|
|
|
- parse = JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
- jsonArray = JSON.parseArray(parse.toString());
|
|
|
- jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
- planCopy.setCareObjectForm(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
- planCopy.setCareObjectName(jsonObject.get("title").toString());
|
|
|
- planCopy.setCareObjectCard(formMap.get("textField_lnyhv5tn").toString());
|
|
|
- planCopy.setCareObjectLevel(ObjectUtil.isNotNull(formMap.get("selectField_lnyhv5tp"))?formMap.get("selectField_lnyhv5tp").toString():"");
|
|
|
- planCopy.setCareObjectAddress(ObjectUtil.isNotNull(formMap.get("textField_lnyhv5tr"))?formMap.get("textField_lnyhv5tr").toString():"");
|
|
|
- planCopy.setCareObjectLongitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5n"))?formMap.get("textField_lvae7q5n").toString():"");
|
|
|
- planCopy.setCareObjectLatitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5o"))?formMap.get("textField_lvae7q5o").toString():"");
|
|
|
- planCopy.setWithinTheWeek(formMap.get("selectField_lo3pmohy").toString());
|
|
|
- planCopy.setCareStartTime(Long.parseLong(formMap.get("dateField_lred6eoj").toString()));
|
|
|
- planCopy.setCareEndTime(Long.parseLong(formMap.get("dateField_lred6eok").toString()));
|
|
|
- planCopy.setStartTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(11, 16));
|
|
|
- planCopy.setEndTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))).substring(11, 16));
|
|
|
- if (ObjectUtil.isNotNull(formMap.get("dateField_lp7obkef"))) {
|
|
|
- if (ObjectUtil.isNotNull(formMap.get("imageField_lrq19cti"))) {
|
|
|
- parse = JSON.parse(formMap.get("imageField_lrq19cti").toString());
|
|
|
+ while (startTime <= lastTime){
|
|
|
+ YDParam ydParam = new YDParam();
|
|
|
+ ydParam = YDParam.builder()
|
|
|
+ .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM") //获取护理计划
|
|
|
+// .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj", dateList)))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .build();
|
|
|
+ List<Map> dataList = ydService.queryFormData_all(ydParam);
|
|
|
+ List<Plan> planCopies = new ArrayList<>();
|
|
|
+ System.out.println(startTime+" - "+secondDayTime+"-"+dataList.size());
|
|
|
+ if (ObjectUtil.isNotNull(dataList)&&dataList.size()>0) {
|
|
|
+ dataList.forEach(formMap -> {
|
|
|
+// Map formMap = (Map) e.get("formData");
|
|
|
+// System.out.println(e);
|
|
|
+ //护理人员
|
|
|
+ try {
|
|
|
+ Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ Plan planCopy = new Plan();
|
|
|
+ planCopy.setDataMonth(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 7));
|
|
|
+ //planCopy.setFormInstId();
|
|
|
+ planCopy.setPlanInstId(formMap.get("formInstanceId").toString());
|
|
|
+ planCopy.setCaregiverForm(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ planCopy.setCaregiverName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCaregiverMember(ObjectUtil.isNotNull(formMap.get("employeeField_lo3pmoi6_id")) ? formMap.get("employeeField_lo3pmoi6_id").toString() : "");
|
|
|
+ planCopy.setCaregiverDepartment(formMap.get("textField_lo3pmoi0").toString());
|
|
|
+ planCopy.setCaregiverCard(formMap.get("textField_lombve2g").toString());
|
|
|
+ planCopy.setCaregiverPhone(formMap.get("textField_lo3pmoi3").toString());
|
|
|
+ if (formMap.get("departmentSelectField_lxzto1e1_id") != null) {
|
|
|
+ planCopy.setDepartment(formMap.get("departmentSelectField_lxzto1e1_id").toString());
|
|
|
+ }
|
|
|
+ //护理对象
|
|
|
+ parse = JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
jsonArray = JSON.parseArray(parse.toString());
|
|
|
jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ planCopy.setCareObjectForm(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ planCopy.setCareObjectName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCareObjectCard(formMap.get("textField_lnyhv5tn").toString());
|
|
|
+ planCopy.setCareObjectLevel(ObjectUtil.isNotNull(formMap.get("selectField_lnyhv5tp")) ? formMap.get("selectField_lnyhv5tp").toString() : "");
|
|
|
+ planCopy.setCareObjectAddress(ObjectUtil.isNotNull(formMap.get("textField_lnyhv5tr")) ? formMap.get("textField_lnyhv5tr").toString() : "");
|
|
|
+ planCopy.setCareObjectLongitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5n")) ? formMap.get("textField_lvae7q5n").toString() : "");
|
|
|
+ planCopy.setCareObjectLatitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5o")) ? formMap.get("textField_lvae7q5o").toString() : "");
|
|
|
+ planCopy.setWithinTheWeek(formMap.get("selectField_lo3pmohy").toString());
|
|
|
+ planCopy.setCareStartTime(Long.parseLong(formMap.get("dateField_lred6eoj").toString()));
|
|
|
+ planCopy.setCareEndTime(Long.parseLong(formMap.get("dateField_lred6eok").toString()));
|
|
|
+ planCopy.setStartTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(11, 16));
|
|
|
+ planCopy.setEndTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))).substring(11, 16));
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lp7obkef"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lrq19cti"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lrq19cti").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
// "https://xvuk8m.aliwork.com" +
|
|
|
- planCopy.setSignInPhoto(jsonObject.get("previewUrl").toString());
|
|
|
- planCopy.setSignInPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
- planCopy.setSignInPhotoName(jsonObject.get("name").toString());
|
|
|
+ planCopy.setSignInPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignInPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignInPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignInLongitude(formMap.get("textField_ljghmc0e").toString());
|
|
|
+ planCopy.setSignInLatitude(formMap.get("textField_ljghmc0f").toString());
|
|
|
+ planCopy.setSignInTime(Long.parseLong(formMap.get("dateField_lp7obkef").toString()));
|
|
|
+ planCopy.setSignInTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))));
|
|
|
+ planCopy.setSignInPosition(formMap.get("textField_lrr62xq6").toString());
|
|
|
+ planCopy.setSignInDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawr")) ? formMap.get("numberField_lv4mhawr").toString() : "");
|
|
|
+ planCopy.setClockInDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lr36z6ha"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lt893c3q"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lt893c3q").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignOutPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignOutLongitude(formMap.get("textField_lr36z6h6").toString());
|
|
|
+ planCopy.setSignOutLatitude(formMap.get("textField_lr36z6h8").toString());
|
|
|
+ planCopy.setSignOutTime(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()));
|
|
|
+ planCopy.setSignOutTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))));
|
|
|
+ planCopy.setSignOutPosition(formMap.get("textField_lrreodfe").toString());
|
|
|
+ planCopy.setSignOutDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawi")) ? formMap.get("numberField_lv4mhawi").toString() : "");
|
|
|
+ planCopy.setClockOutDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ planCopy.setExecuteStatus(formMap.get("selectField_lqcgsbw2").toString());
|
|
|
+ planCopy.setTaskStatus(formMap.get("selectField_lo56u5fn").toString());
|
|
|
+ planCopy.setPlanId(formMap.get("textField_lpgi8scj").toString());
|
|
|
+ planCopy.setCareObjectId(formMap.get("textField_lq9llmhl").toString());
|
|
|
+ planCopy.setCertificateType(ObjectUtil.isNotNull(formMap.get("textField_lo3pmoi4")) ? formMap.get("textField_lo3pmoi4").toString() : "");
|
|
|
+ planCopy.setIsChoose(formMap.get("selectField_lr36z6hd").toString());
|
|
|
+ planCopy.setIsDelete("0");
|
|
|
+ planCopy.setIsCogradient("是");
|
|
|
+ planCopy.setCareDateText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 10));
|
|
|
+ planCopy.setStartTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))));
|
|
|
+ planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
+
|
|
|
+ planCopies.add(planCopy);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("id:{}",formMap.get("formInstanceId").toString());
|
|
|
}
|
|
|
- planCopy.setSignInLongitude(formMap.get("textField_ljghmc0e").toString());
|
|
|
- planCopy.setSignInLatitude(formMap.get("textField_ljghmc0f").toString());
|
|
|
- planCopy.setSignInTime(Long.parseLong(formMap.get("dateField_lp7obkef").toString()));
|
|
|
- planCopy.setSignInTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))));
|
|
|
- planCopy.setSignInPosition(formMap.get("textField_lrr62xq6").toString());
|
|
|
- planCopy.setSignInDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawr"))?formMap.get("numberField_lv4mhawr").toString():"");
|
|
|
- planCopy.setClockInDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))).substring(0, 10));
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotNull(formMap.get("dateField_lr36z6ha"))) {
|
|
|
- if (ObjectUtil.isNotNull(formMap.get("imageField_lt893c3q"))){
|
|
|
- parse = JSON.parse(formMap.get("imageField_lt893c3q").toString());
|
|
|
- jsonArray = JSON.parseArray(parse.toString());
|
|
|
- jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (planCopies.size() > 0) {
|
|
|
+ planService.saveBatch(planCopies);
|
|
|
+ planCopies.clear();
|
|
|
+ }
|
|
|
+ startTime = secondDayTime;
|
|
|
+ calendar.setTimeInMillis(secondDayTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.clear();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ try {
|
|
|
+ Thread.sleep(100);
|
|
|
+ } catch (InterruptedException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void insertHistory1() {
|
|
|
+// Date date = new Date();
|
|
|
+ long startTime = 1735660800000L;
|
|
|
+ long lastTime = 1738339200000L;
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ // 创建一个Calendar实例并设置为给定的时间戳
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeInMillis(startTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ // 获取第二天0点的时间戳
|
|
|
+ long secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
+ while (startTime <= lastTime){
|
|
|
+ YDParam ydParam = new YDParam();
|
|
|
+ ydParam = YDParam.builder()
|
|
|
+ .formUuid("FORM-5FE418EA3F7C4777867A2B034C644324OMQO") //获取护理计划
|
|
|
+// .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj", dateList)))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .build();
|
|
|
+ List<Map> dataList = ydService.queryFormData_all(ydParam);
|
|
|
+ List<Plan> planCopies = new ArrayList<>();
|
|
|
+ System.out.println(startTime+" - "+secondDayTime+"-"+dataList.size());
|
|
|
+ if (ObjectUtil.isNotNull(dataList)&&dataList.size()>0) {
|
|
|
+ dataList.forEach(formMap -> {
|
|
|
+// Map formMap = (Map) e.get("formData");
|
|
|
+// System.out.println(e);
|
|
|
+ //护理人员
|
|
|
+ try {
|
|
|
+ Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ Plan planCopy = new Plan();
|
|
|
+ planCopy.setDataMonth(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 7));
|
|
|
+ //planCopy.setFormInstId();
|
|
|
+ planCopy.setPlanInstId(formMap.get("formInstanceId").toString());
|
|
|
+ planCopy.setCaregiverForm(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ planCopy.setCaregiverName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCaregiverMember(ObjectUtil.isNotNull(formMap.get("employeeField_lo3pmoi6_id")) ? formMap.get("employeeField_lo3pmoi6_id").toString() : "");
|
|
|
+ planCopy.setCaregiverDepartment(formMap.get("textField_lo3pmoi0").toString());
|
|
|
+ planCopy.setCaregiverCard(formMap.get("textField_lombve2g").toString());
|
|
|
+ planCopy.setCaregiverPhone(formMap.get("textField_lo3pmoi3").toString());
|
|
|
+ if (formMap.get("departmentSelectField_lxzto1e1_id") != null) {
|
|
|
+ planCopy.setDepartment(formMap.get("departmentSelectField_lxzto1e1_id").toString());
|
|
|
+ }
|
|
|
+ //护理对象
|
|
|
+ parse = JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ planCopy.setCareObjectForm(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ planCopy.setCareObjectName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCareObjectCard(formMap.get("textField_lnyhv5tn").toString());
|
|
|
+ planCopy.setCareObjectLevel(ObjectUtil.isNotNull(formMap.get("selectField_lnyhv5tp")) ? formMap.get("selectField_lnyhv5tp").toString() : "");
|
|
|
+ planCopy.setCareObjectAddress(ObjectUtil.isNotNull(formMap.get("textField_lnyhv5tr")) ? formMap.get("textField_lnyhv5tr").toString() : "");
|
|
|
+ planCopy.setCareObjectLongitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5n")) ? formMap.get("textField_lvae7q5n").toString() : "");
|
|
|
+ planCopy.setCareObjectLatitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5o")) ? formMap.get("textField_lvae7q5o").toString() : "");
|
|
|
+ planCopy.setWithinTheWeek(formMap.get("selectField_lo3pmohy").toString());
|
|
|
+ planCopy.setCareStartTime(Long.parseLong(formMap.get("dateField_lred6eoj").toString()));
|
|
|
+ planCopy.setCareEndTime(Long.parseLong(formMap.get("dateField_lred6eok").toString()));
|
|
|
+ planCopy.setStartTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(11, 16));
|
|
|
+ planCopy.setEndTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))).substring(11, 16));
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lp7obkef"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lrq19cti"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lrq19cti").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
// "https://xvuk8m.aliwork.com" +
|
|
|
- planCopy.setSignOutPhoto(jsonObject.get("previewUrl").toString());
|
|
|
- planCopy.setSignOutPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
- planCopy.setSignOutPhotoName(jsonObject.get("name").toString());
|
|
|
+ planCopy.setSignInPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignInPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignInPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignInLongitude(formMap.get("textField_ljghmc0e").toString());
|
|
|
+ planCopy.setSignInLatitude(formMap.get("textField_ljghmc0f").toString());
|
|
|
+ planCopy.setSignInTime(Long.parseLong(formMap.get("dateField_lp7obkef").toString()));
|
|
|
+ planCopy.setSignInTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))));
|
|
|
+ planCopy.setSignInPosition(formMap.get("textField_lrr62xq6").toString());
|
|
|
+ planCopy.setSignInDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawr")) ? formMap.get("numberField_lv4mhawr").toString() : "");
|
|
|
+ planCopy.setClockInDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))).substring(0, 10));
|
|
|
}
|
|
|
- planCopy.setSignOutLongitude(formMap.get("textField_lr36z6h6").toString());
|
|
|
- planCopy.setSignOutLatitude(formMap.get("textField_lr36z6h8").toString());
|
|
|
- planCopy.setSignOutTime(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()));
|
|
|
- planCopy.setSignOutTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))));
|
|
|
- planCopy.setSignOutPosition(formMap.get("textField_lrreodfe").toString());
|
|
|
- planCopy.setSignOutDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawi"))?formMap.get("numberField_lv4mhawi").toString():"");
|
|
|
- planCopy.setClockOutDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))).substring(0, 10));
|
|
|
- }
|
|
|
- planCopy.setExecuteStatus(formMap.get("selectField_lqcgsbw2").toString());
|
|
|
- planCopy.setTaskStatus(formMap.get("selectField_lo56u5fn").toString());
|
|
|
- planCopy.setPlanId(formMap.get("textField_lpgi8scj").toString());
|
|
|
- planCopy.setCareObjectId(formMap.get("textField_lq9llmhl").toString());
|
|
|
- planCopy.setCertificateType(ObjectUtil.isNotNull(formMap.get("textField_lo3pmoi4"))?formMap.get("textField_lo3pmoi4").toString():"");
|
|
|
- planCopy.setIsChoose(formMap.get("selectField_lr36z6hd").toString());
|
|
|
- planCopy.setIsDelete("0");
|
|
|
- planCopy.setIsCogradient("是");
|
|
|
- planCopy.setCareDateText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 10));
|
|
|
- planCopy.setStartTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))));
|
|
|
- planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
-
|
|
|
- planCopies.add(planCopy);
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lr36z6ha"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lt893c3q"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lt893c3q").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignOutPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignOutLongitude(formMap.get("textField_lr36z6h6").toString());
|
|
|
+ planCopy.setSignOutLatitude(formMap.get("textField_lr36z6h8").toString());
|
|
|
+ planCopy.setSignOutTime(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()));
|
|
|
+ planCopy.setSignOutTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))));
|
|
|
+ planCopy.setSignOutPosition(formMap.get("textField_lrreodfe").toString());
|
|
|
+ planCopy.setSignOutDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawi")) ? formMap.get("numberField_lv4mhawi").toString() : "");
|
|
|
+ planCopy.setClockOutDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ planCopy.setExecuteStatus(formMap.get("selectField_lqcgsbw2").toString());
|
|
|
+ planCopy.setTaskStatus(formMap.get("selectField_lo56u5fn").toString());
|
|
|
+ planCopy.setPlanId(formMap.get("textField_lpgi8scj").toString());
|
|
|
+ planCopy.setCareObjectId(formMap.get("textField_lq9llmhl").toString());
|
|
|
+ planCopy.setCertificateType(ObjectUtil.isNotNull(formMap.get("textField_lo3pmoi4")) ? formMap.get("textField_lo3pmoi4").toString() : "");
|
|
|
+ planCopy.setIsChoose(formMap.get("selectField_lr36z6hd").toString());
|
|
|
+ planCopy.setIsDelete("0");
|
|
|
+ planCopy.setIsCogradient("是");
|
|
|
+ planCopy.setCareDateText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 10));
|
|
|
+ planCopy.setStartTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))));
|
|
|
+ planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
|
|
|
- try {
|
|
|
- Thread.sleep(200);
|
|
|
- } catch (InterruptedException ex) {
|
|
|
- throw new RuntimeException(ex);
|
|
|
- }
|
|
|
- });
|
|
|
+ planCopies.add(planCopy);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("id:{}",formMap.get("formInstanceId").toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
if (planCopies.size() > 0) {
|
|
|
planService.saveBatch(planCopies);
|
|
|
planCopies.clear();
|
|
|
}
|
|
|
+ startTime = secondDayTime;
|
|
|
+ calendar.setTimeInMillis(secondDayTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.clear();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ try {
|
|
|
+ Thread.sleep(100);
|
|
|
+ } catch (InterruptedException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void insertHistory2() {
|
|
|
// Date date = new Date();
|
|
|
- long lastTime = 1734969600000L;
|
|
|
+ long startTime = 1704038400000L;
|
|
|
+ long lastTime = 1730390400000L;
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
- long startTime = 1732982400000L;
|
|
|
dateList.add(String.valueOf(startTime));
|
|
|
// 创建一个Calendar实例并设置为给定的时间戳
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
@@ -748,8 +936,9 @@ public class YBJServiceImpl implements YBJService {
|
|
|
while (startTime <= lastTime){
|
|
|
YDParam ydParam = new YDParam();
|
|
|
ydParam = YDParam.builder()
|
|
|
- .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM") //获取护理计划
|
|
|
- .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .formUuid("FORM-BF5634B37F424C12962E54123774BFDE01SA") //获取护理计划
|
|
|
+// .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj", dateList)))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
.build();
|
|
|
List<Map> dataList = ydService.queryFormData_all(ydParam);
|
|
|
List<Plan> planCopies = new ArrayList<>();
|
|
@@ -759,6 +948,8 @@ public class YBJServiceImpl implements YBJService {
|
|
|
// Map formMap = (Map) e.get("formData");
|
|
|
// System.out.println(e);
|
|
|
//护理人员
|
|
|
+ try {
|
|
|
+
|
|
|
Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
@@ -840,7 +1031,305 @@ public class YBJServiceImpl implements YBJService {
|
|
|
planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
|
|
|
planCopies.add(planCopy);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("id:{}",formMap.get("formInstanceId").toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (planCopies.size() > 0) {
|
|
|
+ planService.saveBatch(planCopies);
|
|
|
+ planCopies.clear();
|
|
|
+ }
|
|
|
+ startTime = secondDayTime;
|
|
|
+ calendar.setTimeInMillis(secondDayTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.clear();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ try {
|
|
|
+ Thread.sleep(100);
|
|
|
+ } catch (InterruptedException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void insertHistory3() {
|
|
|
+// Date date = new Date();
|
|
|
+ long startTime = 1740758400000L;
|
|
|
+ long lastTime = 1743436800000L;
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ // 创建一个Calendar实例并设置为给定的时间戳
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeInMillis(startTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ // 获取第二天0点的时间戳
|
|
|
+ long secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
+ while (startTime <= lastTime){
|
|
|
+ YDParam ydParam = new YDParam();
|
|
|
+ ydParam = YDParam.builder()
|
|
|
+ .formUuid("FORM-5C1CE445B9FD4192B2DD86EF3BD1F59B6DNX") //获取护理计划
|
|
|
+// .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj", dateList)))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .build();
|
|
|
+ List<Map> dataList = ydService.queryFormData_all(ydParam);
|
|
|
+ List<Plan> planCopies = new ArrayList<>();
|
|
|
+ System.out.println(startTime+" - "+secondDayTime+"-"+dataList.size());
|
|
|
+ if (ObjectUtil.isNotNull(dataList)&&dataList.size()>0) {
|
|
|
+ dataList.forEach(formMap -> {
|
|
|
+// Map formMap = (Map) e.get("formData");
|
|
|
+// System.out.println(e);
|
|
|
+ //护理人员
|
|
|
+ try {
|
|
|
+
|
|
|
+ Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ Plan planCopy = new Plan();
|
|
|
+ planCopy.setDataMonth(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 7));
|
|
|
+ //planCopy.setFormInstId();
|
|
|
+ planCopy.setPlanInstId(formMap.get("formInstanceId").toString());
|
|
|
+ planCopy.setCaregiverForm(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ planCopy.setCaregiverName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCaregiverMember(ObjectUtil.isNotNull(formMap.get("employeeField_lo3pmoi6_id")) ? formMap.get("employeeField_lo3pmoi6_id").toString() : "");
|
|
|
+ planCopy.setCaregiverDepartment(formMap.get("textField_lo3pmoi0").toString());
|
|
|
+ planCopy.setCaregiverCard(formMap.get("textField_lombve2g").toString());
|
|
|
+ planCopy.setCaregiverPhone(formMap.get("textField_lo3pmoi3").toString());
|
|
|
+ if (formMap.get("departmentSelectField_lxzto1e1_id") != null) {
|
|
|
+ planCopy.setDepartment(formMap.get("departmentSelectField_lxzto1e1_id").toString());
|
|
|
+ }
|
|
|
+ //护理对象
|
|
|
+ parse = JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ planCopy.setCareObjectForm(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ planCopy.setCareObjectName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCareObjectCard(formMap.get("textField_lnyhv5tn").toString());
|
|
|
+ planCopy.setCareObjectLevel(ObjectUtil.isNotNull(formMap.get("selectField_lnyhv5tp")) ? formMap.get("selectField_lnyhv5tp").toString() : "");
|
|
|
+ planCopy.setCareObjectAddress(ObjectUtil.isNotNull(formMap.get("textField_lnyhv5tr")) ? formMap.get("textField_lnyhv5tr").toString() : "");
|
|
|
+ planCopy.setCareObjectLongitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5n")) ? formMap.get("textField_lvae7q5n").toString() : "");
|
|
|
+ planCopy.setCareObjectLatitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5o")) ? formMap.get("textField_lvae7q5o").toString() : "");
|
|
|
+ planCopy.setWithinTheWeek(formMap.get("selectField_lo3pmohy").toString());
|
|
|
+ planCopy.setCareStartTime(Long.parseLong(formMap.get("dateField_lred6eoj").toString()));
|
|
|
+ planCopy.setCareEndTime(Long.parseLong(formMap.get("dateField_lred6eok").toString()));
|
|
|
+ planCopy.setStartTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(11, 16));
|
|
|
+ planCopy.setEndTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))).substring(11, 16));
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lp7obkef"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lrq19cti"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lrq19cti").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignInPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignInPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignInPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignInLongitude(formMap.get("textField_ljghmc0e").toString());
|
|
|
+ planCopy.setSignInLatitude(formMap.get("textField_ljghmc0f").toString());
|
|
|
+ planCopy.setSignInTime(Long.parseLong(formMap.get("dateField_lp7obkef").toString()));
|
|
|
+ planCopy.setSignInTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))));
|
|
|
+ planCopy.setSignInPosition(formMap.get("textField_lrr62xq6").toString());
|
|
|
+ planCopy.setSignInDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawr")) ? formMap.get("numberField_lv4mhawr").toString() : "");
|
|
|
+ planCopy.setClockInDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lr36z6ha"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lt893c3q"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lt893c3q").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignOutPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignOutLongitude(formMap.get("textField_lr36z6h6").toString());
|
|
|
+ planCopy.setSignOutLatitude(formMap.get("textField_lr36z6h8").toString());
|
|
|
+ planCopy.setSignOutTime(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()));
|
|
|
+ planCopy.setSignOutTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))));
|
|
|
+ planCopy.setSignOutPosition(formMap.get("textField_lrreodfe").toString());
|
|
|
+ planCopy.setSignOutDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawi")) ? formMap.get("numberField_lv4mhawi").toString() : "");
|
|
|
+ planCopy.setClockOutDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ planCopy.setExecuteStatus(formMap.get("selectField_lqcgsbw2").toString());
|
|
|
+ planCopy.setTaskStatus(formMap.get("selectField_lo56u5fn").toString());
|
|
|
+ planCopy.setPlanId(formMap.get("textField_lpgi8scj").toString());
|
|
|
+ planCopy.setCareObjectId(formMap.get("textField_lq9llmhl").toString());
|
|
|
+ planCopy.setCertificateType(ObjectUtil.isNotNull(formMap.get("textField_lo3pmoi4")) ? formMap.get("textField_lo3pmoi4").toString() : "");
|
|
|
+ planCopy.setIsChoose(formMap.get("selectField_lr36z6hd").toString());
|
|
|
+ planCopy.setIsDelete("0");
|
|
|
+ planCopy.setIsCogradient("是");
|
|
|
+ planCopy.setCareDateText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 10));
|
|
|
+ planCopy.setStartTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))));
|
|
|
+ planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
+
|
|
|
+ planCopies.add(planCopy);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("id:{}",formMap.get("formInstanceId").toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (planCopies.size() > 0) {
|
|
|
+ planService.saveBatch(planCopies);
|
|
|
+ planCopies.clear();
|
|
|
+ }
|
|
|
+ startTime = secondDayTime;
|
|
|
+ calendar.setTimeInMillis(secondDayTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.clear();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ try {
|
|
|
+ Thread.sleep(100);
|
|
|
+ } catch (InterruptedException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void insertHistory12() {
|
|
|
+// Date date = new Date();
|
|
|
+ long startTime = 1732982400000L;
|
|
|
+ long lastTime = 1735660800000L;
|
|
|
+ List<String> dateList = new ArrayList<>();
|
|
|
+ dateList.add(String.valueOf(startTime));
|
|
|
+ // 创建一个Calendar实例并设置为给定的时间戳
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeInMillis(startTime);
|
|
|
+ // 将Calendar的时间设置为第二天的0点
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加一天
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0); // 设置小时为0点
|
|
|
+ calendar.set(Calendar.MINUTE, 0); // 设置分钟为0
|
|
|
+ calendar.set(Calendar.SECOND, 0); // 设置秒为0
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0); // 设置毫秒为0
|
|
|
+ // 获取第二天0点的时间戳
|
|
|
+ long secondDayTime = calendar.getTimeInMillis();
|
|
|
+ dateList.add(String.valueOf(secondDayTime));
|
|
|
+ log.info("创建下月护理计划定时任务生成到数据库:{}", new Date());
|
|
|
+ while (startTime <= lastTime){
|
|
|
+ YDParam ydParam = new YDParam();
|
|
|
+ ydParam = YDParam.builder()
|
|
|
+ .formUuid("FORM-B22E22515C8B4FD0AF207EC1AEB2FFECYMDU") //获取护理计划
|
|
|
+// .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lo3pmoi0", dateList, "上海市奉贤区海湾镇居家")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj", dateList)))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
|
|
|
+ .build();
|
|
|
+ List<Map> dataList = ydService.queryFormData_all(ydParam);
|
|
|
+ List<Plan> planCopies = new ArrayList<>();
|
|
|
+ System.out.println(startTime+" - "+secondDayTime+"-"+dataList.size());
|
|
|
+ if (ObjectUtil.isNotNull(dataList)&&dataList.size()>0) {
|
|
|
+ dataList.forEach(formMap -> {
|
|
|
+// Map formMap = (Map) e.get("formData");
|
|
|
+// System.out.println(e);
|
|
|
+ //护理人员
|
|
|
+ try {
|
|
|
+
|
|
|
+ Object parse = JSON.parse(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ JSONArray jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ Plan planCopy = new Plan();
|
|
|
+ planCopy.setDataMonth(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 7));
|
|
|
+ //planCopy.setFormInstId();
|
|
|
+ planCopy.setPlanInstId(formMap.get("formInstanceId").toString());
|
|
|
+ planCopy.setCaregiverForm(formMap.get("associationFormField_lo3pmohz_id").toString());
|
|
|
+ planCopy.setCaregiverName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCaregiverMember(ObjectUtil.isNotNull(formMap.get("employeeField_lo3pmoi6_id")) ? formMap.get("employeeField_lo3pmoi6_id").toString() : "");
|
|
|
+ planCopy.setCaregiverDepartment(formMap.get("textField_lo3pmoi0").toString());
|
|
|
+ planCopy.setCaregiverCard(formMap.get("textField_lombve2g").toString());
|
|
|
+ planCopy.setCaregiverPhone(formMap.get("textField_lo3pmoi3").toString());
|
|
|
+ if (formMap.get("departmentSelectField_lxzto1e1_id") != null) {
|
|
|
+ planCopy.setDepartment(formMap.get("departmentSelectField_lxzto1e1_id").toString());
|
|
|
+ }
|
|
|
+ //护理对象
|
|
|
+ parse = JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+ planCopy.setCareObjectForm(formMap.get("associationFormField_lo3pmohw_id").toString());
|
|
|
+ planCopy.setCareObjectName(jsonObject.get("title").toString());
|
|
|
+ planCopy.setCareObjectCard(formMap.get("textField_lnyhv5tn").toString());
|
|
|
+ planCopy.setCareObjectLevel(ObjectUtil.isNotNull(formMap.get("selectField_lnyhv5tp")) ? formMap.get("selectField_lnyhv5tp").toString() : "");
|
|
|
+ planCopy.setCareObjectAddress(ObjectUtil.isNotNull(formMap.get("textField_lnyhv5tr")) ? formMap.get("textField_lnyhv5tr").toString() : "");
|
|
|
+ planCopy.setCareObjectLongitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5n")) ? formMap.get("textField_lvae7q5n").toString() : "");
|
|
|
+ planCopy.setCareObjectLatitude(ObjectUtil.isNotNull(formMap.get("textField_lvae7q5o")) ? formMap.get("textField_lvae7q5o").toString() : "");
|
|
|
+ planCopy.setWithinTheWeek(formMap.get("selectField_lo3pmohy").toString());
|
|
|
+ planCopy.setCareStartTime(Long.parseLong(formMap.get("dateField_lred6eoj").toString()));
|
|
|
+ planCopy.setCareEndTime(Long.parseLong(formMap.get("dateField_lred6eok").toString()));
|
|
|
+ planCopy.setStartTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(11, 16));
|
|
|
+ planCopy.setEndTime(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))).substring(11, 16));
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lp7obkef"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lrq19cti"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lrq19cti").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignInPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignInPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignInPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignInLongitude(formMap.get("textField_ljghmc0e").toString());
|
|
|
+ planCopy.setSignInLatitude(formMap.get("textField_ljghmc0f").toString());
|
|
|
+ planCopy.setSignInTime(Long.parseLong(formMap.get("dateField_lp7obkef").toString()));
|
|
|
+ planCopy.setSignInTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))));
|
|
|
+ planCopy.setSignInPosition(formMap.get("textField_lrr62xq6").toString());
|
|
|
+ planCopy.setSignInDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawr")) ? formMap.get("numberField_lv4mhawr").toString() : "");
|
|
|
+ planCopy.setClockInDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lp7obkef").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("dateField_lr36z6ha"))) {
|
|
|
+ if (ObjectUtil.isNotNull(formMap.get("imageField_lt893c3q"))) {
|
|
|
+ parse = JSON.parse(formMap.get("imageField_lt893c3q").toString());
|
|
|
+ jsonArray = JSON.parseArray(parse.toString());
|
|
|
+ jsonObject = (JSONObject) jsonArray.get(0);
|
|
|
+// "https://xvuk8m.aliwork.com" +
|
|
|
+ planCopy.setSignOutPhoto(jsonObject.get("previewUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoDown(jsonObject.get("downloadUrl").toString());
|
|
|
+ planCopy.setSignOutPhotoName(jsonObject.get("name").toString());
|
|
|
+ }
|
|
|
+ planCopy.setSignOutLongitude(formMap.get("textField_lr36z6h6").toString());
|
|
|
+ planCopy.setSignOutLatitude(formMap.get("textField_lr36z6h8").toString());
|
|
|
+ planCopy.setSignOutTime(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()));
|
|
|
+ planCopy.setSignOutTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))));
|
|
|
+ planCopy.setSignOutPosition(formMap.get("textField_lrreodfe").toString());
|
|
|
+ planCopy.setSignOutDistance(ObjectUtil.isNotNull(formMap.get("numberField_lv4mhawi")) ? formMap.get("numberField_lv4mhawi").toString() : "");
|
|
|
+ planCopy.setClockOutDate(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lr36z6ha").toString()))).substring(0, 10));
|
|
|
+ }
|
|
|
+ planCopy.setExecuteStatus(formMap.get("selectField_lqcgsbw2").toString());
|
|
|
+ planCopy.setTaskStatus(formMap.get("selectField_lo56u5fn").toString());
|
|
|
+ planCopy.setPlanId(formMap.get("textField_lpgi8scj").toString());
|
|
|
+ planCopy.setCareObjectId(formMap.get("textField_lq9llmhl").toString());
|
|
|
+ planCopy.setCertificateType(ObjectUtil.isNotNull(formMap.get("textField_lo3pmoi4")) ? formMap.get("textField_lo3pmoi4").toString() : "");
|
|
|
+ planCopy.setIsChoose(formMap.get("selectField_lr36z6hd").toString());
|
|
|
+ planCopy.setIsDelete("0");
|
|
|
+ planCopy.setIsCogradient("是");
|
|
|
+ planCopy.setCareDateText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))).substring(0, 10));
|
|
|
+ planCopy.setStartTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eoj").toString()))));
|
|
|
+ planCopy.setEndTimeText(dateFormat.format(new Date(Long.parseLong(formMap.get("dateField_lred6eok").toString()))));
|
|
|
+
|
|
|
+ planCopies.add(planCopy);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("id:{}",formMap.get("formInstanceId").toString());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
if (planCopies.size() > 0) {
|
|
@@ -1020,6 +1509,11 @@ public class YBJServiceImpl implements YBJService {
|
|
|
|
|
|
@Override
|
|
|
public void afterDatabaseToYiDaTask() {
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ //获取下月1号的日期
|
|
|
+ LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String dataMonth = currentDate.getYear() +"-"+ String.format("%02d", currentDate.getMonthValue());
|
|
|
+ String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
log.info("开始执行同步宜搭是否同步和流程id到数据库");
|
|
|
List<String> dataMonths = new ArrayList<>();
|
|
|
dataMonths.add(dataMonth);
|
|
@@ -1214,6 +1708,35 @@ public class YBJServiceImpl implements YBJService {
|
|
|
planMapper.update(plan,updateWrapper);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void testDelNext() {
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate firstDayOfNextMonth = now.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String format = dateTimeFormatter.format(firstDayOfNextMonth);
|
|
|
+ log.info("开始逻辑删除下月数据库护理计划:{}",format);
|
|
|
+ try {
|
|
|
+ Class.forName(driver);
|
|
|
+ Connection connection = DriverManager.getConnection(url, username, password);
|
|
|
+ PreparedStatement ps = null;
|
|
|
+// String deleteSql = "DELETE FROM`yida_plan_details` where data_month in ('" + dataMonth + "','"+nextDataMonth+"') AND form_inst_id = '"+formInstId+"' AND task_status = '待上报'";
|
|
|
+ String deleteSql = "UPDATE `yida_plan_details` SET is_delete = 1 where care_date_text >= '" + format + "' AND task_status = '待上报'";
|
|
|
+ ps = connection.prepareStatement(deleteSql);
|
|
|
+ ps.executeUpdate(deleteSql);
|
|
|
+ deleteSql = "UPDATE `yida_plan_details` SET is_delete = 2 where care_date_text < '2025-04-25' AND left(create_time,10) >= '2024-04-25'";
|
|
|
+ ps = connection.prepareStatement(deleteSql);
|
|
|
+ ps.executeUpdate(deleteSql);
|
|
|
+
|
|
|
+ ps.close();
|
|
|
+ connection.close();
|
|
|
+ } catch (SQLException e) {
|
|
|
+ log.info("SQL执行错误");
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ } catch (ClassNotFoundException e) {
|
|
|
+ log.info("驱动注册失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 定时任务同步数据库到宜搭
|
|
|
*/
|
|
@@ -1337,7 +1860,7 @@ public class YBJServiceImpl implements YBJService {
|
|
|
LocalDate now = LocalDate.now();
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
String format = dateTimeFormatter.format(now);
|
|
|
- log.info("开始逻辑删除下月数据库护理计划");
|
|
|
+ log.info("开始逻辑删除下月数据库护理计划:{}",format);
|
|
|
try {
|
|
|
Class.forName(driver);
|
|
|
Connection connection = DriverManager.getConnection(url, username, password);
|
|
@@ -1411,7 +1934,7 @@ public class YBJServiceImpl implements YBJService {
|
|
|
int dayOfMonth = now.getDayOfMonth();
|
|
|
//获取本月天数
|
|
|
int daysInMonth = now.toLocalDate().lengthOfMonth();
|
|
|
-
|
|
|
+ log.info("日期数据:{}",""+now+" "+dayOfMonth+" "+daysInMonth);
|
|
|
try {
|
|
|
Class.forName(driver);
|
|
|
connection = DriverManager.getConnection(url, username, password);
|
|
@@ -1429,6 +1952,7 @@ public class YBJServiceImpl implements YBJService {
|
|
|
String dayOfWeek = now.plusDays(i).getDayOfWeek().getDisplayName(TextStyle.FULL, new Locale("zh", "CN"));
|
|
|
//获取循环每天的日期
|
|
|
LocalDate nextDay = LocalDate.from(now.plusDays(i));
|
|
|
+ log.info("nextDay:{}",nextDay);
|
|
|
List<Map> maps = mapList.stream().filter(item -> item.get("selectField_lo3pmohy").equals(dayOfWeek.replace("星期", "周"))).collect(Collectors.toList());
|
|
|
for (Map map : maps) {
|
|
|
// 创建Statement对象,用于执行SQL语句
|
|
@@ -1498,6 +2022,11 @@ public class YBJServiceImpl implements YBJService {
|
|
|
* @param formInstId
|
|
|
*/
|
|
|
public void thisMonthDataBaseToYiDa(String formInstId){
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+ //获取下月1号的日期
|
|
|
+ LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
|
|
+ String dataMonth = currentDate.getYear() +"-"+ String.format("%02d", currentDate.getMonthValue());
|
|
|
+ String nextDataMonth = firstDayOfNextMonth.getYear() +"-"+ String.format("%02d",firstDayOfNextMonth.getMonthValue());
|
|
|
log.info("开始生成当月和下月宜搭未上报护理计划");
|
|
|
String formId = getFormId(dataMonth);
|
|
|
Connection connection = null;
|
|
@@ -1700,12 +2229,12 @@ public class YBJServiceImpl implements YBJService {
|
|
|
/**
|
|
|
* 每天同步护理状态
|
|
|
*/
|
|
|
- @Override
|
|
|
- public void syncUpdatePlanStatus() {
|
|
|
- log.info("每天同步护理状态开始{}", new Date());
|
|
|
- syncPlanStatus();
|
|
|
- log.info("每天同步护理状态结束{}", new Date());
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public void syncUpdatePlanStatus() {
|
|
|
+// log.info("每天同步护理状态开始{}", new Date());
|
|
|
+// syncPlanStatus();
|
|
|
+// log.info("每天同步护理状态结束{}", new Date());
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -1749,7 +2278,7 @@ public class YBJServiceImpl implements YBJService {
|
|
|
}
|
|
|
});
|
|
|
Thread.sleep(5000);
|
|
|
- syncUpdatePlanStatus();
|
|
|
+// syncUpdatePlanStatus();
|
|
|
}
|
|
|
}
|
|
|
|