소스 검색

新增
1、金蝶收款单推送
2、新增轮候模块

liangwenxuan 3 달 전
부모
커밋
828923da22
20개의 변경된 파일711개의 추가작업 그리고 97개의 파일을 삭제
  1. 63 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/BpmCheckInWaitController.java
  2. 64 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/vo/BpmCheckInWaitCreateReqVO.java
  3. 28 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/vo/BpmCheckInWaitSupplementReqVO.java
  4. 2 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/enums/BpmBusinessTypeEnum.java
  5. 46 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/enums/BpmCheckInWaitStatusEnum.java
  6. 7 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/BpmElderlApplyService.java
  7. 50 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/BpmElderlApplyServiceImpl.java
  8. 45 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/listener/BpmCheckInWaitStatusListener.java
  9. 45 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
  10. 19 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApi.java
  11. 36 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/vo/CheckInWaitCreateReqVO.java
  12. 17 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/vo/CheckInWaitSupplementReqVO.java
  13. 79 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApiImpl.java
  14. 148 95
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/kingdee/KingdeeApiImpl.java
  15. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/ElderlyInfoPageReqVO.java
  16. 44 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/ElderlyCheckInWaitDO.java
  17. 1 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyBuildFloorActivityImageMapper.java
  18. 10 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyCheckInWaitMapper.java
  19. 1 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/MedicalCareRecordsMapper.java
  20. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/ElderlyInfoMapper.xml

+ 63 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/BpmCheckInWaitController.java

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.business;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
+import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
+import cn.iocoder.yudao.module.bpm.controller.admin.business.vo.BpmCheckInWaitCreateReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.business.vo.BpmCheckInWaitSupplementReqVO;
+import cn.iocoder.yudao.module.bpm.service.business.BpmElderlApplyService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+
+@Tag(name = "管理后台 - 长者轮候入住流程")
+@RestController
+@RequestMapping("/bpm/check-in-wait")
+@Validated
+public class BpmCheckInWaitController {
+
+    @Resource
+    private BpmElderlApplyService elderlApplyService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建轮候入住申请")
+    @TenantIgnore
+    public CommonResult<Long> create(@Valid @RequestBody BpmCheckInWaitCreateReqVO createReqVO) {
+        createReqVO.setTenantId(createReqVO.getTenantId() == null ? TenantContextHolder.getTenantId() : createReqVO.getTenantId());
+        return success(elderlApplyService.checkInWaitCreate(getLoginUserId(),
+                SecurityFrameworkUtils.getLoginUserNickname(), createReqVO));
+    }
+
+    @PostMapping("/third-review/supplement")
+    @Operation(summary = "第三审批补充护理等级与备注")
+    public CommonResult<Boolean> supplementByThirdReview(@Valid @RequestBody BpmCheckInWaitSupplementReqVO reqVO) {
+        elderlApplyService.supplementCheckInWaitByThirdReview(getLoginUserId(), reqVO);
+        return success(Boolean.TRUE);
+    }
+
+    @PostMapping("/fourth-review/supplement")
+    @Operation(summary = "第四审批补充体检报告")
+    public CommonResult<Boolean> supplementByFourthReview(@Valid @RequestBody BpmCheckInWaitSupplementReqVO reqVO) {
+        elderlApplyService.supplementCheckInWaitByFourthReview(getLoginUserId(), reqVO);
+        return success(Boolean.TRUE);
+    }
+
+    @PostMapping("/sixth-review/supplement")
+    @Operation(summary = "第六审批补充床位")
+    public CommonResult<Boolean> supplementBySixthReview(@Valid @RequestBody BpmCheckInWaitSupplementReqVO reqVO) {
+        elderlApplyService.supplementCheckInWaitBySixthReview(getLoginUserId(), reqVO);
+        return success(Boolean.TRUE);
+    }
+}
+

+ 64 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/vo/BpmCheckInWaitCreateReqVO.java

