소스 검색

重新提交datax依赖

wuyunfeng 1 년 전
부모
커밋
2d44fa3d47
45개의 변경된 파일402개의 추가작업 그리고 269개의 파일을 삭제
  1. 1 1
      id_file
  2. 4 0
      nacos/conf/mysql-schema.sql
  3. 19 11
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/DepartmentController.java
  4. 21 10
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/DoctorAdviceController.java
  5. 21 11
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/EmployeeController.java
  6. 26 14
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/PatientController.java
  7. 8 7
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/DepartmentService.java
  8. 9 8
      ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/EmployeeService.java
  9. 3 2
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceDepartmentFeignClient.java
  10. 3 2
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceDoctorAdviceFeignClient.java
  11. 3 2
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceEmployeeFeignClient.java
  12. 3 2
      ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntracePatientFeignClient.java
  13. 37 17
      ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/exception/JavashopExceptionHandler.java
  14. 16 0
      ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/mvc/CommonResult.java
  15. 1 3
      ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/mvc/ResultCode.java
  16. 1 1
      ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/controller/DoctorAdviceController.java
  17. 7 0
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerMappingServiceImpl.java
  18. 58 19
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/CustomerServiceImpl.java
  19. 13 9
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigOptionServiceImpl.java
  20. 10 0
      ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/iservice/CustomerMappingService.java
  21. 43 0
      ncs-system-service/src/test/java/SystemTest.java
  22. 4 4
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/_remote.repositories
  23. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/datax-common-1.0-SNAPSHOT.jar.lastUpdated
  24. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/datax-common-1.0-SNAPSHOT.pom.lastUpdated
  25. 0 24
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/maven-metadata-local.xml
  26. 4 2
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/resolver-status.properties
  27. 0 11
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/maven-metadata-local.xml
  28. 4 4
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/_remote.repositories
  29. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/datax-core-1.0-SNAPSHOT.jar.lastUpdated
  30. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/datax-core-1.0-SNAPSHOT.pom.lastUpdated
  31. 0 24
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/maven-metadata-local.xml
  32. 4 2
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/resolver-status.properties
  33. 0 11
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/maven-metadata-local.xml
  34. 4 4
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/_remote.repositories
  35. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/datax-transformer-1.0-SNAPSHOT.jar.lastUpdated
  36. 4 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/datax-transformer-1.0-SNAPSHOT.pom.lastUpdated
  37. 0 24
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/maven-metadata-local.xml
  38. 4 2
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/resolver-status.properties
  39. 6 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/datax-transformer-.jar.lastUpdated
  40. 6 0
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/datax-transformer-.pom.lastUpdated
  41. 0 11
      synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/maven-metadata-local.xml
  42. 2 2
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/DepartmentDO.java
  43. 5 4
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/DoctorAdviceDO.java
  44. 14 9
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/EmployeeDO.java
  45. 14 12
      third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/PatientDO.java

+ 1 - 1
id_file

@@ -1 +1 @@
-4300
+4400

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 0
nacos/conf/mysql-schema.sql


+ 19 - 11
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/DepartmentController.java

@@ -1,7 +1,6 @@
 package com.wdklian.ncs.ms.entrace.controller;
 
 import com.wdklian.ncs.ms.common.entity.open.dos.DepartmentDO;
-import com.wdklian.ncs.ms.common.entity.system.dos.ShopDO;
 import com.wdklian.ncs.ms.entrace.service.DepartmentService;
 import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import io.swagger.annotations.Api;
@@ -13,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
@@ -29,29 +29,37 @@ public class DepartmentController {
     private DepartmentService departmentService;
 
     @PostMapping("/sync-list")
-    @ApiOperation(value = "同步科室列表", response = ShopDO.class, responseContainer = "list")
-    public List<ShopDO> syncDepartment(@RequestBody @NotEmpty(message = "科室列表不能为空") @Validated List<DepartmentDO> departments) {
-        return departmentService.saveDepartments(departments);
+    @ApiOperation(value = "同步科室列表", response = ListDepartResponse.class)
+    public CommonResult<List<DepartmentDO>> syncDepartment(@RequestBody @NotEmpty(message = "科室列表不能为空") @Valid List<DepartmentDO> departments) {
+        return CommonResult.success(departmentService.saveDepartments(departments));
     }
 
     @PostMapping("/sync-single")
-    @ApiOperation(value = "同步单个科室信息", response = ShopDO.class)
-    public ShopDO syncSingleDepartment(@RequestBody @NotNull(message = "科室数据不能为null") DepartmentDO departmentDO) {
+    @ApiOperation(value = "同步单个科室信息", response = SingleDepartResponse.class)
+    public CommonResult<DepartmentDO> syncSingleDepartment(@RequestBody @NotNull(message = "科室数据不能为null") @Valid DepartmentDO departmentDO) {
 
-        return departmentService.saveDepartment(departmentDO);
+        return CommonResult.success(departmentService.saveDepartment(departmentDO));
 
     }
 
     @GetMapping("/sync-single/{key}")
-    @ApiOperation(value = "根据his的科室主键更新呼叫系统科室信息", response = ShopDO.class)
+    @ApiOperation(value = "根据his的科室主键更新呼叫系统科室信息", response = SingleDepartResponse.class)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "key", value = "科室主键", required = true, dataType = "String", paramType = "path")
     })
-    public ShopDO syncDepartmentByKey(@PathVariable("key") @NotEmpty(message = "科室主键不能为空") String key) {
-        ShopDO shopDO = departmentService.syncSingleByKey(key);
-        return shopDO;
+    public CommonResult<DepartmentDO> syncDepartmentByKey(@PathVariable("key") @NotEmpty(message = "科室主键不能为空") String key) {
+        DepartmentDO shopDO = departmentService.syncSingleByKey(key);
+        return CommonResult.success(shopDO);
 
     }
 
+    //以下类为swagger返回示例准备
+    private class ListDepartResponse extends CommonResult<List<DepartmentDO>> implements Serializable {
+
+    }
+
+    private class SingleDepartResponse extends CommonResult<DepartmentDO> implements Serializable {
+
+    }
 
 }

+ 21 - 10
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/DoctorAdviceController.java

@@ -2,6 +2,7 @@ package com.wdklian.ncs.ms.entrace.controller;
 
 import com.wdklian.ncs.ms.common.entity.open.dos.DoctorAdviceDO;
 import com.wdklian.ncs.ms.entrace.service.DoctorAdviceService;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -11,8 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
+import java.io.Serializable;
 import java.util.List;
 
 @RestController
@@ -26,19 +29,15 @@ public class DoctorAdviceController {
     private DoctorAdviceService doctorAdviceService;
 
     @PostMapping("/sync-list")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "doctoradvices", value = "医嘱列表", required = true, dataType = "List<DoctorAdviceDO>", paramType = "body")})
-    @ApiOperation(value = "批量新增或更新医嘱,返回更新成功的医嘱列表",response = DoctorAdviceDO.class,responseContainer = "list")
-    public List<DoctorAdviceDO> syncDoctorAdvice(@RequestBody @NotEmpty(message = "医嘱列表不能为空") @Validated List<DoctorAdviceDO> doctoradvices) {
-        return doctorAdviceService.saveDoctorAdvice(doctoradvices);
+    @ApiOperation(value = "批量新增或更新医嘱,返回更新成功的医嘱列表",response = ListDoctorAdviceResponse.class)
+    public CommonResult<List<DoctorAdviceDO>> syncDoctorAdvice(@RequestBody @NotEmpty(message = "医嘱列表不能为空") @Valid List<DoctorAdviceDO> doctoradvices) {
+        return CommonResult.success(doctorAdviceService.saveDoctorAdvice(doctoradvices));
     }
 
     @PostMapping("/sync-single")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "doctoradvices", value = "医嘱列表", required = true, dataType = "DoctorAdviceDO", paramType = "body")})
