浏览代码

1、添加消息中心模块
2、修复应用护理标识接口超时
3、定时任务工程提供指定患者数据即时同步接口

wuyunfeng 1 年之前
父节点
当前提交
48234df624
共有 58 个文件被更改,包括 2046 次插入304 次删除
  1. 17 15
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/BoardItemService.java
  2. 119 167
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/NursingMarkCategoryService.java
  3. 8 7
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/PartTempBedService.java
  4. 6 0
      ncs-entrace-service/src/main/resources/bootstrap.yml
  5. 2 0
      ncs-message-center/README.md
  6. 109 0
      ncs-message-center/pom.xml
  7. 108 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/ConfigSwagger2.java
  8. 22 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/MessageCenterApplication.java
  9. 93 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/config/DataSourceConfig.java
  10. 79 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageSendRecordController.java
  11. 77 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageSendStrategyController.java
  12. 77 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageTypeController.java
  13. 78 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessagesController.java
  14. 77 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/TemplateMessageParamerController.java
  15. 77 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/TemplateMessageTplController.java
  16. 24 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageCenterCRUDServiceImpl.java
  17. 16 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageSendRecordServiceImpl.java
  18. 16 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageSendStrategyServiceImpl.java
  19. 31 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageTypeServiceImpl.java
  20. 16 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessagesServiceImpl.java
  21. 16 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/TemplateMessageParamerServiceImpl.java
  22. 17 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/TemplateMessageTplServiceImpl.java
  23. 12 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageSendRecordService.java
  24. 12 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageSendStrategyService.java
  25. 15 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageTypeService.java
  26. 12 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessagesService.java
  27. 12 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/TemplateMessageParamerService.java
  28. 12 0
      ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/TemplateMessageTplService.java
  29. 58 0
      ncs-message-center/src/main/resources/bootstrap.yml
  30. 8 0
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/open/NursingMarkCategoryConfigFeignClient.java
  31. 4 1
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/system/CustomerFeignClient.java
  32. 7 0
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/system/NursingMarkFeignClient.java
  33. 25 5
      ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/controller/NursingMarkCategoryConfigController.java
  34. 46 38
      ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/service/impl/NursingMarkCategoryConfigServiceImpl.java
  35. 10 1
      ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/service/iservice/NursingMarkCategoryConfigService.java
  36. 9 1
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/controller/NursingMarkController.java
  37. 7 0
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerMappingServiceImpl.java
  38. 1 1
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerServiceImpl.java
  39. 14 15
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigOptionServiceImpl.java
  40. 142 9
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigServiceImpl.java
  41. 2 0
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/CustomerMappingService.java
  42. 4 30
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/NurseConfigOptionService.java
  43. 5 0
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/NurseConfigService.java
  44. 1 0
      pom.xml
  45. 47 0
      synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/controller/DataRefreshController.java
  46. 24 4
      synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/service/DataBaseSyncService.java
  47. 10 2
      synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/service/DataxEngineHelper.java
  48. 1 1
      synchrony-scheduled-task/src/main/resources/bootstrap.yml
  49. 27 6
      third-part-wn-hl7/src/main/java/com/wdklian/ncs/ms/wn/hl7/config/MyHL7BusinessLogicService.java
  50. 123 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageSendRecordDO.java
  51. 69 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageSendStrategyDO.java
  52. 58 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageTypeDO.java
  53. 76 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessagesDO.java
  54. 47 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/TemplateMessageParamerDO.java
  55. 52 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/TemplateMessageTplDO.java
  56. 1 1
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/PatientDO.java
  57. 2 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/system/dos/NurseConfigDO.java
  58. 6 0
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/system/vos/NurseOptionCompareVO.java

+ 17 - 15
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/BoardItemService.java

