Browse Source

医保局代码提交

zfc 1 year ago
parent
commit
48d2508a6d

+ 6 - 0
mjava-yibaoju/src/main/java/com/malk/yibaoju/controller/YBJController.java

@@ -277,6 +277,12 @@ public class YBJController {
 
     @RequestMapping("test")
     McR test(HttpServletRequest request) {
+        LocalDate currentDate = LocalDate.now();
+        ydClient.operateData(YDParam.builder()
+                .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
+                .searchCondition(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+ " 23:59:59","yyyy-MM-dd HH:mm:ss")),"310226193107264120","310226193107264120")))
+                .formDataJson(JSON.toJSONString(UtilMap.map("selectField_lo56u5fn","已上报")))
+                .build(), YDConf.FORM_OPERATION.upsert);
         return McR.success();
     }
 

+ 2 - 2
mjava-yibaoju/src/main/java/com/malk/yibaoju/schedule/ScheduleTask.java

@@ -23,7 +23,7 @@ public class ScheduleTask {
     /**
      * 每月25日0点5分执行定时任务
      */
-    @Scheduled(cron = "0 5 0 25 * ?")
+    @Scheduled(cron = "0 30 0 25 * ?")
     public void syncDingTalkFailedList() {
         try {
             ybjService.syncCreatePlan();
@@ -36,7 +36,7 @@ public class ScheduleTask {
     /**
      * 每天凌晨1-4点更新计划护理的任务状态
      */
-    @Scheduled(cron = " 0 0/25 4 * * ? ")
+    @Scheduled(cron = " 0 5 0 * * ? ")
     public void syncDingTalkStatus() {
         try {
             ybjService.syncUpdatePlanStatus();

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

@@ -54,6 +54,9 @@ public class YBJServiceImpl implements YBJService {
         float pageSize = 50;
         ydParam.setCurrentPage(1);
         ydParam.setPageSize((int) pageSize);
+
+        log.info("totalCount:----{}----",totalCount);
+
         List<Map> dataList = new ArrayList<>();
         for (int page = 1; page <= Math.ceil(totalCount / pageSize); page++) {
             ydParam.setCurrentPage(page);
@@ -85,63 +88,61 @@ public class YBJServiceImpl implements YBJService {
 
                     for (Map map : maps) {
                         Map hashMap = new HashMap();
+
+                        hashMap.put("associationFormField_lo3pmohz",JSON.parse(map.get("associationFormField_lo3pmohz_id").toString()));  //护理人员名称
+                        hashMap.put("textField_lo3pmoi0",map.get("textField_lo3pmoi0"));  //护理人员所属机构
+                        hashMap.put("textField_lombve2g",map.get("textField_lomchzi3"));  //护理人员身份证
+                        hashMap.put("textField_lo3pmoi3",map.get("textField_lo3pmoi3"));  //护理人员手机号
+                        hashMap.put("associationFormField_lo3pmohw",JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString()));  //护理对象姓名
+                        hashMap.put("textField_lnyhv5tn",formMap.get("textField_lnyhv5tn")); //护理对象身份证
+                        hashMap.put("selectField_lnyhv5tp",formMap.get("selectField_lnyhv5tp"));  //护理对象等级
+                        hashMap.put("textField_lnyhv5tr",formMap.get("textField_lnyhv5tr"));  //护理对象住址
+                        hashMap.put("selectField_lo3pmohy",dayOfWeek.replace("星期","周"));  //护理时间  (星期几)
+                        hashMap.put("dateField_lred6eoj", UtilDateTime.parse(String.valueOf(nextDay)+" "+map.get("selectField_lr1uxpu3"),"yyyy-MM-dd HH:mm")); //护理开始时间。 用当前日期+护理计划的  时分    转成时间戳
+                        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"));  //护理对象姓名-文本
+                        hashMap.put("textField_lo3pmoi4",map.get("textField_lo3pmoi4"));  //护理证书类型
+                        hashMap.put("employeeField_lo3pmoi6",JSON.parse(map.get("employeeField_lo3pmoi6_id").toString()));  //护理人员姓名-成员
+                        hashMap.put("textField_lpgi8scj",map.get("textField_lo701pwy"));  //计划明细id
+                        hashMap.put("textField_lq9llmhl",formMap.get("textField_lop4v4qx"));  //护理对象ID
+
                         try {
-                            Thread.sleep(100);
+                            Thread.sleep(200);
                         } catch (InterruptedException e) {
                             throw new RuntimeException(e);
                         }
-                        //通过护理时间  护理对象  护理人员验证数据是否已经存在
-                        YDParam ydParam1 = YDParam.builder()
-                                .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
-                                .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lnyhv5tn, textField_lombve2g",Arrays.asList(UtilDateTime.parse( nextDay+ " 00:00:01","yyyy-MM-dd HH:mm:ss"),UtilDateTime.parse( currentDate.with(TemporalAdjusters.lastDayOfMonth())+ " 23:59:59","yyyy-MM-dd HH:mm:ss")),formMap.get("textField_lnyhv5tn"),map.get("textField_lomchzi3"))))
-                                .build();
-                        List<Map> dataLists = (List<Map>) ydClient.queryData(ydParam1, YDConf.FORM_QUERY.retrieve_search_form).getData();
-
-
-                        if (dataLists.size()<1){
-
-                            hashMap.put("associationFormField_lo3pmohz",JSON.parse(map.get("associationFormField_lo3pmohz_id").toString()));  //护理人员名称
-                            hashMap.put("textField_lo3pmoi0",map.get("textField_lo3pmoi0"));  //护理人员所属机构
-                            hashMap.put("textField_lombve2g",map.get("textField_lomchzi3"));  //护理人员身份证
-                            hashMap.put("textField_lo3pmoi3",map.get("textField_lo3pmoi3"));  //护理人员手机号
-                            hashMap.put("associationFormField_lo3pmohw",JSON.parse(formMap.get("associationFormField_lo3pmohw_id").toString()));  //护理对象姓名
-                            hashMap.put("textField_lnyhv5tn",formMap.get("textField_lnyhv5tn")); //护理对象身份证
-                            hashMap.put("selectField_lnyhv5tp",formMap.get("selectField_lnyhv5tp"));  //护理对象等级
-                            hashMap.put("textField_lnyhv5tr",formMap.get("textField_lnyhv5tr"));  //护理对象住址
-                            hashMap.put("selectField_lo3pmohy",dayOfWeek.replace("星期","周"));  //护理时间  (星期几)
-                            hashMap.put("dateField_lred6eoj", UtilDateTime.parse(String.valueOf(nextDay)+" "+map.get("selectField_lr1uxpu3"),"yyyy-MM-dd HH:mm")); //护理开始时间。 用当前日期+护理计划的  时分    转成时间戳
-                            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"));  //护理对象姓名-文本
-                            hashMap.put("textField_lo3pmoi4",map.get("textField_lo3pmoi4"));  //护理证书类型
-                            hashMap.put("employeeField_lo3pmoi6",JSON.parse(map.get("employeeField_lo3pmoi6_id").toString()));  //护理人员姓名-成员
-                            hashMap.put("textField_lpgi8scj",map.get("textField_lo701pwy"));  //计划明细id
-                            hashMap.put("textField_lq9llmhl",formMap.get("textField_lop4v4qx"));  //护理对象ID
+                        try {
+                            ydClient.operateData(YDParam.builder()
+                                    .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
+                                    .searchCondition(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lnyhv5tn, textField_lombve2g",Arrays.asList(UtilDateTime.parse( nextDay+ " 00:00:01","yyyy-MM-dd HH:mm:ss"),UtilDateTime.parse( currentDate.with(TemporalAdjusters.lastDayOfMonth())+ " 23:59:59","yyyy-MM-dd HH:mm:ss")),formMap.get("textField_lnyhv5tn"),map.get("textField_lomchzi3"))))
+                                    .formDataJson(JSON.toJSONString(hashMap))
+                                    .build(), YDConf.FORM_OPERATION.upsert);
+                        } catch (Exception e) {
+                            log.info("异常数据{}",hashMap);
+                        }
 
 
-                            try {
-                                Thread.sleep(100);
-                            } catch (InterruptedException e) {
-                                throw new RuntimeException(e);
-                            }
-
-                            try {
-                                ydClient.operateData(YDParam.builder()
-                                        .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
-                                        .formDataJson(JSON.toJSONString(hashMap))
-                                        .build(), YDConf.FORM_OPERATION.create);
-                            } catch (Exception e) {
-                                log.info("异常数据{}",hashMap);
-                            }
-                        }
+//                        //通过护理时间  护理对象  护理人员验证数据是否已经存在
+//                        YDParam ydParam1 = YDParam.builder()
+//                                .formUuid("FORM-IY966L71PJ8FV10D61M1HBHU6FB320M2765OLM")
+//                                .searchFieldJson(JSON.toJSONString(UtilMap.map("dateField_lred6eoj, textField_lnyhv5tn, textField_lombve2g",Arrays.asList(UtilDateTime.parse( nextDay+ " 00:00:01","yyyy-MM-dd HH:mm:ss"),UtilDateTime.parse( currentDate.with(TemporalAdjusters.lastDayOfMonth())+ " 23:59:59","yyyy-MM-dd HH:mm:ss")),formMap.get("textField_lnyhv5tn"),map.get("textField_lomchzi3"))))
+//                                .build();
+//                        List<Map> dataLists = (List<Map>) ydClient.queryData(ydParam1, YDConf.FORM_QUERY.retrieve_search_form).getData();
+//
+//
+//                        if (dataLists.size()<1){
+//
+//
+//                        }
                     }
 
                 }
@@ -152,7 +153,6 @@ public class YBJServiceImpl implements YBJService {
     }
 
 
-
     /**
      *定时任务每月25号创建下月的数据
      */

+ 4 - 0
mjava/src/main/java/com/malk/server/aliwork/YDConf.java

@@ -62,6 +62,7 @@ public class YDConf {
         retrieve_changed,    // 变更记录
         retrieve_definition, // 表单定义
 
+
     }
 
     /**
@@ -71,6 +72,7 @@ public class YDConf {
         create,
         delete,             // 传入为body, 文档为param
         update,
+        upsert,
         multi_create,               // 批量操作
         delete_batch,               // 批量删除
         multi_update,               // 批量更新
@@ -139,6 +141,8 @@ public class YDConf {
     public static final String API_FORM_QUERY_ID = formatApiForm("searchFormDataIds");
     public static final String API_FORM_QUERY_DATA = formatApiForm("searchFormDatas");
 
+
+
     public static final String API_FORM_DEFINITION = "/yida_vpc/formDesign/getFormComponentDefinationList.json";
 
     /**

+ 3 - 0
mjava/src/main/java/com/malk/service/aliwork/impl/YDClientImpl.java

@@ -77,6 +77,9 @@ public class YDClientImpl implements YDClient {
             case batchSave:
                 ddr_new = (DDR_New) UtilHttp.doPost(getRequestUrl("/forms/instances/batchSave"), ddClient.initTokenHeader(), null, _initBodyParam(ydParam), DDR_New.class);
                 break;
+            case upsert:
+                ddr_new = (DDR_New) UtilHttp.doPost(getRequestUrl("/forms/instances/insertOrUpdate"), ddClient.initTokenHeader(), bodys, DDR_New.class);
+                break;
             default:
                 break;
         }