@@ -0,0 +1,64 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.business.vo;
+
+import cn.iocoder.yudao.module.bpm.enums.BpmBusinessTypeEnum;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+import java.util.Map;
+
+@Schema(description = "管理后台 - 轮候入住发起 Request VO")
+@Data
+public class BpmCheckInWaitCreateReqVO {
+
+    @Schema(description = "主键ID")
+    private Long id;
+
+    @Schema(description = "长者姓名", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "长者姓名不能为空")
+    private String elderName;
+
+    @Schema(description = "身份证")
+    private String idCard;
+
+    @Schema(description = "院区ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "院区不能为空")
+    private Long tenantId;
+
+    @Schema(description = "近期生活状态视频", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "近期生活状态不能为空")
+    private String recentLivingSituation;
+
+    @Schema(description = "行走情况视频", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "行走情况视频不能为空")
+    private String walkSituationVideo;
+
+    @Schema(description = "半年内病历", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "半年内病历不能为空")
+    private String medicalRecordsWithinSixMonth;
+
+    @Schema(description = "身份证正反面", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "身份证正反面不能为空")
+    private String idCardPhoto;
+
+    @Schema(description = "近期出院小结")
+    private String recentDischargeSummary;
+
+    @Schema(description = "申请类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
+    @NotNull(message = "申请类型不能为空")
+    private Integer type = BpmBusinessTypeEnum.CHECK_IN_WAIT.getValue();
+
+    @Schema(description = "业务ID")
+    private Long businessId;
+
+    @Schema(description = "业务ID2")
+    private Long businessId2;
+
+    @Schema(description = "流程实例编号")
+    private String processInstanceId;
+
+    @Schema(description = "发起人自选审批人")
+    private Map<String, List<Long>> startUserSelectAssignees;
+}

+ 28 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/vo/BpmCheckInWaitSupplementReqVO.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.business.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Schema(description = "管理后台 - 轮候入住补充信息 Request VO")
+@Data
+public class BpmCheckInWaitSupplementReqVO {
+
+    @Schema(description = "轮候记录ID", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "轮候记录ID不能为空")
+    private Long id;
+
+    @Schema(description = "护理等级ID")
+    private Long nurseLevelId;
+
+    @Schema(description = "备注")
+    private String remark;
+
+    @Schema(description = "体检报告")
+    private String physicalExaminationReport;
+
+    @Schema(description = "床位ID")
+    private Long bedId;
+}
+

+ 2 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/enums/BpmBusinessTypeEnum.java

@@ -24,7 +24,8 @@ public enum BpmBusinessTypeEnum implements ArrayValuable<Integer> {
     CATERING_CHANGE(6, "catering_change"), //餐饮变更
     PRICE_CHANGE(7, "price_change"), //价格变更
     TRANSFER_CHANGE(8, "transfer_change"), //转院变更
-    CHECK_IN(9, "check_in"); //办理入住
+    CHECK_IN(9, "check_in"), //办理入住
+    CHECK_IN_WAIT(10, "check_in_wait"); //轮候入住
 
     public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmBusinessTypeEnum::getValue).toArray(Integer[]::new);
 

+ 46 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/enums/BpmCheckInWaitStatusEnum.java

@@ -0,0 +1,46 @@
+package cn.iocoder.yudao.module.bpm.enums;
+
+import cn.hutool.core.util.ArrayUtil;
+import cn.iocoder.yudao.framework.common.core.ArrayValuable;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+
+/**
+ * 轮候入住业务状态
+ */
+@AllArgsConstructor
+@Getter
+public enum BpmCheckInWaitStatusEnum implements ArrayValuable<Integer> {
+
+    SUBMITTED_WAIT_FIRST_APPROVAL(1, "已提交,待第一审批人"),
+    FIRST_APPROVAL_PASSED_WAIT_SECOND_APPROVAL(2, "第一审批通过,待第二审批人"),
+    SECOND_APPROVAL_PASSED_WAIT_THIRD_APPROVAL(3, "第二审批通过,待第三审批人"),
+    THIRD_APPROVAL_REJECT_TO_SECOND(4, "第三审批退回第二审批人"),
+    THIRD_APPROVAL_PASSED_WAIT_FOURTH_APPROVAL(5, "第三审批通过,待第四审批人"),
+    FOURTH_APPROVAL_REJECT_TO_THIRD(6, "第四审批退回第三审批人"),
+    FOURTH_APPROVAL_PASSED_WAIT_FIFTH_APPROVAL(7, "第四审批通过,待第五审批人"),
+    FIFTH_APPROVAL_PASSED_WAIT_SIXTH_APPROVAL(8, "第五审批通过,待第六审批人"),
+    SIXTH_APPROVAL_PASSED_WAIT_BED_FILL(9, "第六审批通过待补床位"),
+    APPROVED_FINISHED(10, "流程审批完成"),
+    FIRST_APPROVAL_REJECT_TO_FAMILY(11, "第一审批驳回退家属"),
+    SECOND_APPROVAL_REJECT_FINISHED(12, "第二审批驳回结束"),
+    FIFTH_APPROVAL_REJECT_FINISHED(13, "第五审批驳回结束"),
+    SIXTH_APPROVAL_REJECT_TO_FIFTH(14, "第六审批驳回退第五审批人");
+
+    public static final Integer[] ARRAYS = Arrays.stream(values()).map(BpmCheckInWaitStatusEnum::getStatus).toArray(Integer[]::new);
+
+    private final Integer status;
+
+    private final String desc;
+
+    public static BpmCheckInWaitStatusEnum valueOfStatus(Integer status) {
+        return ArrayUtil.firstMatch(item -> item.getStatus().equals(status), BpmCheckInWaitStatusEnum.values());
+    }
+
+    @Override
+    public Integer[] array() {
+        return ARRAYS;
+    }
+}

+ 7 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/BpmElderlApplyService.java

@@ -35,5 +35,12 @@ public interface BpmElderlApplyService {
 
     Long checkInCreate(Long loginUserId, CheckInCreateReqVO createReqVO);
 
+    Long checkInWaitCreate(Long loginUserId, String nickname, BpmCheckInWaitCreateReqVO createReqVO);
+
+    void supplementCheckInWaitByThirdReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO);
+
+    void supplementCheckInWaitByFourthReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO);
+
+    void supplementCheckInWaitBySixthReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO);
 
 }

+ 50 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/BpmElderlApplyServiceImpl.java

@@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.business.BpmBusinessFormDO;
 import cn.iocoder.yudao.module.bpm.dal.mysql.business.BpmBusinessFormMapper;
 import cn.iocoder.yudao.module.bpm.enums.BpmBusinessTypeEnum;
 import cn.iocoder.yudao.module.system.api.bpm.BpmCheckInApi;
+import cn.iocoder.yudao.module.system.api.bpm.BpmCheckInWaitApi;
 import cn.iocoder.yudao.module.system.api.bpm.BpmElderlyExpenseApi;
 import cn.iocoder.yudao.module.system.api.bpm.vo.*;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