@@ -140,23 +140,25 @@ public class BoardItemService {
                 JSONArray manualBeds = JSON.parseArray(p.getManualAddData());
                 if (!manualBeds.isEmpty()) {
                     List<DoctorAdviceMatchBoardItemVO> doctorAdvices = vo.getDoctorAdvices();
-                    List<String> adviceBeds = doctorAdvices.stream().map(d -> d.getCustomerBedNo()).collect(Collectors.toList());
-                    List<String> manualBedArr = manualBeds.stream().map(m -> m.toString()).collect(Collectors.toList());
-                    List<String> nomatchBeds = ListUtils.removeAll(manualBedArr, adviceBeds);
-                    if (nomatchBeds != null && nomatchBeds.size() > 0) {
-                        for (String nomatchBed : nomatchBeds) {
-                            DoctorAdviceMatchBoardItemVO dambiVO = new DoctorAdviceMatchBoardItemVO();
-                            dambiVO.setCustomerBedNo(nomatchBed);
-                            dambiVO.setAdviceContent("手工输入床位");
+                    if(doctorAdvices!=null) {
+                        List<String> adviceBeds = doctorAdvices.stream().filter(d -> StrUtil.isNotEmpty(d.getCustomerBedNo())).map(d -> d.getCustomerBedNo()).collect(Collectors.toList());
+                        List<String> manualBedArr = manualBeds.stream().map(m -> m.toString()).collect(Collectors.toList());
+                        List<String> nomatchBeds = ListUtils.removeAll(manualBedArr, adviceBeds);
+                        if (nomatchBeds != null && nomatchBeds.size() > 0) {
+                            for (String nomatchBed : nomatchBeds) {
+                                DoctorAdviceMatchBoardItemVO dambiVO = new DoctorAdviceMatchBoardItemVO();
+                                dambiVO.setCustomerBedNo(nomatchBed);
+                                dambiVO.setAdviceContent("手工输入床位");
 //                                DoctorAdviceDO doctorAdviceDO = nomatchAdvices.stream().filter(p -> p.getCustomerBedNo().equalsIgnoreCase(nomatchBed)).findFirst().orElse(null);
-                            CustomerFrameVO customerFrameVO = hospitalizedBeds.stream().filter(cf -> !StringUtil.isEmpty(cf.getBedNo()) && cf.getBedNo().equalsIgnoreCase(nomatchBed)).findFirst().orElse(null);
-                            if (customerFrameVO != null) {
-                                dambiVO.setHisKey(customerFrameVO.getId().toString());
-                                dambiVO.setPatientName(customerFrameVO.getNamed());
-                            } else {
-                                dambiVO.setHisKey(ObjectId.next());
+                                CustomerFrameVO customerFrameVO = hospitalizedBeds.stream().filter(cf -> !StringUtil.isEmpty(cf.getBedNo()) && cf.getBedNo().equalsIgnoreCase(nomatchBed)).findFirst().orElse(null);
+                                if (customerFrameVO != null) {
+                                    dambiVO.setHisKey(customerFrameVO.getId().toString());
+                                    dambiVO.setPatientName(customerFrameVO.getNamed());
+                                } else {
+                                    dambiVO.setHisKey(ObjectId.next());
+                                }
+                                doctorAdvices.add(dambiVO);
                             }
-                            doctorAdvices.add(dambiVO);
                         }
                     }
                 }

+ 119 - 167
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/NursingMarkCategoryService.java

@@ -119,63 +119,9 @@ public class NursingMarkCategoryService {
 
     public JsonResponse foceCopyDefaultToPart() {
 
-        List<NursingMarkCategoryConfigVO> categoryConfigVOS = this.categoryConfigFeignClient.list(-1).getData();
+//        List<NursingMarkCategoryConfigVO> categoryConfigVOS = this.categoryConfigFeignClient.list(-1).getData();
         List<ShopDO> shopDOS = this.shopFeignClient.listShopByType(ShopTypeEnum.PART.value()).getData();
-
-        for (ShopDO shopDO : shopDOS) {
-            NursingMarkCategoryConfigDO categoryConfigDO = new NursingMarkCategoryConfigDO();
-            NursingMarkOptionConfigDO optionConfigDO = new NursingMarkOptionConfigDO();
-            List<NursingMarkCategoryConfigVO> partCategory = this.categoryConfigFeignClient.list(shopDO.getShopId()).getData();
-            for (NursingMarkCategoryConfigVO categoryConfigVO : categoryConfigVOS) {
-                NursingMarkCategoryConfigVO sameNameCategory = partCategory.stream().filter(p -> StrUtil.isNotEmpty(p.getNameMd5()) && p.getNameMd5().equalsIgnoreCase(categoryConfigVO.getNameMd5())).findFirst().orElse(null);
-                if (sameNameCategory != null && !categoryConfigVO.getId().equals(sameNameCategory.getCopyFrom())) { //存在同名分类,但不是从categoryConfigVO拷贝而来,删除这个项目及其子项
-                    this.categoryConfigFeignClient.delete(sameNameCategory.getId());
-                    partCategory.remove(sameNameCategory);
-                }
-                NursingMarkCategoryConfigVO copyFrom = partCategory.stream().filter(p -> p.getCopyFrom() != null && p.getCopyFrom().equals(categoryConfigVO.getId()) && p.getForPartId() != null && p.getForPartId().equals(shopDO.getShopId())).findFirst().orElse(null);
-                List<NursingMarkOptionConfigDO> copyChild = new ArrayList<>();
-                if (copyFrom != null) {
-                    copyChild = copyFrom.getChild();
-                    BeanUtil.copyProperties(copyFrom, categoryConfigDO);
-                    BeanUtil.copyProperties(categoryConfigVO, categoryConfigDO);
-                    categoryConfigDO.setCopyFrom(categoryConfigVO.getId());
-                    categoryConfigDO.setId(copyFrom.getId());
-                    categoryConfigDO.setForPartId(shopDO.getShopId());
-                    categoryConfigDO = this.categoryConfigFeignClient.edit(categoryConfigDO, categoryConfigDO.getId()).getData();
-                } else {
-                    BeanUtil.copyProperties(categoryConfigVO, categoryConfigDO);
-                    categoryConfigDO.setCopyFrom(categoryConfigVO.getId());
-                    categoryConfigDO.setForPartId(shopDO.getShopId());
-                    categoryConfigDO.setId(null);
-                    categoryConfigDO = this.categoryConfigFeignClient.add(categoryConfigDO).getData();
-
-                }
-                List<NursingMarkOptionConfigDO> child = categoryConfigVO.getChild();
-                if (child != null && child.size() > 0) {
-                    for (NursingMarkOptionConfigDO nursingMarkOptionConfigDO : child) {
-                        NursingMarkOptionConfigDO optionConfigDO1 = copyChild.stream().filter(p -> p.getCopyFrom() != null && p.getCopyFrom().equals(nursingMarkOptionConfigDO.getId()) && p.getForPartId() != null && p.getForPartId().equals(shopDO.getShopId())).findFirst().orElse(null);
-                        if (optionConfigDO1 == null) {
-
-                            BeanUtil.copyProperties(nursingMarkOptionConfigDO, optionConfigDO);
-                            optionConfigDO.setCategoryId(categoryConfigDO.getId());
-                            optionConfigDO.setCopyFrom(nursingMarkOptionConfigDO.getId());
-                            optionConfigDO.setForPartId(shopDO.getShopId());
-                            optionConfigDO.setId(null);
-                            this.nursingMarkOptionConfigFeignClient.add(optionConfigDO);
-                        } else {
-                            BeanUtil.copyProperties(optionConfigDO1, optionConfigDO);
-                            BeanUtil.copyProperties(nursingMarkOptionConfigDO, optionConfigDO);
-                            optionConfigDO.setId(optionConfigDO1.getId());
-                            optionConfigDO.setCopyFrom(nursingMarkOptionConfigDO.getId());
-                            optionConfigDO.setCategoryId(categoryConfigDO.getId());
-                            optionConfigDO.setForPartId(shopDO.getShopId());
-                            this.nursingMarkOptionConfigFeignClient.edit(optionConfigDO, optionConfigDO.getId());
-                        }
-
-                    }
-                }
-            }
-        }
+        this.categoryConfigFeignClient.forceCopyDefaultToPart(shopDOS);
         //拷贝后应用
         this.applyNurseConfig(-1);
         return JsonResponse.successResponse();
@@ -185,117 +131,123 @@ public class NursingMarkCategoryService {
     public JsonResponse applyNurseConfig(Integer partId) {
 
         List<NursingMarkCategoryConfigVO> list = this.categoryConfigFeignClient.listAll().getData();
-        //所有床头屏医嘱分类
-        List<NurseConfigDO> nurseConfigDOS = this.nursingMarkFeignClient.listAllNursingMark().getData();
-        //所有床头屏医嘱分类的选项
-        List<NurseConfigOptionDO> nurseConfigOptionDOS = this.nursingMarkFeignClient.listAllNursingMarkOption().getData();
-        //要处理的科室列表
-        List<ShopDO> shops = new ArrayList<>();
-        if (partId.equals(-1)) {
-            shops.addAll(this.shopFeignClient.listShopByType(ShopTypeEnum.PART.value()).getData());
-        } else {
-            shops.add(this.shopFeignClient.getPartById(partId).getData());
-        }
-
-        if (list.size() > 0) {
-            //删除已经在配置中不存在的床头屏医嘱分类
-            String deleteOptionsSqlTpl = "delete from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " where find_in_set(MD5(option_name),'%s')=0 and ncfg_id =%d";
-            List<String> clearOptionsSql = new ArrayList<>();
-
-            for (NursingMarkCategoryConfigVO screenAdviceCategoryVO : list) {
-                for (ShopDO shop : shops) {
-                    //删掉已存在的但是配置中没有的记录
-                    String categoryNamesMd5 = list.stream().filter(p -> p.getForPartId().equals(shop.getShopId())).map(p -> p.getNameMd5()).collect(Collectors.joining(","));
-                    if (screenAdviceCategoryVO.getForPartId().equals(shop.getShopId())) { //本科室的分类
-                        List<NurseConfigDO> partNurseConfigDOs = nurseConfigDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
-                        List<NurseConfigOptionDO> partOptionDOS = nurseConfigOptionDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
-                        //同步分类
-                        NurseConfigDO nurseConfigDO = this.syncPartScreenAdviceCategory(screenAdviceCategoryVO, shop, partNurseConfigDOs);
-                        List<NursingMarkOptionConfigDO> child = screenAdviceCategoryVO.getChild();
-                        if (!screenAdviceCategoryVO.getBoolAuto() && child != null && child.size() > 0) {
-                            List<NursingMarkOptionConfigDO> partScreenAdviceItemSettingDOs = child.stream().filter(p -> !StringUtil.isEmpty(p.getItemNameMd5()) && p.getForPartId().equals(shop.getShopId())).collect(Collectors.toList());
-                            String optionsNameMd5s = partScreenAdviceItemSettingDOs.stream().map(p -> p.getItemNameMd5()).collect(Collectors.joining(","));
-                            String formatSql = String.format(deleteOptionsSqlTpl, optionsNameMd5s, nurseConfigDO.getId());
-                            clearOptionsSql.add(formatSql);
-                            for (NursingMarkOptionConfigDO settingDO : partScreenAdviceItemSettingDOs) {
-                                this.syncPartScreenAdviceItem(settingDO, nurseConfigDO, partOptionDOS);
-                            }
-                        }
-                    }
-                    //删除配置中没有的分类,及其选项
-                    String sqlNurseConfigClear = " delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id  where not find_in_set(MD5(config.config_name),'" + categoryNamesMd5 + "') and config.part_id =" + shop.getShopId();
-                    //反向删除找不到分类的项目,由于更新用户护理项时是删除重建,这里可以不删除用户护理项mapping记录
-                    String sqlNurseConfigOptionClear = "delete op from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op left join " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config on config.id=op.ncfg_id where config.id is null ";
-                    clearOptionsSql.add(sqlNurseConfigClear);
-                    clearOptionsSql.add(sqlNurseConfigOptionClear);
-
-                }
-            }
-            //清理已经不在设置中的分类和选项
-            if (clearOptionsSql.size() > 0) {
-                this.nursingMarkFeignClient.batchUpdate(clearOptionsSql.toArray(new String[clearOptionsSql.size()]));
-            }
-
-        } else { //清空配置
-            List<String> clearConfigSqls = new ArrayList<>();
-            for (ShopDO shop : shops) {
-                String sql = "delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id where config.part_id =" + shop.getShopId();
-                clearConfigSqls.add(sql);
-            }
-            if (clearConfigSqls.size() > 0) {
-                this.nursingMarkFeignClient.batchUpdate(clearConfigSqls.toArray(new String[clearConfigSqls.size()]));
-            }
-        }
-        return JsonResponse.successResponse(list);
-    }
-
-    //应用指定科室的指定床头屏医嘱分类
-    private NurseConfigDO syncPartScreenAdviceCategory(NursingMarkCategoryConfigVO screenAdviceCategoryVO, ShopDO shop, List<NurseConfigDO> partNurseConfigDOs) {
-
-        NurseConfigDO nurseConfigDO = partNurseConfigDOs.stream().filter(p -> StringUtil.md5(p.getConfigName()).equalsIgnoreCase(screenAdviceCategoryVO.getNameMd5())).findFirst().orElse(null);
-        if (nurseConfigDO == null) {
-            nurseConfigDO = new NurseConfigDO();
-            nurseConfigDO.setPartId(shop.getShopId());
-            nurseConfigDO.setConfigName(screenAdviceCategoryVO.getCategoryName());
-            nurseConfigDO.setUnionId(ObjectId.next());
-            nurseConfigDO.setBoolCritical(screenAdviceCategoryVO.getCritical());
-            nurseConfigDO.setIndexNo(screenAdviceCategoryVO.getIndexNo());
-            nurseConfigDO.setDefaultColor(screenAdviceCategoryVO.getDefaultColor().replace("#", ""));
-            nurseConfigDO.setBoolManual(screenAdviceCategoryVO.getBoolManual());
-            nurseConfigDO= this.nursingMarkFeignClient.addNursingConfig(nurseConfigDO).getData();
-        } else {
-            nurseConfigDO.setBoolCritical(screenAdviceCategoryVO.getCritical());
-            nurseConfigDO.setIndexNo(screenAdviceCategoryVO.getIndexNo());
-            nurseConfigDO.setDefaultColor(screenAdviceCategoryVO.getDefaultColor().replace("#", ""));
-            nurseConfigDO.setSyncTime(DateUtil.getDateline());
-            nurseConfigDO.setBoolManual(screenAdviceCategoryVO.getBoolManual());
-            this.nursingMarkFeignClient.updateNursingConfig(nurseConfigDO, nurseConfigDO.getId());
-        }
-        return nurseConfigDO;
-    }
-
-
-    //同步应用床头屏医嘱分类选择项
-    private void syncPartScreenAdviceItem(NursingMarkOptionConfigDO settingDO, NurseConfigDO nurseConfigDO, List<NurseConfigOptionDO> partOptionDOS) {
-        //查询是否存在与设置对应的项目
-        NurseConfigOptionDO nurseConfigOptionDO = partOptionDOS.stream().filter(p -> !StringUtil.isEmpty(p.getOptionName()) &&
-                StringUtil.md5(p.getOptionName()).equalsIgnoreCase(settingDO.getItemNameMd5()) && p.getNcfgId().equals(nurseConfigDO.getId())).findFirst().orElse(null);
-        if (nurseConfigOptionDO == null) {
-            nurseConfigOptionDO = new NurseConfigOptionDO();
-            nurseConfigOptionDO.setCreateTime(DateUtil.getDateline());
-            nurseConfigOptionDO.setNcfgId(nurseConfigDO.getId());
-            nurseConfigOptionDO.setUnionId(ObjectId.next());
-            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
-            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
-            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
-            this.nursingMarkFeignClient.addNursingOptionConfig(nurseConfigOptionDO);
-        } else {
-            nurseConfigOptionDO.setUpdateTime(DateUtil.getDateline());
-            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
-            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
-            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
-            this.nursingMarkFeignClient.updateNursingOptionConfig(nurseConfigOptionDO, nurseConfigOptionDO.getId());
-        }
+//        //所有床头屏医嘱分类
+//        List<NurseConfigDO> nurseConfigDOS = this.nursingMarkFeignClient.listAllNursingMark().getData();
+//        //所有床头屏医嘱分类的选项
+//        List<NurseConfigOptionDO> nurseConfigOptionDOS = this.nursingMarkFeignClient.listAllNursingMarkOption().getData();
+
+         this.nursingMarkFeignClient.applyNursingMark(list,partId);
+
+//
+//
+//        //要处理的科室列表
+//        List<ShopDO> shops = new ArrayList<>();
+//        if (partId.equals(-1)) {
+//            shops.addAll(this.shopFeignClient.listShopByType(ShopTypeEnum.PART.value()).getData());
+//        } else {
+//            shops.add(this.shopFeignClient.getPartById(partId).getData());
+//        }
+//
+//        if (list.size() > 0) {
+//            //删除已经在配置中不存在的床头屏医嘱分类
+//            String deleteOptionsSqlTpl = "delete from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " where find_in_set(MD5(option_name),'%s')=0 and ncfg_id =%d";
+//
+//
+//            for (NursingMarkCategoryConfigVO screenAdviceCategoryVO : list) {
+//                for (ShopDO shop : shops) {
+//                    List<String> clearOptionsSql = new ArrayList<>();
+//                    //删掉已存在的但是配置中没有的记录
+//                    String categoryNamesMd5 = list.stream().filter(p -> p.getForPartId().equals(shop.getShopId())).map(p -> p.getNameMd5()).collect(Collectors.joining(","));
+//                    if (screenAdviceCategoryVO.getForPartId().equals(shop.getShopId())) { //本科室的分类
+//                        List<NurseConfigDO> partNurseConfigDOs = nurseConfigDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
+//                        List<NurseConfigOptionDO> partOptionDOS = nurseConfigOptionDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
+//                        //同步分类
+//                        NurseConfigDO nurseConfigDO = this.syncPartScreenAdviceCategory(screenAdviceCategoryVO, shop, partNurseConfigDOs);
+//                        List<NursingMarkOptionConfigDO> child = screenAdviceCategoryVO.getChild();
+//                        if (!screenAdviceCategoryVO.getBoolAuto() && child != null && child.size() > 0) {
+//                            List<NursingMarkOptionConfigDO> partScreenAdviceItemSettingDOs = child.stream().filter(p -> !StringUtil.isEmpty(p.getItemNameMd5()) && p.getForPartId().equals(shop.getShopId())).collect(Collectors.toList());
+//                            String optionsNameMd5s = partScreenAdviceItemSettingDOs.stream().map(p -> p.getItemNameMd5()).collect(Collectors.joining(","));
+//                            String formatSql = String.format(deleteOptionsSqlTpl, optionsNameMd5s, nurseConfigDO.getId());
+//                            clearOptionsSql.add(formatSql);
+//                            for (NursingMarkOptionConfigDO settingDO : partScreenAdviceItemSettingDOs) {
+//                                this.syncPartScreenAdviceItem(settingDO, nurseConfigDO, partOptionDOS);
+//                            }
+//                        }
+//                    }
+//                    //删除配置中没有的分类,及其选项
+//                    String sqlNurseConfigClear = " delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id  where not find_in_set(MD5(config.config_name),'" + categoryNamesMd5 + "') and config.part_id =" + shop.getShopId();
+//                    //反向删除找不到分类的项目,由于更新用户护理项时是删除重建,这里可以不删除用户护理项mapping记录
+//                    String sqlNurseConfigOptionClear = "delete op from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op left join " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config on config.id=op.ncfg_id where config.id is null ";
+//                    clearOptionsSql.add(sqlNurseConfigClear);
+//                    clearOptionsSql.add(sqlNurseConfigOptionClear);
+//                    //清理已经不在设置中的分类和选项
+//                    if (clearOptionsSql.size() > 0) {
+//                        this.nursingMarkFeignClient.batchUpdate(clearOptionsSql.toArray(new String[clearOptionsSql.size()]));
+//                    }
+//                }
+//            }
+//
+//
+//        } else { //清空配置
+//            List<String> clearConfigSqls = new ArrayList<>();
+//            for (ShopDO shop : shops) {
+//                String sql = "delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id where config.part_id =" + shop.getShopId();
+//                clearConfigSqls.add(sql);
+//            }
+//            if (clearConfigSqls.size() > 0) {
+//                this.nursingMarkFeignClient.batchUpdate(clearConfigSqls.toArray(new String[clearConfigSqls.size()]));
+//            }
+//        }
+        return JsonResponse.successResponse();
     }
+//
+//    //应用指定科室的指定床头屏医嘱分类
+//    private NurseConfigDO syncPartScreenAdviceCategory(NursingMarkCategoryConfigVO screenAdviceCategoryVO, ShopDO shop, List<NurseConfigDO> partNurseConfigDOs) {
+//
+//        NurseConfigDO nurseConfigDO = partNurseConfigDOs.stream().filter(p -> StringUtil.md5(p.getConfigName()).equalsIgnoreCase(screenAdviceCategoryVO.getNameMd5())).findFirst().orElse(null);
+//        if (nurseConfigDO == null) {
+//            nurseConfigDO = new NurseConfigDO();
+//            nurseConfigDO.setPartId(shop.getShopId());
+//            nurseConfigDO.setConfigName(screenAdviceCategoryVO.getCategoryName());
+//            nurseConfigDO.setUnionId(ObjectId.next());
+//            nurseConfigDO.setBoolCritical(screenAdviceCategoryVO.getCritical());
+//            nurseConfigDO.setIndexNo(screenAdviceCategoryVO.getIndexNo());
+//            nurseConfigDO.setDefaultColor(screenAdviceCategoryVO.getDefaultColor().replace("#", ""));
+//            nurseConfigDO.setBoolManual(screenAdviceCategoryVO.getBoolManual());
+//            nurseConfigDO= this.nursingMarkFeignClient.addNursingConfig(nurseConfigDO).getData();
+//        } else {
+//            nurseConfigDO.setBoolCritical(screenAdviceCategoryVO.getCritical());
+//            nurseConfigDO.setIndexNo(screenAdviceCategoryVO.getIndexNo());
+//            nurseConfigDO.setDefaultColor(screenAdviceCategoryVO.getDefaultColor().replace("#", ""));
+//            nurseConfigDO.setSyncTime(DateUtil.getDateline());
+//            nurseConfigDO.setBoolManual(screenAdviceCategoryVO.getBoolManual());
+//            this.nursingMarkFeignClient.updateNursingConfig(nurseConfigDO, nurseConfigDO.getId());
+//        }
+//        return nurseConfigDO;
+//    }
+//
+//
+//    //同步应用床头屏医嘱分类选择项
+//    private void syncPartScreenAdviceItem(NursingMarkOptionConfigDO settingDO, NurseConfigDO nurseConfigDO, List<NurseConfigOptionDO> partOptionDOS) {
+//        //查询是否存在与设置对应的项目
+//        NurseConfigOptionDO nurseConfigOptionDO = partOptionDOS.stream().filter(p -> !StringUtil.isEmpty(p.getOptionName()) &&
+//                StringUtil.md5(p.getOptionName()).equalsIgnoreCase(settingDO.getItemNameMd5()) && p.getNcfgId().equals(nurseConfigDO.getId())).findFirst().orElse(null);
+//        if (nurseConfigOptionDO == null) {
+//            nurseConfigOptionDO = new NurseConfigOptionDO();
+//            nurseConfigOptionDO.setCreateTime(DateUtil.getDateline());
+//            nurseConfigOptionDO.setNcfgId(nurseConfigDO.getId());
+//            nurseConfigOptionDO.setUnionId(ObjectId.next());
+//            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
+//            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
+//            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
+//            this.nursingMarkFeignClient.addNursingOptionConfig(nurseConfigOptionDO);
+//        } else {
+//            nurseConfigOptionDO.setUpdateTime(DateUtil.getDateline());
+//            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
+//            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
+//            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
+//            this.nursingMarkFeignClient.updateNursingOptionConfig(nurseConfigOptionDO, nurseConfigOptionDO.getId());
+//        }
+//    }
 
 }

+ 8 - 7
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/PartTempBedService.java

@@ -93,7 +93,7 @@ public class PartTempBedService {
                 virtual_room.setType(FrameTypeEnum.ROOM.value());
                 virtual_room.setUnionId(ObjectId.next());
                 virtual_room.setSort(10000);
-                this.frameFeignClient.add(virtual_room);
+                virtual_room= this.frameFeignClient.add(virtual_room).getData();
             } else {
                 throw new ServiceException("科室空间错误!");
             }
@@ -251,13 +251,14 @@ public class PartTempBedService {
                     this.deviceFeignClient.delete(new Integer[]{deviceByEthMac.getId()});
                 }
             }
-
-            FrameDO roomFrame = this.frameFeignClient.getModel(bedFrame.getParentId()).getData();
-            if (!roomFrame.getName().equalsIgnoreCase("v-room")) {
-                throw new ServiceException("床位号[" + model.getBedNo() + "]已经是常用床位,无法删除该记录");
+            if (bedFrame.getParentId() != null) {
+                FrameDO roomFrame = this.frameFeignClient.getModel(bedFrame.getParentId()).getData();
+                if (!roomFrame.getName().equalsIgnoreCase("v-room")) {
+                    throw new ServiceException("床位号[" + model.getBedNo() + "]已经是常用床位,无法删除该记录");
+                }
+                //删除床位
+                this.frameFeignClient.delete(new Integer[]{bedFrame.getId()});
             }
-            //删除床位
-            this.frameFeignClient.delete(new Integer[]{bedFrame.getId()});
         }
         this.partTempBedFeignClient.delete(id);
     }

+ 6 - 0
ncs-entrace-service/src/main/resources/bootstrap.yml

@@ -47,5 +47,11 @@ ribbon:
   MaxAutoRetries: 2
   MaxAutoRetriesNextServer: 3
   OkToRetryOnAllOperations: false
+feign:
+  client:
+    config:
+      patientFeignClient:
+        connectTimeout: 100000 # 连接超时时间(毫秒)
+        readTimeout: 100000
 
 

+ 2 - 0
ncs-message-center/README.md

@@ -0,0 +1,2 @@
+## 推送消息中心
+- 管理推送消息分类,消息内容,消息模板,推送策略等等

+ 109 - 0
ncs-message-center/pom.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>ncs-ms</artifactId>
+        <groupId>com.wdklian</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>ncs-message-center</artifactId>
+    <version>1.0.0</version>
+    <dependencies>
+        <dependency>
+            <groupId>com.wdklian</groupId>
+            <artifactId>third-party-common</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bootstrap</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-alibaba-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test</artifactId>
+            <version>2.1.8.RELEASE</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>5.1.9.RELEASE</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.wdklian</groupId>
+            <artifactId>ncs-ms-feign</artifactId>
+            <version>1.0.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-loadbalancer</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.ben-manes.caffeine</groupId>
+            <artifactId>caffeine</artifactId>
+            <version>3.1.1</version>
+        </dependency>
+
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.7.10</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 108 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/ConfigSwagger2.java

@@ -0,0 +1,108 @@
+package com.wdklian.ncs.ms.message.center;
+
+
+import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
+import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
+import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
+import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
+import org.springframework.boot.actuate.endpoint.web.*;
+import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
+import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
+import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.Environment;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+@Configuration
+@EnableSwagger2
+public class ConfigSwagger2 implements WebMvcConfigurer {
+    /**
+     * 创建RESTFUL API文档内容
+     * @return
+     */
+    @Bean
+    public Docket createRestApi(){
+        return new Docket(DocumentationType.SWAGGER_2)
+                //此处参数为ApiInfo对象
+                //指定构建api文档的详细信息的方法
+                .apiInfo(apiInfo())
+                .select()
+                //指定构建api接口的包路径-指定具体包路径
+//                .apis(RequestHandlerSelectors.basePackage("com.provider.controller"))
+                //指定构建api接口的包路径-此处为所有包(未指定)
+                .apis(RequestHandlerSelectors.any())
+                //访问路径下面的接口
+//                .paths(PathSelectors.any())
+//                .paths(PathSelectors.ant("/libai/**"))
+//                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+                //可根据url路径设置那些请求加入文档,忽略哪些请求
+                .paths(PathSelectors.any())
+                .build()
+                //分组管理可以与哪个访问路径结合使用
+//                .groupName("用户管理")
+                ;
+    }
+
+    /**
+     * 创建API界面的基本信息
+     * @return 返回一个构建好的ApiInfo对象
+     */
+    private ApiInfo apiInfo(){
+        return new ApiInfoBuilder()
+                //界面标题
+                .title("维鼎康联消息中心接口")
+                //接口描述
+                .description("后端消息中心接口文档展示")
+                //联系方式,联系人-网址-邮箱
+                .contact(new Contact("WDKL", "http://www.wdklian.com", "service@wdklian.com"))
+                //版本信息
+                .version("1.0.0")
+                //证书描述
+                .license("访问主页")
+                //以上全部,开始构建
+                .build();
+    }
+
+    @Bean
+    public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,
+                                                                         ServletEndpointsSupplier servletEndpointsSupplier, ControllerEndpointsSupplier controllerEndpointsSupplier,
+                                                                         EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,
+                                                                         WebEndpointProperties webEndpointProperties, Environment environment) {
+        List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
+        Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
+        allEndpoints.addAll(webEndpoints);
+        allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
+        allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
+        String basePath = webEndpointProperties.getBasePath();
+        EndpointMapping endpointMapping = new EndpointMapping(basePath);
+        boolean shouldRegisterLinksMapping =
+                webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.hasText(basePath)
+                        || ManagementPortType.get(environment).equals(ManagementPortType.DIFFERENT));
+        return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes,
+                corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath),
+                shouldRegisterLinksMapping, null);
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
+    }
+
+
+}

