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

修改
1、修改金蝶收款单推送单据类型
2、修改轮候模块

liangwenxuan 1 hónapja
szülő
commit
001a3b2c48
17 módosított fájl, 157 hozzáadás és 209 törlés
  1. 4 0
      yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java
  2. 2 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/business/BpmCheckInWaitController.java
  3. 2 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java
  4. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java
  5. 1 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/ModelConfigServiceImpl.java
  6. 48 0
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java
  7. 69 1
      yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
  8. 3 0
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
  9. 3 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApi.java
  10. 0 3
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/kingdee/KingdeeApi.java
  11. 7 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/bpm/BpmCheckInWaitApiImpl.java
  12. 5 193
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/kingdee/KingdeeApiImpl.java
  13. 0 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/KingdeeRecordController.java
  14. 2 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/biz/ElderlyCheckInWaitDO.java
  15. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/biz/ElderlyBuildFloorActivityImageMapper.java
  16. 3 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/KingdeeOrderBillSyncIdJob.java
  17. 4 2
      yudao-server/src/main/resources/application.yaml

+ 4 - 0
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/message/BpmMessageEnum.java

@@ -50,6 +50,10 @@ public enum BpmMessageEnum {
     CHECK_IN_PROCESS_INSTANCE_APPROVE("check_in_process_instance_approve"),
     CHECK_IN_PROCESS_INSTANCE_REJECT("check_in_process_instance_reject"),
 
+    CHECK_IN_WAIT_PROCESS_TASK_ASSIGNED("check_in_wait_process_task_assigned"),
+    CHECK_IN_WAIT_PROCESS_INSTANCE_APPROVE("check_in_wait_process_instance_approve"),
+    CHECK_IN_WAIT_PROCESS_INSTANCE_REJECT("check_in_wait_process_instance_reject"),
+
     PROCESS_INSTANCE_BACK("process_instance_back"),
 
     CHECK_IN_HANDLE("check_in_handle"),

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

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import javax.annotation.security.PermitAll;
 import javax.validation.Valid;
 
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@@ -33,6 +34,7 @@ public class BpmCheckInWaitController {
     @PostMapping("/create")
     @Operation(summary = "创建轮候入住申请")
     @TenantIgnore
+    @PermitAll
     public CommonResult<Long> create(@Valid @RequestBody BpmCheckInWaitCreateReqVO createReqVO) {
         createReqVO.setTenantId(createReqVO.getTenantId() == null ? TenantContextHolder.getTenantId() : createReqVO.getTenantId());
         return success(elderlApplyService.checkInWaitCreate(getLoginUserId(),

+ 2 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java

@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormRespVO;
 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormSaveReqVO;
@@ -66,6 +67,7 @@ public class BpmFormController {
 
     @GetMapping({"/list-all-simple", "/simple-list"})
     @Operation(summary = "获得动态表单的精简列表", description = "用于表单下拉框")
+    @TenantIgnore
     public CommonResult<List<BpmFormRespVO>> getFormSimpleList() {
         List<BpmFormDO> list = formService.getFormList();
         return success(convertList(list, formDO -> // 只返回 id、name 字段

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java

@@ -55,7 +55,7 @@ public interface BpmModelConvert {
             if (tenantMap != null && processDefinition != null) {
                 String[] arr = processDefinition.getKey().split("_");
                 if (arr.length > 2) {
-                    Long tenantId = Long.valueOf(arr[2]);
+                    Long tenantId = Long.valueOf(arr[arr.length-1]);
                     tenantInfoRespDTO = tenantMap.get(tenantId);
                 }
             }

+ 1 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/business/ModelConfigServiceImpl.java

@@ -85,7 +85,7 @@ public class ModelConfigServiceImpl implements ModelConfigService {
     public Integer getModelStatus(String modelKey) {
         ModelConfigDO modelConfigDO = modelConfigMapper.selectOne(new LambdaQueryWrapperX<ModelConfigDO>()
                 .eq(ModelConfigDO::getModelKey, modelKey)
-                .eq(ModelConfigDO::getTenantId, TenantContextHolder.getTenantId())
+                .eqIfPresent(ModelConfigDO::getTenantId, TenantContextHolder.getTenantId())
                 .eq(ModelConfigDO::getDeleted, 0));
         if (null == modelConfigDO) {
             return 1;

+ 48 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java

@@ -28,6 +28,7 @@ import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskTim
 import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
 import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
 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.BpmElderlyApi;
 import cn.iocoder.yudao.module.system.api.bpm.BpmElderlyChangeApi;
 import cn.iocoder.yudao.module.system.api.bpm.vo.ElderlyInfoReqVO;
@@ -44,6 +45,7 @@ import cn.iocoder.yudao.module.system.api.wechat.dto.WechatMessageSaveReq;
 import cn.iocoder.yudao.module.system.enums.notice.NotieBusinessTypeEnum;
 import cn.iocoder.yudao.module.system.enums.notice.NotifyPriorityEnum;
 import cn.iocoder.yudao.module.system.enums.notice.NotifyTypeEnum;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.flowable.engine.HistoryService;
@@ -89,6 +91,8 @@ public class BpmMessageServiceImpl implements BpmMessageService {
 
     @Resource
     private BpmElderlyApi bpmElderlyApi;
+    @Autowired
+    private BpmCheckInWaitApi bpmCheckInWaitApi;
 
     @Resource
     private BpmElderlyChangeApi bpmElderlyChangeApi;
@@ -368,6 +372,18 @@ public class BpmMessageServiceImpl implements BpmMessageService {
                         NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
                         NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
                 break;
+            case CHECK_IN_WAIT:
+                JSONObject checkInWaitInfo = bpmCheckInWaitApi.selectById(businessFormDO.getBusinessId2());
+                templateParams.put("nickname", user.getNickname());
+                templateParams.put("elderName", checkInWaitInfo.getString("elderName"));
+                detailUrl = getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
+                templateParams.put("detailUrl", detailUrl);
+                notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getStartUserId(),
+                        reqDTO.getProcessInstanceId(), "", detailUrl,
+                        BpmMessageEnum.CHECK_IN_WAIT_PROCESS_INSTANCE_APPROVE.getTemplateCode(), templateParams,
+                        NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
+                        NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
+                break;
             default:
                 break;
 
@@ -580,6 +596,18 @@ public class BpmMessageServiceImpl implements BpmMessageService {
                         NotieBusinessTypeEnum.BPM.getValue(), notifyType,
                         NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
                 break;
+            case CHECK_IN_WAIT:
+                detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
+                JSONObject checkInWaitInfo = bpmCheckInWaitApi.selectById(businessFormDO.getBusinessId2());
+                templateParams.put("nickname", user.getNickname());
+                templateParams.put("elderName", checkInWaitInfo.getString("elderName"));
+                templateParams.put("detailUrl", detailUrl);
+                notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getStartUserId(),
+                        reqDTO.getProcessInstanceId(), "", detailUrl,
+                        BpmMessageEnum.CHECK_IN_WAIT_PROCESS_INSTANCE_REJECT.getTemplateCode(), templateParams,
+                        NotieBusinessTypeEnum.BPM.getValue(), notifyType,
+                        NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
+                break;
             default:
                 break;
         }
@@ -783,6 +811,26 @@ public class BpmMessageServiceImpl implements BpmMessageService {
             }
         }
 
+        if (BpmBusinessTypeEnum.CHECK_IN_WAIT.getValue().equals(businessFormDO.getType())) {
+            JSONObject checkInWaitInfo = bpmCheckInWaitApi.selectById(businessFormDO.getBusinessId2());
+            templateParams.put("nickname", user.getNickname());
+            templateParams.put("elderName", checkInWaitInfo.getString("elderName"));
+            detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
+            templateParams.put("detailUrl", detailUrl);
+            notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getAssigneeUserId(),
+                    reqDTO.getProcessInstanceId(), reqDTO.getTaskId(), detailUrl,
+                    BpmMessageEnum.CHECK_IN_WAIT_PROCESS_TASK_ASSIGNED.getTemplateCode(), templateParams,
+                    NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
+                    NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
+            if (reqDTO.getStartUserId().equals(loginUserId)) {
+                notifyMessageSendApi.sendSingleMessageToAdminByDTO(BpmMessageConvert.INSTANCE.messageConvert(loginUserId,
+                        reqDTO.getProcessInstanceId(), reqDTO.getTaskId(), detailUrl,
+                        BpmMessageEnum.CHECK_IN_WAIT_PROCESS_TASK_ASSIGNED.getTemplateCode(), templateParams,
+                        NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
+                        NotifyPriorityEnum.MEDIUM.getValue(), 1, assigneeUser.getTenantId()));
+            }
+        }
+
         if (null == approveMethod && startNodeFlag) {
             elderlyInfo = bpmElderlyApi.getElderlyInfo(businessFormDO.getBusinessId2());
             templateParams.put("nickname", user.getNickname());

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

@@ -40,6 +40,7 @@ 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.bpm.vo.CheckInWaitSupplementReqVO;
 import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
 import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
 import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
@@ -608,10 +609,16 @@ public class BpmTaskServiceImpl implements BpmTaskService {
                 BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason()));
         // 2.3 调用 BPM complete 去完成任务
         // 其中,variables 是存储动态表单到 local 任务级别。过滤一下,避免 ProcessInstance 系统级的变量被占用
+        Map<String, Object> variables = null;
         if (CollUtil.isNotEmpty(reqVO.getVariables())) {
-            Map<String, Object> variables = FlowableUtils.filterTaskFormVariable(reqVO.getVariables());
+            variables = FlowableUtils.filterTaskFormVariable(reqVO.getVariables());
             // 修改表单的值需要存储到 ProcessInstance 变量
             runtimeService.setVariables(task.getProcessInstanceId(), variables);
+        }
+        // 轮候入住流程在审批通过时,根据节点+变量补充业务字段
+        handleCheckInWaitApprove(task.getProcessInstanceId(), task.getTaskDefinitionKey(), variables);
+
+        if (CollUtil.isNotEmpty(variables)) {
             taskService.complete(task.getId(), variables, true);
         } else {
             taskService.complete(task.getId());
@@ -647,6 +654,67 @@ public class BpmTaskServiceImpl implements BpmTaskService {
     }
 
     /**
+     * 轮候入住流程审批通过时,根据审批节点补充业务数据
+     */
+    private void handleCheckInWaitApprove(String processInstanceId, String taskDefinitionKey, Map<String, Object> variables) {
+        BpmBusinessFormDO businessForm = businessFormService.selectOneByProcessInstanceId(processInstanceId);
+        if (businessForm == null || !BpmBusinessTypeEnum.CHECK_IN_WAIT.getValue().equals(businessForm.getType())) {
+            return;
+        }
+        if (StrUtil.isBlank(taskDefinitionKey)) {
+            return;
+        }
+        CheckInWaitSupplementReqVO reqVO = new CheckInWaitSupplementReqVO();
+        reqVO.setId(businessForm.getBusinessId());
+        String key = taskDefinitionKey.toLowerCase();
+        if ("third_approve".equals(key)) {
+            reqVO.setNurseLevelId(parseLong(variables, "nurseLevelId"));
+            reqVO.setRemark(parseString(variables, "remark"));
+            if (reqVO.getNurseLevelId() != null || StrUtil.isNotBlank(reqVO.getRemark())) {
+                checkInWaitApi.updateThirdReviewInfo(reqVO);
+            }
+            checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(),
+                    BpmCheckInWaitStatusEnum.THIRD_APPROVAL_PASSED_WAIT_FOURTH_APPROVAL.getStatus());
+            return;
+        }
+        if ("fourth_approve".equals(key)) {
+            reqVO.setPhysicalExaminationReport(parseString(variables, "physicalExaminationReport"));
+            if (StrUtil.isNotBlank(reqVO.getPhysicalExaminationReport())) {
+                checkInWaitApi.updateFourthReviewInfo(reqVO);
+            }
+            checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(),
+                    BpmCheckInWaitStatusEnum.FOURTH_APPROVAL_PASSED_WAIT_FIFTH_APPROVAL.getStatus());
+            return;
+        }
+        if ("sixth_approve".equals(key)) {
+            reqVO.setBedId(parseLong(variables, "bedId"));
+            if (reqVO.getBedId() != null) {
+                checkInWaitApi.updateSixthReviewInfo(reqVO);
+            }
+            checkInWaitApi.updateCheckInWaitStatusByBusinessId(businessForm.getBusinessId(),
+                    BpmCheckInWaitStatusEnum.APPROVED_FINISHED.getStatus());
+        }
+    }
+
+    private Long parseLong(Map<String, Object> variables, String key) {
+        if (variables == null || variables.get(key) == null) {
+            return null;
+        }
+        Object value = variables.get(key);
+        if (value instanceof Number) {
+            return ((Number) value).longValue();
+        }
+        return NumberUtils.parseLong(String.valueOf(value));
+    }
+
+    private String parseString(Map<String, Object> variables, String key) {
+        if (variables == null || variables.get(key) == null) {
+            return null;
+        }
+        return String.valueOf(variables.get(key));
+    }
+
+    /**
      * 审批通过存在“后加签”的任务。
      * <p>
      * 注意:该任务不能马上完成,需要一个中间状态(APPROVING),并激活剩余所有子任务(PROCESS)为可审批处理

+ 3 - 0
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.URLUtil;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
 import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.*;
 import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
 import cn.iocoder.yudao.module.infra.service.file.FileService;
@@ -47,6 +48,8 @@ public class FileController {
     @PostMapping("/upload")
     @Operation(summary = "上传文件", description = "模式一:后端上传文件")
     @LogRecord(type = UPLOAD_FILE_TYPE,subType = UPLOAD_FILE,success = UPLOAD_FILE_SUCCESS, bizNo = "{{#file.size}}",extra = "{{#uploadReqVO.elderId}}" )
+    @PermitAll
+    @TenantIgnore
     public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
         MultipartFile file = uploadReqVO.getFile();
         String path = uploadReqVO.getPath();

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

@@ -2,6 +2,7 @@ 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 com.alibaba.fastjson.JSONObject;
 
 public interface BpmCheckInWaitApi {
 
@@ -16,4 +17,6 @@ public interface BpmCheckInWaitApi {
     Integer updateFourthReviewInfo(CheckInWaitSupplementReqVO reqVO);
 
     Integer updateSixthReviewInfo(CheckInWaitSupplementReqVO reqVO);
+
+    JSONObject selectById(Long id);
 }

+ 0 - 3
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/kingdee/KingdeeApi.java

@@ -14,9 +14,6 @@ public interface KingdeeApi {
     Integer syncArReceivable(Long tenantId, String billingMonth,Long elderId);
     Integer syncArReceivable(Long tenantId, String billingMonth);
 
-    // 收款单
-    Integer syncArReceivebill(Long tenantId);
-
 
     String syncArReceivebillNew(Long expenseOrderId);
     String syncArReceivebillNewBatch(List<Long> expenseOrderId);

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

@@ -4,6 +4,7 @@ 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 com.alibaba.fastjson.JSONObject;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
@@ -76,4 +77,10 @@ public class BpmCheckInWaitApiImpl implements BpmCheckInWaitApi {
         updateDO.setBedId(reqVO.getBedId());
         return checkInWaitMapper.updateById(updateDO);
     }
+
+    @Override
+    public JSONObject selectById(Long id) {
+        ElderlyCheckInWaitDO elderlyCheckInWaitDO = checkInWaitMapper.selectById(id);
+        return (JSONObject) JSONObject.toJSON(elderlyCheckInWaitDO);
+    }
 }

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

@@ -269,194 +269,6 @@ public class KingdeeApiImpl implements KingdeeApi {
 
     @Override
     @TenantIgnore
-    public Integer syncArReceivebill(Long tenantId) {
-        Integer payStatus = 1;
-        List<ExpenseOrderDO> expenseOrderDOS = orderMapper.selectList(new LambdaQueryWrapperX<ExpenseOrderDO>()
-                .eq(ExpenseOrderDO::getPayStatus, payStatus)
-                .eq(ExpenseOrderDO::getBillingMonth, "2025-05")
-                .eq(ExpenseOrderDO::getTenantId, tenantId));
-        if (null == expenseOrderDOS) {
-            return 0;
-        }
-
-        // 根据elderId , billingMonth ,payStatus比较相同,保留createdTime最新的数据
-        List<ExpenseOrderDO> deduplicate = deduplicate(expenseOrderDOS);
-
-        for (ExpenseOrderDO expenseOrderDO : deduplicate) {
-            if (expenseOrderDO.getBillingMonth().compareTo("2024-11") < 0) {
-                continue;
-            }
-            String payTimeStr = DateUtils.formatDate(expenseOrderDO.getPayTime(), DateUtils.FORMAT_YEAR_MONTH_DAY);
-            ElderlyInfoDO elderlyInfoDO = elderlyInfoMapper.selectById(expenseOrderDO.getElderId());
-            if (null == elderlyInfoDO) continue;
-            if (StringUtil.isEmptyORNull(elderlyInfoDO.getKingdeeCustomerNumber())) continue;
-            if (!elderlyInfoDO.getElderName().equals("吕福元")) continue;
-            TenantDO tenantDO = tenantMapper.selectById(expenseOrderDO.getTenantId());
-//            String customerid = StringUtil.isNotEmptyORNull(elderlyInfoDO.getCustomerid()) ? elderlyInfoDO.getCustomerid() : "CUST0002";
-            String customerid = StringUtil.isNotEmptyORNull(elderlyInfoDO.getKingdeeCustomerNumber()) ? elderlyInfoDO.getKingdeeCustomerNumber() : "CUST0002";
-
-            String tenantid = StringUtil.isNotEmptyORNull(tenantDO.getKingdeeOrgid()) ? tenantDO.getKingdeeOrgid() : "106";
-
-            String  FBillNo = "BILL" + expenseOrderDO.getBillOrderNumber();
-
-            // 应收单默认货币
-            AtomicReference<String> FMAINBOOKSTDCURRID = new AtomicReference<>("PRE001");
-            List<KingdeeRecordDO> kingdeeRecordDOS = kingdeeRecordMapper.selectList(new LambdaQueryWrapperX<KingdeeRecordDO>()
-                    .eq(KingdeeRecordDO::getFBillNo, FBillNo)
-                    .eq(KingdeeRecordDO::getSyncState, 1)
-                    .orderByDesc(KingdeeRecordDO::getId).last("LIMIT 1"));
-            String fid = "";
-            if (null != kingdeeRecordDOS && kingdeeRecordDOS.size() > 0) {
-                KingdeeRecordDO kingdeeRecordDO = kingdeeRecordDOS.get(0);
-                fid = kingdeeRecordDO.getFid();
-            }
-            List<ReceiveBillSaveEntryDTO> freceivebillentryList = new ArrayList<>();
-
-            List<ExpenseOrderItemDO> expenseOrderItemDOS = orderItemMapper.selectList(new LambdaQueryWrapperX<ExpenseOrderItemDO>()
-                    .eq(ExpenseOrderItemDO::getExpenseOrderId, expenseOrderDO.getId())
-                    .eq(ExpenseOrderItemDO::getPayStatus, expenseOrderDO.getPayStatus()));
-            if (null == expenseOrderItemDOS) {
-                continue;
-            }
-
-
-            expenseOrderItemDOS.forEach(expenseOrderItemDO -> {
-                // 费用类型
-                // 床位费 CI047
-                // 膳食费 CI109
-                // 护理费 CI111
-
-                // 风险预备金 CI002
-                // 保证金 CI003
-                String FCOSTID = "CI047";
-                String FSETTLETYPEID = "JSFS04_SYS";
-                String FPURPOSEID = "SFKYT01_SYS";
-//                String FACCOUNTID = "398460100100148998";
-//                String FACCOUNTID = "398460100100153498";
-                String FACCOUNTID = "713373400267";
-
-                if (BusinessConstants.EXPENSE_ITEM.equals(expenseOrderItemDO.getExpenseSource())) {
-                    ExpenseItemDO expenseItemDO = expenseItemMapper.selectById(expenseOrderItemDO.getSourceExpenseItemId());
-                    if (null == expenseItemDO) return;
-                    OverheadChargeDO overheadChargeDO = overheadChargeMapper.selectById(expenseItemDO.getItemId());
-                    if (null != overheadChargeDO && StringUtil.isNotEmptyORNull(overheadChargeDO.getKingdeeCostid())) {
-                        FCOSTID = overheadChargeDO.getKingdeeCostid();
-                    }
-                }
-
-                ExpensePayOrderDO expensePayOrderDO = payOrderMapper.selectById(expenseOrderItemDO.getPayOrderId());
-                if (null != expensePayOrderDO) {
-                    List<ExpensePayOrderItemDO> expensePayOrderItemDOS = payOrderItemMapper.selectList(new LambdaQueryWrapperX<ExpensePayOrderItemDO>()
-                            .eq(ExpensePayOrderItemDO::getPayOrderId, expensePayOrderDO.getId())
-                            .eq(ExpensePayOrderItemDO::getTenantId, tenantId).orderByAsc(ExpensePayOrderItemDO::getId));
-                    if (null != expensePayOrderItemDOS && expensePayOrderItemDOS.size() > 0) {
-                        ExpensePayOrderItemDO expensePayOrderItemDO = expensePayOrderItemDOS.get(0);
-                        if (StringUtil.isNotEmptyORNull(expensePayOrderItemDO.getCurrencyCode())) {
-                            FMAINBOOKSTDCURRID.set(expensePayOrderItemDO.getCurrencyCode());
-                        }
-                        if (StringUtil.isNotEmptyORNull(expensePayOrderItemDO.getBankAccount())) {
-                            FACCOUNTID = expensePayOrderItemDO.getBankAccount();
-                        }
-                    }
-                }
-
-                BigDecimal roundAmount = expenseOrderItemDO.getRoundAmount();
-                if (null == roundAmount) return;
-
-                String count = expenseOrderItemDO.getCount().toString();
-                // 判断是负数
-                if (roundAmount.compareTo(BigDecimal.ZERO) < 0) {
-                    count = "-" + count;
-                }
-                DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateUtils.FORMAT_YEAR_MONTH_DAY);
-                LocalDate billingDate = LocalDate.parse(expenseOrderDO.getBillingMonth() + "-01", formatter);
-                LocalDate lastDayOfMonth = billingDate.withDayOfMonth(billingDate.lengthOfMonth());
-                // 转换成String
-                String lastDayOfMonthStr = lastDayOfMonth.format(formatter);
-                ReceiveBillSaveEntryDTO freceivebillentry = ReceiveBillSaveEntryDTO.builder()
-                        .FSETTLETYPEID(KingdeeNumberDTO.builder().FNUMBER(FSETTLETYPEID).build())
-                        .FPURPOSEID(KingdeeNumberDTO.builder().FNUMBER(FPURPOSEID).build())
-                        .FRECTOTALAMOUNTFOR(roundAmount)
-                        .FRECAMOUNTFOR_E(roundAmount)
-                        .FRECNOTAXAMOUNTFOR(roundAmount)
-                        .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.getPrice())
-                        .FQty(expenseOrderItemDO.getCount())
-                        .FPOSTDATE(lastDayOfMonthStr)
-                        .FRECNOTAXAMOUNTFOR(roundAmount)
-                        .FRECNOTAXAMOUNT(roundAmount)
-                        .FWRITTENOFFTAXAMOUNTFOR(roundAmount)
-                        .FWRITTENOFFTAXAMOUNT(roundAmount)
-                        .FCOSTID(KingdeeNumberDTO.builder().FNUMBER(FCOSTID).build())
-                        .FCOMMENT(expenseOrderItemDO.getItemName())
-                        .build();
-                freceivebillentryList.add(freceivebillentry);
-            });
-
-
-            ReceiveBillSaveModelDTO saveModelDTO = ReceiveBillSaveModelDTO.builder()
-                    .FID(fid)
-                    .FBillNo(FBillNo)
-                    .FBillTypeID(KingdeeNumberDTO.builder().FNUMBER("SKDLX01_SYS").build())
-                    .FPAYORGID(KingdeeNumberDTO.builder().FNUMBER(tenantid).build())
-//                    .FSETTLEORGID(KingdeeNumberDTO.builder().FNUMBER(tenantid).build())
-//                    .FSALEORGID(KingdeeNumberDTO.builder().FNUMBER(tenantid).build())
-                    .FDATE(expenseOrderDO.getBillingMonth())
-                    .FCONTACTUNITTYPE("BD_Customer")
-                    .FCONTACTUNIT(KingdeeNumberDTO.builder().FNUMBER(customerid).build())
-                    .FPAYUNITTYPE("BD_Customer")
-                    .FPAYUNIT(KingdeeNumberDTO.builder().FNUMBER(customerid).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);
-            try {
-                String billId = arReceivebillSave(getK3CloudApi(tenantId), json, expenseOrderDO.getBillOrderNumber(), expenseOrderDO.getElderId(),tenantId);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-
-        return null;
-    }
-    @Override
-    @TenantIgnore
     public String syncArReceivebillNewBatch(List<Long> expenseOrderIdList) {
         return handleSyncArReceivebillNew(expenseOrderIdList);
     }
@@ -551,7 +363,7 @@ public class KingdeeApiImpl implements KingdeeApi {
                             buildReceiveBillEntry(FACCOUNTID, payTimeStr, normalAmount, "CI001", "SFKYT01_SYS", "长者生活费")
                     );
                     String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber(), baseBillNo,
-                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, normalEntryList);
+                            "SKDLX02_SYS", kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, normalEntryList);
                     if (StringUtils.isBlank(billId)) {
                         allSuccess = false;
                     }
@@ -562,7 +374,7 @@ public class KingdeeApiImpl implements KingdeeApi {
                             buildReceiveBillEntry(FACCOUNTID, payTimeStr, facilityAmount, "CI005", "SFKYT02_SYS", "设施费")
                     );
                     String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber() + "-SSF", baseBillNo + "-SSF",
-                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, facilityEntryList);
+                            "SKDLX01_SYS", kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, facilityEntryList);
                     if (StringUtils.isBlank(billId)) {
                         allSuccess = false;
                     }
@@ -573,7 +385,7 @@ public class KingdeeApiImpl implements KingdeeApi {
                             buildReceiveBillEntry(FACCOUNTID, payTimeStr, depositAmount, "CI002", "SFKYT41_SYS", "押金")
                     );
                     String billId = pushReceiveBill(tenantId, elderId, expenseOrderDO.getBillOrderNumber() + "-YJ", baseBillNo + "-YJ",
-                            kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, depositEntryList);
+                            "SKDLX02_SYS", kingedeeTenantId, kingedeeCustomerId, payTimeStr, currency, depositEntryList);
                     if (StringUtils.isBlank(billId)) {
                         allSuccess = false;
                     }
@@ -626,12 +438,12 @@ public class KingdeeApiImpl implements KingdeeApi {
     }
 
     private String pushReceiveBill(Long tenantId, Long elderId, String recordBillNo, String kdBillNo,
-                                   String kingedeeTenantId, String kingedeeCustomerId, String payTimeStr,
+                                   String billTypeId, 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())
+                .FBillTypeID(KingdeeNumberDTO.builder().FNUMBER(billTypeId).build())
                 .FPAYORGID(KingdeeNumberDTO.builder().FNUMBER(kingedeeTenantId).build())
                 .FDATE(payTimeStr)
                 .FCONTACTUNITTYPE("BD_Customer")

+ 0 - 5
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/biz/KingdeeRecordController.java

@@ -55,11 +55,6 @@ public class KingdeeRecordController {
     @PreAuthorize("@ss.hasPermission('sync:kingdee-record:query')")
     public CommonResult<Integer> getKingdeeRecord(@RequestParam("param") String param) {
         Integer result = 0;
-        if ("0".equals(param)) {
-            result = kingdeeApi.syncArReceivebill(1l);
-        } else {
-            result = kingdeeApi.syncArReceivebill(1l);
-        }
 
         return CommonResult.success((result));
     }

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

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.system.dal.dataobject.biz;
 
 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseNoDeleteDO;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -11,7 +12,7 @@ import lombok.ToString;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
-public class ElderlyCheckInWaitDO extends BaseDO {
+public class ElderlyCheckInWaitDO extends BaseNoDeleteDO {
 
     @TableId
     private Long id;

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

@@ -39,3 +39,6 @@ public interface ElderlyBuildFloorActivityImageMapper extends BaseMapperX<Elderl
 
 
 
+
+
+

+ 3 - 2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/KingdeeOrderBillSyncIdJob.java

@@ -35,8 +35,9 @@ public class KingdeeOrderBillSyncIdJob implements JobHandler {
         }
         Long tenantId = tenantIdElement.getAsLong();
         // 收款单
-        Integer syncCount = kingdeeApi.syncArReceivebill(tenantId);
-        return String.format("租户{}同步金蝶用户账单数量{}", TenantContextHolder.getTenantId(), syncCount);
+//        Integer syncCount = kingdeeApi.syncArReceivebill(tenantId);
+//        return String.format("租户{}同步金蝶用户账单数量{}", TenantContextHolder.getTenantId(), syncCount);
+        return "";
     }
 
 }

+ 4 - 2
yudao-server/src/main/resources/application.yaml

@@ -3,8 +3,8 @@ spring:
     name: yudao-server
 
   profiles:
-#    active: test
-    active: dev
+    active: test
+#    active: dev
 
 
   main:
@@ -238,6 +238,8 @@ yudao:
       - /admin-api/elderly-nursing-log/list
       - /admin-api/elderlyInfo/miniGetElderInfo
       - /admin-api/ward/roundRecord/create
+      - /admin-api/infra/file/upload
+#      - /admin-api/bpm/check-in-wait/create
     ignore-tables:
       - system_tenant
       - system_groups