@@ -59,6 +60,9 @@ public class BpmElderlApplyServiceImpl implements BpmElderlApplyService {
     @Resource
     private BpmCheckInApi checkInApi;
 
+    @Resource
+    private BpmCheckInWaitApi checkInWaitApi;
+
     @Resource
     private BpmBusinessFormMapper bpmBusinessFormMapper;
 
@@ -357,4 +361,50 @@ public class BpmElderlApplyServiceImpl implements BpmElderlApplyService {
         BpmBusinessFormCreateReqVO businessFormCreateReqVO = BeanUtils.toBean(createReqVO, BpmBusinessFormCreateReqVO.class);
         return bpmBusinessFormService.create(businessFormCreateReqVO);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Long checkInWaitCreate(Long loginUserId, String nickname, BpmCheckInWaitCreateReqVO createReqVO) {
+        CheckInWaitCreateReqVO reqVO = BeanUtils.toBean(createReqVO, CheckInWaitCreateReqVO.class);
+        reqVO.setStatus(1);
+        Long id = checkInWaitApi.createCheckInWait(reqVO);
+        createReqVO.setBusinessId(id);
+        createReqVO.setBusinessId2(id);
+        createReqVO.setType(BpmBusinessTypeEnum.CHECK_IN_WAIT.getValue());
+        BpmBusinessFormCreateReqVO businessFormCreateReqVO = BeanUtils.toBean(createReqVO, BpmBusinessFormCreateReqVO.class);
+        return bpmBusinessFormService.create(businessFormCreateReqVO);
+    }
+
+    @Override
+    public void supplementCheckInWaitByThirdReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO) {
+        if (reqVO.getNurseLevelId() == null) {
+            throw new IllegalArgumentException("护理等级不能为空");
+        }
+        if (reqVO.getRemark() == null || reqVO.getRemark().trim().isEmpty()) {
+            throw new IllegalArgumentException("备注不能为空");
+        }
+        CheckInWaitSupplementReqVO updateReqVO = BeanUtils.toBean(reqVO, CheckInWaitSupplementReqVO.class);
+        checkInWaitApi.updateThirdReviewInfo(updateReqVO);
+        checkInWaitApi.updateCheckInWaitStatus(reqVO.getId(), 5);
+    }
+
+    @Override
+    public void supplementCheckInWaitByFourthReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO) {
+        if (reqVO.getPhysicalExaminationReport() == null || reqVO.getPhysicalExaminationReport().trim().isEmpty()) {
+            throw new IllegalArgumentException("体检报告不能为空");
+        }
+        CheckInWaitSupplementReqVO updateReqVO = BeanUtils.toBean(reqVO, CheckInWaitSupplementReqVO.class);
+        checkInWaitApi.updateFourthReviewInfo(updateReqVO);
+        checkInWaitApi.updateCheckInWaitStatus(reqVO.getId(), 7);
+    }
+
+    @Override
+    public void supplementCheckInWaitBySixthReview(Long loginUserId, BpmCheckInWaitSupplementReqVO reqVO) {
+        if (reqVO.getBedId() == null) {
+            throw new IllegalArgumentException("床位不能为空");
+        }
+        CheckInWaitSupplementReqVO updateReqVO = BeanUtils.toBean(reqVO, CheckInWaitSupplementReqVO.class);
+        checkInWaitApi.updateSixthReviewInfo(updateReqVO);
+        checkInWaitApi.updateCheckInWaitStatus(reqVO.getId(), 10);
+    }
 }

+ 45 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/listener/BpmCheckInWaitStatusListener.java

@@ -0,0 +1,45 @@
+package cn.iocoder.yudao.module.bpm.service.business.listener;
+
+import cn.iocoder.yudao.module.bpm.dal.dataobject.business.BpmBusinessFormDO;
+import cn.iocoder.yudao.module.bpm.enums.BpmBusinessTypeEnum;
+import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
+import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
+import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener;
+import cn.iocoder.yudao.module.bpm.service.business.BpmBusinessFormService;
+import cn.iocoder.yudao.module.system.api.bpm.BpmCheckInWaitApi;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * 长者轮候入住流程状态监听器
+ */
+@Component
+public class BpmCheckInWaitStatusListener extends BpmProcessInstanceStatusEventListener {
+
+    @Resource
+    private BpmBusinessFormService businessFormService;
+
+    @Resource
+    private BpmCheckInWaitApi checkInWaitApi;
+
+    @Override
+    protected String getProcessDefinitionKey() {
+        return BpmBusinessTypeEnum.CHECK_IN_WAIT.getKey();
+    }
+
+    @Override
+    protected void onEvent(BpmProcessInstanceStatusEvent event) {
+        BpmBusinessFormDO businessFormDO = businessFormService.getBusinessFormByInstanceId(event.getId());
+        businessFormDO.setStatus(event.getStatus());
+        businessFormService.updateBusinessForm(businessFormDO);
+
+        if (BpmProcessInstanceStatusEnum.APPROVE.getStatus().equals(event.getStatus())) {
+            checkInWaitApi.updateCheckInWaitStatus(businessFormDO.getBusinessId(), 10);
+            BpmBusinessFormDO updateDO = new BpmBusinessFormDO();
+            updateDO.setId(businessFormDO.getId());
+            updateDO.setCompleteStatus(1);
+            businessFormService.updateBusinessForm(updateDO);
+        }
+    }
+}

+ 45 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java

@@ -16,8 +16,11 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.elderly.BpmElderlyIn
 import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.elderly.ElderlyLogRecordVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
 import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.business.BpmBusinessFormDO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
+import cn.iocoder.yudao.module.bpm.enums.BpmBusinessTypeEnum;
+import cn.iocoder.yudao.module.bpm.enums.BpmCheckInWaitStatusEnum;
 import cn.iocoder.yudao.module.bpm.enums.definition.*;
 import cn.iocoder.yudao.module.bpm.enums.task.BpmCommentTypeEnum;
 import cn.iocoder.yudao.module.bpm.enums.task.BpmReasonEnum;
@@ -35,6 +38,7 @@ import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService;
 import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskTimeoutReqDTO;
 import cn.iocoder.yudao.module.system.api.dept.DeptApi;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import cn.iocoder.yudao.module.system.api.bpm.BpmCheckInWaitApi;
 import cn.iocoder.yudao.module.system.api.bpm.BpmElderlyApi;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
 import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
@@ -133,6 +137,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
     @Resource
     private BpmElderlyApi bpmElderlyApi;
 
+    @Resource
+    private BpmCheckInWaitApi checkInWaitApi;
+
     @Resource
     private NotifyMessageSendApi notifyMessageSendApi;
 
@@ -772,6 +779,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
         LogRecordContext.putVariable("nickname", SecurityFrameworkUtils.getLoginUserNickname());
         LogRecordContext.putVariable("instanceName", instance.getName());
 