+ 22 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/MessageCenterApplication.java

@@ -0,0 +1,22 @@
+package com.wdklian.ncs.ms.message.center;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.context.annotation.ComponentScan;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-01 12:19
+ * ${description}
+ */
+@SpringBootApplication
+@EnableDiscoveryClient
+@ComponentScan("com.wdklian.ncs.ms")
+@ServletComponentScan
+public class MessageCenterApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(MessageCenterApplication.class,args);
+    }
+}

+ 93 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/config/DataSourceConfig.java

@@ -0,0 +1,93 @@
+package com.wdklian.ncs.ms.message.center.config;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
+import com.wdklian.ncs.ms.framework.database.DaoSupport;
+import com.wdklian.ncs.ms.framework.database.impl.DaoSupportImpl;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+import javax.sql.DataSource;
+
+
+@Configuration
+public class DataSourceConfig {
+
+    /*----------------------------------------------------------------------------*/
+    /*                           DaoSupport配置                                    */
+    /*----------------------------------------------------------------------------*/
+
+    /**
+     * 系统daoSupport
+     * @param jdbcTemplate 系统 jdbcTemplate
+     * @return
+     */
+    @Primary
+    @Bean(name = "messageCenterDaoSupport")
+    public DaoSupport systemDaoSupport(@Qualifier("messageCenterJdbcTemplate") JdbcTemplate jdbcTemplate) {
+        DaoSupport daosupport = new DaoSupportImpl(jdbcTemplate);
+        return daosupport;
+    }
+
+
+
+    /*----------------------------------------------------------------------------*/
+    /*                           JdbcTemplate 配置                                */
+    /*----------------------------------------------------------------------------*/
+
+
+    /**
+     * 系统jdbcTemplate
+     * @param dataSource 系统数据源
+     * @return
+     */
+    @Primary
+    @Bean(name = "messageCenterJdbcTemplate")
+    public JdbcTemplate systemJdbcTemplate(
+            @Qualifier("messageCenterDataSource") DataSource dataSource) {
+        return new JdbcTemplate(dataSource);
+    }
+
+
+    /*----------------------------------------------------------------------------*/
+    /*                           数据源配置                                        */
+    /*----------------------------------------------------------------------------*/
+
+    /**
+     * 系统数据源
+     * @return
+     */
+    @Primary
+    @Bean(name = "messageCenterDataSource")
+    @Qualifier("messageCenterDataSource")
+    @ConfigurationProperties(prefix="spring.datasource.message-center")
+    public DataSource systemDataSource() {
+        return DruidDataSourceBuilder.create().build();
+    }
+
+
+
+
+
+    /*----------------------------------------------------------------------------*/
+    /*                           事务配置                                         */
+    /*----------------------------------------------------------------------------*/
+
+
+    /**
+     * 系统事务
+     * @param dataSource
+     * @return
+     */
+    @Bean(name = "messageCenterTransactionManager")
+    public PlatformTransactionManager systemTransactionManager(@Qualifier("messageCenterDataSource")DataSource dataSource) {
+        return new DataSourceTransactionManager(dataSource);
+    }
+
+
+}

+ 79 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageSendRecordController.java

