liukangdong
2024-12-03 669de807372597eb58bd6b1555ffabab99489691
Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei
已添加1个文件
已修改15个文件
275 ■■■■ 文件已修改
admin/src/api/customer.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/client/components/OperaYwCustomerWindow.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/client/components/staffEdit.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/contract/components/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/contract/components/contractEdit.vue 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProjectCloudController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/DataDTO.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProjectService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwCustomerServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwRoomServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/customer.js
@@ -11,3 +11,9 @@
export function list (data) {
  return request.post('/visitsAdmin/cloudService/business/ywCustomer/list', data)
}
// é˜œå®è¿ç»´ - æŸ¥è¯¢è”系人列表
export function ywList (data) {
  return request.post('/visitsAdmin/cloudService/business/member/ywList', data)
}
admin/src/views/client/components/OperaYwCustomerWindow.vue
@@ -45,7 +45,9 @@
          <el-form-item label="证件号码" prop="member.idcardNo">
            <el-input v-model="form.member.idcardNo" placeholder="请输入" v-trim />
          </el-form-item>
          <el-form-item label="邮箱" prop="email">
          <el-form-item label="邮箱" prop="member.email" :rules="[
            { required: false, type: 'email', message: '请输入正确的邮箱格式'}
          ]">
            <el-input v-model="form.member.email" placeholder="请输入邮箱" v-trim />
          </el-form-item>
        </template>
@@ -264,4 +266,4 @@
    }
  }
}
</style>
</style>
admin/src/views/client/components/staffEdit.vue
@@ -32,7 +32,9 @@
        <el-form-item label="证件号码" prop="member.idcardNo">
          <el-input v-model="form.idcardNo" placeholder="请输入" v-trim />
        </el-form-item>
        <el-form-item label="邮箱" prop="email">
        <el-form-item label="邮箱" prop="email" :rules="[
          { required: false, type: 'email', message: '请输入正确的邮箱格式'}
        ]">
          <el-input v-model="form.email" placeholder="请输入邮箱" v-trim />
        </el-form-item>
        <el-form-item label="性别">
@@ -213,4 +215,4 @@
    }
  }
}
</style>
</style>
admin/src/views/contract/components/config.js
@@ -9,7 +9,7 @@
  roundedUp: [{ required: true, message: '请选择' }],
  companyId: [{ required: true, message: '请选择' }],
  renterName: [{ required: true, message: '请选择' }],
  memberName: [{ required: true, message: '请选择' }],
  memberId: [{ required: true, message: '请选择' }],
  zlDeposit: [{ required: true, message: '请输入' }],
  zlPayType: [{ required: true, message: '请选择' }],
  wyDeposit: [{ required: true, message: '请输入' }],
admin/src/views/contract/components/contractEdit.vue
@@ -1,6 +1,4 @@
<template>
<!--  :text="activeTabs === 0 ? '下一步' : '提交'"-->
<!--  :backText="activeTabs === 0 ? '返回' : '上一步'"-->
  <GlobalWindow
    width="100%"
    :title="title"
@@ -42,7 +40,7 @@
                <el-date-picker type="date" v-model="form.endDate" @change="getHouseData" :clearable="false" value-format="yyyy-MM-dd" placeholder="请选择" />
              </el-form-item>
              <el-form-item label="归属项目" prop="projectId">
                <el-select v-model="form.projectId" placeholder="请选择">
                <el-select v-model="form.projectId" @change="getHouseTree" placeholder="请选择">
                  <el-option v-for="(item, index) in projectList" :key="index" :value="item.id" :label="item.name"></el-option>
                </el-select>
              </el-form-item>
@@ -65,8 +63,11 @@
                  <el-input v-model="form.renterName" readonly placeholder="请点击选择租客" />
                </div>
              </el-form-item>
              <el-form-item label="联系人" prop="memberName">
                <el-input v-model="form.memberName" readonly placeholder="请点击选择租客" />
              <el-form-item label="联系人" prop="memberId">
                <el-select v-model="form.memberId" placeholder="请选择">
                  <el-option v-for="(item, index) in contactsList" :key="index" :value="item.id" :label="item.name"></el-option>
                </el-select>
<!--                <el-input v-model="form.memberName" readonly placeholder="请点击选择租客" />-->
              </el-form-item>
            </div>
          </el-form>