-    @ApiOperation(value = "新增或更新单个医嘱信息,返回更新后的医嘱",response = DoctorAdviceDO.class)
-    public DoctorAdviceDO syncSingleDoctorAdvice(@RequestBody @NotNull(message = "医嘱数据不能为null") @Validated DoctorAdviceDO doctorAdvice) {
-        return doctorAdviceService.saveDoctorAdvice(doctorAdvice);
+    @ApiOperation(value = "新增或更新单个医嘱信息,返回更新后的医嘱",response = SingleDoctorAdviceResponse.class)
+    public CommonResult<DoctorAdviceDO> syncSingleDoctorAdvice(@RequestBody @NotNull(message = "医嘱数据不能为null") @Valid DoctorAdviceDO doctorAdvice) {
+        return CommonResult.success(doctorAdviceService.saveDoctorAdvice(doctorAdvice));
     }
 
     @DeleteMapping("/{his_keys}")
@@ -50,5 +49,17 @@ public class DoctorAdviceController {
     }
 
 
+    //以下类为swagger返回示例准备
+    private class ListDoctorAdviceResponse extends CommonResult<List<DoctorAdviceDO>> implements Serializable {
+
+    }
+
+    private class SingleDoctorAdviceResponse extends CommonResult<DoctorAdviceDO> implements Serializable {
+
+    }
+
+    private class StringResponse extends CommonResult<String> implements Serializable {
+
+    }
 
 }

+ 21 - 11
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/EmployeeController.java

@@ -1,8 +1,8 @@
 package com.wdklian.ncs.ms.entrace.controller;
 
 import com.wdklian.ncs.ms.common.entity.open.dos.EmployeeDO;
-import com.wdklian.ncs.ms.common.entity.system.dos.ClerkDO;
 import com.wdklian.ncs.ms.entrace.service.EmployeeService;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -12,8 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
+import java.io.Serializable;
 import java.util.List;
 
 @RestController
@@ -27,26 +29,34 @@ public class EmployeeController {
     private EmployeeService employeeService;
 
     @PostMapping("/sync-list")
-    @ApiOperation(value = "新增或更新职员信息,返回更新成功的职员列表", response = EmployeeDO.class, responseContainer = "list")
-    public List<ClerkDO> syncEmployee(@RequestBody @NotEmpty(message = "职员列表不能为空") @Validated List<EmployeeDO> employees) {
-        return employeeService.saveEmployee(employees);
+    @ApiOperation(value = "新增或更新职员信息,返回更新成功的职员列表", response = ListEmployeeResponse.class)
+    public CommonResult<List<EmployeeDO>> syncEmployee(@RequestBody @NotEmpty(message = "职员列表不能为空") @Valid List<EmployeeDO> employees) {
+        return CommonResult.success(employeeService.saveEmployee(employees));
     }
 
     @PostMapping("/sync-single")
-    @ApiOperation(value = "新增或更新单个职员信息,返回更新成功的职员", response = EmployeeDO.class)
-    public ClerkDO syncSingleEmployee(@RequestBody @NotNull(message = "科室数据不能为null") @Validated EmployeeDO employee) {
-        return employeeService.saveEmployee(employee);
+    @ApiOperation(value = "新增或更新单个职员信息,返回更新成功的职员", response = SingleEmployeeResponse.class)
+    public CommonResult<EmployeeDO> syncSingleEmployee(@RequestBody @NotNull(message = "科室数据不能为null") @Valid EmployeeDO employee) {
+        return CommonResult.success(employeeService.saveEmployee(employee));
     }
 
     @GetMapping("/sync-single/{key}")
-    @ApiOperation(value = "通过职工主键,更新数据到呼叫系统", response = ClerkDO.class)
+    @ApiOperation(value = "通过职工主键,更新数据到呼叫系统", response = SingleEmployeeResponse.class)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "key", value = "职工主键", required = true, dataType = "String", paramType = "path")
     })
-    public ClerkDO syncSingleEmployeeByKey(@NotEmpty(message = "职工主键不能为空") @PathVariable("key") String key) {
-        ClerkDO clerkDO = employeeService.syncEmployeeByKey(key);
-        return clerkDO;
+    public CommonResult<EmployeeDO> syncSingleEmployeeByKey(@NotEmpty(message = "职工主键不能为空") @PathVariable("key") String key) {
+        EmployeeDO clerkDO = employeeService.syncEmployeeByKey(key);
+        return CommonResult.success(clerkDO);
     }
 
+    //以下类为swagger返回示例准备
+    private class ListEmployeeResponse extends CommonResult<List<EmployeeDO>> implements Serializable {
+
+    }
+
+    private class SingleEmployeeResponse extends CommonResult<EmployeeDO> implements Serializable {
+
+    }
 
 }

+ 26 - 14
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/controller/PatientController.java

@@ -1,8 +1,8 @@
 package com.wdklian.ncs.ms.entrace.controller;
 
 import com.wdklian.ncs.ms.common.entity.open.dos.PatientDO;
-import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.entrace.service.PatientService;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -12,8 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
+import java.io.Serializable;
 import java.util.List;
 
 @RestController
@@ -27,38 +29,48 @@ public class PatientController {
     private PatientService patientService;
 
     @PostMapping("/sync-list")
-    @ApiOperation(value = "新增或更新患者信息,返回更新成功的患者列表", response = PatientDO.class, responseContainer = "List")
-    public List<PatientDO> syncPatient(@RequestBody @NotEmpty(message = "患者列表不能为空") @Validated List<PatientDO> patients) {
-        return patientService.savePatient(patients);
+    @ApiOperation(value = "新增或更新患者信息,返回更新成功的患者列表", response = ListPatientResponse.class)
+    public CommonResult<List<PatientDO>> syncPatient(@RequestBody @NotEmpty(message = "患者列表不能为空") @Valid List<PatientDO> patients) {
+        return CommonResult.success(patientService.savePatient(patients));
 
     }
 
     @PostMapping("/sync-single")
-    @ApiOperation(value = "新增或更新单个患者信息,返回更新成功的患者", response = PatientDO.class)
-    public PatientDO syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") @Validated PatientDO patient) {
-        return patientService.savePatient(patient);
+    @ApiOperation(value = "新增或更新单个患者信息,返回更新成功的患者", response = SinglePatientResponse.class)
+    public CommonResult<PatientDO> syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") @Valid PatientDO patient) {
+        return CommonResult.success(patientService.savePatient(patient));
     }
 
 
     @GetMapping("/sync-single/{patient_key}")
-    @ApiOperation(value = "根据患者主键把患者同步到呼叫系统", response = PatientDO.class)
-    public PatientDO syncSinglePatientByKey(@PathVariable("patient_key") String patientKey) {
-        return patientService.syncPatientByKey(patientKey);
+    @ApiOperation(value = "根据患者主键把患者同步到呼叫系统", response = SinglePatientResponse.class)
+    public CommonResult<PatientDO> syncSinglePatientByKey(@PathVariable("patient_key") String patientKey) {
+        return CommonResult.success(patientService.syncPatientByKey(patientKey));
     }
 
     @PostMapping("/patient-out/{patient_key}")
-    @ApiOperation(value = "指定患者主键出院")
+    @ApiOperation(value = "指定患者主键出院",response = SinglePatientResponse.class)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "patient_key", value = "患者主键", required = true, dataType = "String", paramType = "path")
     })
-    public PatientDO patientOut(@NotEmpty(message = "患者主键不能为空") @PathVariable(value = "patient_key") String patientKey) {
-        return patientService.patientOut(patientKey);
+    public CommonResult<PatientDO> patientOut(@NotEmpty(message = "患者主键不能为空") @PathVariable(value = "patient_key") String patientKey) {
+        return CommonResult.success(patientService.patientOut(patientKey));
     }
 
     @GetMapping("/sync-all")
-    @ApiOperation(value = "更新所有患者信息,his数据库转换到ncs库,仅对视图同步方式有效", response = CustomerDO.class)
+    @ApiOperation(value = "更新所有患者信息,his数据库转换到ncs库,仅对视图同步方式有效")
     public void syncAllPatient() {
         patientService.syncAllPatient();
     }
 
+
+    //以下类为swagger返回示例准备
+    private class ListPatientResponse extends CommonResult<List<PatientDO>> implements Serializable {
+
+    }
+
+    private class SinglePatientResponse extends CommonResult<PatientDO> implements Serializable {
+
+    }
+
 }

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