@@ -0,0 +1,79 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendRecordDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageSendRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:39
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "消息发送记录管理API", tags = "消息发送记录管理API")
+@RequestMapping("/message-send-record")
+@Validated
+public class MessageSendRecordController {
+
+
+    @Autowired
+    private MessageSendRecordService messageSendRecordService;
+
+    @ApiOperation(value = "分页查询消息发送记录", response = MessageSendRecordDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(MessageSendRecordDO.class, request.getParameterMap());
+
+        return this.messageSendRecordService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加消息发送记录", response = MessageSendRecordDO.class)
+    @PostMapping
+    public MessageSendRecordDO add(@Valid MessageSendRecordDO messageSendRecordDO) {
+        this.messageSendRecordService.add(messageSendRecordDO);
+        return messageSendRecordDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改消息类型", response = MessageSendRecordDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public MessageSendRecordDO edit(@Valid MessageSendRecordDO messageSendRecordDO, @PathVariable Integer id) {
+        this.messageSendRecordService.edit(messageSendRecordDO, id);
+        return messageSendRecordDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除消息类型")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.messageSendRecordService.delete(ids);
+        return "";
+    }
+
+
+}

+ 77 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageSendStrategyController.java

@@ -0,0 +1,77 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendStrategyDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageSendStrategyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:56
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "消息发送策略管理API", tags = "消息发送策略管理API")
+@RequestMapping("/message-send-strategy")
+@Validated
+public class MessageSendStrategyController {
+
+    @Autowired
+    private MessageSendStrategyService messageSendStrategyService;
+
+    @ApiOperation(value = "分页查询消息发送策略", response = MessageSendStrategyDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(MessageSendStrategyDO.class, request.getParameterMap());
+
+        return this.messageSendStrategyService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加消息发送策略", response = MessageSendStrategyDO.class)
+    @PostMapping
+    public MessageSendStrategyDO add(@Valid MessageSendStrategyDO messageSendStrategyDO) {
+        this.messageSendStrategyService.add(messageSendStrategyDO);
+        return messageSendStrategyDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改消息发送策略", response = MessageSendStrategyDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public MessageSendStrategyDO edit(@Valid MessageSendStrategyDO messageSendStrategyDO, @PathVariable Integer id) {
+        this.messageSendStrategyService.edit(messageSendStrategyDO, id);
+        return messageSendStrategyDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除消息发送策略")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.messageSendStrategyService.delete(ids);
+        return "";
+    }
+
+}

+ 77 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessageTypeController.java

@@ -0,0 +1,77 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageTypeDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 14:42
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "消息分类管理API", tags = "消息分类管理API")
+@RequestMapping("/message-type")
+@Validated
+public class MessageTypeController {
+
+    @Autowired
+    private MessageTypeService messageTypeService;
+
+    @ApiOperation(value = "分页查询消息类型", response = MessageTypeDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(MessageTypeDO.class, request.getParameterMap());
+
+        return this.messageTypeService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加消息类型", response = MessageTypeDO.class)
+    @PostMapping
+    public MessageTypeDO add(@Valid MessageTypeDO messageTypeDO) {
+        this.messageTypeService.add(messageTypeDO);
+        return messageTypeDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改消息类型", response = MessageTypeDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public MessageTypeDO edit(@Valid MessageTypeDO messageTypeDO, @PathVariable Integer id) {
+        this.messageTypeService.edit(messageTypeDO, id);
+        return messageTypeDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除消息类型")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.messageTypeService.delete(ids);
+        return "";
+    }
+
+}

+ 78 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/MessagesController.java

@@ -0,0 +1,78 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessagesDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessagesService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:22
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "消息管理API", tags = "消息管理API")
+@RequestMapping("/messages")
+@Validated
+public class MessagesController {
+
+
+    @Autowired
+    private MessagesService messagesService;
+
+    @ApiOperation(value = "分页查询消息", response = MessagesDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(MessagesDO.class, request.getParameterMap());
+
+        return this.messagesService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加消息", response = MessagesDO.class)
+    @PostMapping
+    public MessagesDO add(@Valid MessagesDO messagesDO) {
+        this.messagesService.add(messagesDO);
+        return messagesDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改消息", response = MessagesDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public MessagesDO edit(@Valid MessagesDO messagesDO, @PathVariable Integer id) {
+        this.messagesService.edit(messagesDO, id);
+        return messagesDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除消息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.messagesService.delete(ids);
+        return "";
+    }
+
+}

+ 77 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/TemplateMessageParamerController.java

@@ -0,0 +1,77 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageParamerDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.TemplateMessageParamerService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:21
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "模版消息参数管理API", tags = "模版消息参数管理API")
+@RequestMapping("/template-message-paramer")
+@Validated
+public class TemplateMessageParamerController {
+
+    @Autowired
+    private TemplateMessageParamerService templateMessageParamerService;
+
+    @ApiOperation(value = "分页查询消息类型", response = TemplateMessageParamerDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(TemplateMessageParamerDO.class, request.getParameterMap());
+
+        return this.templateMessageParamerService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加消息类型", response = TemplateMessageParamerDO.class)
+    @PostMapping
+    public TemplateMessageParamerDO add(@Valid TemplateMessageParamerDO templateMessageParamerDO) {
+        this.templateMessageParamerService.add(templateMessageParamerDO);
+        return templateMessageParamerDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改消息类型", response = TemplateMessageParamerDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public TemplateMessageParamerDO edit(@Valid TemplateMessageParamerDO templateMessageParamerDO, @PathVariable Integer id) {
+        this.templateMessageParamerService.edit(templateMessageParamerDO, id);
+        return templateMessageParamerDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除消息类型")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.templateMessageParamerService.delete(ids);
+        return "";
+    }
+
+}

+ 77 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/controller/TemplateMessageTplController.java

@@ -0,0 +1,77 @@
+package com.wdklian.ncs.ms.message.center.controller;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageTplDO;
+import com.wdklian.ncs.ms.framework.database.Page;
+import com.wdklian.ncs.ms.framework.mvc.GridParameter;
+import com.wdklian.ncs.ms.framework.mvc.GridParameterParser;
+import com.wdklian.ncs.ms.message.center.service.iservice.TemplateMessageTplService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:09
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "模版消息管理API", tags = "模版消息管理API")
+@RequestMapping("/template-message-tpl")
+@Validated
+public class TemplateMessageTplController {
+
+
+    @Autowired
+    private TemplateMessageTplService templateMessageTplService;
+
+    @ApiOperation(value = "分页查询模版消息", response = TemplateMessageTplDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(TemplateMessageTplDO.class, request.getParameterMap());
+
+        return this.templateMessageTplService.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加模版消息", response = TemplateMessageTplDO.class)
+    @PostMapping
+    public TemplateMessageTplDO add(@Valid TemplateMessageTplDO templateMessageTplDO) {
+        this.templateMessageTplService.add(templateMessageTplDO);
+        return templateMessageTplDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改模版消息", response = TemplateMessageTplDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", paramType = "path")})
+    public TemplateMessageTplDO edit(@Valid TemplateMessageTplDO templateMessageTplDO, @PathVariable Integer id) {
+        this.templateMessageTplService.edit(templateMessageTplDO, id);
+        return templateMessageTplDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除模版消息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的消息类型主键列表", required = true, dataType = "int", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.templateMessageTplService.delete(ids);
+        return "";
+    }
+}

+ 24 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageCenterCRUDServiceImpl.java

@@ -0,0 +1,24 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.framework.database.DaoSupport;
+import com.wdklian.ncs.ms.framework.database.impl.AbstractCRUDBaseManagerImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+public class MessageCenterCRUDServiceImpl<T> extends AbstractCRUDBaseManagerImpl<T> {
+
+    @Override
+    @Autowired
+    public void setDaoSupport(@Qualifier("messageCenterDaoSupport") DaoSupport daoSupport) {
+     this.daoSupport=daoSupport;
+    }
+
+
+    @Override
+    @Transactional(value = "messageCenterTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public void delete(Integer[] ids) {
+        super.delete(ids);
+    }
+}

+ 16 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageSendRecordServiceImpl.java

@@ -0,0 +1,16 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendRecordDO;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageSendRecordService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:44
+ * ${description}
+ */
+@Slf4j
+@Service
+public class MessageSendRecordServiceImpl extends MessageCenterCRUDServiceImpl<MessageSendRecordDO> implements MessageSendRecordService {
+}

+ 16 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageSendStrategyServiceImpl.java

@@ -0,0 +1,16 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendStrategyDO;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageSendStrategyService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:06
+ * ${description}
+ */
+@Slf4j
+@Service
+public class MessageSendStrategyServiceImpl extends MessageCenterCRUDServiceImpl<MessageSendStrategyDO> implements MessageSendStrategyService {
+}

+ 31 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessageTypeServiceImpl.java

@@ -0,0 +1,31 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageTypeDO;
+import com.wdklian.ncs.ms.framework.util.DateUtil;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessageTypeService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 14:51
+ * ${description}
+ */
+@Service
+@Slf4j
+public class MessageTypeServiceImpl extends MessageCenterCRUDServiceImpl<MessageTypeDO> implements MessageTypeService {
+
+    @Override
+    public MessageTypeDO add(MessageTypeDO messageTypeDO) {
+        if(messageTypeDO.getCreateTime()==null){
+            messageTypeDO.setCreateTime(DateUtil.getDateline());
+        }
+        return super.add(messageTypeDO);
+    }
+
+    @Override
+    public MessageTypeDO edit(MessageTypeDO messageTypeDO, Integer id) {
+        messageTypeDO.setUpdateTime(DateUtil.getDateline());
+        return super.edit(messageTypeDO, id);
+    }
+}

+ 16 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/MessagesServiceImpl.java

@@ -0,0 +1,16 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessagesDO;
+import com.wdklian.ncs.ms.message.center.service.iservice.MessagesService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:25
+ * ${description}
+ */
+@Slf4j
+@Service
+public class MessagesServiceImpl extends MessageCenterCRUDServiceImpl<MessagesDO> implements MessagesService {
+}

+ 16 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/TemplateMessageParamerServiceImpl.java

@@ -0,0 +1,16 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageParamerDO;
+import com.wdklian.ncs.ms.message.center.service.iservice.TemplateMessageParamerService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:29
+ * ${description}
+ */
+@Slf4j
+@Service
+public class TemplateMessageParamerServiceImpl extends MessageCenterCRUDServiceImpl<TemplateMessageParamerDO> implements TemplateMessageParamerService {
+}

+ 17 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/impl/TemplateMessageTplServiceImpl.java

@@ -0,0 +1,17 @@
+package com.wdklian.ncs.ms.message.center.service.impl;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageTplDO;
+import com.wdklian.ncs.ms.message.center.service.iservice.TemplateMessageTplService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:12
+ * ${description}
+ */
+@Slf4j
+@Service
+public class TemplateMessageTplServiceImpl extends MessageCenterCRUDServiceImpl<TemplateMessageTplDO> implements TemplateMessageTplService {
+
+}

+ 12 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageSendRecordService.java

@@ -0,0 +1,12 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendRecordDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:43
+ * ${description}
+ */
+public interface MessageSendRecordService extends CRUDBaseManager<MessageSendRecordDO> {
+}

+ 12 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageSendStrategyService.java

@@ -0,0 +1,12 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageSendStrategyDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:06
+ * ${description}
+ */
+public interface MessageSendStrategyService extends CRUDBaseManager<MessageSendStrategyDO> {
+}

+ 15 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessageTypeService.java

@@ -0,0 +1,15 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessageTypeDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 14:43
+ * ${description}
+ */
+public interface MessageTypeService extends CRUDBaseManager<MessageTypeDO> {
+
+
+
+}

+ 12 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/MessagesService.java

@@ -0,0 +1,12 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.MessagesDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 16:24
+ * ${description}
+ */
+public interface MessagesService extends CRUDBaseManager<MessagesDO> {
+}

+ 12 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/TemplateMessageParamerService.java

@@ -0,0 +1,12 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageParamerDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:28
+ * ${description}
+ */
+public interface TemplateMessageParamerService extends CRUDBaseManager<TemplateMessageParamerDO> {
+}

+ 12 - 0
ncs-message-center/src/main/java/com/wdklian/ncs/ms/message/center/service/iservice/TemplateMessageTplService.java

@@ -0,0 +1,12 @@
+package com.wdklian.ncs.ms.message.center.service.iservice;
+
+import com.wdklian.ncs.ms.common.entity.msgcenter.dos.TemplateMessageTplDO;
+import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-08 17:11
+ * ${description}
+ */
+public interface TemplateMessageTplService extends CRUDBaseManager<TemplateMessageTplDO> {
+}

+ 58 - 0
ncs-message-center/src/main/resources/bootstrap.yml

@@ -0,0 +1,58 @@
+spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+  main:
+    allow-bean-definition-overriding: true
+    allow-circular-references: true
+  cloud:
+    loadbalancer:
+      cache:
+        enabled: true
+      enabled: true
+    nacos:
+      config:
+        server-addr: 192.168.1.198:8848
+        file-extension: yaml
+        username: nacos
+        password: nacos
+        context-path: /nacos
+        shared-configs:
+          - application-common.yaml #公共配置
+      discovery:
+        server-addr: 192.168.1.198:8848
+        username: nacos
+        password: nacos
+        namespace: public
+  config:
+    import: nacos:${spring.application.name}-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}?refresh=true
+  application:
+    name: message-center
+  profiles:
+    active: dev
+server:
+  port: 8033
+
+
+#logging:
+#  config: classpath:logback-wn.xml
+#  level:
+#    com.wdklian.ncs.ms.feignclient.*: debug #开启open-feign调用日志
+#ribbon:
+#  MaxAutoRetries: 2
+#  MaxAutoRetriesNextServer: 3
+#  OkToRetryOnAllOperations: false
+
+
+#graylog:
+#  host: 192.168.1.198
+#  port: 12201
+#
+#feign:
+#  client:
+#    config:
+#      default:
+#        retryer: com.wdklian.ncs.ms.retryer.MyRetryer #超时重试配置
+#        ConnectTimeOut: 10000  #open-feign连接超时时长
+#        ReadTimeOut: 10000 #open-feign读超时时长
+#        loggerLevel: FULL #必须设置为FULL才会打印open-fegin请求日志