@@ -294,6 +295,7 @@
import MemberSearch from '@/components/common/MemberSearch'
import { rules } from './config'
import { create, getBillList } from '@/api/contract'
import { ywList } from '@/api/customer'
import { getUserList } from '@/api/system/user'
import { getProjectList, tree } from '@/api/project/ywProject'
import { companyList } from '@/api/company'
@@ -335,6 +337,7 @@
        zlDate: [],
        zlDetailList: [
          {
            circleType: 0,
            startDate: '',
            endDate: '',
            time: [],
@@ -350,6 +353,7 @@
        wyDate: [],
        wyDetailList: [
          {
            circleType: 0,
            startDate: '',
            endDate: '',
            time: [],
@@ -367,6 +371,8 @@
      wyList: [],
      
      rules,
      contactsList: [],
      loadingInstance: null,
      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
@@ -407,6 +413,7 @@
    open (title, target) {
      this.title = title
      this.ids = []
      this.houseList = []
      this.getUser()
      this.getProject()
      this.getCompany()
@@ -422,18 +429,20 @@
        }
        this.form.zlDetailList = [
          {
            startDate: '',
            endDate: '',
            time: [],
            circleType: 0,
            startDate: this.form.startDate,
            endDate: this.form.endDate,
            time: [this.form.startDate, this.form.endDate],
            price: '',
            advanceDays: ''
          }
        ]
        this.form.wyDetailList = [
          {
            startDate: '',
            endDate: '',
            time: [],
            circleType: 0,
            startDate: this.form.startDate,
            endDate: this.form.endDate,
            time: [this.form.startDate, this.form.endDate],
            price: '',
            advanceDays: ''
          }
@@ -444,7 +453,15 @@
        this.form.signDate = this.getDayTime()
        this.form.startDate = this.getDayTime()
        this.form.endDate = this.getDayTime(1)
        this.getHouseTree()
        // this.getHouseTree()
      })
    },
    // èŽ·å–è”ç³»äºº
    getYwList () {
      ywList({
        customerId: this.form.renterId
      }).then(res => {
        this.contactsList = res
      })
    },
    getHouseData () {
@@ -470,10 +487,34 @@
        return `${year + 1}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
      }
    },
    clearData () {
      this.form.zlDetailList = [
        {
          circleType: 0,
          startDate: this.form.startDate,
          endDate: this.form.endDate,
          time: [this.form.startDate, this.form.endDate],
          price: '',
          advanceDays: ''
        }
      ]
      this.form.wyDetailList = [
        {
          circleType: 0,
          startDate: this.form.startDate,
          endDate: this.form.endDate,
          time: [this.form.startDate, this.form.endDate],
          price: '',
          advanceDays: ''
        }
      ]
    },
    confirm () {
      if (this.activeTabs === 0) {
        this.$refs.form.validate((valid) => {
          if (!valid) return
          if (this.form.roomIds.length === 0) return this.$message.warning('请选择房源!')
          this.clearData()
          this.activeTabs = 1
        })
      } else if (this.activeTabs === 1) {
@@ -539,7 +580,8 @@
    getHouseTree () {
      tree({
        startDate: this.form.startDate,
        endDate: this.form.endDate
        endDate: this.form.endDate,
        projectId: this.form.projectId
      })
        .then(res => {
          res.forEach(item => {
@@ -590,18 +632,20 @@
    },
    addZl () {
      this.form.zlDetailList.push({
        startDate: '',
        endDate: '',
        time: [],
        circleType: 0,
        startDate: this.form.startDate,
        endDate: this.form.endDate,
        time: [this.form.startDate, this.form.endDate],
        price: '',
        advanceDays: ''
      })
    },
    addWy () {
      this.form.wyDetailList.push({
        startDate: '',
        endDate: '',
        time: [],
        circleType: 0,
        startDate: this.form.startDate,
        endDate: this.form.endDate,
        time: [this.form.startDate, this.form.endDate],
        price: '',
        advanceDays: ''
      })
@@ -625,8 +669,9 @@
    getTenant (row) {
      this.form.renterId = row.id
      this.form.renterName = row.name
      this.form.memberId = row.memberId
      this.form.memberName = row.memberName
      this.form.memberId = ''
      this.form.memberName = ''
      this.getYwList()
    },
    dele (imgaddr) {
      this.form.fileList.forEach((item, index) => {
@@ -718,6 +763,7 @@
  position: sticky;
  top: 0;
  left: 0;
  z-index: 999;
}
.tabs {
  border-bottom: 1px solid #DFE2E8;
server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java
@@ -39,17 +39,17 @@
     *                                ä»¥å¹´ä¸ºå•位相差为:6å¹´
     *                                ä»¥æœˆä¸ºå•位相差为:73个月
     *                                ä»¥æ—¥ä¸ºå•位相差为:2220天
     * @param fromDate
     * @param toDate
     * @param toDateOrigin
     * @return
     */
    public static DateCompare dayCompare(Date fromDate,Date toDate,Date freeStart,Date freeEnd){
    public static DateCompare dayCompare(Date fromDateOrigin,Date toDateOrigin,Date freeStart,Date freeEnd){
        //开始时间往后延伸,除去有效时期
        fromDate = DateUtil.addDaysToDate(fromDate,getIntersectingDays(fromDate,DateUtil.addDaysToDate(toDate,1),freeStart,DateUtil.addDaysToDate(freeEnd,1)));
        if(toDate.getTime()<  fromDate.getTime()){
        Date fromDate = DateUtil.addDaysToDate(fromDateOrigin,getIntersectingDays(fromDateOrigin,DateUtil.addDaysToDate(toDateOrigin,1),freeStart,DateUtil.addDaysToDate(freeEnd,1)));
        if(toDateOrigin.getTime()<  fromDate.getTime()){
            return DateCompare.builder().day(0).month(0).year(0).yearFloat(new BigDecimal(0)).monthFloat(new BigDecimal(0)).build();
        }
        toDate = DateUtil.addDaysToDate(toDate,1);//包含截止日期
        Date toDate =DateUtil.addDaysToDate(toDateOrigin, 1);
//        toDate = DateUtil.addDaysToDate(toDate,1);//包含截止日期
        Calendar  from  =  Calendar.getInstance();
        from.setTime(fromDate);
        Calendar  to  =  Calendar.getInstance();
@@ -67,7 +67,7 @@
        BigDecimal yearFloat = new BigDecimal(year) ;
        BigDecimal monthFloat = new BigDecimal(month) ;
        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate)+1);
        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate));
        if(yearDays!=0){
            if(yearDays <0){
                year = year-1;
@@ -76,7 +76,7 @@
            }
            yearFloat = yearFloat.add(new BigDecimal(1.0*yearDays).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
        }
        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)+1) ;
        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)) ;
        if(monthDays!=0){
            if(monthDays <0){
                month = month-1;
@@ -89,7 +89,7 @@
    }
    public static void main(String[] args) {
        DateCompare dateCompare =   DateCompare.monthYearCompare(DateUtil.getDateFromString("2024-12-02 00:00:00"),DateUtil.getDateByString("2025-01-02 00:00:00") );
        DateCompare dateCompare =   DateCompare.monthYearCompare(DateUtil.getDateFromString("2025-06-03 00:00:00"),DateUtil.getDateByString("2025-09-02 00:00:00") );
        System.out.println(dateCompare.day);
        System.out.println(dateCompare.monthDays);
        System.out.println(dateCompare.month);
@@ -99,9 +99,9 @@
        System.out.println(dateCompare.year);
        System.out.println(dateCompare.yearFloat);
    }
    public static DateCompare monthYearCompare(Date fromDate,Date toDate ){
    public static DateCompare monthYearCompare(Date fromDate,Date toDateOrigin ){
        //开始时间往后延伸,除去有效时期
        toDate =DateUtil.addDaysToDate(toDate, 1);
        Date toDate =DateUtil.addDaysToDate(toDateOrigin, 1);
        Calendar  from  =  Calendar.getInstance();
        from.setTime(fromDate);
        Calendar  to  =  Calendar.getInstance();
@@ -119,7 +119,7 @@
        BigDecimal yearFloat = new BigDecimal(year) ;
        BigDecimal monthFloat = new BigDecimal(month) ;
        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate)+1);
        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate));
        if(yearDays!=0){
            if(yearDays <0){
                year = year-1;
@@ -128,7 +128,7 @@
            }
            yearFloat = yearFloat.add(new BigDecimal(1.0*yearDays).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
        }
        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)+1) ;
        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)) ;
        if(monthDays!=0){
            if(monthDays <0){
                month = month-1;
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProjectCloudController.java
@@ -7,6 +7,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.dto.DataDTO;
import com.doumee.dao.business.model.YwProject;
import com.doumee.dao.business.model.YwRoom;
import com.doumee.dao.business.vo.ProjectDataVO;
@@ -90,8 +91,8 @@
    @ApiOperation("项目树")
    @PostMapping("/tree")
    @CloudRequiredPermission("business:ywproject:query")
    public ApiResponse<List<ProjectDataVO>> tree (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        return ApiResponse.success(ywProjectService.projectTree());
    public ApiResponse<List<ProjectDataVO>> tree (@RequestBody DataDTO dataDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        return ApiResponse.success(ywProjectService.projectTree(dataDTO));
    }
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/DataDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
package com.doumee.dao.business.dto;
import com.doumee.core.model.LoginUserInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/5/20 14:54
 */
@Data
@ApiModel("日期查询类")
public class DataDTO {
    @ApiModelProperty(value = "项目主键")
    private Integer projectId;
    @ApiModelProperty(value = "开始日期: yyyy-MM-dd")
    private String startDate;
    @ApiModelProperty(value = "结束日期: yyyy-MM-dd")
    private String endDate;
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProjectService.java
@@ -3,6 +3,7 @@
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.DataDTO;
import com.doumee.dao.business.model.YwProject;
import com.doumee.dao.business.vo.ProjectDataVO;
@@ -99,5 +100,5 @@
    long count(YwProject ywProject);
    List<ProjectDataVO> projectTree();
    List<ProjectDataVO> projectTree(DataDTO dataDTO);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -2118,9 +2118,6 @@
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(StringUtils.isNotBlank(member.getEmail())&&!Constants.validEmail(member.getEmail())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"请填写正确的email");
        }
        LoginUserInfo loginUserInfo = member.getLoginUserInfo();
        member.setCreator(loginUserInfo.getId());
        member.setCreateDate(new Date());
@@ -2162,8 +2159,10 @@
    @Override
    public List<Member> ywList(Member member) {
        List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>()
                .lambda().eq(Member::getIsdeleted,Constants.ZERO)
                .lambda()
                .eq(Member::getIsdeleted,Constants.ZERO)
                        .eq(Member::getStatus,Constants.ZERO)
                .eq(Objects.nonNull(member.getCustomerId()),Member::getCustomerId,member.getCustomerId())
                .eq(Member::getType,Constants.memberType.customer)
        );
        return memberList;
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
@@ -98,11 +98,14 @@
            ywContractBill.setEndDate(ywContractBill.getPlanPayDate());
        }
        //查询合同下的最大的序号
        List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContract.getId()).orderByDesc(YwContractBill::getId));
        List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>()
                .lambda().eq(YwContractBill::getContractId,ywContract.getId())
                .in(YwContractBill::getCostType,Constants.ZERO,Constants.SIX,Constants.FOUR,Constants.FIVE,7)
                .orderByDesc(YwContractBill::getId));
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){
            ywContractBill.setSortnum(ywContractBillList.size() + 1 );
        }else{
            ywContractBill.setSortnum(Constants.ZERO);
            ywContractBill.setSortnum(0);
        }
        ywContractBillMapper.insert(ywContractBill);
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -91,6 +91,7 @@
    }
    private void dealRoomsForContract(YwContract model) {
        this.dealRoomsValid(model);
        List<YwContractRoom> list = new ArrayList<>();
        for(YwRoom room :model.getRoomList()){
            YwContractRoom t = new YwContractRoom();
@@ -106,6 +107,46 @@
        }
        ywContractRoomMapper.insert(list);
    }
    private void dealRoomsValid(YwContract model){
        List<Integer> roomIds = model.getRoomList().stream().map(i->i.getId()).collect(Collectors.toList());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(roomIds)){
            if(ywContractMapper.selectJoinCount(new MPJLambdaWrapper<YwContract>()
                    .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId)
                    .eq(YwContractRoom::getType,Constants.ZERO)
                    .in(YwContractRoom::getRoomId,roomIds)
                    .in(YwContract::getStatus,Constants.ZERO,Constants.ONE,Constants.TWO)
                    .apply(" (" +
                            " ( t.START_DATE < '"+DateUtil.getFomartDate(model.getEndDate(),"yyyy-MM-dd HH:mm:ss")+"'  and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " +
                            "or " +
                            " ( t.START_DATE < '"+DateUtil.getFomartDate(model.getEndDate(),"yyyy-MM-dd HH:mm:ss")+"'  and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " +
                            " ) ")
            )>Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"房源已被占用请刷新重试");
            };
            if(ywContractMapper.selectJoinCount(new MPJLambdaWrapper<YwContract>()
                    .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId)
                    .eq(YwContractRoom::getType,Constants.ZERO)
                    .in(YwContractRoom::getRoomId,roomIds)
                    .in(YwContract::getStatus,Constants.THREE)
                    .apply(" ( t.START_DATE < '"+DateUtil.getFomartDate(model.getBtDate(),"yyyy-MM-dd HH:mm:ss")+"' " +
                            " and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " )
            )>Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"房源已被占用请刷新重试");
            };
        }
    }
    @Override
    public   List<YwContractBill> getBillList(YwContract model){
@@ -311,9 +352,6 @@
        update.setBtFee(param.getBtFee());
        update.setBtRemark(getbackRentRemarkByParam(param));
        ywContractMapper.updateById(update);
//        if(1==1){
//            throw new BusinessException(ResponseStatus.NOT_ALLOWED);
//        }
        dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK, param.getLoginUserInfo().getRealname(),getbackRentLogByParam(param));
        return param.getId();
    }
@@ -441,12 +479,17 @@
                totalBackFee = totalBackFee.add(fee);//累计退款金额
            }
        }
        List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>()
                .lambda().eq(YwContractBill::getContractId,param.getId()).orderByDesc(YwContractBill::getId));
        Integer sortNum = ywContractBillList.size();
        if(param.getAddBillList()!=null && param.getAddBillList().size()>0){
            for(YwContractBill addBill : param.getAddBillList()){
                sortNum = sortNum + 1 ;
                addBill.setIsdeleted(Constants.ZERO);
                addBill.setContractId(param.getId());
                addBill.setType(Constants.ONE);
                addBill.setStatus(Constants.ZERO);
                addBill.setTotleFee(addBill.getReceivableFee());
                if(Constants.equalsInteger(addBill.getFeeType(),Constants.ONE)){
                    addBill.setStartDate(addBill.getPlanPayDate());
                    addBill.setEndDate(addBill.getPlanPayDate());
@@ -470,6 +513,7 @@
                addBill.setBtUserId(param.getBtUserId());
                addBill.setBtSignDate(param.getBtSignDate());
                addBill.setBtType(param.getBtType());
                addBill.setSortnum(sortNum );
                newBills.add(addBill);
            }
            ywContractBillMapper.insert(param.getAddBillList());//批量插入数据
@@ -648,12 +692,15 @@
        }
        int num =1;
        for(int i=0;i<billList1.size();i++){
            billList1.get(i).setSortnum(num);
            num++;
            if(Constants.equalsInteger( billList1.get(i).getCostType(),Constants.ZERO)){
                billList1.get(i).setSortnum(num++);
            }
        }
        num =1;
        for(int i=0;i<billList2.size();i++){
            billList2.get(i).setSortnum(num);
            num++;
            if(Constants.equalsInteger( billList2.get(i).getCostType(),Constants.ONE)){
                billList2.get(i).setSortnum(num++);
            }
        }
        if(model.getId()!=null){
            ywContractBillMapper.insert(billList1);
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwCustomerServiceImpl.java
@@ -61,9 +61,6 @@
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo loginUserInfo = ywCustomer.getLoginUserInfo();
        if(StringUtils.isNotBlank(ywCustomer.getEmail())&&!Constants.validEmail(ywCustomer.getEmail())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"请填写正确的email");
        }
        ywCustomer.setStatus(Constants.ZERO);
        ywCustomer.setIsdeleted(Constants.ZERO);
        ywCustomer.setCreator(loginUserInfo.getId());
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskServiceImpl.java
@@ -146,6 +146,7 @@
                .leftJoin(YwPatrolScheme.class,YwPatrolScheme::getId,YwPatrolTask::getSchemeId)
                .eq(YwPatrolTask::getIsdeleted, Constants.ZERO)
                .eq(Objects.nonNull(model.getStatus()) && !Constants.equalsInteger(model.getStatus(),Constants.TWO),YwPatrolTask::getStatus, model.getStatus())
                .eq(Objects.nonNull(model.getDealUserId()),YwPatrolTask::getDealUserId, model.getDealUserId())
                .apply(Objects.nonNull(model.getStatus()) && Constants.equalsInteger(model.getStatus(),Constants.TWO)," t.status = 1 and t.END_DATE > now() ")
                .apply(StringUtils.isNotBlank(model.getQueryStatus())," find_in_set(t.status ,'"+model.getQueryStatus()+"') ")
                .like(StringUtils.isNotBlank(model.getPlanTitle()),YwPatrolScheme::getTitle,model.getPlanTitle())
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java
@@ -6,11 +6,13 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwBuildingMapper;
import com.doumee.dao.business.YwFloorMapper;
import com.doumee.dao.business.YwProjectMapper;
import com.doumee.dao.business.YwRoomMapper;
import com.doumee.dao.business.dto.DataDTO;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.CompanyTree;
import com.doumee.dao.business.vo.ProjectDataVO;
@@ -230,11 +232,12 @@
    @Override
    public List<ProjectDataVO> projectTree(){
    public List<ProjectDataVO> projectTree(DataDTO dataDTO){
        List<ProjectDataVO> projectDataVOList = new ArrayList<>();
        List<YwProject>  ywProjectList = ywProjectMapper.selectList(new QueryWrapper<YwProject>().lambda()
                .eq(YwProject::getIsdeleted,Constants.ZERO)
                .eq(YwProject::getStatus,Constants.ZERO)
                .eq(Objects.nonNull(dataDTO.getProjectId()),YwProject::getId,dataDTO.getProjectId())
                .orderByAsc(YwProject::getSortnum)
        );
        for (YwProject ywProject:ywProjectList) {
@@ -247,6 +250,7 @@
        List<YwBuilding>  ywBuildingList = ywBuildingMapper.selectList(new QueryWrapper<YwBuilding>().lambda()
                .eq(YwBuilding::getIsdeleted,Constants.ZERO)
                .eq(YwBuilding::getStatus,Constants.ZERO)
                .eq(Objects.nonNull(dataDTO.getProjectId()),YwBuilding::getProjectId,dataDTO.getProjectId())
                .orderByAsc(YwBuilding::getSortnum)
        );
@@ -262,6 +266,7 @@
        List<YwFloor>  ywFloorList = ywFloorMapper.selectList(new QueryWrapper<YwFloor>().lambda()
                .eq(YwFloor::getIsdeleted,Constants.ZERO)
                .eq(YwFloor::getStatus,Constants.ZERO)
                .eq(Objects.nonNull(dataDTO.getProjectId()),YwFloor::getProjectId,dataDTO.getProjectId())
                .orderByAsc(YwFloor::getSortnum)
        );
@@ -273,19 +278,25 @@
            projectDataVOList.add(projectDataVO);
        }
        List<YwRoom>  ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda()
                .eq(YwRoom::getIsdeleted,Constants.ZERO)
                .eq(YwRoom::getStatus,Constants.ZERO)
                .eq(Objects.nonNull(dataDTO.getProjectId()),YwRoom::getProjectId,dataDTO.getProjectId())
                .apply(Objects.nonNull(dataDTO)&&Objects.nonNull(dataDTO.getStartDate())&&Objects.nonNull(dataDTO.getEndDate())," id not in  (" +
                        " SELECT y2.room_id FROM  yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` in( 0,1,2) " +
                        " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.END_DATE > '"+ dataDTO.getStartDate() +"  00:00:00' " +
                        "  ) ")
                .apply(Objects.nonNull(dataDTO)&&Objects.nonNull(dataDTO.getStartDate())&&Objects.nonNull(dataDTO.getEndDate())," id not in  (" +
                        " SELECT y2.room_id FROM  yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` = 3 " +
                        " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.BT_DATE > '"+ dataDTO.getStartDate() +"  00:00:00' " +
                        "  ) ")
                .orderByAsc(YwRoom::getSortnum)
        );
        for (YwRoom data:ywRoomList) {
            ProjectDataVO projectDataVO = new ProjectDataVO();
            BeanUtils.copyProperties(data,projectDataVO);
            projectDataVO.setName(data.getCode());
            projectDataVO.setName(data.getCode() + " " + data.getArea() +"㎡");
            projectDataVO.setPId(data.getFloor());
            projectDataVO.setLv(Constants.THREE);
            projectDataVOList.add(projectDataVO);
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwRoomServiceImpl.java
@@ -150,9 +150,9 @@
                .selectAs(YwProject::getName,YwRoom::getProjectName)
                .selectAs(YwFloor::getName,YwRoom::getFloorName)
                .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                .select(" select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END  " +
                .select(" ifnull( ( select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END  " +
                        "from yw_contract y1 left join yw_contract_room y2 on y1.id = y2.CONTRACT_ID and y2.TYPE = 0  " +
                        "where y1.`STATUS` <> 4  and y2.room_id = t.id order by y1.create_date desc  limit 1   ",YwRoom::getLeaseStatus)
                        "where y1.`STATUS` <> 4  and y2.room_id = t.id order by y1.create_date desc  limit 1  ) ,0) ",YwRoom::getLeaseStatus)
                .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
                .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId)
                .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor);