From d66b806d685672f2f817986e89f69fb09d130f11 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 09 四月 2025 18:02:32 +0800
Subject: [PATCH] Merge branch 'xizang-changyun' of https://gitee.com/xiaochen991015/xizang into dev

---
 ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java
index b6939b8..a8bcb1d 100644
--- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java
+++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/IndexController.java
@@ -21,6 +21,7 @@
 import com.ruoyi.system.query.*;
 import com.ruoyi.system.service.*;
 import com.ruoyi.system.vo.*;
+import com.ruoyi.web.controller.tool.MyFileUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import jdk.nashorn.internal.parser.Token;
@@ -28,9 +29,13 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -75,6 +80,11 @@
     private TContractRentTypeService contractRentTypeService;
     @Autowired
     private StateProcessTemplateService processTemplateService;
+
+    public static void main(String[] args) throws IOException {
+        File file = new File("D:\\wechatFiles\\WeChat Files\\wxid_25nztsudcon722\\FileStorage\\File\\2025-03\\2.mp3");
+        MultipartFile multipartFile = MyFileUtil.fileToMultipartFile(file, "3333");
+    }
     /**
      * 获取轮播图管理列表
      */
@@ -192,6 +202,7 @@
                 myToDoVO.setStartTime(DateUtils.localDateTimeToStringYear(contract.getStartTime()));
                 myToDoVO.setPropertyRightPerson(tHouse.getPropertyRightPerson());
                 myToDoVO.setPhone(tHouse.getPhone());
+                myToDoVO.setRentalReturnStatus(tHouse.getRentalReturnStatus() == null ? "1" : tHouse.getRentalReturnStatus());
                 List<TBill> billList = bills.stream().filter(e -> e.getContractId().equals(contract.getId())).collect(Collectors.toList());
                 List<PayListVO> payList = new ArrayList<>();
                 for (TBill tBill : billList) {
@@ -225,9 +236,15 @@
             myToDoVO.setExamineCount((int) processTaskListVOPageInfo.getTotal());
             List<String> contractIds = billService.lambdaQuery().eq(TBill::getPayFeesStatus, 4).list()
                     .stream().map(TBill::getContractId).collect(Collectors.toList());
-            int overdueCount = contractService.lambdaQuery().in(TContract::getId, contractIds).list()
-                    .stream().map(TContract::getTenantId).distinct().collect(Collectors.toList()).size();
-            myToDoVO.setOverdueCount(overdueCount);
+            if(contractIds.isEmpty()){
+                myToDoVO.setOverdueCount(0);
+
+            }else{
+                int overdueCount = contractService.lambdaQuery().in(TContract::getId, contractIds).list()
+                        .stream().map(TContract::getTenantId).distinct().collect(Collectors.toList()).size();
+                myToDoVO.setOverdueCount(overdueCount);
+            }
+
         } else {
             myToDoVO.setExamineCount(0);
             myToDoVO.setOverdueCount(0);
@@ -251,10 +268,11 @@
     @GetMapping(value = "/getDetailById")
     public R<TCheckAcceptRecordVO> getDetailById(@RequestParam String id) {
         TCheckAcceptRecord checkAcceptRecord = checkAcceptRecordService.getById(id);
-        checkAcceptRecord.setCleanSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION, checkAcceptRecord.getCleanSituation()));
-        checkAcceptRecord.setOverallSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION, checkAcceptRecord.getOverallSituation()));
-        checkAcceptRecord.setDeviceSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION, checkAcceptRecord.getDeviceSituation()));
-        checkAcceptRecord.setFurnitureSituation(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION, checkAcceptRecord.getFurnitureSituation()));
+//        checkAcceptRecord.setCleanSituation(checkAcceptRecord.getCleanSituation());
+//        checkAcceptRecord.setOverallSituation(StringUtils.hasLength(checkAcceptRecord.getOverallSituation())?(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,checkAcceptRecord.getOverallSituation())):"");
+//        checkAcceptRecord.setDeviceSituation(StringUtils.hasLength(checkAcceptRecord.getDeviceSituation())?(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,checkAcceptRecord.getDeviceSituation())):"");
+//        checkAcceptRecord.setFurnitureSituation(StringUtils.hasLength(checkAcceptRecord.getDeviceSituation())?(DictUtils.getDictLabel(DictConstants.DICT_TYPE_CHECK_SITUATION,checkAcceptRecord.getFurnitureSituation())):"");
+
         TCheckAcceptRecordVO checkAcceptRecordVO = new TCheckAcceptRecordVO();
         BeanUtils.copyProperties(checkAcceptRecord, checkAcceptRecordVO);
         // 查询合同信息
@@ -276,7 +294,21 @@
         dto.setCode(replace.substring(2)+String.format("%03d", size+1));
         dto.setStatus(true);
         // 添加验收记录
+        dto.setCheckPerson(tokenService.getLoginUser().getUser().getNickName());
         checkAcceptRecordService.updateById(dto);
+        TCheckAcceptRecord checkAcceptRecord = checkAcceptRecordService.getById(dto.getId());
+        TContract contract = contractService.getById(checkAcceptRecord.getContractId());
+        // 添加账单
+        TBill tBill = new TBill();
+        tBill.setContractId(checkAcceptRecord.getContractId());
+        tBill.setContractNumber(contract.getContractNumber());
+        tBill.setPayableFeesMoney(dto.getCheckMoney());
+        tBill.setPayableFeesTime(LocalDate.now());
+        tBill.setPayFeesStatus("1");
+        tBill.setBillType("4");
+        tBill.setOverDays(0);
+        tBill.setOutstandingMoney(dto.getCheckMoney());
+        billService.save(tBill);
         return R.ok();
     }
     /**

--
Gitblit v1.7.1