+ 8 - 0
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/open/NursingMarkCategoryConfigFeignClient.java

@@ -3,6 +3,7 @@ package com.wdklian.ncs.ms.feignclient.open;
 import com.wdklian.ncs.ms.common.entity.open.dos.NursingMarkCategoryConfigDO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NurseCascaderVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
+import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
 import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.EnableFeignClients;
@@ -46,4 +47,11 @@ public interface NursingMarkCategoryConfigFeignClient {
 
     @GetMapping(value = "/auto-match-category/{part_id}")
     CommonResult<List<NursingMarkCategoryConfigDO>> autoChildrenCategory(@PathVariable("part_id") Integer partId);
+
+    @GetMapping(value = "/delete-not-default")
+    CommonResult<Boolean> deleteNotDefault();
+
+    @PostMapping("/force-copy-default")
+    CommonResult<Boolean> forceCopyDefaultToPart(@RequestBody List<ShopDO> shopDOS);
+
 }

+ 4 - 1
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/system/CustomerFeignClient.java

@@ -28,7 +28,7 @@ public interface CustomerFeignClient {
     CommonResult<List<CustomerDO>> syncPatient(@NotEmpty(message = "患者数据不能为空") @RequestBody List<PatientDO> patients);
 
     @PostMapping("/sync-single")
-   CommonResult<List<CustomerDO>> syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") PatientDO patient);
+    CommonResult<List<CustomerDO>> syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") PatientDO patient);
 
     @PostMapping("/patient-out")
     CommonResult<List<CustomerDO>> patientOut(@RequestBody @NotNull(message = "患者信息不能为空") PatientDO patientDO);
@@ -38,4 +38,7 @@ public interface CustomerFeignClient {
 
     @GetMapping("/sync-all")
     CommonResult syncAllPatient();
+
+    @GetMapping("/sync-single/{key}")
+    CommonResult syncSinglePatientByKey(@NotEmpty(message = "患者主键不能为空") @PathVariable("key") String key);
 }

+ 7 - 0
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/system/NursingMarkFeignClient.java

@@ -1,5 +1,6 @@
 package com.wdklian.ncs.ms.feignclient.system;
 
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigOptionDO;
@@ -60,4 +61,10 @@ public interface NursingMarkFeignClient {
     CommonResult<NurseConfigDO> updateNursingConfig(@RequestBody NurseConfigDO nurseConfigDO, @PathVariable("id") Integer id);
 
 
+    @PostMapping("/apply-nursing-mark/{partid}")
+    CommonResult<Boolean> applyNursingMark(@RequestBody List<NursingMarkCategoryConfigVO> nursingMarkCategoryConfigVOS, @PathVariable("partid") Integer partId);
+
+
+
+
 }

+ 25 - 5
ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/controller/NursingMarkCategoryConfigController.java

@@ -4,6 +4,7 @@ import com.wdklian.ncs.ms.common.entity.open.dos.NursingMarkCategoryConfigDO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NurseCascaderVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDisplayDO;
+import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
 import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import com.wdklian.ncs.ms.open.service.iservice.NursingMarkCategoryConfigService;
 import io.swagger.annotations.Api;
@@ -120,6 +121,19 @@ public class NursingMarkCategoryConfigController {
     }
 
 
+    @ApiOperation(value = "删除非默认设置的分类及项目")
+    @GetMapping(value = "/delete-not-default")
+    public CommonResult<Boolean> deleteNotDefault() {
+
+       boolean result = this.nurseCategoryConfigService.deleteNotDefault();
+        if (result) {
+            return CommonResult.success(true);
+        } else {
+            return CommonResult.failed("操作失败!");
+        }
+    }
+
+
     //    @ApiOperation(value = "拷贝默认分类到科室", response = NurseCascaderVO.class, responseContainer = "List")
 //    @PostMapping(value = "/copy-default/{part_id}")
 //    @ApiImplicitParams({
@@ -136,11 +150,17 @@ public class NursingMarkCategoryConfigController {
 //        return this.nurseCategoryConfigService.copyDefaultToPart(categoryIds,partId,true);
 //    }
 //
-//    @ApiOperation(value = "强制拷贝默认分类到科室", response = NurseCascaderVO.class, responseContainer = "List")
-//    @PostMapping(value = "/foce-copy-default")
-//    public JsonResponse forceCopyDefaultToPart() {
-//        return this.nurseCategoryConfigService.foceCopyDefaultToPart();
-//    }
+    @ApiOperation(value = "强制拷贝默认分类到科室")
+    @PostMapping(value = "/force-copy-default")
+    public CommonResult<Boolean> forceCopyDefaultToPart(@RequestBody List<ShopDO> shopDOS) {
+        boolean result = this.nurseCategoryConfigService.forceCopyDefaultToPart(shopDOS);
+        if (result) {
+            return CommonResult.success(true);
+        } else {
+            return CommonResult.failed("操作失败!");
+        }
+
+    }
 //
 //
 //

+ 46 - 38
ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/service/impl/NursingMarkCategoryConfigServiceImpl.java

@@ -12,11 +12,14 @@ import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
 import com.wdklian.ncs.ms.common.utils.MatchConditionAnalysis;
 import com.wdklian.ncs.ms.framework.database.annotation.Table;
 import com.wdklian.ncs.ms.framework.exception.ServiceException;
+import com.wdklian.ncs.ms.framework.util.BeanUtil;
 import com.wdklian.ncs.ms.open.common.ShopHelper;
 import com.wdklian.ncs.ms.open.service.iservice.NursingMarkCategoryConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
@@ -405,32 +408,30 @@ public class NursingMarkCategoryConfigServiceImpl extends OpenPlateformCRUDServi
 //        }
 //        return this.listAutoChildrenCategory(partId);
 //    }
-//todo 解藕模块 此方法应由上层服务调用
+// todo 解藕模块 此方法应由上层服务调用
 //    @Override
 //    @Transactional(value = "translateConfigTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 //    public List copyDefaultToPart(Integer[] categoryIds, Integer partId) {
 //        return this.copyDefaultToPart(categoryIds, partId, false);
 //    }
 
-    //todo 解藕模块 此方法应由上层服务调用
-//    @Override
-//    @Transactional(value = "translateConfigTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-//    public JsonResponse foceCopyDefaultToPart() {
-//        List<NursingMarkCategoryConfigVO> categoryConfigVOS = this.listPartCategory(-1);
-//        List<ShopDO> shopDOS = shopService.listShopByType(ShopTypeEnum.PART);
-//
-//        for (ShopDO shopDO : shopDOS) {
-//            NursingMarkCategoryConfigDO categoryConfigDO = new NursingMarkCategoryConfigDO();
-//            NursingMarkOptionConfigDO optionConfigDO = new NursingMarkOptionConfigDO();
-//            List<NursingMarkCategoryConfigVO> partCategory = this.listPartCategory(shopDO.getShopId());
-//            for (NursingMarkCategoryConfigVO categoryConfigVO : categoryConfigVOS) {
+
+    @Override
+    @Transactional(value = "openPlateformTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean forceCopyDefaultToPart(List<ShopDO> shopDOS) {
+        List<NursingMarkCategoryConfigVO> categoryConfigVOS = this.listPartCategory(-1);
+        this.deleteNotDefault();
+        for (ShopDO shopDO : shopDOS) {
+            NursingMarkCategoryConfigDO categoryConfigDO = new NursingMarkCategoryConfigDO();
+            NursingMarkOptionConfigDO optionConfigDO = new NursingMarkOptionConfigDO();
+            for (NursingMarkCategoryConfigVO categoryConfigVO : categoryConfigVOS) {
 //                NursingMarkCategoryConfigVO sameNameCategory = partCategory.stream().filter(p -> StrUtil.isNotEmpty(p.getNameMd5()) && p.getNameMd5().equalsIgnoreCase(categoryConfigVO.getNameMd5())).findFirst().orElse(null);
 //                if (sameNameCategory != null && !categoryConfigVO.getId().equals(sameNameCategory.getCopyFrom())) { //存在同名分类,但不是从categoryConfigVO拷贝而来,删除这个项目及其子项
 //                    this.deleteById(sameNameCategory.getId());
 //                    partCategory.remove(sameNameCategory);
 //                }
 //                NursingMarkCategoryConfigVO copyFrom = partCategory.stream().filter(p -> p.getCopyFrom() != null && p.getCopyFrom().equals(categoryConfigVO.getId()) && p.getForPartId() != null && p.getForPartId().equals(shopDO.getShopId())).findFirst().orElse(null);
-//                List<NursingMarkOptionConfigDO> copyChild = new ArrayList<>();
+                List<NursingMarkOptionConfigDO> copyChild = new ArrayList<>();
 //                if (copyFrom != null) {
 //                    copyChild = copyFrom.getChild();
 //                    BeanUtil.copyProperties(copyFrom, categoryConfigDO);
@@ -440,25 +441,25 @@ public class NursingMarkCategoryConfigServiceImpl extends OpenPlateformCRUDServi
 //                    categoryConfigDO.setForPartId(shopDO.getShopId());
 //                    categoryConfigDO = this.edit(categoryConfigDO, categoryConfigDO.getId());
 //                } else {
-//                    BeanUtil.copyProperties(categoryConfigVO, categoryConfigDO);
-//                    categoryConfigDO.setCopyFrom(categoryConfigVO.getId());
-//                    categoryConfigDO.setForPartId(shopDO.getShopId());
-//                    categoryConfigDO.setId(null);
-//                    categoryConfigDO = this.add(categoryConfigDO);
-//
+                    BeanUtil.copyProperties(categoryConfigVO, categoryConfigDO);
+                    categoryConfigDO.setCopyFrom(categoryConfigVO.getId());
+                    categoryConfigDO.setForPartId(shopDO.getShopId());
+                    categoryConfigDO.setId(null);
+                    categoryConfigDO = this.add(categoryConfigDO);
+
 //                }
-//                List<NursingMarkOptionConfigDO> child = categoryConfigVO.getChild();
-//                if (child != null && child.size() > 0) {
-//                    for (NursingMarkOptionConfigDO nursingMarkOptionConfigDO : child) {
+                List<NursingMarkOptionConfigDO> child = categoryConfigVO.getChild();
+                if (child != null && child.size() > 0) {
+                    for (NursingMarkOptionConfigDO nursingMarkOptionConfigDO : child) {
 //                        NursingMarkOptionConfigDO optionConfigDO1 = copyChild.stream().filter(p -> p.getCopyFrom() != null && p.getCopyFrom().equals(nursingMarkOptionConfigDO.getId()) && p.getForPartId() != null && p.getForPartId().equals(shopDO.getShopId())).findFirst().orElse(null);
 //                        if (optionConfigDO1 == null) {
-//
-//                            BeanUtil.copyProperties(nursingMarkOptionConfigDO, optionConfigDO);
-//                            optionConfigDO.setCategoryId(categoryConfigDO.getId());
-//                            optionConfigDO.setCopyFrom(nursingMarkOptionConfigDO.getId());
-//                            optionConfigDO.setForPartId(shopDO.getShopId());
-//                            optionConfigDO.setId(null);
-//                            this.daoSupport.insert(optionConfigDO);
+
+                            BeanUtil.copyProperties(nursingMarkOptionConfigDO, optionConfigDO);
+                            optionConfigDO.setCategoryId(categoryConfigDO.getId());
+                            optionConfigDO.setCopyFrom(nursingMarkOptionConfigDO.getId());
+                            optionConfigDO.setForPartId(shopDO.getShopId());
+                            optionConfigDO.setId(null);
+                            this.daoSupport.insert(optionConfigDO);
 //                        } else {
 //                            BeanUtil.copyProperties(optionConfigDO1, optionConfigDO);
 //                            BeanUtil.copyProperties(nursingMarkOptionConfigDO, optionConfigDO);
@@ -468,14 +469,14 @@ public class NursingMarkCategoryConfigServiceImpl extends OpenPlateformCRUDServi
 //                            optionConfigDO.setForPartId(shopDO.getShopId());
 //                            this.daoSupport.update(optionConfigDO, optionConfigDO.getId());
 //                        }
-//
-//                    }
-//                }
-//            }
-//        }
-//
-//        return JsonResponse.successResponse();
-//    }
+
+                    }
+                }
+            }
+        }
+
+        return true;
+    }
 
     @Override
     public NursingMarkCategoryConfigDO getPartNursingMarkCategoryByNameMd5(String categoryName, Integer forPartId) {
@@ -639,4 +640,11 @@ public class NursingMarkCategoryConfigServiceImpl extends OpenPlateformCRUDServi
         }
     }
 
+
+    @Override
+    public boolean deleteNotDefault() {
+
+        String sql = "delete  c, o from "+NursingMarkCategoryConfigDO.class.getAnnotation(Table.class).name()+" c left join "+NursingMarkOptionConfigDO.class.getAnnotation(Table.class).name()+" o on c.id=o.category_id where c.for_part_id<>-1";
+        return this.daoSupport.execute(sql)>0;
+    }
 }

