Forráskód Böngészése

医保局代码修改添加护理对象经纬度

zfc 1 éve%!(EXTRA string=óta)
szülő
commit
6a88651471

+ 35 - 37
mjava-yibaoju/src/main/java/com/malk/yibaoju/controller/YBJController.java

@@ -220,46 +220,44 @@ public class YBJController {
     }
 
 
-
-
     @RequestMapping("test")
     McR test(HttpServletRequest request) {
 
-//        Map data = UtilServlet.getParamMap(request);
-//
-//        log.info("xxxx, {}", data);
-
-//        ybjService.syncUpdatePlanStatus();
-//        LocalDate currentDate = LocalDate.now();
-//        LocalDate nextDay = currentDate.plusDays(0);
-//        //通过护理时间  护理对象ID    证数据是否已经存在
-//        YDParam ydParam1 = YDParam.builder()
-//                .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
-//                .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lnyhv5tn, textField_lombve2g",Arrays.asList(UtilDateTime.parse( currentDate+ " 00:00:01","yyyy-MM-dd HH:mm:ss"),UtilDateTime.parse( currentDate.with(TemporalAdjusters.lastDayOfMonth())+ " 23:59:59","yyyy-MM-dd HH:mm:ss")),"310226193107268888","510702196511294820")))
-//                .build();
-//        List<Map> dataList = (List<Map>) ydClient.queryData(ydParam1, YDConf.FORM_QUERY.retrieve_search_form).getData();
-//        log.info("dataList, {}", dataList);
-
-//        ybjService.syncUpdatePlanStatus();
-
-
-//        LocalDate currentDate = LocalDate.now();
-//
-//
-//        LocalDate firstDayOfNextMonth = currentDate.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
-//
-//        int dayOfMonth = firstDayOfNextMonth.getDayOfMonth();
-//
-//        int daysInMonth = firstDayOfNextMonth.lengthOfMonth();
-//
-//        //获取是周几
-//        String dayOfWeek = firstDayOfNextMonth.plusDays(1).getDayOfWeek().getDisplayName(TextStyle.FULL, new Locale("zh", "CN"));
-//        log.info("日期{}",dayOfWeek);
-//        //获取循环每天的日期
-//        LocalDate nextDay = firstDayOfNextMonth.plusDays(1);
-//
-//        log.info("日期{}",nextDay);
-        ybjService.syncCreatePlan();
+        YDParam ydParam = new YDParam();
+        ydParam = YDParam.builder()
+                .formUuid("FORM-RK966E7105DFD27FA7EQHAOH9IFS2RN6MP3OL2")  //获取护理计划
+                .searchFieldJson(JSON.toJSONString(UtilMap.map("selectField_lo2b6bvf","正常")))//护理对象暂停和正常、月度计划创建只查询正常的护理计划
+                .build();
+        //pagesize设为1获取总数
+        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<>();
+        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();
+            log.info("dataList:{}-----page:"+page+"---",dataList.size());
+            dataList.forEach(dataItem -> {
+                Map formMap = (Map) dataItem.get("formData");
+                YDParam hldxParam = YDParam.builder()
+                        .formUuid("FORM-OS566L91C91FO7LJ8V6AQ9O7CGB53OCVUHYNLH1")  //获取护理对象
+                        .searchFieldJson(JSON.toJSONString(UtilMap.map("textField_lnyhv5tn",formMap.get("textField_lnyhv5tn"))))
+                        .build();
+
+                List<Map> mapList = (List<Map>) ydClient.queryData(hldxParam, YDConf.FORM_QUERY.retrieve_search_form).getData();
+                Map fkmap = (Map) mapList.get(0).get("formData");
+
+                // 更新
+                ydClient.operateData(YDParam.builder()
+                        .formInstanceId((String) dataItem.get("formInstanceId"))
+                        .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_lvae99fj, textField_lvae99fk", fkmap.get("textField_ljghmc0e"),fkmap.get("textField_ljghmc0f"))))
+                        .build(), YDConf.FORM_OPERATION.update);
+
+            });
+        }
 
         return McR.success();
     }

+ 15 - 0
mjava-yibaoju/src/main/java/com/malk/yibaoju/service/impl/YBJServiceImpl.java

@@ -115,6 +115,9 @@ public class YBJServiceImpl implements YBJService {
                             hashMap.put("selectField_lqcgsbw2","未执行");  //执行情况
                             hashMap.put("selectField_lo56u5fn","待上报");  //任务状态
 
+                            hashMap.put("textField_lvae7q5n",formMap.get("textField_lvae99fj")); //护理对象经度
+                            hashMap.put("textField_lvae7q5o",formMap.get("textField_lvae99fk"));  //护理对象纬度
+
 
                             hashMap.put("textField_lrx0r38x",String.valueOf(nextDay));  //护理日期-文本
                             hashMap.put("selectField_lr36z6hd","是");  //任务状态
@@ -233,6 +236,9 @@ public class YBJServiceImpl implements YBJService {
                 hashMap.put("selectField_lqcgsbw2","未执行");  //执行情况
                 hashMap.put("selectField_lo56u5fn","待上报");  //任务状态
 
+                hashMap.put("textField_lvae7q5n",formData.get("textField_lvae99fj")); //护理对象经度
+                hashMap.put("textField_lvae7q5o",formData.get("textField_lvae99fk"));  //护理对象纬度
+
                 hashMap.put("textField_lrx0r38x",String.valueOf(nextDay));  //护理日期-文本
                 hashMap.put("selectField_lr36z6hd","是");  //任务状态
                 hashMap.put("textField_lo55rupj",formData.get("textField_lo55rupj"));  //护理对象姓名-文本
@@ -312,6 +318,9 @@ public class YBJServiceImpl implements YBJService {
                 hashMap.put("selectField_lqcgsbw2","未执行");  //执行情况
                 hashMap.put("selectField_lo56u5fn","待上报");  //任务状态
 
+                hashMap.put("textField_lvae7q5n",formData.get("textField_lvae99fj")); //护理对象经度
+                hashMap.put("textField_lvae7q5o",formData.get("textField_lvae99fk"));  //护理对象纬度
+
                 hashMap.put("textField_lrx0r38x",String.valueOf(nextDay));  //护理日期-文本
                 hashMap.put("selectField_lr36z6hd","是");  //任务状态
                 hashMap.put("textField_lo55rupj",formData.get("textField_lo55rupj"));  //护理对象姓名-文本
@@ -406,6 +415,8 @@ public class YBJServiceImpl implements YBJService {
                     hashMap.put("selectField_lqcgsbw2","未执行");  //执行情况
                     hashMap.put("selectField_lo56u5fn","待上报");  //任务状态
 
+                    hashMap.put("textField_lvae7q5n",formData.get("textField_lvae99fj")); //护理对象经度
+                    hashMap.put("textField_lvae7q5o",formData.get("textField_lvae99fk"));  //护理对象纬度
 
                     hashMap.put("textField_lrx0r38x",String.valueOf(nextDay));  //护理日期-文本
                     hashMap.put("selectField_lr36z6hd","是");  //任务状态
@@ -530,6 +541,10 @@ public class YBJServiceImpl implements YBJService {
                             hashMap.put("dateField_lred6eok", UtilDateTime.parse(String.valueOf(nextDay)+" "+map.get("selectField_lr1uxpu4"),"yyyy-MM-dd HH:mm")); //护理结束时间。 用当前日期+护理计划的  时分    转成时间戳
                             hashMap.put("selectField_lqcgsbw2","未执行");  //执行情况
                             hashMap.put("selectField_lo56u5fn","待上报");  //任务状态
+
+                            hashMap.put("textField_lvae7q5n",formMap.get("textField_lvae99fj")); //护理对象经度
+                            hashMap.put("textField_lvae7q5o",formMap.get("textField_lvae99fk"));  //护理对象纬度
+
                             hashMap.put("textField_lrx0r38x",String.valueOf(nextDay));  //护理日期-文本
                             hashMap.put("selectField_lr36z6hd","是");  //任务状态
                             hashMap.put("textField_lo55rupj",formMap.get("textField_lo55rupj"));  //护理对象姓名-文本