@@ -27,25 +27,26 @@ public class DepartmentService {
     @Autowired
     private ShopFeignClient shopFeignClient;
 
-    public List<ShopDO> saveDepartments(List<DepartmentDO> departments) {
-        this.departmentFeignClient.saveDepartments(departments).getData();
+    public List<DepartmentDO> saveDepartments(List<DepartmentDO> departments) {
+        List<DepartmentDO> departmentDOS = this.departmentFeignClient.saveDepartments(departments).getData();
         List<ShopDO> data = this.shopFeignClient.syncDepartment(departments).getData();
-        return data;
+        return departmentDOS;
 
     }
 
-    public ShopDO saveDepartment(DepartmentDO departmentDO) {
+    public DepartmentDO saveDepartment(DepartmentDO departmentDO) {
         DepartmentDO data = this.departmentFeignClient.saveSingleDepartment(departmentDO).getData();
         ShopDO shopDO = this.shopFeignClient.syncSingleDepartment(departmentDO).getData();
-        return shopDO;
+        return data;
     }
 
 
-    public ShopDO syncSingleByKey(String key) {
+    public DepartmentDO syncSingleByKey(String key) {
         DepartmentDO departmentDO = this.departmentFeignClient.getDepartment(key).getData();
         if (departmentDO == null) {
             throw new ServiceException("找不到科室信息");
         }
-        return this.shopFeignClient.syncSingleDepartment(departmentDO).getData();
+        this.shopFeignClient.syncSingleDepartment(departmentDO).getData();
+        return departmentDO;
     }
 }

+ 9 - 8
ncs-entrace-service/src/main/java/com/wdklian/ncs/ms/entrace/service/EmployeeService.java

@@ -25,25 +25,26 @@ public class EmployeeService {
     @Autowired
     private ClerkFeignClient clerkFeignClient;
 
-    public List<ClerkDO> saveEmployee(List<EmployeeDO> employees) {
-        this.employeeFeignClient.saveEmployeeList(employees).getData();
+    public List<EmployeeDO> saveEmployee(List<EmployeeDO> employees) {
+        List<EmployeeDO> data = this.employeeFeignClient.saveEmployeeList(employees).getData();
         List<ClerkDO> clerkDOS = this.clerkFeignClient.syncEmployee(employees).getData();
-        return clerkDOS;
+        return data;
     }
 
-    public ClerkDO saveEmployee(EmployeeDO employee) {
+    public EmployeeDO saveEmployee(EmployeeDO employee) {
 
-        this.employeeFeignClient.saveEmployee(employee).getData();
+        EmployeeDO data = this.employeeFeignClient.saveEmployee(employee).getData();
         ClerkDO clerkDO = this.clerkFeignClient.syncSingleEmployee(employee).getData();
-        return clerkDO;
+        return data;
     }
 
-    public ClerkDO syncEmployeeByKey(String key) {
+    public EmployeeDO syncEmployeeByKey(String key) {
         EmployeeDO employeeDO = this.employeeFeignClient.getEmployee(key).getData();
         if (employeeDO == null) {
             throw new ServiceException("不存在的职员!");
         }
-        return this.clerkFeignClient.syncSingleEmployee(employeeDO).getData();
+        this.clerkFeignClient.syncSingleEmployee(employeeDO).getData();
+        return employeeDO;
 
     }
 }

+ 3 - 2
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceDepartmentFeignClient.java

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
@@ -24,10 +25,10 @@ import java.util.List;
 public interface EntraceDepartmentFeignClient {
 
     @PostMapping("/sync-list")
-    List<ShopDO> syncDepartment(@RequestBody @NotEmpty(message = "科室列表不能为空") @Validated List<DepartmentDO> departments);
+    List<ShopDO> syncDepartment(@RequestBody @NotEmpty(message = "科室列表不能为空") @Valid List<DepartmentDO> departments);
 
     @PostMapping("/sync-single")
-    ShopDO syncSingleDepartment(@RequestBody @NotNull(message = "科室数据不能为null") DepartmentDO departmentDO);
+    ShopDO syncSingleDepartment(@RequestBody @NotNull(message = "科室数据不能为null") @Valid DepartmentDO departmentDO);
 
     @GetMapping("/sync-single/{key}")
     ShopDO syncDepartmentByKey(@PathVariable("key") @NotEmpty(message = "科室主键不能为空") String key);

+ 3 - 2
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceDoctorAdviceFeignClient.java

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
@@ -23,10 +24,10 @@ import java.util.List;
 @FeignClient(value = "entrace-service", path = "/doctor-advice")
 public interface EntraceDoctorAdviceFeignClient {
     @PostMapping("/sync-list")
-    List<DoctorAdviceDO> syncDoctorAdvice(@RequestBody @NotEmpty(message = "医嘱列表不能为空") @Validated List<DoctorAdviceDO> doctoradvices);
+    List<DoctorAdviceDO> syncDoctorAdvice(@RequestBody @NotEmpty(message = "医嘱列表不能为空") @Valid List<DoctorAdviceDO> doctoradvices);
 
     @PostMapping("/sync-single")
-    DoctorAdviceDO syncSingleDoctorAdvice(@RequestBody @NotNull(message = "医嘱数据不能为null") @Validated DoctorAdviceDO doctorAdvice);
+    DoctorAdviceDO syncSingleDoctorAdvice(@RequestBody @NotNull(message = "医嘱数据不能为null") @Valid DoctorAdviceDO doctorAdvice);
 
     @DeleteMapping("/{his_keys}")
     Integer deleteDoctorAdvice(@PathVariable(value = "his_keys") @NotEmpty(message = "医嘱主键不能为空") String[] hisKeys);

+ 3 - 2
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntraceEmployeeFeignClient.java

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
@@ -25,10 +26,10 @@ public interface EntraceEmployeeFeignClient {
 
 
     @PostMapping("/sync-list")
-    List<ClerkDO> syncEmployee(@RequestBody @NotEmpty(message = "职员列表不能为空") @Validated List<EmployeeDO> employees);
+    List<ClerkDO> syncEmployee(@RequestBody @NotEmpty(message = "职员列表不能为空") @Valid List<EmployeeDO> employees);
 
     @PostMapping("/sync-single")
-    ClerkDO syncSingleEmployee(@RequestBody @NotNull(message = "科室数据不能为null") @Validated EmployeeDO employee);
+    ClerkDO syncSingleEmployee(@RequestBody @NotNull(message = "科室数据不能为null") @Valid EmployeeDO employee);
 
     @GetMapping("/sync-single/{key}")
     ClerkDO syncSingleEmployeeByKey(@NotEmpty(message = "职工主键不能为空") @PathVariable("key") String key);

+ 3 - 2
ncs-ms-feign/src/main/java/com/wdklian/ncs/ms/feignclient/entrace/EntracePatientFeignClient.java

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
@@ -22,10 +23,10 @@ import java.util.List;
 @FeignClient(value = "entrace-service", path = "/patient")
 public interface EntracePatientFeignClient {
     @PostMapping("/sync-list")
-    List<PatientDO> syncPatient(@RequestBody @NotEmpty(message = "患者列表不能为空") @Validated List<PatientDO> patients);
+    List<PatientDO> syncPatient(@RequestBody @NotEmpty(message = "患者列表不能为空") @Valid List<PatientDO> patients);
 
     @PostMapping("/sync-single")
-    PatientDO syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") @Validated PatientDO patient);
+    PatientDO syncSinglePatient(@RequestBody @NotNull(message = "患者数据不能为null") @Valid PatientDO patient);
 
 
     @GetMapping("/sync-single/{patient_key}")

+ 37 - 17
ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/exception/JavashopExceptionHandler.java

@@ -1,5 +1,8 @@
 package com.wdklian.ncs.ms.framework.exception;
 
+import com.fasterxml.jackson.core.JsonParseException;
+import com.wdklian.ncs.ms.framework.mvc.CommonResult;
+import com.wdklian.ncs.ms.framework.util.StringUtil;
 import org.springframework.http.HttpStatus;
 import org.springframework.validation.BindException;
 import org.springframework.validation.ObjectError;
@@ -15,7 +18,6 @@ import javax.validation.ConstraintViolationException;
 
 /**
  * Eop 参数校验处理类
- *
  */
 @ControllerAdvice
 public class JavashopExceptionHandler {
@@ -28,11 +30,16 @@ public class JavashopExceptionHandler {
     @ExceptionHandler(ConstraintViolationException.class)
     @ResponseBody
     @ResponseStatus(HttpStatus.BAD_REQUEST)
-    public ErrorMessage handleValidationException(ConstraintViolationException e) {
+    public CommonResult handleValidationException(ConstraintViolationException e) {
+        String errorMsg="";
+
         for (ConstraintViolation<?> s : e.getConstraintViolations()) {
-            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getMessage());
+            errorMsg+=s.getMessage()+"\t";
+        }
+        if(!StringUtil.isEmpty(errorMsg)){
+            return CommonResult.validateFailed(errorMsg);
         }
-        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+        return CommonResult.validateFailed("未知参数错误");
     }
 
     /**
@@ -44,11 +51,15 @@ public class JavashopExceptionHandler {
     @ExceptionHandler(MethodArgumentNotValidException.class)
     @ResponseBody
     @ResponseStatus(HttpStatus.BAD_REQUEST)
-    public ErrorMessage handleValidationBodyException(MethodArgumentNotValidException e) {
+    public CommonResult handleValidationBodyException(MethodArgumentNotValidException e) {
+        String errorMsg="";
         for (ObjectError s : e.getBindingResult().getAllErrors()) {
-            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getDefaultMessage());
+            errorMsg+=s.getDefaultMessage()+"\t";
+        }
+        if(!StringUtil.isEmpty(errorMsg)){
+            return CommonResult.validateFailed(errorMsg);
         }
-        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+        return CommonResult.validateFailed("未知参数错误");
     }
 
     /**
@@ -60,12 +71,12 @@ public class JavashopExceptionHandler {
     @ExceptionHandler(BindException.class)
     @ResponseBody
     @ResponseStatus(HttpStatus.BAD_REQUEST)
-    public ErrorMessage handleValidationBeanException(BindException e) {
+    public CommonResult handleValidationBeanException(BindException e) {
 
         for (ObjectError s : e.getAllErrors()) {
-            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getDefaultMessage());
+            return CommonResult.validateFailed(s.getDefaultMessage());
         }
-        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+        return CommonResult.validateFailed(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
     }
 
     /**
@@ -76,30 +87,39 @@ public class JavashopExceptionHandler {
      */
     @ExceptionHandler(ServiceException.class)
     @ResponseBody
-    public ErrorMessage handleServiceException(ServiceException e, HttpServletResponse response) {
+    public CommonResult handleServiceException(ServiceException e, HttpServletResponse response) {
         response.setStatus(e.getStatusCode().value());
         Object data = e.getData();
         if (data == null) {
-            return new ErrorMessage(e.getCode(), e.getMessage());
+            return CommonResult.failed(e.getMessage());
         } else {
-            return new ErrorMessageWithData(e.getCode(), e.getMessage(), data);
+            return CommonResult.failed(e.getMessage(), data);
         }
 
     }
 
 
-
-
     /**
      * 处理参数传递异常
      */
     @ExceptionHandler(IllegalArgumentException.class)
     @ResponseBody
-    public ErrorMessage handleUnProccessableServiceException(IllegalArgumentException e, HttpServletResponse response) {
+    public CommonResult handleUnProccessableServiceException(IllegalArgumentException e, HttpServletResponse response) {
 
         response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
-        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, e.getMessage());
+        return CommonResult.failed(e.getMessage());
     }
 
 
+    /**
+     * JSON数据异常
+     */
+    @ExceptionHandler(JsonParseException.class)
+    @ResponseBody
+    public CommonResult handleUnProccessableServiceException(JsonParseException e, HttpServletResponse response) {
+
+        response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+        return CommonResult.failed("JSON数据错误:"+e.getOriginalMessage());
+    }
+
 }

+ 16 - 0
ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/mvc/CommonResult.java

@@ -86,6 +86,14 @@ public class CommonResult <T>{
 
     /**
      * 失败返回结果
+     * @param message 提示信息
+     */
+    public static <T> CommonResult<T> failed(String message,T data) {
+        return new CommonResult<T>(ResultCode.FAILED.getCode(), message, data);
+    }
+
+    /**
+     * 失败返回结果
      */
     public static <T> CommonResult<T> failed() {
         return failed(ResultCode.FAILED);
@@ -107,6 +115,14 @@ public class CommonResult <T>{
     }
 
     /**
+     * 参数验证失败返回结果
+     * @param message 提示信息
+     */
+    public static <T> CommonResult<T> validateFailed(String message,T data) {
+        return new CommonResult<T>(ResultCode.VALIDATE_FAILED.getCode(), message, data);
+    }
+
+    /**
      * 未登录返回结果
      */
     public static <T> CommonResult<T> unauthorized(T data) {

+ 1 - 3
ncs-ms-framework/src/main/java/com/wdklian/ncs/ms/framework/mvc/ResultCode.java

@@ -1,12 +1,10 @@
 package com.wdklian.ncs.ms.framework.mvc;
 
-import com.wdklian.ncs.ms.framework.mvc.IErrorCode;
-
 public enum ResultCode implements IErrorCode {
 
     SUCCESS(200, "操作成功"),
     FAILED(500, "操作失败"),
-    VALIDATE_FAILED(404, "参数检验失败"),
+    VALIDATE_FAILED(300, "参数检验失败"),
     UNAUTHORIZED(401, "暂未登录或token已经过期"),
     FORBIDDEN(403, "没有相关权限");
     

+ 1 - 1
ncs-open-service/src/main/java/com/wdklian/ncs/ms/open/controller/DoctorAdviceController.java

@@ -25,7 +25,7 @@ import java.util.List;
 @Slf4j
 @Validated
 @RequestMapping("/doctor-advice")
-@Api(description = "医嘱操作API", tags = "医嘱操作API")
+@Api(description = "医嘱操作", tags = "医嘱操作API")
 public class DoctorAdviceController {
 
     @Autowired

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

@@ -7,6 +7,7 @@ import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
 import com.wdklian.ncs.ms.common.entity.system.dos.CustomerMappingDO;
 import com.wdklian.ncs.ms.common.entity.system.vos.CustomerCareMappingVO;
 import com.wdklian.ncs.ms.common.entity.system.vos.CustomerNurseConfigMappingVO;
+import com.wdklian.ncs.ms.framework.database.annotation.Table;
 import com.wdklian.ncs.ms.system.service.iservice.CustomerMappingService;
 import com.wdklian.ncs.ms.system.service.iservice.NurseConfigService;
 import lombok.extern.slf4j.Slf4j;
@@ -66,4 +67,10 @@ public class CustomerMappingServiceImpl extends SystemCRUDManagerImpl<CustomerMa
     public List<CustomerDO> renewDePartment(String key) {
         return this.nurseConfigService.renewDePartment(key);
     }
+
+    @Override
+    public void clearCustomerMapping(Integer customerId) {
+        String sql="delete from "+CustomerMappingDO.class.getAnnotation(Table.class).name()+" where customer_id=?";
+        this.daoSupport.execute(sql,customerId);
+    }
 }

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

@@ -162,14 +162,14 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
 //        List<CustomerDO> patientWasIn = this.listCustomerByHisKeys(patientDOS.stream().map(p -> p.getKeyval()).collect(Collectors.toList()));
         //在住院患者
         List<CustomerDO> patientIn = this.getCustomersByHospitaliseStatus(HospitaliseStatusEnum.HOSPITALIZED);
-        //传入患者已经有入住过的记录
-        List<CustomerDO> patientWasIn = this.listCustomerByHisKeys(patientDOS.stream().map(p -> p.getKeyval()).collect(Collectors.toList()));
+        //传入患者已经有入住过但已出院的记录
+        List<CustomerDO> patientWasIn = this.listCustomerByHisKeys(patientDOS.stream().map(p -> p.getKeyval()).collect(Collectors.toList())).stream().filter(p->p.getStatus().equals(HospitaliseStatusEnum.DISCHARGED.value())).collect(Collectors.toList());
         patientWasIn.addAll(patientIn);
         List<MemberDO> patientMemberWasIn = new ArrayList<>();
         List<CustomerCareMappingVO> patientWasInCareMapping = new ArrayList<>();
         if (patientWasIn != null && patientWasIn.size() > 0) {
             patientMemberWasIn = this.memberService.listMemberByIds(patientWasIn.stream().mapToInt(p -> p.getMemberId()).boxed().collect(Collectors.toList()));
-            patientWasInCareMapping = this.customerMappingService.listCustomerCareChargeByCustomerIds(patientWasIn.stream().mapToInt(p -> p.getMemberId()).boxed().collect(Collectors.toList()));
+            patientWasInCareMapping = this.customerMappingService.listCustomerCareChargeByCustomerIds(patientWasIn.stream().mapToInt(p -> p.getId()).boxed().collect(Collectors.toList()));
         }
         //所有角色列表
         List<RoleDO> roles = this.roleService.listRole();
@@ -209,14 +209,22 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
             MemberDO member = null;
             List<CustomerCareMappingVO> customerCareMappingVOS = new ArrayList<>();
             if (customerDO != null) {
+
                 member = patientMemberWasIn.stream().filter(p -> p.getMemberId().equals(customerDO.getMemberId())).findFirst().orElse(null);
                 customerCareMappingVOS = patientWasInCareMapping.stream().filter(p -> p.getCustomerId().equals(customerDO.getId())).collect(Collectors.toList());
                 //患者已经在库中,需要判定此患者是否住院状态,如果是住院状态,要处理患者是否转床、转科室
-                if (customerDO.getStatus().equals(HospitaliseStatusEnum.HOSPITALIZED.value()) && bed != null && !customerDO.getFrameId().equals(bed.getId())) {
+                if (customerDO.getStatus().equals(HospitaliseStatusEnum.HOSPITALIZED.value()) && (bed != null && !customerDO.getFrameId().equals(bed.getId()))
+                || bed==null //这个人还在住院,但是床位变了,可能转到了新的床位,或者转到了一个呼叫系统中不存在的床位
+                ) {
                     //住院状态,且床位信息发生了变化,拷贝custoerDO,放入syncCustomers中,返回后可以获取到旧的customer信息,通知旧床位更新设备信息
                     CustomerDO customerBak = new CustomerDO();
                     BeanUtil.copyProperties(customerDO, customerBak);
                     syncCustomers.add(customerBak);
+                    //旧床位设备设置memberId为0,否则485依然显示旧床位患者数据
+                    FrameDO oldFrameDO = allBeds.stream().filter(p -> p.getId().equals(customerDO.getFrameId())).findFirst().orElse(null);
+                    if(!patientWasIn.stream().anyMatch(p->p.getFrameId().equals(oldFrameDO.getId())&&p.getStatus().equals(HospitaliseStatusEnum.HOSPITALIZED.value())&&!p.getId().equals(customerDO.getId()))) { //没有人入住旧床位了
+                        this.deviceService.updateMemberId(customerDO.getFrameId(), new int[]{DeviceTypeEnum.DIGIT_BED_DEVICE.value(), DeviceTypeEnum.RS485_DOOR_DEVICE.value(), DeviceTypeEnum.SIMULATE_BED_DEVICE.value()}, 0);
+                    }
                 }
 
             }
@@ -224,7 +232,9 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
             CustomerDO customer = handleSinglePatient(patientInfo, part, bed, customerDO, member, roles, customerCareMappingVOS, patientWasIn);
             if (customer != null) {
                 //重要-- 把同步成功的患者加入到已入住列表中,防止同一批次患者有相同床位的,不加入无法判断出上一次已经入住了床位
-                patientWasIn.add(customer);
+                if(!patientWasIn.stream().anyMatch(p->p.getId().equals(customer.getId()))) {
+                    patientWasIn.add(customer);
+                }
                 //把同步成功的患者加入返回列表
                 syncCustomers.add(customer);
             }
@@ -290,8 +300,6 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
                 customer = updateCustomer(patient, part, bed, customer);
                 //提交更新
                 this.edit(customer, customer.getId());
-            } else {
-                return null;
             }
         }
         return customer;
@@ -322,13 +330,14 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
             if (StrUtil.isEmpty(inbedCustomer.getHisKeyval())) {//非his同步的病人,可能是测试数据。出院
                 inbedCustomer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
                 this.edit(inbedCustomer, inbedCustomer.getId());
-
+               // this.customerMappingService.clearCustomerMapping(inbedCustomer.getId());
             } else if (StrUtil.isNotEmpty(inbedCustomer.getHisPartKeyval())
                     && inbedCustomer.getHisPartKeyval().trim().equalsIgnoreCase(part.getHisCode())
             ) { //当前入住的患者是主科室的患者,又传进来一个同床位患者。
                 if (!inbedCustomer.getHisKeyval().equals(patient.getKeyval())) { //现在住的和要住的不是同一个人,把现在住的出院。这里如果传过来同一个床位如果有两个人以上,我方显示的人可能会切换显示
                     inbedCustomer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
                     this.edit(inbedCustomer, inbedCustomer.getId());
+                   // this.customerMappingService.clearCustomerMapping(inbedCustomer.getId());
                 }
             } else if (StrUtil.isNotEmpty(part.getAttachHisCodes())
                     && part.getAttachHisCodes().contains(inbedCustomer.getHisPartKeyval())
@@ -337,15 +346,23 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
                 if (patient.getPartKeyval().trim().equalsIgnoreCase(part.getHisCode())) { //现在要住主科室的患者,其他科室的出院
                     inbedCustomer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
                     this.edit(inbedCustomer, inbedCustomer.getId());
+                   // this.customerMappingService.clearCustomerMapping(inbedCustomer.getId());
                 } else { //现在要住的也不是主科室的患者
-                    if (!inbedCustomer.getHisKeyval().equalsIgnoreCase(patient.getKeyval())) { //在住的和要住的还不是同一个人,不处理
-                        return false;
+                    if(inbedCustomer.getHisPartKeyval().equalsIgnoreCase(patient.getPartKeyval())&&!inbedCustomer.getHisKeyval().equalsIgnoreCase(patient.getKeyval())){ //当前入住的和要住的是同一个科室的患者,把当前住的患者出院
+                            inbedCustomer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
+                            this.edit(inbedCustomer, inbedCustomer.getId());
+                        //this.customerMappingService.clearCustomerMapping(inbedCustomer.getId());
                     }
+
+//                    if (!inbedCustomer.getHisKeyval().equalsIgnoreCase(patient.getKeyval())) { //在住的和要住的还不是同一个人,不处理
+//                        return false;
+//                    }
                 }
 
             }else{ //科室对接更换了hiscode,当前入住的患者已经不属于这个科室
                 inbedCustomer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
                 this.edit(inbedCustomer, inbedCustomer.getId());
+                this.customerMappingService.clearCustomerMapping(inbedCustomer.getId());
             }
         }
 
@@ -393,14 +410,31 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
     @Transactional(value = "systemTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public CustomerDO handleSinglePatient(PatientDO patient, ShopDO part, FrameDO bed, CustomerDO customer, MemberDO member, List<RoleDO> roles, List<CustomerCareMappingVO> customerCareMapping, List<CustomerDO> hospitalized) {
 
-        //出院状态
-        if (StrUtil.isNotEmpty(patient.getStatus()) && Integer.parseInt(patient.getStatus()) == (HospitaliseStatusEnum.DISCHARGED.value()) && customer != null) {
-            customer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
-            this.edit(customer, customer.getId());
-            this.deviceService.updateMemberId(customer.getFrameId(), new int[]{DeviceTypeEnum.DIGIT_BED_DEVICE.value(),DeviceTypeEnum.RS485_DOOR_DEVICE.value(),DeviceTypeEnum.SIMULATE_BED_DEVICE.value()}, 0);
-            return customer;
+
+
+
+        if(customer != null) {
+            //出院状态
+            if ((StrUtil.isNotEmpty(patient.getStatus()) && Integer.parseInt(patient.getStatus()) == (HospitaliseStatusEnum.DISCHARGED.value()))||
+                    bed==null //患者转到了一个无法识别的床位
+            ) {
+         if(customer.getFrameId().equals(784)){
+             int i=0;
+         }
+                customer.setStatus(HospitaliseStatusEnum.DISCHARGED.value());
+                this.edit(customer, customer.getId());
+                this.customerMappingService.clearCustomerMapping(customer.getId());
+                if(bed!=null) { //如果患者转到了不存在的床位,不能更新设备的memberId,不然可能有新入住的患者在485上无法显示.只有患者明确出院了才能设置memberId为0
+                    if(bed.getId().equals(784)){
+                        int i=0;
+                    }
+                    this.deviceService.updateMemberId(customer.getFrameId(), new int[]{DeviceTypeEnum.DIGIT_BED_DEVICE.value(), DeviceTypeEnum.RS485_DOOR_DEVICE.value(), DeviceTypeEnum.SIMULATE_BED_DEVICE.value()}, 0);
+                }
+                return customer;
+            }
         }
 
+
         CustomerDO inBed = hospitalized.stream().filter(p -> p.getFrameId() != null && bed != null && p.getFrameId().equals(bed.getId()) &&
                 p.getStatus().equals(0)).findFirst().orElse(null);
         //入住
@@ -410,7 +444,7 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
             //2、用户入住
             CustomerDO customerDO = patient2Customer(patient, part, bed, customer, member);
 
-            if (customerDO != null || customer != null) {
+            if (customerDO != null ) {
 
                 //3、入住成功,更新医护人员
                 //准备医护人员,这里必须每次查询,因为可能有新增,如果一次性查出来,数据可能不对
@@ -420,9 +454,13 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
                 Boolean changed = updateCustomerCareCharge(ObjectUtil.defaultIfNull(customerDO, customer), clerkDOS, customerCareMapping);
                 if (changed) {
                     customerDO = ObjectUtil.defaultIfNull(customerDO, customer);
-                    this.deviceService.updateMemberId(customerDO.getFrameId(), new int[]{DeviceTypeEnum.DIGIT_BED_DEVICE.value(),DeviceTypeEnum.RS485_DOOR_DEVICE.value(),DeviceTypeEnum.SIMULATE_BED_DEVICE.value()}, customerDO.getMemberId());
                 }
+
+            }
+            if(customerDO!=null){
+                this.deviceService.updateMemberId(customerDO.getFrameId(), new int[]{DeviceTypeEnum.DIGIT_BED_DEVICE.value(),DeviceTypeEnum.RS485_DOOR_DEVICE.value(),DeviceTypeEnum.SIMULATE_BED_DEVICE.value()}, customerDO.getMemberId());
             }
+
             return customerDO;
 
         } else {
@@ -451,6 +489,7 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
         //要删除的医护人员id
         List<Integer> removes = ListUtils.removeAll(oldClerkIds, newClerkIds);
         Boolean change = false;
+
         if (adds != null && adds.size() > 0) { //要新加的医护人员
             for (Integer add : adds) {
                 ClerkDO clerk = clerks.stream().filter(p -> p.getClerkId().equals(add)).findFirst().orElse(null);
@@ -484,7 +523,7 @@ public class CustomerServiceImpl extends SystemCRUDManagerImpl<CustomerDO> imple
     }
 
     private CustomerDO updateCustomer(PatientDO patient, ShopDO shop, FrameDO bed, CustomerDO customerDO) {
-        String age = patient.getAge().toString();
+        String age = patient.getAge();
         Integer patientAge = StringHelper.fetchAge(age);
         customerDO.setAge(patientAge);
         if (StrUtil.isEmpty(patient.getAgeUnit())) { //没有传入年龄单位,尝试从年龄中获取

+ 13 - 9
ncs-system-service/src/main/java/com/wdklian/ncs/ms/system/service/impl/NurseConfigOptionServiceImpl.java

@@ -97,7 +97,9 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
         }
 
         if (partInHospitalCustomers != null && partInHospitalCustomers.size() > 0) {
+
             for (CustomerDO customerDO : partInHospitalCustomers) {
+                List<String> operatorSql = new ArrayList<>();
                 if (StrUtil.isEmpty(customerDO.getHisKeyval())) { //患者不是从his对接过来的,没必要匹配,跳过记录
                     continue;
                 }
@@ -133,7 +135,7 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
                     //现有护理项与医嘱的差集,需删除
                     List<NurseOptionCompareVO> removes = ListUtils.removeAll(nurseConfigs, doctorAdviceMapping);
 
-                    List<String> operatorSql = new ArrayList<>();
+
                     if (adds != null && adds.size() > 0) {//新增的护理参数,去重,相同项目不重重复添加
                         for (NurseOptionCompareVO add : new HashSet<>(adds)) {
                             operatorSql.add(String.format("insert into ncs_customer_mapping(union_id,part_id,customer_id,nurse_config_option_id) values('%s',%d,%d,%d)", ObjectId.next(), add.getPartId(), add.getCustomerId(), add.getOptionId()));
@@ -144,17 +146,19 @@ public class NurseConfigOptionServiceImpl extends SystemCRUDManagerImpl<NurseCon
                             operatorSql.add(String.format("delete from ncs_customer_mapping where id=%d", remove.getMappingId()));
                         }
                     }
-                    if (operatorSql.size() > 0) {
-                        this.daoSupport.batchUpdate(operatorSql.toArray(new String[operatorSql.size()]));
-                        nurseChangeCustomers.add(customerDO);
-                    }
+
 
                 } else { //此用户没有匹配的护理参数,清除用户的所有护理项mapping
 
-                    int i = this.daoSupport.execute("delete from ncs_customer_mapping where customer_id=? and nurse_config_option_id is not null", customerDO.getId());
-                    if (i > 0) {
-                        nurseChangeCustomers.add(customerDO);
-                    }
+//                    int i = this.daoSupport.execute("delete from ncs_customer_mapping where customer_id=? and nurse_config_option_id is not null", customerDO.getId());
+//                    if (i > 0) {
+//                        nurseChangeCustomers.add(customerDO);
+//                    }
+                    operatorSql.add(String.format("delete from ncs_customer_mapping where customer_id=%d and nurse_config_option_id is not null", customerDO.getId()));
+                }
+                if (operatorSql.size() > 0) {
+                    this.daoSupport.batchUpdate(operatorSql.toArray(new String[operatorSql.size()]));
+                    nurseChangeCustomers.add(customerDO);
                 }
             }
         }

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

@@ -23,4 +23,14 @@ public interface CustomerMappingService extends CRUDBaseManager<CustomerMappingD
     List<CustomerNurseConfigMappingVO> listCustomerNurseConfigs(Integer customerId);
 
     List<CustomerDO> renewDePartment(String key);
+
+    /**
+     * 删除患者的mapping记录,防止数据过多造成查询缓慢
+     *
+     * @date 2024-02-19 18:14
+     * @author wuyunfeng
+     * @param customer
+     * @return
+     */
+    void clearCustomerMapping(Integer customer);
 }

+ 43 - 0
ncs-system-service/src/test/java/SystemTest.java

@@ -0,0 +1,43 @@
+import com.wdklian.ncs.ms.common.entity.open.dos.PatientDO;
+import com.wdklian.ncs.ms.common.entity.system.dos.CustomerDO;
+import com.wdklian.ncs.ms.feignclient.open.PatientFeignClient;
+import com.wdklian.ncs.ms.system.SystemServiceApplication;
+import com.wdklian.ncs.ms.system.service.iservice.CustomerService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author wuyunfeng
+ * 2024-02-20 14:33
+ * ${description}
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = SystemServiceApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@Slf4j
+public class SystemTest {
+
+    @Autowired
+    private CustomerService customerService;
+
+    @Autowired
+    private PatientFeignClient patientFeignClient;
+
+    @Test
+    public void syncPatientTest() {
+
+        List<PatientDO> collect = patientFeignClient.listHospitaledPatient().getData().stream().filter(p -> p.getPartKeyval().equalsIgnoreCase("31e4c4705d818081e219")).collect(Collectors.toList());
+
+        List<CustomerDO> customerDOS = customerService.syncPatient(collect);
+        int i=0;
+
+    }
+
+}

+ 4 - 4
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/_remote.repositories

@@ -1,4 +1,4 @@
-#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
-#Tue Dec 19 17:11:43 CST 2023
-datax-common-1.0-SNAPSHOT.jar>=
-datax-common-1.0-SNAPSHOT.pom>=
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Sat Jan 27 17:32:43 CST 2024
+datax-common-1.0-SNAPSHOT.jar>local-project-repositor=
+datax-common-1.0-SNAPSHOT.pom>local-project-repositor=

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/datax-common-1.0-SNAPSHOT.jar.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:46 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497726031

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/datax-common-1.0-SNAPSHOT.pom.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:45 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497725785

+ 0 - 24
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/maven-metadata-local.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-common</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <versioning>
-    <snapshot>
-      <localCopy>true</localCopy>
-    </snapshot>
-    <lastUpdated>20231219091143</lastUpdated>
-    <snapshotVersions>
-      <snapshotVersion>
-        <extension>jar</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219091143</updated>
-      </snapshotVersion>
-      <snapshotVersion>
-        <extension>pom</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219091143</updated>
-      </snapshotVersion>
-    </snapshotVersions>
-  </versioning>
-</metadata>

+ 4 - 2
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/1.0-SNAPSHOT/resolver-status.properties

@@ -1,4 +1,6 @@
 #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
-#Sat Jan 27 10:13:13 CST 2024
-maven-metadata-local-project-repository.xml.lastUpdated=1706321593217
+#Thu Mar 28 16:49:45 CST 2024
+maven-metadata-local-project-repository.xml.lastUpdated=1706497725776
 maven-metadata-local-project-repository.xml.error=
+maven-metadata-local-project-repositor.xml.lastUpdated=1711615785565
+maven-metadata-local-project-repositor.xml.error=

+ 0 - 11
synchrony-scheduled-task/maven/com/alibaba/datax/datax-common/maven-metadata-local.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-common</artifactId>
-  <versioning>
-    <versions>
-      <version>1.0-SNAPSHOT</version>
-    </versions>
-    <lastUpdated>20231219091143</lastUpdated>
-  </versioning>
-</metadata>

+ 4 - 4
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/_remote.repositories

@@ -1,4 +1,4 @@
-#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
-#Tue Dec 19 17:13:09 CST 2023
-datax-core-1.0-SNAPSHOT.jar>=
-datax-core-1.0-SNAPSHOT.pom>=
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Sat Jan 27 17:32:42 CST 2024
+datax-core-1.0-SNAPSHOT.pom>local-project-repositor=
+datax-core-1.0-SNAPSHOT.jar>local-project-repositor=

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/datax-core-1.0-SNAPSHOT.jar.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:46 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497726031

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/datax-core-1.0-SNAPSHOT.pom.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:45 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497725766

+ 0 - 24
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/maven-metadata-local.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-core</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <versioning>
-    <snapshot>
-      <localCopy>true</localCopy>
-    </snapshot>
-    <lastUpdated>20231219091309</lastUpdated>
-    <snapshotVersions>
-      <snapshotVersion>
-        <extension>jar</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219091309</updated>
-      </snapshotVersion>
-      <snapshotVersion>
-        <extension>pom</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219091309</updated>
-      </snapshotVersion>
-    </snapshotVersions>
-  </versioning>
-</metadata>

+ 4 - 2
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/1.0-SNAPSHOT/resolver-status.properties

@@ -1,4 +1,6 @@
 #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
-#Sat Jan 27 10:13:13 CST 2024
-maven-metadata-local-project-repository.xml.lastUpdated=1706321593208
+#Thu Mar 28 16:49:45 CST 2024
+maven-metadata-local-project-repository.xml.lastUpdated=1706497725749
 maven-metadata-local-project-repository.xml.error=
+maven-metadata-local-project-repositor.xml.lastUpdated=1711615785557
+maven-metadata-local-project-repositor.xml.error=

+ 0 - 11
synchrony-scheduled-task/maven/com/alibaba/datax/datax-core/maven-metadata-local.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-core</artifactId>
-  <versioning>
-    <versions>
-      <version>1.0-SNAPSHOT</version>
-    </versions>
-    <lastUpdated>20231219091309</lastUpdated>
-  </versioning>
-</metadata>

+ 4 - 4
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/_remote.repositories

@@ -1,4 +1,4 @@
-#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
-#Tue Dec 19 17:56:18 CST 2023
-datax-transformer-1.0-SNAPSHOT.jar>=
-datax-transformer-1.0-SNAPSHOT.pom>=
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Sat Jan 27 17:32:42 CST 2024
+datax-transformer-1.0-SNAPSHOT.pom>local-project-repositor=
+datax-transformer-1.0-SNAPSHOT.jar>local-project-repositor=

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/datax-transformer-1.0-SNAPSHOT.jar.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:46 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497726032

+ 4 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/datax-transformer-1.0-SNAPSHOT.pom.lastUpdated

@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Mon Jan 29 11:08:45 CST 2024
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.error=
+file\:////Volumes/mac/projects/ncs/nc.database.sync/maven/.lastUpdated=1706497725832

+ 0 - 24
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/maven-metadata-local.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-transformer</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <versioning>
-    <snapshot>
-      <localCopy>true</localCopy>
-    </snapshot>
-    <lastUpdated>20231219095618</lastUpdated>
-    <snapshotVersions>
-      <snapshotVersion>
-        <extension>jar</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219095618</updated>
-      </snapshotVersion>
-      <snapshotVersion>
-        <extension>pom</extension>
-        <value>1.0-SNAPSHOT</value>
-        <updated>20231219095618</updated>
-      </snapshotVersion>
-    </snapshotVersions>
-  </versioning>
-</metadata>

+ 4 - 2
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/1.0-SNAPSHOT/resolver-status.properties

@@ -1,4 +1,6 @@
 #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
-#Sat Jan 27 10:13:13 CST 2024
-maven-metadata-local-project-repository.xml.lastUpdated=1706321593224
+#Thu Mar 28 16:49:45 CST 2024
+maven-metadata-local-project-repository.xml.lastUpdated=1706497725797
 maven-metadata-local-project-repository.xml.error=
+maven-metadata-local-project-repositor.xml.lastUpdated=1711615785574
+maven-metadata-local-project-repositor.xml.error=

+ 6 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/datax-transformer-.jar.lastUpdated

@@ -0,0 +1,6 @@
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Sat Jan 27 17:33:12 CST 2024
+http\://maven.aliyun.com/nexus/content/groups/public/.error=
+file\:////Volumes/mac/projects/ncs-ms/synchrony-scheduled-task/maven/.error=
+http\://maven.aliyun.com/nexus/content/groups/public/.lastUpdated=1706347992072
+file\:////Volumes/mac/projects/ncs-ms/synchrony-scheduled-task/maven/.lastUpdated=1706347991702

+ 6 - 0
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/datax-transformer-.pom.lastUpdated

@@ -0,0 +1,6 @@
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Sat Jan 27 17:33:11 CST 2024
+http\://maven.aliyun.com/nexus/content/groups/public/.error=
+file\:////Volumes/mac/projects/ncs-ms/synchrony-scheduled-task/maven/.error=
+http\://maven.aliyun.com/nexus/content/groups/public/.lastUpdated=1706347991503
+file\:////Volumes/mac/projects/ncs-ms/synchrony-scheduled-task/maven/.lastUpdated=1706347991141

+ 0 - 11
synchrony-scheduled-task/maven/com/alibaba/datax/datax-transformer/maven-metadata-local.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>com.alibaba.datax</groupId>
-  <artifactId>datax-transformer</artifactId>
-  <versioning>
-    <versions>
-      <version>1.0-SNAPSHOT</version>
-    </versions>
-    <lastUpdated>20231219095618</lastUpdated>
-  </versioning>
-</metadata>

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

@@ -27,7 +27,7 @@ public class DepartmentDO implements Serializable {
      */
     @Column(name = "keyval")
     @ApiModelProperty(value = "部门唯一标识", required = true,example = "211")
-    @NotEmpty(message = "科室主键不能为空")
+    @NotEmpty(message = "科室主键(keyval)不能为空")
     @Id(name = "keyval")
     private String keyval;
     /**
@@ -35,7 +35,7 @@ public class DepartmentDO implements Serializable {
      */
     @Column(name = "name")
     @ApiModelProperty(value = "部门名称", required = true,example = "内一科")
-    @NotEmpty(message = "科室名称不能为空")
+    @NotEmpty(message = "科室名称(name)不能为空")
     private String name;
     /**
      * null

+ 5 - 4
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/DoctorAdviceDO.java

@@ -46,7 +46,7 @@ public class DoctorAdviceDO implements Serializable {
     @Column(name = "state")
     @ApiModelProperty(value = "医嘱状态", notes = "1代表有效,0代表无效", example = "1", required = false)
     @NotEmpty(message = "医嘱状态(state)不能为空")
-    @EnumValue(strValues = {"0","1"},message = "用指定的数字表示医嘱状态(1代表有效,0代表无效)")
+    @EnumValue(strValues = {"0","1"},message = "用指定的数字表示医嘱状态(state),'1'代表有效,'0'代表无效")
     private String state;
     /**
      * his患者主键
@@ -60,19 +60,20 @@ public class DoctorAdviceDO implements Serializable {
      */
     @Column(name = "patient_name")
     @ApiModelProperty(value = "患者姓名", required = true,example = "张三")
-    @NotEmpty(message = "患者姓名(patient_key)不能为空")
+    @NotEmpty(message = "患者姓名(patient_name)不能为空")
     private String patientName;
     /**
      * 患者床位号
      */
     @Column(name = "customer_bed_no")
-    @ApiModelProperty(value = "患者床位号", required = false,example = "10")
+    @ApiModelProperty(value = "患者床位号", required = true,example = "10")
     private String customerBedNo;
     /**
      * his患者科室主键
      */
     @Column(name = "his_part_key")
-    @ApiModelProperty(value = "患者住院科室(部门)主键", required = false,example = "211")
+    @ApiModelProperty(value = "患者住院科室(部门)主键", required = true,example = "211")
+    @NotEmpty(message = "患者姓名(his_part_key)不能为空")
     private String hisPartKey;
     /**
      * 内容加密字符串(作为内容唯一标记)

+ 14 - 9
third-party-common/src/main/java/com/wdklian/ncs/ms/common/entity/open/dos/EmployeeDO.java

@@ -4,6 +4,7 @@ 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.Table;
+import com.wdklian.ncs.ms.framework.validation.annotation.DateTime;
 import com.wdklian.ncs.ms.framework.validation.annotation.EnumValue;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -16,7 +17,7 @@ import javax.validation.constraints.NotEmpty;
 import java.io.Serializable;
 
 @Table(name = "employee")
-@ApiModel(value = "职实体")
+@ApiModel(value = "职实体")
 @Data
 @NoArgsConstructor
 @AllArgsConstructor
@@ -28,13 +29,14 @@ public class EmployeeDO implements Serializable {
      */
     @Column(name = "keyval")
     @ApiModelProperty(value = "职员唯一标识", required = true,example = "1")
-    @NotEmpty(message = "职工主键不能为空")
+    @NotEmpty(message = "职工主键(keyval)不能为空")
     private String keyval;
     /**
      * null
      */
     @Column(name = "part_keyval")
-    @ApiModelProperty(value = "所属部门主键", required = false,example = "211")
+    @ApiModelProperty(value = "所属部门主键", required = true,example = "211")
+    @NotEmpty(message = "任职部门主键(part_keyval)不能为空")
     private String partKeyval;
     /**
      * null
@@ -46,22 +48,24 @@ public class EmployeeDO implements Serializable {
      * null
      */
     @Column(name = "name")
-    @NotEmpty(message = "职工姓名不能为空")
-    @ApiModelProperty(value = "职员姓名", required = false,example = "张三")
+    @NotEmpty(message = "职工姓名(name)不能为空")
+    @ApiModelProperty(value = "职员姓名", required = true,example = "张三")
     private String name;
     /**
      * null
      */
     @Column(name = "type")
-    @ApiModelProperty(value = "职员类型", notes = "可取值(1、2、3)1、代表医生,2、代表护士,3、代表护工", example = "1", required = false)
-    @EnumValue(strValues = {"1","2","3","医生","护士","护工"},message = "用指定的数字或中文表示职员类型")
+    @ApiModelProperty(value = "职员类型", notes = "可取值(1、2、3)1、代表医生,2、代表护士,3、代表护工", example = "1", required = true)
+    @NotEmpty(message = "职员类型(type)不能为空")
+    @EnumValue(strValues = {"1","2","3","医生","护士","护工"},message = "用指定的数字或中文表示职员类型(type),'1','2','3'或'医生','护士','护工'")
     private String type;
     /**
      * null
      */
     @Column(name = "sex")
-    @ApiModelProperty(value = "职员性别", notes = "可取值(0、1、2、女、男、未知)0、代表女性,1、代表男性", required = false,example = "1")
-    @EnumValue(strValues = {"0","1","2","女","男","未知"},message = "用指定的数字或中文表示职员性别")
+    @ApiModelProperty(value = "职员性别", notes = "可取值(0、1、2、女、男、未知)0、代表女性,1、代表男性", required = true,example = "1")
+    @NotEmpty(message = "职员性别(sex)不能为空")
+    @EnumValue(strValues = {"0","1","2","女","男","未知"},message = "用指定的数字或中文表示职员性别(sex),'0','1','2'或'女','男','未知'")
     private String sex;
     /**
      * null
@@ -69,6 +73,7 @@ public class EmployeeDO implements Serializable {
     @Column(name = "birthday")
     @ApiModelProperty(value = "职员生日", notes = "日期格式:YYYY-MM-DD", example = "1989-05-06", required = false)
     @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @DateTime(message = "职员生日(birthday)格式错误")
     private String birthday;
     /**
      * null

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

@@ -30,14 +30,14 @@ public class PatientDO implements Serializable {
      */
     @Column(name = "keyval")
     @ApiModelProperty(value = "患者主键", required = true,example = "123456")
-    @NotEmpty(message = "患者主键不能为空")
+    @NotEmpty(message = "患者主键(keyval)不能为空")
     private String keyval;
     /**
      * null
      */
     @Column(name = "part_keyval")
     @ApiModelProperty(value = "患者住院科室(部门)主键", required = true,example = "211")
-    @NotEmpty(message = "患者科室主键不能空")
+    @NotEmpty(message = "患者科室主键(part_keyval)不能空")
     private String partKeyval;
     /**
      * null
@@ -50,28 +50,29 @@ public class PatientDO implements Serializable {
      */
     @Column(name = "bed_no")
     @ApiModelProperty(value = "床位号", required = true,example = "10")
-    @NotEmpty(message = "患者床位号不能为空")
+    @NotEmpty(message = "患者床位号(bed_no)不能为空")
     private String bedNo;
     /**
      * null
      */
     @Column(name = "name")
     @ApiModelProperty(value = "患者姓名", required = true,example = "李四")
-    @NotEmpty(message = "患者姓名不能为空")
+    @NotEmpty(message = "患者姓名(name)不能为空")
     private String name;
     /**
      * null
      */
     @Column(name = "sex")
-    @ApiModelProperty(value = "患者性别",notes ="可取值(0,1,2)0或女、代表女性,1或男、代表男性,2或未知、代表未知",example = "1", required = false)
-    @NotEmpty(message = "患者性别不能为空")
+    @ApiModelProperty(value = "患者性别",notes ="可取值(0,1,2)0或女、代表女性,1或男、代表男性,2或未知、代表未知",example = "1", required = true)
+    @NotEmpty(message = "患者性别(sex)不能为空")
     @EnumValue(strValues = {"0","1","2","女","男","未知"},message = "用指定的数字或中文表示职员性别")
     private String sex;
     /**
      * null
      */
     @Column(name = "age")
-    @ApiModelProperty(value = "患者年龄", notes = "患者年龄",example = "10岁",required = false)
+    @ApiModelProperty(value = "患者年龄", notes = "患者年龄",example = "10岁",required = true)
+    @NotEmpty(message = "患者年龄(age)不能为空")
     private String age;
     /**
      * null
@@ -109,8 +110,8 @@ public class PatientDO implements Serializable {
      * null
      */
     @Column(name = "indate")
-    @ApiModelProperty(value = "入院日期",notes = "日期格式:YYYY-MM-DD",example = "2023-11-11", required = false)
-    @DateTime(message = "入院日期格式错误")
+    @ApiModelProperty(value = "入院日期",notes = "日期格式:YYYY-MM-DD",example = "2023-11-11", required = true)
+    @DateTime(message = "入院日期(indate)格式错误")
     private String indate;
     /**
      * null
@@ -147,15 +148,16 @@ public class PatientDO implements Serializable {
      * null
      */
     @Column(name = "status")
-    @ApiModelProperty(value = "患者住院状态(0-住院,1-出院)",notes = "0-住院,1-出院,根据此状态更新床位用户",example = "1",required = false)
-    @EnumValue(strValues = {"0","1"},message = "用指定的数字表示患者住院状态")
+    @ApiModelProperty(value = "患者住院状态(0-住院,1-出院)",notes = "0-住院,1-出院,根据此状态更新床位用户",example = "1",required = true)
+    @EnumValue(strValues = {"0","1"},message = "用指定的数字表示患者住院状态(status),'0'代表住院,'1'代表出院")
+    @NotEmpty(message = "患者住院状态(status)不能为空")
     private String status;
     /**
      * null
      */
     @Column(name = "outdate")
     @ApiModelProperty(value = "出院日期",notes = "日期格式:YYYY-MM-DD",example = "2023-11-11", required = false)
-    @DateTime(message = "出院日期格式错误")
+    @DateTime(message = "出院日期(outdate)格式错误")
     private String outdate;
     /**
      * null