+ 10 - 1
ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/service/iservice/NursingMarkCategoryConfigService.java

@@ -97,7 +97,16 @@ public interface NursingMarkCategoryConfigService extends CRUDBaseManager<Nursin
 //
 //    List copyDefaultToPart(Integer[] categoryIds, Integer partId);
 
-//    JsonResponse foceCopyDefaultToPart();
+    boolean forceCopyDefaultToPart(List<ShopDO> shopDOS);
 
     NursingMarkCategoryConfigDO getPartNursingMarkCategoryByNameMd5(String categoryName, Integer forPartId);
+    /**
+     * 删除非默认设置的护理标识分类及项目设置
+     *
+     * @date 2024-04-10 12:15
+     * @author wuyunfeng
+     * @param
+     * @return {@link boolean}
+     */
+    boolean deleteNotDefault();
 }

+ 9 - 1
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/controller/NursingMarkController.java

@@ -1,5 +1,6 @@
 package com.wdklian.ncs.ms.system.controller;
 
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigOptionDO;
@@ -52,7 +53,7 @@ public class NursingMarkController {
     @PostMapping("/renew-by-his-part-keys")
     @ApiOperation(value = "更新指定科室中患者的护理信息", response = CustomerDO.class, responseContainer = "list")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "ids", value = "科室主键列表", required = true, dataType = "JSONObject", paramType = "body")
+            @ApiImplicitParam(name = "keys", value = "科室主键列表", required = true, dataType = "JSONObject", paramType = "body")
     })
     public CommonResult<List<CustomerDO>> renewDepartNursingByHisPartKeys(@NotEmpty(message = "科室主键列表不能为空") @RequestBody List<String> keys) {
         List<CustomerDO> customers = nurseConfigService.renewDePartments(keys);
@@ -134,4 +135,11 @@ public class NursingMarkController {
         return CommonResult.success(nurseConfigService.edit(nurseConfigDO, id));
     }
 
+
+    @PostMapping("/apply-nursing-mark/{partid}")
+    @ApiOperation(value = "应用科室护理标识设置", response = NurseConfigOptionDO.class)
+    public CommonResult<Boolean> applyNursingMark(@RequestBody List<NursingMarkCategoryConfigVO> nursingMarkCategoryConfigVOS,@PathVariable("partid") Integer partId) {
+        return CommonResult.success(nurseConfigService.applyNursingMark(nursingMarkCategoryConfigVOS,partId));
+    }
+
 }

+ 7 - 0
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerMappingServiceImpl.java

@@ -73,4 +73,11 @@ public class CustomerMappingServiceImpl extends SystemCRUDManagerImpl<CustomerMa
         String sql="delete from "+CustomerMappingDO.class.getAnnotation(Table.class).name()+" where customer_id=?";
         this.daoSupport.execute(sql,customerId);
     }
+
+
+    @Override
+    public void deleteNursingMarkMapping() {
+        String sql="delete from "+CustomerMappingDO.class.getAnnotation(Table.class).name()+" where nurse_config_option_id is not null";
+        this.daoSupport.execute(sql);
+    }
 }

+ 1 - 1
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerServiceImpl.java

@@ -516,7 +516,7 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
 
     private MemberDO updateMember(PatientDO patient, MemberDO memberDO) {
         memberDO.setSex(StringHelper.parseSex(patient.getSex()));
-        memberDO.setMobile(patient.getKeyval());
+        memberDO.setMobile(StrUtil.emptyToDefault(patient.getMobile(),patient.getKeyval()));
         memberDO.setTrueName(patient.getName());
         memberDO.setNickname(patient.getName());
         return memberDO;

+ 14 - 15
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigOptionServiceImpl.java

@@ -5,15 +5,21 @@ import cn.hutool.core.util.StrUtil;
 
 
 import com.wdklian.ncs.ms.common.entity.open.dos.DoctorAdviceDO;
+import com.wdklian.ncs.ms.common.entity.open.dos.NursingMarkOptionConfigDO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkCategoryVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkOptionVO;
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkOptionConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigOptionDO;
+import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
 import com.wdklian.ncs.ms.common.entity.system.vos.CustomerNurseConfigMappingVO;
 import com.wdklian.ncs.ms.common.entity.system.vos.NurseOptionCompareVO;
+import com.wdklian.ncs.ms.common.enums.ShopTypeEnum;
 import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import com.wdklian.ncs.ms.framework.mvc.JsonResponse;
+import com.wdklian.ncs.ms.framework.util.StringUtil;
 import com.wdklian.ncs.ms.system.service.iservice.CustomerMappingService;
 import com.wdklian.ncs.ms.system.service.iservice.NurseConfigOptionService;
 import lombok.extern.slf4j.Slf4j;
@@ -43,20 +49,6 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
     private CustomerMappingService customerMappingService;
 
 
-    @Override
-    public void removeDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS) {
-
-    }
-
-    @Override
-    public void updateDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS) {
-
-    }
-
-    @Override
-    public void insertDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS) {
-
-    }
 
 
     @Override
@@ -185,7 +177,7 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
             }
 
 
-        }).filter(p -> p != null).collect(Collectors.toList());
+        }).filter(p -> p != null).distinct().collect(Collectors.toList());
     }
 
     @Override
@@ -199,6 +191,11 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
         this.daoSupport.batchUpdate(sql);
     }
 
+    @Override
+    public void truncateTable(){
+        String sql = "truncate table " + NurseConfigOptionDO.class.getAnnotation(Table.class).name();
+        this.daoSupport.execute(sql);
+    }
 
     /**
      * 把用户的护理信息转换成可比对的对象列表(NurseOptionCompareVO)
@@ -277,4 +274,6 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
         add.setId(lastId);
         return add;
     }
+
+
 }

+ 142 - 9
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigServiceImpl.java

@@ -2,23 +2,24 @@ package com.wdklian.ncs.ms.system.service.impl;
 
 import cn.hutool.core.lang.ObjectId;
 import cn.hutool.core.util.StrUtil;
+import com.wdklian.ncs.ms.common.entity.open.dos.NursingMarkOptionConfigDO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkCategoryVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkOptionVO;
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkOptionConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigOptionDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
+import com.wdklian.ncs.ms.common.enums.ShopTypeEnum;
 import com.wdklian.ncs.ms.feignclient.open.DoctorAdviceFeignClient;
 import com.wdklian.ncs.ms.feignclient.open.NursingMarkOptionConfigFeignClient;
 import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import com.wdklian.ncs.ms.framework.mvc.JsonResponse;
 import com.wdklian.ncs.ms.framework.util.DateUtil;
 import com.wdklian.ncs.ms.framework.util.StringUtil;
 import com.wdklian.ncs.ms.system.common.DoctorAdviceHelper;
-import com.wdklian.ncs.ms.system.service.iservice.CustomerService;
-import com.wdklian.ncs.ms.system.service.iservice.NurseConfigOptionService;
-import com.wdklian.ncs.ms.system.service.iservice.NurseConfigService;
-import com.wdklian.ncs.ms.system.service.iservice.ShopService;
+import com.wdklian.ncs.ms.system.service.iservice.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -74,6 +75,9 @@ public class NurseConfigServiceImpl extends SystemCRUDManagerImpl<NurseConfigDO>
     @Autowired
     private NursingMarkOptionConfigFeignClient nursingMarkOptionConfigFeignClient;
 
+    @Autowired
+    private CustomerMappingService customerMappingService;
+
 
 
     @Override
@@ -121,11 +125,13 @@ public class NurseConfigServiceImpl extends SystemCRUDManagerImpl<NurseConfigDO>
                                 nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
                                 this.nurseConfigOptionService.add(nurseConfigOptionDO);
                             } else {
-                                nurseConfigOptionDO.setUpdateTime(DateUtil.getDateline());
-                                nurseConfigOptionDO.setOptionName(StrUtil.trim(optionName));
-                                nurseConfigOptionDO.setColorRgb(optionGroup.get(optionName).get(0).getBgColor().replace("#", ""));
-                                nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
-                                this.nurseConfigOptionService.edit(nurseConfigOptionDO, nurseConfigOptionDO.getId());
+                                String color = optionGroup.get(optionName).get(0).getBgColor().replace("#", "");
+                                if(StrUtil.isNotEmpty(color)&&!color.equalsIgnoreCase(nurseConfigOptionDO.getColorRgb())) { //颜色改变,更新项目颜色,名称一定是一样的
+                                    nurseConfigOptionDO.setUpdateTime(DateUtil.getDateline());
+                                    nurseConfigOptionDO.setColorRgb(color);
+                                    nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
+                                    this.nurseConfigOptionService.edit(nurseConfigOptionDO, nurseConfigOptionDO.getId());
+                                }
                             }
                         }
                     }
@@ -242,4 +248,131 @@ public class NurseConfigServiceImpl extends SystemCRUDManagerImpl<NurseConfigDO>
         add.setId(lastId);
         return add;
     }
+   @Override
+    public void truncateTable(){
+        String sql = "truncate table " + NurseConfigDO.class.getAnnotation(Table.class).name();
+        this.daoSupport.execute(sql);
+    }
+
+
+
+
+    @Override
+    @Transactional(value = "systemTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public Boolean applyNursingMark(List<NursingMarkCategoryConfigVO> list, Integer partId) {
+//        List<NursingMarkCategoryConfigVO> list = this.categoryConfigFeignClient.listAll().getData();
+//        //所有床头屏医嘱分类
+//        List<NurseConfigDO> nurseConfigDOS = this.listAll();
+//        //所有床头屏医嘱分类的选项
+//        List<NurseConfigOptionDO> nurseConfigOptionDOS = this.nurseConfigOptionService.listAll();
+        //要处理的科室列表
+        List<ShopDO> shops = new ArrayList<>();
+        if (partId.equals(-1)) {
+            shops.addAll(this.shopService.listShopByType(ShopTypeEnum.PART));
+        } else {
+            shops.add(this.shopService.getModel(partId));
+        }
+        //清空所有设置项目,重新生成
+        this.truncateTable();
+        this.nurseConfigOptionService.truncateTable();
+        this.customerMappingService.deleteNursingMarkMapping();
+
+        if (list.size() > 0) {
+            //删除已经在配置中不存在的床头屏医嘱分类
+//            String deleteOptionsSqlTpl = "delete from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " where find_in_set(MD5(option_name),'%s')=0 and ncfg_id =%d";
+
+
+            for (NursingMarkCategoryConfigVO screenAdviceCategoryVO : list) {
+                for (ShopDO shop : shops) {
+//                    List<String> clearOptionsSql = new ArrayList<>();
+                    //删掉已存在的但是配置中没有的记录
+//                    String categoryNamesMd5 = list.stream().filter(p -> p.getForPartId().equals(shop.getShopId())).map(p -> p.getNameMd5()).collect(Collectors.joining(","));
+                    if (screenAdviceCategoryVO.getForPartId().equals(shop.getShopId())) { //本科室的分类
+//                        List<NurseConfigDO> partNurseConfigDOs = nurseConfigDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
+//                        List<NurseConfigOptionDO> partOptionDOS = nurseConfigOptionDOS.stream().filter(p -> p.getPartId().equals(shop.getShopId())).collect(Collectors.toList());
+                        //同步分类
+                        NurseConfigDO nurseConfigDO = this.syncPartScreenAdviceCategory(screenAdviceCategoryVO, shop);
+                        List<NursingMarkOptionConfigDO> child = screenAdviceCategoryVO.getChild();
+                        if (!screenAdviceCategoryVO.getBoolAuto() && child != null && child.size() > 0) {
+                            List<NursingMarkOptionConfigDO> partScreenAdviceItemSettingDOs = child.stream().filter(p -> !StringUtil.isEmpty(p.getItemNameMd5()) && p.getForPartId().equals(shop.getShopId())).collect(Collectors.toList());
+//                            String optionsNameMd5s = partScreenAdviceItemSettingDOs.stream().map(p -> p.getItemNameMd5()).collect(Collectors.joining(","));
+//                            String formatSql = String.format(deleteOptionsSqlTpl, optionsNameMd5s, nurseConfigDO.getId());
+//                            clearOptionsSql.add(formatSql);
+                            for (NursingMarkOptionConfigDO settingDO : partScreenAdviceItemSettingDOs) {
+                                this.syncPartScreenAdviceItem(settingDO, nurseConfigDO);
+                            }
+                        }
+                    }
+                }
+                    //删除配置中没有的分类,及其选项
+//                    String sqlNurseConfigClear = " delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id  where not find_in_set(MD5(config.config_name),'" + categoryNamesMd5 + "') and config.part_id =" + shop.getShopId();
+                    //反向删除找不到分类的项目,由于更新用户护理项时是删除重建,这里可以不删除用户护理项mapping记录
+//                    String sqlNurseConfigOptionClear = "delete op from " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op left join " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config on config.id=op.ncfg_id where config.id is null ";
+//                    clearOptionsSql.add(sqlNurseConfigClear);
+//                    clearOptionsSql.add(sqlNurseConfigOptionClear);
+                    //清理已经不在设置中的分类和选项
+//                    if (clearOptionsSql.size() > 0) {
+//                        this.nursingMarkFeignClient.batchUpdate(clearOptionsSql.toArray(new String[clearOptionsSql.size()]));
+//                    }
+                }
+
+
+        }
+//        else { //清空配置
+//            List<String> clearConfigSqls = new ArrayList<>();
+//            for (ShopDO shop : shops) {
+//                String sql = "delete config,op from " + NurseConfigDO.class.getAnnotation(Table.class).name() + " as config left join " + NurseConfigOptionDO.class.getAnnotation(Table.class).name() + " as op on config.id=op.ncfg_id where config.part_id =" + shop.getShopId();
+//                clearConfigSqls.add(sql);
+//            }
+//            if (clearConfigSqls.size() > 0) {
+//                this.nursingMarkFeignClient.batchUpdate(clearConfigSqls.toArray(new String[clearConfigSqls.size()]));
+//            }
+//        }
+//        return JsonResponse.successResponse(list);
+
+        return true;
+    }
+
+
+    //应用指定科室的指定床头屏医嘱分类
+    private NurseConfigDO syncPartScreenAdviceCategory(NursingMarkCategoryConfigVO screenAdviceCategoryVO, ShopDO shop) {
+
+//        NurseConfigDO nurseConfigDO = partNurseConfigDOs.stream().filter(p -> StringUtil.md5(p.getConfigName()).equalsIgnoreCase(screenAdviceCategoryVO.getNameMd5())).findFirst().orElse(null);
+
+        NurseConfigDO nurseConfigDO = new NurseConfigDO();
+            nurseConfigDO.setPartId(shop.getShopId());
+            nurseConfigDO.setConfigName(screenAdviceCategoryVO.getCategoryName());
+            nurseConfigDO.setUnionId(ObjectId.next());
+            nurseConfigDO.setBoolCritical(screenAdviceCategoryVO.getCritical());
+            nurseConfigDO.setIndexNo(screenAdviceCategoryVO.getIndexNo());
+            nurseConfigDO.setDefaultColor(screenAdviceCategoryVO.getDefaultColor().replace("#", ""));
+            nurseConfigDO.setBoolManual(screenAdviceCategoryVO.getBoolManual());
+            nurseConfigDO= this.add(nurseConfigDO);
+        return nurseConfigDO;
+    }
+
+
+    //同步应用床头屏医嘱分类选择项
+    private void syncPartScreenAdviceItem(NursingMarkOptionConfigDO settingDO, NurseConfigDO nurseConfigDO) {
+        //查询是否存在与设置对应的项目
+//        NurseConfigOptionDO nurseConfigOptionDO = partOptionDOS.stream().filter(p -> !StringUtil.isEmpty(p.getOptionName()) &&
+//                StringUtil.md5(p.getOptionName()).equalsIgnoreCase(settingDO.getItemNameMd5()) && p.getNcfgId().equals(nurseConfigDO.getId())).findFirst().orElse(null);
+//        if (nurseConfigOptionDO == null) {
+            NurseConfigOptionDO nurseConfigOptionDO = new NurseConfigOptionDO();
+            nurseConfigOptionDO.setCreateTime(DateUtil.getDateline());
+            nurseConfigOptionDO.setNcfgId(nurseConfigDO.getId());
+            nurseConfigOptionDO.setUnionId(ObjectId.next());
+            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
+            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
+            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
+            this.nurseConfigOptionService.add(nurseConfigOptionDO);
+//        } else {
+//            nurseConfigOptionDO.setUpdateTime(DateUtil.getDateline());
+//            nurseConfigOptionDO.setOptionName(settingDO.getItemName());
+//            nurseConfigOptionDO.setColorRgb(settingDO.getColor().replace("#", ""));
+//            nurseConfigOptionDO.setPartId(nurseConfigDO.getPartId());
+//            this.nursingMarkFeignClient.updateNursingOptionConfig(nurseConfigOptionDO, nurseConfigOptionDO.getId());
+//        }
+    }
+
 }

+ 2 - 0
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/CustomerMappingService.java

@@ -33,4 +33,6 @@ public interface CustomerMappingService extends CRUDBaseManager<CustomerMappingD
      * @return
      */
     void clearCustomerMapping(Integer customer);