+        // 2.4 轮候入住流程,按驳回节点回写业务状态(11/12/13/14)
+        updateCheckInWaitRejectStatus(task.getProcessInstanceId(), task.getTaskDefinitionKey());
+
         // 3. 根据不同的 RejectHandler 处理策略
         BpmnModel bpmnModel = modelService.getBpmnModelByDefinitionId(task.getProcessDefinitionId());
         FlowElement userTaskElement = BpmnModelUtils.getFlowElementById(bpmnModel, task.getTaskDefinitionKey());
@@ -789,6 +799,41 @@ public class BpmTaskServiceImpl implements BpmTaskService {
         moveTaskToEnd(task.getProcessInstanceId(), BpmCommentTypeEnum.REJECT.formatComment(reqVO.getReason())); // 结束流程
     }
 
+    /**
+     * 回写轮候入住驳回状态
+     */
+    private void updateCheckInWaitRejectStatus(String processInstanceId, String taskDefinitionKey) {
+        BpmBusinessFormDO businessForm = businessFormService.selectOneByProcessInstanceId(processInstanceId);
+        if (businessForm == null || !BpmBusinessTypeEnum.CHECK_IN_WAIT.getValue().equals(businessForm.getType())) {
+            return;
+        }
+        Integer status = resolveCheckInWaitRejectStatus(taskDefinitionKey);
+        if (status != null) {
+            checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(), status);
+        }
+    }
+
+    /**
+     * 驳回节点 -> 轮候状态映射
+     */
+    private Integer resolveCheckInWaitRejectStatus(String taskDefinitionKey) {
+        if (StrUtil.isBlank(taskDefinitionKey)) {
+            return null;
+        }
+        switch (taskDefinitionKey) {
+            case "first_approve":
+                return BpmCheckInWaitStatusEnum.FIRST_APPROVAL_REJECT_TO_FAMILY.getStatus();
+            case "second_approve":
+                return BpmCheckInWaitStatusEnum.SECOND_APPROVAL_REJECT_FINISHED.getStatus();
+            case "fifth_approve":
+                return BpmCheckInWaitStatusEnum.FIFTH_APPROVAL_REJECT_FINISHED.getStatus();
+            case "sixth_approve":
+                return BpmCheckInWaitStatusEnum.SIXTH_APPROVAL_REJECT_TO_FIFTH.getStatus();
+            default:
+                return BpmCheckInWaitStatusEnum.SECOND_APPROVAL_REJECT_FINISHED.getStatus();
+        }
+    }
+
     /**
      * 更新流程任务的 status 状态
      *

+ 19 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApi.java

@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.system.api.bpm;
+
+import cn.iocoder.yudao.module.system.api.bpm.vo.CheckInWaitCreateReqVO;
+import cn.iocoder.yudao.module.system.api.bpm.vo.CheckInWaitSupplementReqVO;
+
+public interface BpmCheckInWaitApi {
+
+    Long createCheckInWait(CheckInWaitCreateReqVO reqVO);
+
+    Integer updateCheckInWaitStatus(Long id, Integer status);
+
+    Integer updateCheckInWaitStatusByBusinessId(Long businessId, Integer status);
+
+    Integer updateThirdReviewInfo(CheckInWaitSupplementReqVO reqVO);
+
+    Integer updateFourthReviewInfo(CheckInWaitSupplementReqVO reqVO);
+
+    Integer updateSixthReviewInfo(CheckInWaitSupplementReqVO reqVO);
+}

+ 36 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/vo/CheckInWaitCreateReqVO.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.module.system.api.bpm.vo;
+
+import lombok.Data;
+
+@Data
+public class CheckInWaitCreateReqVO {
+
+    private Long id;
+
+    private String elderName;
+
+    private String idCard;
+
+    private String recentLivingSituation;
+
+    private String walkSituationVideo;
+
+    private String medicalRecordsWithinSixMonth;
+
+    private String idCardPhoto;
+
+    private String recentDischargeSummary;
+
+    private Long tenantId;
+
+    private Integer status;
+
+    private Long nurseLevelId;
+
+    private String remark;
+
+    private String physicalExaminationReport;
+
+    private Long bedId;
+}
+

+ 17 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/vo/CheckInWaitSupplementReqVO.java

@@ -0,0 +1,17 @@
+package cn.iocoder.yudao.module.system.api.bpm.vo;
+
+import lombok.Data;
+
+@Data
+public class CheckInWaitSupplementReqVO {
+
+    private Long id;
+
+    private Long nurseLevelId;
+
+    private String remark;
+
+    private String physicalExaminationReport;
+
+    private Long bedId;
+}

+ 79 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApiImpl.java

@@ -0,0 +1,79 @@
+package cn.iocoder.yudao.module.system.api.bpm;
+
+import cn.iocoder.yudao.module.system.api.bpm.vo.CheckInWaitCreateReqVO;
+import cn.iocoder.yudao.module.system.api.bpm.vo.CheckInWaitSupplementReqVO;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyCheckInWaitDO;
+import cn.iocoder.yudao.module.system.dal.mysql.biz.ElderlyCheckInWaitMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+
+@Service
+@Validated
+public class BpmCheckInWaitApiImpl implements BpmCheckInWaitApi {
+
+    @Resource
+    private ElderlyCheckInWaitMapper checkInWaitMapper;
+
+    @Override
+    public Long createCheckInWait(CheckInWaitCreateReqVO reqVO) {
+        ElderlyCheckInWaitDO data = new ElderlyCheckInWaitDO();
+        data.setElderName(reqVO.getElderName());
+        data.setIdCard(reqVO.getIdCard());
+        data.setRecentLivingSituation(reqVO.getRecentLivingSituation());
+        data.setWalkSituationVideo(reqVO.getWalkSituationVideo());
+        data.setMedicalRecordsWithinSixMonth(reqVO.getMedicalRecordsWithinSixMonth());
+        data.setIdCardPhoto(reqVO.getIdCardPhoto());
+        data.setRecentDischargeSummary(reqVO.getRecentDischargeSummary());
+        data.setTenantId(reqVO.getTenantId());
+        data.setStatus(reqVO.getStatus());
+        data.setNurseLevelId(reqVO.getNurseLevelId());
+        data.setRemark(reqVO.getRemark());
+        data.setPhysicalExaminationReport(reqVO.getPhysicalExaminationReport());
+        data.setBedId(reqVO.getBedId());
+        checkInWaitMapper.insert(data);
+        return data.getId();
+    }
+
+    @Override
+    public Integer updateCheckInWaitStatus(Long id, Integer status) {
+        ElderlyCheckInWaitDO updateDO = new ElderlyCheckInWaitDO();
+        updateDO.setId(id);
+        updateDO.setStatus(status);
+        return checkInWaitMapper.updateById(updateDO);
+    }
+
+    @Override
+    public Integer updateCheckInWaitStatusByBusinessId(Long businessId, Integer status) {
+        ElderlyCheckInWaitDO updateDO = new ElderlyCheckInWaitDO();
+        updateDO.setId(businessId);
+        updateDO.setStatus(status);
+        return checkInWaitMapper.updateById(updateDO);
+    }
+
+    @Override
+    public Integer updateThirdReviewInfo(CheckInWaitSupplementReqVO reqVO) {
+        ElderlyCheckInWaitDO updateDO = new ElderlyCheckInWaitDO();
+        updateDO.setId(reqVO.getId());
+        updateDO.setNurseLevelId(reqVO.getNurseLevelId());
+        updateDO.setRemark(reqVO.getRemark());
+        return checkInWaitMapper.updateById(updateDO);
+    }
+
+    @Override
+    public Integer updateFourthReviewInfo(CheckInWaitSupplementReqVO reqVO) {
+        ElderlyCheckInWaitDO updateDO = new ElderlyCheckInWaitDO();
+        updateDO.setId(reqVO.getId());
+        updateDO.setPhysicalExaminationReport(reqVO.getPhysicalExaminationReport());
+        return checkInWaitMapper.updateById(updateDO);
+    }
+
+    @Override
+    public Integer updateSixthReviewInfo(CheckInWaitSupplementReqVO reqVO) {
+        ElderlyCheckInWaitDO updateDO = new ElderlyCheckInWaitDO();
+        updateDO.setId(reqVO.getId());
+        updateDO.setBedId(reqVO.getBedId());
+        return checkInWaitMapper.updateById(updateDO);
+    }
+}

+ 148 - 95
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/kingdee/KingdeeApiImpl.java

@@ -47,7 +47,9 @@ import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exceptionCustomMsg;
 import static cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO.PACKAGE_ID_SYSTEM;
+import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.COMMON_ERROR;
 import static org.aspectj.bridge.MessageUtil.fail;
 
 /**
@@ -476,11 +478,11 @@ public class KingdeeApiImpl implements KingdeeApi {
             ElderlyInfoDO elderlyInfoDO = elderlyInfoMapper.selectById(expenseOrderDO.getElderId());
             if (null == elderlyInfoDO) continue;
             Long tenantId = expenseOrderDO.getTenantId();
-            if(tenantId == null){
+            if (tenantId == null) {
                 msg.append(elderlyInfoDO.getElderName()).append(",").append(expenseOrderDO.getBillingMonth()).append("账单不存在机构id<br/>");
                 continue;
             }
-            if(expenseOrderDO.getIsPushKingdeeReceiveBill()){
+            if (expenseOrderDO.getIsPushKingdeeReceiveBill()) {
                 msg.append(elderlyInfoDO.getElderName()).append(",").append(expenseOrderDO.getBillingMonth()).append("账单已经推送过金蝶收款单<br/>");
                 continue;
             }
@@ -488,134 +490,185 @@ public class KingdeeApiImpl implements KingdeeApi {
             if (StringUtil.isEmptyORNull(elderlyInfoDO.getKingdeeCustomerNumber())) continue;
             TenantDO tenantDO = tenantMapper.selectById(expenseOrderDO.getTenantId());
             String kingedeeCustomerId = elderlyInfoDO.getKingdeeCustomerNumber();
-            String  FBillNo = "BILL" + expenseOrderDO.getBillOrderNumber();
+            String baseBillNo = "BILL" + expenseOrderDO.getBillOrderNumber();
             String kingedeeTenantId = tenantDO.getKingdeeOrgid();
-            // 应收单默认货币
-            AtomicReference<String> FMAINBOOKSTDCURRID = new AtomicReference<>("PRE001");
-            String fid = "";
-            List<ReceiveBillSaveEntryDTO> freceivebillentryList = new ArrayList<>();
-            // 费用类型
-            // 床位费 C0001
-            // 膳食费 CI048
-            // 护理费 CI050
-            // 长护险 CI051
-            // 服务费 CI049
-            // 其他 CI046
-            // 风险预备金 CI002
-            String FSETTLETYPEID = "JSFS04_SYS";
-            String FPURPOSEID = "SFKYT01_SYS";
+            String currency = "PRE001";
+
             List<EnterpriseBankInfoDO> openAccountList = enterpriseBankInfoMapper.selectList(new LambdaQueryWrapperX<EnterpriseBankInfoDO>()
                     .eq(EnterpriseBankInfoDO::getTenantId, tenantId));
             String FACCOUNTID = "";
-            if (null != openAccountList && openAccountList.size() > 0) {
-                FACCOUNTID = openAccountList.get(0).getAccountName();
-            } else {
-                FACCOUNTID = "398460100100153498";
+            if (null != openAccountList && !openAccountList.isEmpty()) {
+                FACCOUNTID = openAccountList.get(0).getBankAccount();
             }
-//            BigDecimal payAmount = expenseOrderDO.getPayableAmount();
+            if (StringUtils.isBlank(FACCOUNTID)) {
+                throw exceptionCustomMsg(COMMON_ERROR, "不存在银行账户,请联系管理员处理");
+            }
+
+            BigDecimal normalAmount = BigDecimal.ZERO;
+            BigDecimal facilityAmount = BigDecimal.ZERO;
+            BigDecimal depositAmount = BigDecimal.ZERO;
+
             List<ExpenseOrderItemDO> expenseOrderItemList = orderItemMapper.selectList(new LambdaQueryWrapperX<ExpenseOrderItemDO>()
                     .eq(ExpenseOrderItemDO::getExpenseOrderId, expenseOrderDO.getId())
                     .eq(ExpenseOrderItemDO::getPayStatus, BooleanEnum.TRUE.getValue()));
+
             for (ExpenseOrderItemDO expenseOrderItemDO : expenseOrderItemList) {
-                if(expenseOrderItemDO.getTotalAmount().compareTo(BigDecimal.ZERO) == 0){
+                if (expenseOrderItemDO.getTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
                     continue;
                 }
-                if(BusinessConstants.LONG_TERM_CARE_INSURANCE.equals(expenseOrderItemDO.getExpenseSource())){
+                if (BusinessConstants.LONG_TERM_CARE_INSURANCE.equals(expenseOrderItemDO.getExpenseSource())) {
+                    continue;
+                }
+                String itemName = StringUtils.defaultString(expenseOrderItemDO.getItemName());
+                if (itemName.contains("设施费")) {
+                    facilityAmount = facilityAmount.add(expenseOrderItemDO.getTotalAmount());
                     continue;
                 }
                 String FCOSTID = getFCOSTID(expenseOrderItemDO);
-                if(StringUtils.isBlank(FCOSTID)){
+                if ("CI002".equals(FCOSTID)
+                        || itemName.contains("风险金")
+                        || itemName.contains("预备金")
+                        || itemName.contains("保证金")
+                        || itemName.contains("押金")) {
+                    depositAmount = depositAmount.add(expenseOrderItemDO.getTotalAmount());
                     continue;
                 }
-                ReceiveBillSaveEntryDTO freceivebillentry = ReceiveBillSaveEntryDTO.builder()
-                        .FSETTLETYPEID(KingdeeNumberDTO.builder().FNUMBER(FSETTLETYPEID).build())
-                        .FPURPOSEID(KingdeeNumberDTO.builder().FNUMBER(FPURPOSEID).build())
-                        .FRECTOTALAMOUNTFOR(expenseOrderItemDO.getTotalAmount())
-                        .FRECAMOUNTFOR_E(expenseOrderItemDO.getTotalAmount())
-                        .FRECNOTAXAMOUNTFOR(expenseOrderItemDO.getTotalAmount())
-                        .FSETTLEDISTAMOUNTFOR(new BigDecimal(0.0))
-                        .FHANDLINGCHARGEFOR(new BigDecimal(0.0))
-                        .FOVERUNDERAMOUNTFOR(new BigDecimal(0.0))
-                        .FACCOUNTID(KingdeeNumberDTO.builder().FNUMBER(FACCOUNTID).build())
-                        .FOPPOSITEBANKACCOUNT("")
-                        .FOPPOSITEBANKNAME("")
-                        .FPrice(expenseOrderItemDO.getActualPrice())
-                        .FQty(expenseOrderItemDO.getCount())
-                        .FPOSTDATE(payTimeStr)
-                        .FRECNOTAXAMOUNTFOR(expenseOrderItemDO.getTotalAmount())
-                        .FRECNOTAXAMOUNT(expenseOrderItemDO.getTotalAmount())
-                        .FWRITTENOFFTAXAMOUNTFOR(expenseOrderItemDO.getTotalAmount())
-                        .FWRITTENOFFTAXAMOUNT(expenseOrderItemDO.getTotalAmount())
-                        .FCOSTID(KingdeeNumberDTO.builder().FNUMBER(FCOSTID).build())
-                        .FCOMMENT("")
-                        .build();
-                freceivebillentryList.add(freceivebillentry);
+                normalAmount = normalAmount.add(expenseOrderItemDO.getTotalAmount());
             }
-            ReceiveBillSaveModelDTO saveModelDTO = ReceiveBillSaveModelDTO.builder()
-                    .FID(fid)
-                    .FBillNo(FBillNo)
-                    .FBillTypeID(KingdeeNumberDTO.builder().FNUMBER("SKDLX01_SYS").build())
-                    .FPAYORGID(KingdeeNumberDTO.builder().FNUMBER(kingedeeTenantId).build())
-                    .FDATE(payTimeStr)
-                    .FCONTACTUNITTYPE("BD_Customer")
-                    .FCONTACTUNIT(KingdeeNumberDTO.builder().FNUMBER(kingedeeCustomerId).build())
-                    .FPAYUNITTYPE("BD_Customer")
-                    .FPAYUNIT(KingdeeNumberDTO.builder().FNUMBER(kingedeeCustomerId).build())
-                    .FCURRENCYID(KingdeeNumberDTO.builder().FNUMBER(FMAINBOOKSTDCURRID.get()).build())
-                    .FEXCHANGERATE(new BigDecimal("1.0"))
-                    .FSETTLECUR(KingdeeNumberDTO.builder().FNUMBER(FMAINBOOKSTDCURRID.get()).build())
-                    .FSETTLERATE(new BigDecimal("1.0"))
-                    .FISINIT(Boolean.FALSE.toString())
-                    .FISCARRYRATE(Boolean.FALSE.toString())
-                    .FDOCUMENTSTATUS("Z")
-                    .FBUSINESSTYPE("1")
-                    .FCancelStatus("A")
-                    .FSETTLEMAINBOOKID(KingdeeNumberDTO.builder().FNUMBER(FMAINBOOKSTDCURRID.get()).build())
-                    .FRECEIVEBILLENTRY(freceivebillentryList)
-                    .FBUSINESSTYPE("FY")
-                    .build();
-            ReceiveBillSaveDTO saveDTO = ReceiveBillSaveDTO.builder()
-                    .IsDeleteEntry(Boolean.TRUE.toString())
-                    .IsVerifyBaseDataField(Boolean.FALSE.toString())
-                    .IsEntryBatchFill(Boolean.TRUE.toString())
-                    .ValidateFlag(Boolean.TRUE.toString())
-                    .NumberSearch(Boolean.TRUE.toString())
-                    .IsAutoAdjustField(Boolean.FALSE.toString())
-                    .InterationFlags("")
-                    .IgnoreInterationFlag("")
-                    .IsControlPrecision(Boolean.FALSE.toString())
-                    .ValidateRepeatJson(Boolean.FALSE.toString())
-                    .model(saveModelDTO)
-                    .build();
-            Gson gson = new Gson();
-            // 将ReceivableSaveDTO转换成json字符串
-            String json = gson.toJson(saveDTO);
-            System.out.println("json = " + json);
+
+            boolean needPushNormal = normalAmount.compareTo(BigDecimal.ZERO) != 0;
+            boolean needPushFacility = facilityAmount.compareTo(BigDecimal.ZERO) != 0;
+            boolean needPushDeposit = depositAmount.compareTo(BigDecimal.ZERO) != 0;
+            if (!needPushNormal && !needPushFacility && !needPushDeposit) {
+                msg.append(elderlyInfoDO.getElderName()).append(",").append(expenseOrderDO.getBillingMonth()).append("账单无可推送收款明细<br/>");
+                continue;
+            }
+
+            boolean allSuccess = true;
             try {
-                String billId = arReceivebillSave(getK3CloudApi(tenantId), json, expenseOrderDO.getBillOrderNumber(), elderId,tenantId);
+                if (needPushNormal) {
+                    List<ReceiveBillSaveEntryDTO> normalEntryList = Collections.singletonList(
+                            buildReceiveBillEntry(FACCOUNTID, payTimeStr, normalAmount, "CI001", "SFKYT01_SYS", "长者生活费")
+                    );
+                    String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber(), baseBillNo,
+                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, normalEntryList);
+                    if (StringUtils.isBlank(billId)) {
+                        allSuccess = false;
+                    }
+                }
+
+                if (needPushFacility) {
+                    List<ReceiveBillSaveEntryDTO> facilityEntryList = Collections.singletonList(
+                            buildReceiveBillEntry(FACCOUNTID, payTimeStr, facilityAmount, "CI005", "SFKYT02_SYS", "设施费")
+                    );
+                    String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber() + "-SSF", baseBillNo + "-SSF",
+                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, facilityEntryList);
+                    if (StringUtils.isBlank(billId)) {
+                        allSuccess = false;
+                    }
+                }
+
+                if (needPushDeposit) {
+                    List<ReceiveBillSaveEntryDTO> depositEntryList = Collections.singletonList(
+                            buildReceiveBillEntry(FACCOUNTID, payTimeStr, depositAmount, "CI002", "SFKYT41_SYS", "押金")
+                    );
+                    String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber() + "-YJ", baseBillNo + "-YJ",
+                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, depositEntryList);
+                    if (StringUtils.isBlank(billId)) {
+                        allSuccess = false;
+                    }
+                }
+
                 msg.append(elderlyInfoDO.getElderName()).append(",").append(expenseOrderDO.getBillingMonth()).append("账单推送金蝶收款单");
-                if(StringUtils.isBlank(billId)){
+                if (!allSuccess) {
                     msg.append("失败。<br/>");
-                }else {
+                } else {
                     msg.append("成功。<br/>");
                     expenseOrderDO.setIsPushKingdeeReceiveBill(Boolean.TRUE);
                     successSet.add(expenseOrderDO);
                 }
             } catch (Exception e) {
-                // 把异常前的成功记录更新为已推送
-                if(successSet.size() > 0){
+                if (successSet.size() > 0) {
                     orderMapper.updateBatch(successSet);
                 }
                 e.printStackTrace();
             }
         }
-        // 把异常前的成功记录更新为已推送
-        if(successSet.size() > 0){
+        if (successSet.size() > 0) {
             orderMapper.updateBatch(successSet);
         }
         return msg.toString();
     }
 
+    private ReceiveBillSaveEntryDTO buildReceiveBillEntry(String accountId, String payTimeStr, BigDecimal amount,
+                                                          String costId, String purposeId, String comment) {
+        return ReceiveBillSaveEntryDTO.builder()
+                .FSETTLETYPEID(KingdeeNumberDTO.builder().FNUMBER("JSFS04_SYS").build())
+                .FPURPOSEID(KingdeeNumberDTO.builder().FNUMBER(purposeId).build())
+                .FRECTOTALAMOUNTFOR(amount)
+                .FRECAMOUNTFOR_E(amount)
+                .FRECNOTAXAMOUNTFOR(amount)
+                .FSETTLEDISTAMOUNTFOR(BigDecimal.ZERO)
+                .FHANDLINGCHARGEFOR(BigDecimal.ZERO)
+                .FOVERUNDERAMOUNTFOR(BigDecimal.ZERO)
+                .FACCOUNTID(KingdeeNumberDTO.builder().FNUMBER(accountId).build())
+                .FOPPOSITEBANKACCOUNT("")
+                .FOPPOSITEBANKNAME("")
+                .FPrice(amount)
+                .FQty(1)
+                .FPOSTDATE(payTimeStr)
+                .FRECNOTAXAMOUNT(amount)
+                .FWRITTENOFFTAXAMOUNTFOR(amount)
+                .FWRITTENOFFTAXAMOUNT(amount)
+                .FCOSTID(KingdeeNumberDTO.builder().FNUMBER(costId).build())
+                .FCOMMENT(comment)
+                .build();
+    }
+
+    private String pushReceiveBill(Long tenantId, Long elderId, String recordBillNo, String kdBillNo,
+                                   String kingedeeTenantId, String kingedeeCustomerId, String payTimeStr,
+                                   String currency, List<ReceiveBillSaveEntryDTO> entryList) throws Exception {
+        ReceiveBillSaveModelDTO saveModelDTO = ReceiveBillSaveModelDTO.builder()
+                .FID("")
+                .FBillNo(kdBillNo)
+                .FBillTypeID(KingdeeNumberDTO.builder().FNUMBER("SKDLX01_SYS").build())
+                .FPAYORGID(KingdeeNumberDTO.builder().FNUMBER(kingedeeTenantId).build())
+                .FDATE(payTimeStr)
+                .FCONTACTUNITTYPE("BD_Customer")
+                .FCONTACTUNIT(KingdeeNumberDTO.builder().FNUMBER(kingedeeCustomerId).build())
+                .FPAYUNITTYPE("BD_Customer")
+                .FPAYUNIT(KingdeeNumberDTO.builder().FNUMBER(kingedeeCustomerId).build())
+                .FCURRENCYID(KingdeeNumberDTO.builder().FNUMBER(currency).build())
+                .FEXCHANGERATE(new BigDecimal("1.0"))
+                .FSETTLECUR(KingdeeNumberDTO.builder().FNUMBER(currency).build())
+                .FSETTLERATE(new BigDecimal("1.0"))
+                .FISINIT(Boolean.FALSE.toString())
+                .FISCARRYRATE(Boolean.FALSE.toString())
+                .FDOCUMENTSTATUS("Z")
+                .FBUSINESSTYPE("FY")
+                .FCancelStatus("A")
+                .FSETTLEMAINBOOKID(KingdeeNumberDTO.builder().FNUMBER(currency).build())
+                .FRECEIVEBILLENTRY(entryList)
+                .build();
+        ReceiveBillSaveDTO saveDTO = ReceiveBillSaveDTO.builder()
+                .IsDeleteEntry(Boolean.TRUE.toString())
+                .IsVerifyBaseDataField(Boolean.FALSE.toString())
+                .IsEntryBatchFill(Boolean.TRUE.toString())
+                .ValidateFlag(Boolean.TRUE.toString())
+                .NumberSearch(Boolean.TRUE.toString())
+                .IsAutoAdjustField(Boolean.FALSE.toString())
+                .InterationFlags("")
+                .IgnoreInterationFlag("")
+                .IsControlPrecision(Boolean.FALSE.toString())
+                .ValidateRepeatJson(Boolean.FALSE.toString())
+                .model(saveModelDTO)
+                .build();
+        Gson gson = new Gson();
+        String json = gson.toJson(saveDTO);
+        System.out.println("json = " + json);
+        return arReceivebillSave(getK3CloudApi(tenantId), json, recordBillNo, elderId, tenantId);
+    }
+
     @Override
     public K3CloudApi getK3CloudApi(Long tenantId) {
         SocialTypeEnum environment = SocialTypeEnum.KINGDEE_PRODUCT;

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/vo/ElderlyInfoPageReqVO.java

@@ -76,6 +76,9 @@ public class ElderlyInfoPageReqVO extends PageParam {
 
     @Schema(description = "排序")
     private String orderByClause;
+
+    @Schema(description = "床位id")
+    private Long bedId;
 }
 
 

+ 44 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/ElderlyCheckInWaitDO.java

@@ -0,0 +1,44 @@
+package cn.iocoder.yudao.module.system.dal.dataobject.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@TableName("elderly_check_in_wait")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ElderlyCheckInWaitDO extends BaseDO {
+
+    @TableId
+    private Long id;
+
+    private String elderName;
+
+    private String idCard;
+
+    private String recentLivingSituation;
+
+    private String walkSituationVideo;
+
+    private String medicalRecordsWithinSixMonth;
+
+    private String idCardPhoto;
+
+    private String recentDischargeSummary;
+
+    private Long tenantId;
+
+    private Integer status;
+
+    private Long nurseLevelId;
+
+    private String remark;
+
+    private String physicalExaminationReport;
+
+    private Long bedId;
+}

+ 1 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyBuildFloorActivityImageMapper.java

@@ -38,3 +38,4 @@ public interface ElderlyBuildFloorActivityImageMapper extends BaseMapperX<Elderl
 
 
 
+

+ 10 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyCheckInWaitMapper.java

@@ -0,0 +1,10 @@
+package cn.iocoder.yudao.module.system.dal.mysql.biz;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyCheckInWaitDO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ElderlyCheckInWaitMapper extends BaseMapperX<ElderlyCheckInWaitDO> {
+}
+

+ 1 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/MedicalCareRecordsMapper.java

@@ -25,7 +25,7 @@ public interface MedicalCareRecordsMapper extends BaseMapperX<MedicalCareRecords
                 .eqIfPresent(MedicalCareRecordsDO::getHandlingNote, reqVO.getHandlingNote())
                 .likeIfPresent(MedicalCareRecordsDO::getElderName, reqVO.getElderName())
                 .eqIfPresent(MedicalCareRecordsDO::getTenantId, reqVO.getTenantId())
-                .orderByDesc(MedicalCareRecordsDO::getCreateTime));
+                .orderByDesc(MedicalCareRecordsDO::getDiscoveryTime));
     }
 
 }

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/ElderlyInfoMapper.xml

@@ -90,6 +90,9 @@
         <if test="pageVO.floorId != null">
             and ei.floor_id = #{pageVO.floorId}
         </if>
+        <if test="pageVO.bedId != null">
+            and ei.bed_id = #{pageVO.bedId}
+        </if>
         <if test="pageVO.roomName != null and pageVO.roomName != '' ">
             and ei.room_name like concat('%', #{pageVO.roomName}, '%')
         </if>