+
+    void deleteNursingMarkMapping();
 }

+ 4 - 30
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/NurseConfigOptionService.java

@@ -1,14 +1,13 @@
 package com.wdklian.ncs.ms.system.service.iservice;
 
 
-import com.wdklian.ncs.ms.common.entity.open.dos.DoctorAdviceDO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkCategoryVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkOptionVO;
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkOptionConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigOptionDO;
-
 import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
 
 import java.util.List;
@@ -19,35 +18,7 @@ import java.util.List;
  * ${description}
  */
 public interface NurseConfigOptionService extends CRUDBaseManager<NurseConfigOptionDO> {
-    /**
-     * 响应医嘱信息删除变化
-     *
-     * @param doctorAdviceDOS
-     * @return
-     * @date 2023-11-14 18:33
-     * @author wuyunfeng
-     */
-    void removeDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS);
 
-    /**
-     * 响应医嘱更新
-     *
-     * @param doctorAdviceDOS
-     * @return
-     * @date 2023-11-14 18:34
-     * @author wuyunfeng
-     */
-    void updateDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS);
-
-    /**
-     * 医嘱插入
-     *
-     * @param doctorAdviceDOS
-     * @return
-     * @date 2023-11-14 18:36
-     * @author wuyunfeng
-     */
-    void insertDoctorAdvice(List<DoctorAdviceDO> doctorAdviceDOS);
 
     List<NurseConfigOptionDO> listPartNurseConfigOption(Integer partId);
 
@@ -82,4 +53,7 @@ public interface NurseConfigOptionService extends CRUDBaseManager<NurseConfigOpt
     List<NurseConfigOptionDO> listAll();
 
     void batchUpdate(String[] sql);
+
+
+    void truncateTable();
 }

+ 5 - 0
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/NurseConfigService.java

@@ -2,6 +2,7 @@ package com.wdklian.ncs.ms.system.service.iservice;
 
 
 import com.wdklian.ncs.ms.common.entity.open.vos.DoctorAdviceMatchNursingMarkCategoryVO;
+import com.wdklian.ncs.ms.common.entity.open.vos.NursingMarkCategoryConfigVO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.NurseConfigDO;
 import com.wdklian.ncs.ms.framework.database.CRUDBaseManager;
@@ -38,4 +39,8 @@ public interface NurseConfigService extends CRUDBaseManager<NurseConfigDO> {
 
     //
     void handleAutoNurseOption(List<DoctorAdviceMatchNursingMarkCategoryVO> doctorAdviceCategoryVOS, Integer partId);
+
+    void truncateTable();
+
+    Boolean applyNursingMark(List<NursingMarkCategoryConfigVO> nursingMarkCategoryConfigVOS, Integer partId);
 }

+ 1 - 0
pom.xml

@@ -27,6 +27,7 @@
         <module>ncs-system-service</module>
         <module>ncs-ms-feign</module>
         <module>ncs-entrace-service</module>
+        <module>ncs-message-center</module>
     </modules>
 
 

+ 47 - 0
synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/controller/DataRefreshController.java

@@ -0,0 +1,47 @@
+package com.wdklian.ncs.ms.scheduled.controller;
+
+import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
+import com.wdklian.ncs.ms.scheduled.service.DataBaseSyncService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2024-04-10 10:37
+ * ${description}
+ */
+@RestController
+@Slf4j
+@Api(description = "患者信息即时同步刷新", tags = "患者信息即时同步刷新")
+@RequestMapping("/data-refresh")
+@Validated
+public class DataRefreshController {
+
+
+    @Autowired
+    private DataBaseSyncService dataBaseSyncService;
+
+    @GetMapping("/{patientkey}")
+    @ApiOperation(value = "即时同步单个患者信息", response = CustomerDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "patientkey", value = "患者主键", required = true, dataType = "string", paramType = "path")
+    })
+    public CommonResult refreshPatient(@NotNull(message = "patientkey") @PathVariable("patientkey") String patientKey) {
+
+      return  dataBaseSyncService.syncSinglePatient(patientKey);
+
+    }
+
+}

+ 24 - 4
synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/service/DataBaseSyncService.java

@@ -4,6 +4,7 @@ package com.wdklian.ncs.ms.scheduled.service;
 import com.wdklian.ncs.ms.feignclient.system.CustomerFeignClient;
 import com.wdklian.ncs.ms.framework.config.TaskSchedule;
 import com.wdklian.ncs.ms.framework.database.DaoSupport;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -15,6 +16,8 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author wuyunfeng
@@ -62,11 +65,11 @@ public class DataBaseSyncService {
      * @author wuyunfeng
      */
 
-    public void syncViewData(String[] jobJson) {
+    public void syncViewData(String[] jobJson, Map<String,String> params) {
         try {
             if (jobJson != null) {
                 for (String s : jobJson) {
-                    DataxEngineHelper.entry(s, homePath);
+                    DataxEngineHelper.entry(s, homePath,params);
                 }
 
             }
@@ -94,7 +97,10 @@ public class DataBaseSyncService {
         if (dataxSyncEnable) {
             Runnable syncPatientRunnable = () -> {
                 //同步数据
-                this.syncViewData(patientJob);
+                Map<String,String> params = new HashMap<>();
+                params.put("adviceWhere","1=1");
+                params.put("patientWhere","1=1");
+                this.syncViewData(patientJob,params);
                 //更新到呼叫系统
                 customerFeignClient.syncAllPatient();
                 //处理open数据
@@ -106,7 +112,7 @@ public class DataBaseSyncService {
             this.taskSchedule.scheduleTask("SYNC_PATIENT_DOCTORADVICE", syncPatientRunnable, triggerPatient);
 
             Runnable syncDepartRunnable = () -> {
-                this.syncViewData(departmentJob);
+                this.syncViewData(departmentJob,null);
             };
             new Thread(syncDepartRunnable).start();
             Trigger triggerDepart = triggerContext -> new CronTrigger(dataxSyncDepartPeriod).nextExecutionTime(triggerContext);
@@ -114,4 +120,18 @@ public class DataBaseSyncService {
         }
 
     }
+
+    public CommonResult syncSinglePatient(String patientKey) {
+
+        Runnable syncPatientRunnable = () -> {
+            Map<String,String> params = new HashMap<>();
+            params.put("adviceWhere","patient_key='"+patientKey+"'");
+            params.put("patientWhere","keyval='"+patientKey+"'");
+            this.syncViewData(patientJob,params);
+            //更新到呼叫系统
+            customerFeignClient.syncSinglePatientByKey(patientKey);
+        };
+        new Thread(syncPatientRunnable).start();
+       return CommonResult.success("");
+    }
 }

+ 10 - 2
synchrony-scheduled-task/src/main/java/com/wdklian/ncs/ms/scheduled/service/DataxEngineHelper.java

@@ -4,18 +4,26 @@ import com.alibaba.datax.core.Engine;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
+import java.util.Map;
+
 @Component
 @Slf4j
 public class DataxEngineHelper {
     /**
      * datax任务引擎
-     * @param jobJson   json配置文件路径
+     *
+     * @param jobJson json配置文件路径
      * @throws Throwable
      */
 
 
-    public static void entry(String jobJson,String homePath) throws Throwable {
+    public static void entry(String jobJson, String homePath, Map<String, String> params) throws Throwable {
         DataxHomePathUtil.setDataxHomePath(homePath);
+        if (params != null) {
+            for (Map.Entry<String, String> entry : params.entrySet()) {
+                System.setProperty(entry.getKey(), entry.getValue());
+            }
+        }
         String[] datxArgs2 = {"-job", jobJson, "-mode", "standalone", "-jobid", "-1"};
         Engine.entry(datxArgs2);
     }

+ 1 - 1
synchrony-scheduled-task/src/main/resources/bootstrap.yml

@@ -5,7 +5,7 @@ spring:
   main:
     allow-bean-definition-overriding: true
     allow-circular-references: true
-    web-application-type: none
+#    web-application-type: none
   cloud:
     loadbalancer:
       cache:

+ 27 - 6
third-part-wn-hl7/src/main/java/com/wdklian/ncs/ms/wn/hl7/config/MyHL7BusinessLogicService.java

@@ -49,7 +49,7 @@ public class MyHL7BusinessLogicService {
     public Message handleA19(Message msg) throws Exception {
 
         if (msg instanceof QRY_A19) {
-            // do processing
+            // dos processing
         }
         return msg;
     }
@@ -141,22 +141,36 @@ public class MyHL7BusinessLogicService {
 
                     }
                     //处理患者信息,根据缓存数据判定是否需要提交到数据库更新
-                    if (patient != null&&StrUtil.isNotEmpty(patient.getBedNo())) {
+                    if (patient != null) {
                         if (StrUtil.isEmpty(patient.getBedNo())) {
                             Object o = cache.get(patientKey);
                             if (o != null) {
                                 patient.setBedNo(o.toString());
                             }
                         }
+
+                       if(StrUtil.isEmpty(patient.getBedNo())){ //防止接口报错
+                           return;
+                       }
+                       //患者再次入院重选分床,要把患者上次的出院日期清除,否则会认为已出院,同步不了
+                        if(StrUtil.isNotEmpty(patient.getOutdate())&&"1".equalsIgnoreCase(status)){
+                            patient.setOutdate(null);
+                        }
                         if (cachePatient == null) { //没有缓存,表明患者信息未保存,超过5天没有操作。
+                            if(StrUtil.isEmpty(patient.getStatus())){ //此次消息患者状态为null,不作处理,无法明确患者状态
+                               return;
+                            }
                             entracePatientFeignClient.syncSinglePatient(patient);
-                            cache.put("PATIENT_" + patientKey, patient, 5 * 24 * 60 * 60);
+                            cache.put("PATIENT_" + patientKey, patient, 10 * 24 * 60 * 60);
                         } else { //只有患者信息有变化时才更新,减少数据库访问次数
                             PatientDO patientOld = (PatientDO) cachePatient;
+                            if(StrUtil.isEmpty(patient.getStatus())){ //此次消息患者状态为null,从缓存中获取
+                                patient.setStatus(patientOld.getStatus());
+                            }
                             if (!ObjectUtil.equal(patient, patientOld)) {
                                 entracePatientFeignClient.syncSinglePatient(patient);
                                 //重新缓存
-                                cache.put("PATIENT_" + patientKey, patient, 5 * 24 * 60 * 60);
+                                cache.put("PATIENT_" + patientKey, patient, 10 * 24 * 60 * 60);
                             }
                         }
                     }
@@ -283,10 +297,17 @@ public class MyHL7BusinessLogicService {
 
     private String statusDecode(String state) {
         switch (state) {
-            case "3":
+            case "2": //出区
+            case "3": //出院
+            case "7": //转科状态
+            case "8": //数据转出
                 return "1";
-            default:
+            case "1": //病区分床
+            case "5":
+            case "6":
                 return "0";
+            default: //其他状态 根据原来的状态处理
+                return null;
         }
     }
 

+ 123 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageSendRecordDO.java

@@ -0,0 +1,123 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Table(name = "message_send_record")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MessageSendRecordDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 发送时间
+     */
+    @Column(name = "send_time")
+    @ApiModelProperty(value = "发送时间", required = false)
+    private Long sendTime;
+    /**
+     * 发送方式、自动、手动
+     */
+    @Column(name = "send_mode")
+    @ApiModelProperty(value = "发送方式、自动、手动", required = false)
+    private String sendMode;
+    /**
+     * 消息id
+     */
+    @Column(name = "message_id")
+    @ApiModelProperty(value = "消息id", required = false)
+    private Integer messageId;
+    /**
+     * 接收者id
+     */
+    @Column(name = "to_customer_id")
+    @ApiModelProperty(value = "接收者id", required = false)
+    private Integer toCustomerId;
+    /**
+     * 是否已接收
+     */
+    @Column(name = "bool_received")
+    @ApiModelProperty(value = "是否已接收", required = false)
+    private Boolean boolReceived;
+    /**
+     * 是否已读
+     */
+    @Column(name = "bool_readed")
+    @ApiModelProperty(value = "是否已读", required = false)
+    private Boolean boolReaded;
+    /**
+     * 是否发送成功
+     */
+    @Column(name = "bool_sended")
+    @ApiModelProperty(value = "是否发送成功", required = false)
+    private Boolean boolSended;
+    /**
+     * 重发时间
+     */
+    @Column(name = "resend_time")
+    @ApiModelProperty(value = "重发时间", required = false)
+    private Long resendTime;
+    /**
+     * 消息类型id
+     */
+    @Column(name = "message_type_id")
+    @ApiModelProperty(value = "消息类型id", required = false)
+    private Integer messageTypeId;
+    /**
+     * 消息打开方式
+     */
+    @Column(name = "open_type")
+    @ApiModelProperty(value = "消息打开方式", required = false)
+    private String openType;
+    /**
+     * 是否为模板消息
+     */
+    @Column(name = "bool_template_mesage")
+    @ApiModelProperty(value = "是否为模板消息", required = false)
+    private String boolTemplateMesage;
+    /**
+     * 消息模板
+     */
+    @Column(name = "message_template")
+    @ApiModelProperty(value = "消息模板", required = false)
+    private String messageTemplate;
+    /**
+     * 参数json
+     */
+    @Column(name = "paramer_json")
+    @ApiModelProperty(value = "参数json", required = false)
+    private String paramerJson;
+    /**
+     * 模板消息内容
+     */
+    @Column(name = "template_message_content")
+    @ApiModelProperty(value = "模板消息内容", required = false)
+    private String templateMessageContent;
+    /**
+     * 模板消息标题
+     */
+    @Column(name = "template_message_title")
+    @ApiModelProperty(value = "模板消息标题", required = false)
+    private String templateMessageTitle;
+
+
+}

+ 69 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageSendStrategyDO.java

@@ -0,0 +1,69 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Table(name = "message_send_strategy")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MessageSendStrategyDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 策略名称
+     */
+    @Column(name = "strategy_name")
+    @ApiModelProperty(value = "策略名称", required = false)
+    private String strategyName;
+    /**
+     * 开启状态
+     */
+    @Column(name = "enabled")
+    @ApiModelProperty(value = "开启状态", required = false)
+    private String enabled;
+    /**
+     * 科室id
+     */
+    @Column(name = "part_id")
+    @ApiModelProperty(value = "科室id", required = false)
+    private Integer partId;
+    /**
+     * 要发送的消息ids
+     */
+    @Column(name = "message_ids")
+    @ApiModelProperty(value = "要发送的消息ids", required = false)
+    private String messageIds;
+    /**
+     * 入院后几小时发送
+     */
+    @Column(name = "send_after_inhours")
+    @ApiModelProperty(value = "入院后几小时发送", required = false)
+    private Integer sendAfterInhours;
+    /**
+     * 患者医嘱特征关键字
+     */
+    @Column(name = "doctor_advice_keywords")
+    @ApiModelProperty(value = "患者医嘱特征关键字", required = false)
+    private String doctorAdviceKeywords;
+
+
+}

+ 58 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessageTypeDO.java

@@ -0,0 +1,58 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+@Table(name = "message_type")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MessageTypeDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 消息类型名称
+     */
+    @Column(name = "type_name")
+    @ApiModelProperty(value = "消息类型名称", required = false)
+    private String typeName;
+    /**
+     * 消息打开方式
+     */
+    @Column(name = "open_type")
+    @ApiModelProperty(value = "消息打开方式", required = false)
+    private String openType;
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "创建时间", required = false)
+    private Long createTime;
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    @ApiModelProperty(value = "更新时间", required = false)
+    private Long updateTime;
+
+
+}

+ 76 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/MessagesDO.java

@@ -0,0 +1,76 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Table(name = "messages")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class MessagesDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 标题
+     */
+    @Column(name = "title")
+    @ApiModelProperty(value = "标题", required = false)
+    private String title;
+    /**
+     * 分类Id
+     */
+    @Column(name = "message_type_id")
+    @ApiModelProperty(value = "分类Id", required = false)
+    private Integer messageTypeId;
+    /**
+     * 消息内容文章富文本,音频、视频、图片生成url列表
+     */
+    @Column(name = "message_body")
+    @ApiModelProperty(value = "消息内容文章富文本,音频、视频、图片生成url列表", required = false)
+    private String messageBody;
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "创建时间", required = false)
+    private Long createTime;
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    @ApiModelProperty(value = "更新时间", required = false)
+    private Long updateTime;
+    /**
+     * 科室Id
+     */
+    @Column(name = "part_id")
+    @ApiModelProperty(value = "科室Id", required = false)
+    private Integer partId;
+    /**
+     * 创建人
+     */
+    @Column(name = "creator")
+    @ApiModelProperty(value = "创建人", required = false)
+    private String creator;
+
+
+}

+ 47 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/TemplateMessageParamerDO.java

@@ -0,0 +1,47 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+@Table(name="template_message_paramer")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TemplateMessageParamerDO implements Serializable {
+
+  	/**
+	*	null
+	*/	@Column(name = "id" )
+	@ApiModelProperty(value="null",required=false)
+	@Id(name="id")
+  private Integer id;
+  	/**
+	*	参数名称
+	*/	@Column(name = "param_name" )
+	@ApiModelProperty(value="参数名称",required=false)
+  private String paramName;
+  	/**
+	*	参数输入类型select,input
+	*/	@Column(name = "input_type" )
+	@ApiModelProperty(value="参数输入类型select,input",required=false)
+  private String inputType;
+  	/**
+	*	预设参数可用值json数组
+	*/	@Column(name = "pre_input_option" )
+	@ApiModelProperty(value="预设参数可用值json数组",required=false)
+  private String preInputOption;
+
+}

+ 52 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/msgcenter/dos/TemplateMessageTplDO.java

@@ -0,0 +1,52 @@
+package com.wdklian.ncs.ms.common.entity.msgcenter.dos;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdklian.ncs.ms.framework.database.annotation.Column;
+import com.wdklian.ncs.ms.framework.database.annotation.Id;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+@Table(name = "template_message_tpl")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TemplateMessageTplDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 科室id
+     */
+    @Column(name = "part_id")
+    @ApiModelProperty(value = "科室id", required = false)
+    private Integer partId;
+    /**
+     * 模板标题
+     */
+    @Column(name = "template_title")
+    @ApiModelProperty(value = "模板标题", required = false)
+    private String templateTitle;
+    /**
+     * 模板内容
+     */
+    @Column(name = "template_content")
+    @ApiModelProperty(value = "模板内容", required = false)
+    private String templateContent;
+
+
+}

+ 1 - 1
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/PatientDO.java

@@ -155,7 +155,7 @@ public class PatientDO implements Serializable {
     /**
      * null
      */
-    @Column(name = "outdate")
+    @Column(name = "outdate",allowNullUpdate = true)
     @ApiModelProperty(value = "出院日期",notes = "日期格式:YYYY-MM-DD",example = "2023-11-11", required = false)
     @DateTime(message = "出院日期(outdate)格式错误")
     private String outdate;

+ 2 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/system/dos/NurseConfigDO.java

@@ -12,6 +12,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 @Table(name = "ncs_nurse_config")
 @ApiModel("护理信息分类")
@@ -101,4 +102,5 @@ public class NurseConfigDO implements Serializable {
     @ApiModelProperty(value = "分类是否为手动选择项目,如果是手动选择项目,不需要配置医嘱匹配", required = false)
     private Boolean boolManual;
 
+
 }

+ 6 - 0
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/system/vos/NurseOptionCompareVO.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * @author wuyunfeng
@@ -42,4 +43,9 @@ public class NurseOptionCompareVO implements Serializable {
                 this.categoryName.equalsIgnoreCase(((NurseOptionCompareVO)obj).getCategoryName()) &&
                 this.optionName.equalsIgnoreCase(((NurseOptionCompareVO)obj).getOptionName());
     }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(categoryName, optionName);
+    }
 }