renkang
2025-05-13 0a99001be87811ebb884b8f3f491f48054a22330
客户资料 巡检任务业务
已添加1个文件
已修改38个文件
827 ■■■■ 文件已修改
server/system_gateway/src/main/resources/bootstrap.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/dao/system/dto/ImportMaterialDTO.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwContractBillCloudController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/excel/ExcelReplaceCommon.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContract.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwPatrolTask.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwRoom.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWorkorder.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwOutinboundExcelOutVO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java 153 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwDeviceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolSchemeServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskRecordServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProjectServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwRoomServiceImpl.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwTempConfigServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/resources/application-test.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_gateway/src/main/resources/bootstrap.yml
@@ -1,11 +1,11 @@
spring:
  profiles:
    active: dev
    active: pro
  application:
    name: system_gateway
  # å®‰å…¨é…ç½®
  security:
    # éªŒç­¾å…¬é’¥åœ°å€
  security:
    oauth2:
      authorizationserver:
        token-uri: https://
server/system_service/src/main/java/com/doumee/dao/system/dto/ImportMaterialDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package com.doumee.dao.system.dto;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
 * @author Eva.Caesar Liu
 * @date 2023/05/04 18:21
 */
@Data
@ApiModel("导入物料信息")
public class ImportMaterialDTO {
    @ApiModelProperty(value = "物料编号")
    @ExcelColumn(name="物料编号",index = 0,width = 10)
    private String code;
    @ApiModelProperty(value = "物料名称")
    @ExcelColumn(name="物料名称",index = 1,width = 10)
    private String name;
    @ApiModelProperty(value = "物料分类")
    @ExcelColumn(name="物料分类",index = 2,width = 10)
    private String categoryName;
    @ApiModelProperty(value = "物料子分类")
    @ExcelColumn(name="物料子分类",index = 3,width = 10)
    private String categoryChildName;
    @ApiModelProperty(value = "条码")
    @ExcelColumn(name="条码",index = 4,width = 10)
    private String qrcode;
    @ApiModelProperty(value = "品牌")
    @ExcelColumn(name="品牌",index = 5,width = 10)
    private String brand;
    @ApiModelProperty(value = "规格型号")
    @ExcelColumn(name="规格型号",index = 6,width = 10)
    private String attr;
    @ApiModelProperty(value = "单位")
    @ExcelColumn(name="单位",index = 7,width = 10)
    private String unitName;
    @ApiModelProperty(value = "安全库存(下限)", example = "1")
    @ExcelColumn(name="安全库存(下限)",index = 8,width = 16)
    private BigDecimal minStock;
    @ApiModelProperty(value = "安全库存(上限)", example = "1")
    @ExcelColumn(name="安全库存(上限)",index = 9,width = 16)
    private BigDecimal maxStock;
}
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -98,4 +98,11 @@
    @GetMapping("/timer/yw/ywPatrolSchemeTaskTimer")
    ApiResponse ywPatrolSchemeTaskTimer();
    @ApiOperation("【阜宁运维】定时更新房源租赁状态")
    @GetMapping("/timer/yw/ywRoomStatusTimer")
    ApiResponse ywRoomStatusTimer();
}
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java
@@ -83,6 +83,17 @@
    }
    @ApiOperation("定时更新房源租赁状态")
    @GetMapping("/ywRoomStatusTimer")
    public ApiResponse ywRoomStatusTimer() {
        ywContractService.updRentContractStatus();
        ywContractService.updRoomLeaseNowStatus();
        return ApiResponse.success("定时更新房源租赁状态任务执行中");
    }
    @ApiOperation("定时更新redis数据")
    @GetMapping("/ywUpdRedisDataTimer")
    public ApiResponse ywUpdRedisDataTimer() {
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwContractBillCloudController.java
@@ -14,6 +14,7 @@
import com.doumee.dao.business.vo.YwContractBillCallDataVO;
import com.doumee.dao.business.vo.YwContractBillDataVO;
import com.doumee.service.business.YwContractBillService;
import com.doumee.service.business.YwContractService;
import com.doumee.service.business.impl.SmsEmailServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -38,6 +39,9 @@
    @Autowired
    private SmsEmailServiceImpl smsEmailService;
    @Autowired
    private YwContractService ywContractService;
    @PreventRepeat
    @ApiOperation("新建")
@@ -129,6 +133,15 @@
        return ApiResponse.success("生成成功");
    }
    @LoginNoRequired
    @ApiOperation("更新房源租赁状态")
    @GetMapping("/dealRoomStatus")
    public ApiResponse dealRoomStatus() {
        ywContractService.updRentContractStatus();
        ywContractService.updRoomLeaseNowStatus();
        return ApiResponse.success("操作成功");
    }
    @ApiOperation("获取待处理账单")
    @GetMapping("/getWaitDealList")
    @CloudRequiredPermission("business:ywcontractbill:query")
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java
@@ -10,13 +10,15 @@
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.YwMaterial;
import com.doumee.service.business.YwMaterialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -91,7 +93,7 @@
    @PostMapping("/exportExcel")
    @CloudRequiredPermission("business:ywmaterial:exportExcel")
    public void exportExcel (@RequestBody PageWrap<YwMaterial> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        ExcelExporter.build(YwMaterial.class).export(ywMaterialService.findPage(pageWrap).getRecords(), "运维资产信息表", response);
        ExcelExporter.build(YwMaterial.class).export(ywMaterialService.findPage(pageWrap).getRecords(), "物料信息表", response);
    }
    @ApiOperation("根据ID查询")
@@ -100,4 +102,15 @@
    public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        return ApiResponse.success(ywMaterialService.getDetail(id));
    }
    @ApiOperation("物料信息导入")
    @PostMapping("/importMaterialBatch")
    @CloudRequiredPermission("business:ywmaterial:query")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class),
    })
    public ApiResponse importMaterialBatch(@ApiParam(value = "file") MultipartFile file,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        return ApiResponse.success(ywMaterialService.importMaterialBatch(file,getLoginUser(token)));
    }
}
server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
spring:
  profiles:
    active: dev
    active: pro
  application:
    name: visitsAdmin
    # å®‰å…¨é…ç½®
server/visits/dmvisit_service/src/main/java/com/doumee/core/excel/ExcelReplaceCommon.java
@@ -94,7 +94,7 @@
            IContext context = report.createContext();
            for (YwTempConfig ywTempConfig:ywTempConfigList) {
                if(StringUtils.isBlank(ywTempConfig.getUrl())){
                    ywTempConfig.setUrl("-");
                    ywTempConfig.setUrl(" - ");
                }
                context.put(ywTempConfig.getTitle().replace("${","").replace("}",""), ywTempConfig.getUrl());
            }
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContract.java
@@ -204,6 +204,10 @@
    @ExcelColumn(name="物业费总金额")
    private BigDecimal wyTotalFee;
    @ApiModelProperty(value = "合同状态集合")
    @TableField(exist = false)
    private List<Integer> statusList;
    @ApiModelProperty(value = "房间主键 æŸ¥è¯¢ä½¿ç”¨")
    @TableField(exist = false)
    private Integer roomId;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
@@ -157,11 +157,11 @@
    @TableField(exist = false)
    private Integer customerId;
    @ApiModelProperty(value = "是否发送邮件:0=否;1=是", example = "1")
    @ApiModelProperty(value = "是否发送邮件:0=否;1=发送成功;2=发送失败", example = "1")
    @TableField(exist = false)
    private Integer isSendEmail;
    @ApiModelProperty(value = "是否发送短信:0=否;1=是", example = "1")
    @ApiModelProperty(value = "是否发送短信:0=否;1=发送成功;2=发送失败", example = "1")
    @TableField(exist = false)
    private Integer isSendSms;
@@ -178,6 +178,7 @@
    @ExcelColumn(name="合同编号",index = 2,width = 10)
    @TableField(exist = false)
    private String contractCode;
    @ApiModelProperty(value = "合同状态", example = "1")
    @TableField(exist = false)
    private Integer contractStatus;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java
@@ -26,89 +26,77 @@
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "名称")
    @ExcelColumn(name="名称")
    @ExcelColumn(name="物料名称",index = 1,width = 10)
    private String name;
    @ApiModelProperty(value = "状态 0启用 1禁用", example = "1")
    @ExcelColumn(name="状态 0启用 1禁用")
    @ExcelColumn(name="状态",index = 8,width = 8,valueMapping = "0=启用;1=禁用;")
    private Integer status;
    @ApiModelProperty(value = "编号")
    @ExcelColumn(name="编号")
    @ExcelColumn(name="物料编号",index = 0,width = 10)
    private String code;
    @ApiModelProperty(value = "所属一级分类编码(关联category)", example = "1")
    @ExcelColumn(name="所属一级分类编码(关联category)")
    private Integer parentCateId;
    @ApiModelProperty(value = "所属二级分类编码(关联category)", example = "1")
    @ExcelColumn(name="所属二级分类编码(关联category)")
    private Integer cateId;
    @ApiModelProperty(value = "条码")
    @ExcelColumn(name="条码")
    @ExcelColumn(name="条码",index = 2,width = 10)
    private String qrcode;
    @ApiModelProperty(value = "排序码", example = "1")
    @ExcelColumn(name="排序码")
    private Integer sortnum;
    @ApiModelProperty(value = "品牌")
    @ExcelColumn(name="品牌")
    @ExcelColumn(name="品牌",index = 3,width = 10)
    private String brand;
    @ApiModelProperty(value = "规格型号")
    @ExcelColumn(name="规格型号")
    @ExcelColumn(name="规格型号",index = 4,width = 10)
    private String attr;
    @ApiModelProperty(value = "安全库存(下限)", example = "1")
    @ExcelColumn(name="安全库存(下限)")
    @ExcelColumn(name="安全库存(下限)",index = 6,width = 16)
    private BigDecimal minStock;
    @ApiModelProperty(value = "安全库存(上限)", example = "1")
    @ExcelColumn(name="安全库存(上限)")
    @ExcelColumn(name="安全库存(上限)",index = 7,width = 16)
    private BigDecimal maxStock;
    @ApiModelProperty(value = "单位")
    @ExcelColumn(name="单位")
    @ExcelColumn(name="单位",index = 5,width = 10)
    private String unitName;
    @ApiModelProperty(value = "所属房源编码(关联yw_room)", example = "1")
    @ExcelColumn(name="所属房源编码(关联yw_room)")
    private Integer roomId;
    @ApiModelProperty(value = "是否自动编码:0=否;1=是;", example = "1")
    @ExcelColumn(name="是否自动编码:0=否;1=是;")
    private Integer autoCode;
    @ApiModelProperty(value = "附件信息", example = "1")
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java
@@ -92,6 +92,9 @@
    @ExcelColumn(name="单据编号")
    private String code;
    @ApiModelProperty(value = "领用人", example = "1")
    private Integer outUserId;
    @ApiModelProperty(value = "出入库数据明细", example = "1")
    @TableField(exist = false)
    private List<YwOutinboundRecord> recordList;
@@ -108,4 +111,8 @@
    @ApiModelProperty(value = "操作人名称", example = "1")
    @TableField(exist = false)
    private String createUserName;
    @ApiModelProperty(value = "领用人名称", example = "1")
    @TableField(exist = false)
    private String outUserName;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java
@@ -24,53 +24,47 @@
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelColumn(name="创建时间",width = 10,index = 11,dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "出入库记录主键", example = "1")
    @ExcelColumn(name="出入库记录主键")
    private Integer outInBoundId;
    @ApiModelProperty(value = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_material)")
    private Integer materialId;
    @ApiModelProperty(value = "数量", example = "1")
    @ExcelColumn(name="数量")
    @ExcelColumn(name="数量",width = 10,index = 5)
    private BigDecimal stock;
    @ApiModelProperty(value = "资产编码")
    @TableField(exist = false)
    @ExcelColumn(name="物料编码",width = 10,index = 1)
    private String materialCode;
    @ApiModelProperty(value = "资产名称")
    @TableField(exist = false)
    @ExcelColumn(name="物料名称",width = 10,index = 2)
    private String materialName;
    @ApiModelProperty(value = "资产条形码")
@@ -83,6 +77,7 @@
    @ApiModelProperty(value = "资产单位")
    @TableField(exist = false)
    @ExcelColumn(name="单位",width = 10,index = 6)
    private String materialUnitName;
    @ApiModelProperty(value = "操作类型:1=出库;0=入库(分页列表查询使用)", example = "1")
@@ -95,31 +90,38 @@
    @ApiModelProperty(value = "仓库名称")
    @TableField(exist = false)
    @ExcelColumn(name="仓库",width = 10,index = 8)
    private String warehouseName;
    @ApiModelProperty(value = "单据日期")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelColumn(name="单据日期",width = 10,index = 0,dateFormat = "yyyy-MM-dd")
    private Date doneDate;
    @ApiModelProperty(value = "一级分类名称")
    @TableField(exist = false)
    @ExcelColumn(name="物料分类",width = 10,index = 3)
    private String categoryParentName;
    @ApiModelProperty(value = "二级分类名称")
    @TableField(exist = false)
    @ExcelColumn(name="物料子分类",width = 10,index = 4)
    private String categoryName;
    @ApiModelProperty(value = "操作人名称", example = "1")
    @TableField(exist = false)
    @ExcelColumn(name="创建人",width = 10,index = 10)
    private String createUserName;
    @ApiModelProperty(value = "单据编号", example = "1")
    @TableField(exist = false)
    @ExcelColumn(name="单据编号",width = 10,index = 9)
    private String code;
    @ApiModelProperty(value = "类型 0采购入库 1领用退回 2调整入库 3其他入库 4盘盈入库 5领用出库 6仓库出库 7调整出库 8采购出库 9其他出库 10盘亏出库", example = "1")
    @TableField(exist = false)
    @ExcelColumn(name="类型",width = 10,index = 7,valueMapping = "0=采购入库;1=领用退回;2=调整入库;3=其他入库;4=盘盈入库;5=领用出库;6=仓库出库;7=调整出库;8=采购出库;9=其他出库;10=盘亏出库;")
    private Integer type;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwPatrolTask.java
@@ -54,7 +54,7 @@
    private String remark;
    @ApiModelProperty(value = "状态 0待开始 1进行中 2已超期 3已完成 4已取消", example = "1")
    @ExcelColumn(name="执行结果",index = 7,width = 6,valueMapping = "0=待开始;1=进行中;2=已超期;3=已完成;")
    @ExcelColumn(name="执行结果",index = 7,width = 6,valueMapping = "0=待开始;1=进行中;2=已超期;3=已完成;4=已取消;")
    private Integer status;
    @ApiModelProperty(value = "排序码", example = "1")
@@ -103,6 +103,9 @@
    @TableField(exist = false)
    private String userName;
    @ApiModelProperty(value = "可处理人(多个以,分割)")
    @TableField(exist = false)
    private String userIds;
    @ApiModelProperty(value = "任务状态:多个以,分割 0待开始 1进行中 2已超期 3已完成 4已取消")
    @TableField(exist = false)
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwRoom.java
@@ -106,6 +106,13 @@
    @ExcelColumn(name="所属楼宇编码(关联yw_building)")
    private Integer buildingId;
    @ApiModelProperty(value = "当前租赁状态:0=未租赁;1=已租赁")
    private Integer leaseNowStatus;
    @ApiModelProperty(value = "退租到期日期,退租使用")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date leaseRentDate;
    @ApiModelProperty(value = "租赁状态:0=待租赁;1=已租赁 ;2=未开启租赁", example = "1")
    @TableField(exist = false)
    private Integer leaseStatus;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java
@@ -57,7 +57,6 @@
    @ExcelColumn(name="数量",index = 6,width = 10)
    private BigDecimal stock;
    @ApiModelProperty(value = "物料编码")
    @ExcelColumn(name="物料编码",index = 0,width = 10)
    @TableField(exist = false)
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java
@@ -35,7 +35,7 @@
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java
@@ -25,97 +25,91 @@
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    @ExcelColumn(name="备注",index = 9,width = 30)
    private String remark;
    @ApiModelProperty(value = "状态 0未开始 1已盘点", example = "1")
    @ExcelColumn(name="状态 0未开始 1已盘点")
    private Integer status;
    @ApiModelProperty(value = "盘点员编码(关联system_user)")
    @ExcelColumn(name="盘点员编码(关联system_user)")
    private String userId;
    @ApiModelProperty(value = "盘点时间")
    @ExcelColumn(name="盘点时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planDate;
    @ApiModelProperty(value = "编号")
    @ExcelColumn(name="编号")
    private String code;
    @ApiModelProperty(value = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_material)")
    private Integer materialId;
    @ApiModelProperty(value = "账面数量", example = "1")
    @ExcelColumn(name="账面数量")
    @ExcelColumn(name="账面数量",index = 7,width = 10)
    private BigDecimal stock;
    @ApiModelProperty(value = "实际盘点库存量", example = "1")
    @ExcelColumn(name="实际盘点库存量")
    @ExcelColumn(name="盘点数量",index = 8,width = 10)
    private BigDecimal actStock;
    @ApiModelProperty(value = "盘点 0账实相符 1盘亏 2盘盈", example = "1")
    @ExcelColumn(name="盘点 0账实相符 1盘亏 2盘盈")
    private Integer type;
    @ApiModelProperty(value = "盘点计划编码(关联yw_stocktaking)", example = "1")
    @ExcelColumn(name="盘点计划编码(关联yw_stocktaking)")
    private Integer stocktakingId;
    @ApiModelProperty(value = "资产编码")
    @TableField(exist = false)
    @ExcelColumn(name="物料编码",index = 0,width = 10)
    private String materialCode;
    @ApiModelProperty(value = "资产名称")
    @TableField(exist = false)
    @ExcelColumn(name="物料名称",index = 1,width = 10)
    private String materialName;
    @ApiModelProperty(value = "资产条形码")
    @TableField(exist = false)
    @ExcelColumn(name="条码",index = 2,width = 10)
    private String materialQrcode;
    @ApiModelProperty(value = "资产品牌")
    @TableField(exist = false)
    @ExcelColumn(name="品牌",index = 3,width = 10)
    private String materialBrand;
    @ApiModelProperty(value = "资产规格型号")
    @TableField(exist = false)
    @ExcelColumn(name="规格型号",index = 4,width = 10)
    private String materialAttr;
    @ApiModelProperty(value = "资产单位")
    @TableField(exist = false)
    @ExcelColumn(name="单位",index = 5,width = 10)
    private String materialUnitName;
    @ApiModelProperty(value = "仓库名称")
    @ExcelColumn(name="仓库",index = 6,width = 10)
    @TableField(exist = false)
    private String warehouseName;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWorkorder.java
@@ -98,7 +98,7 @@
    private String code;
    @ApiModelProperty(value = "处理状态 0待处理 1已分派 2已处理", example = "1")
    @ExcelColumn(name="工单状态",index = 7,width = 10,valueMapping = "0=待处理;1=已分派;2=已处理;")
    @ExcelColumn(name="工单状态",index = 7,width = 10,valueMapping = "0=待指派;1=已指派;2=已处理;")
    private Integer dealStatus;
    @ApiModelProperty(value = "分派人编码(关联system_user)", example = "1")
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwOutinboundExcelOutVO.java
@@ -39,14 +39,17 @@
    @ExcelColumn(name="出库数量",index = 4,width = 16)
    private String outMaterialNum;
    @ApiModelProperty(value = "操作人名称", example = "1")
    @ApiModelProperty(value = "领用人", example = "1")
    @ExcelColumn(name="领用人",index = 5,width = 16)
    private String createUserName;
    private String outUserName;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="操作时间",index = 6,width = 16,dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @ApiModelProperty(value = "领用人", example = "1")
    @ExcelColumn(name="操作人名称",index = 7,width = 16)
    private String createUserName;
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractService.java
@@ -102,5 +102,17 @@
    void dealTimeOut();
    /**
     * åˆ°æœŸåˆåŒ æœªå‘起退租的进行数据调整 æŠŠåˆåŒä¸‹çš„æˆ¿æºé‡Šæ”¾ å®šæ—¶æ—¶é—´éœ€è¦åœ¨æ¯å¤©æ™šä¸Š12点前
     */
    void updRoomLeaseNowStatus();
    /**
     * é€€ç§Ÿä¸­/已退租合同 æŠŠåˆ°äº†é€€ç§Ÿæ—¥æœŸæ—¶é—´çš„æ•°æ® è¿›è¡Œæˆ¿æºé‡Šæ”¾ å®šæ—¶æ—¶é—´éœ€è¦åœ¨æ¯å¤©æ™šä¸Š12点前
     */
    void updRentContractStatus();
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java
@@ -1,8 +1,11 @@
package com.doumee.service.business;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.YwMaterial;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
@@ -98,4 +101,6 @@
    long count(YwMaterial ywMaterial);
    YwMaterial getDetail(Integer id);
    Integer importMaterialBatch(MultipartFile file, LoginUserInfo loginUserInfo);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -2231,12 +2231,12 @@
                throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "身份证号【"+member.getIdcardNo()+"】已被使用,不能重复");
            }
        }
        if(memberMapper.selectCount(new QueryWrapper<Member>().lambda()
                .ne(Objects.nonNull(member.getId()),Member::getId,member.getId())
                .eq(Member::getPhone,  member.getPhone())
                .eq(Member::getIsdeleted,Constants.ZERO) ) >0){
            throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "手机号【"+member.getPhone()+"】已被使用,不能重复");
        }
//        if(memberMapper.selectCount(new QueryWrapper<Member>().lambda()
//                .ne(Objects.nonNull(member.getId()),Member::getId,member.getId())
//                .eq(Member::getPhone,  member.getPhone())
//                .eq(Member::getIsdeleted,Constants.ZERO) ) >0){
//            throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "手机号【"+member.getPhone()+"】已被使用,不能重复");
//        }
    }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
@@ -595,7 +595,7 @@
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(result?Constants.ZERO:Constants.ONE);
        smsEmail.setStatus(result?Constants.ONE:Constants.TWO);
        smsEmail.setType(Constants.ZERO);
        smsEmail.setRemark(result?"短信发送成功":"短信发送失败");
        smsEmail.setTitle("账单催费");
@@ -618,13 +618,13 @@
        if(result){
            result=   emailService.sendEmail(email,"账单催费",content,null);
        }
        content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode() + content;
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setRemark(result?"邮件发送成功":"邮件发送失败");
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setTitle("账单催费");
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(result?Constants.ZERO:Constants.ONE);
        smsEmail.setType(Constants.TWO);
        smsEmail.setStatus(result?Constants.ONE:Constants.TWO);
        smsEmail.setType(Constants.ONE);
        smsEmail.setObjId(billId);
        smsEmail.setObjType(Constants.TWO+"");
        smsEmail.setContent(content);
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
@@ -232,6 +232,17 @@
                ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee())
        );
        if(Constants.equalsInteger(ywContractBill.getStatus(),Constants.ZERO)
                && (Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ZERO)
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.TWO)
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.THREE)
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.FOUR))
                && Utils.Date.getEnd(ywContractBill.getPlanPayDate()).getTime() < System.currentTimeMillis()){
            ywContractBill.setIsOverdue(Constants.ONE);
        }else{
            ywContractBill.setIsOverdue(Constants.ZERO);
        }
        //房源数据
        ywContractBill.setYwContractRoomList(
                ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>()
@@ -239,8 +250,8 @@
                .selectAs(YwProject::getName,YwRoom::getProjectName)
                .selectAs(YwFloor::getName,YwRoom::getFloorName)
                .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                .selectAs(YwRoom::getCode,YwContractRoom::getRoomName)
                .selectAs(YwRoom::getArea,YwContractRoom::getArea)
                .selectAs(YwRoom::getRoomNum,YwContractRoom::getRoomName)
                .selectAs(YwRoom::getRentArea,YwContractRoom::getArea)
                .leftJoin(YwRoom.class,YwRoom::getId,YwContractRoom::getRoomId)
                .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor)
                .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
@@ -345,7 +356,7 @@
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.TWO)
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.THREE)
                || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.FOUR))
            && ywContractBill.getPlanPayDate().getTime() < System.currentTimeMillis()){
            && Utils.Date.getEnd(ywContractBill.getPlanPayDate()).getTime() < System.currentTimeMillis()){
                ywContractBill.setIsOverdue(Constants.ONE);
            }else{
                ywContractBill.setIsOverdue(Constants.ZERO);
@@ -392,6 +403,8 @@
        IPage<YwContractBill> iPage = ywContractBillMapper.selectJoinPage(page,YwContractBill.class,
                queryWrapper.selectAll(YwContractBill.class)
                        .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when  t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE  when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else  yw.ACT_RECEIVABLE_FEE END),0) from  yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as  actReceivableFee  ")
                        .select(" ifnull((select s.status  from sms_email s where s.OBJ_ID = t.id and s.OBJ_TYPE = 2 order by s.CREATE_DATE desc  limit 1 ),0)  ",YwContractBill::getIsSendEmail)
                        .select(" ifnull((select s.status  from sms_email s where s.OBJ_ID = t.id and s.OBJ_TYPE = 1 order by s.CREATE_DATE desc  limit 1 ),0)  ",YwContractBill::getIsSendSms)
                        .selectAs(YwContract::getCode,YwContractBill::getContractCode)
                        .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
                        .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
@@ -405,12 +418,12 @@
                                YwContractBill::getBillType,model.getBillType())
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()),
                                YwContractBill::getPayStatus,model.getPayStatus())
                        .in(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()),
                                YwContractBill::getPayStatus,Constants.ZERO,Constants.THREE,Constants.TWO,Constants.FOUR)
                        .in(YwContractBill::getPayStatus,Constants.ZERO,Constants.TWO,Constants.THREE)
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()),
                                YwContractBill::getType,model.getType())
                        .le(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                                YwContractBill::getPlanPayDate, DateUtil.getCurrDateTime())
                        .lt(YwContractBill::getPlanPayDate, DateUtil.getDate(new Date(),"yyyy-MM-dd"))
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                                YwContractBill::getStatus, Constants.ZERO)
                        .ge(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateStart()),YwContractBill::getPlanPayDate, Utils.Date.getStart(model.getPlanPayDateStart()))
@@ -455,7 +468,7 @@
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){
            //获取所有数据
            List<Integer> billIdList = ywContractBillList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).map(i->i.getId()).collect(Collectors.toList());
            List<Integer> contractIdList = ywContractBillList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).map(i->i.getContractId()).collect(Collectors.toList());
            List<Integer> contractIdList = ywContractBillList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)||Constants.equalsInteger(i.getType(),Constants.TWO)).map(i->i.getContractId()).collect(Collectors.toList());
            List<YwContractRoom> ywContractRoomList  = new ArrayList<>();
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(billIdList)){
                ywContractRoomList.addAll( ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>()
@@ -463,7 +476,7 @@
                        .selectAs(YwProject::getName,YwRoom::getProjectName)
                        .selectAs(YwFloor::getName,YwRoom::getFloorName)
                        .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                        .selectAs(YwRoom::getCode,YwContractRoom::getRoomName)
                        .selectAs(YwRoom::getRoomNum,YwContractRoom::getRoomName)
                        .leftJoin(YwRoom.class,YwRoom::getId,YwContractRoom::getRoomId)
                        .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor)
                        .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
@@ -479,7 +492,7 @@
                        .selectAs(YwProject::getName,YwRoom::getProjectName)
                        .selectAs(YwFloor::getName,YwRoom::getFloorName)
                        .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                        .selectAs(YwRoom::getCode,YwContractRoom::getRoomName)
                        .selectAs(YwRoom::getRoomNum,YwContractRoom::getRoomName)
                        .leftJoin(YwRoom.class,YwRoom::getId,YwContractRoom::getRoomId)
                        .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor)
                        .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
@@ -690,7 +703,8 @@
                    .selectAs(YwContractDetail::getType,YwContractBill::getDetailType)
                    .selectAs(YwContract::getZlPayType,YwContractBill::getZlPayType)
                    .selectAs(YwContract::getWyPayType,YwContractBill::getWyPayType)
                    .select(" ( select ifnull(sum(y.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .select(" ( select ifnull(sum(y.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 1 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when  t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE  when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else  yw.ACT_RECEIVABLE_FEE END),0) from  yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as  actReceivableFee  ")
                    .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                    .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                    .leftJoin(YwContractDetail.class,YwContractDetail::getId,YwContractBill::getDetailId)
@@ -825,7 +839,7 @@
            }else if(y.getTitle().equals("${应收日期}")&&Objects.nonNull(ywContractBill.getPlanPayDate())){
                y.setUrl(DateUtil.formatDate(ywContractBill.getPlanPayDate(),"yyyy-MM-dd"));
            }else if(y.getTitle().equals("${应收金额}")&&Objects.nonNull(ywContractBill.getReceivableFee())){
                y.setUrl(ywContractBill.getReceivableFee().toString());
                y.setUrl((ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee())).setScale(2).toString());
            }else if(y.getTitle().equals("${账单备注}")){
                if(StringUtils.isNotBlank(ywContractBill.getRemark())){
                    y.setUrl(ywContractBill.getRemark());
@@ -926,14 +940,19 @@
                    .selectAs(YwContractDetail::getType,YwContractBill::getDetailType)
                    .selectAs(YwContract::getZlPayType,YwContractBill::getZlPayType)
                    .selectAs(YwContract::getWyPayType,YwContractBill::getWyPayType)
                    .select(" ( select ifnull(sum(r.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .select(" ( select ifnull(sum(y.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 1 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                    .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                    .leftJoin(YwContractDetail.class,YwContractDetail::getId,YwContractBill::getDetailId)
                    .eq(YwContractBill::getId,ywSmsEmailBillCallDTO.getBillId())
                    .last( "limit 1" )
            );
            this.dealTempData(tempList,ywContractBill,loginUserInfo);
            List<YwContractBill> ywContractBillList = new ArrayList<>();
            ywContractBillList.add(ywContractBill);
            this.dealRoomDetail(ywContractBillList);
//            this.dealTempData(tempList,ywContractBill,loginUserInfo);
            Member member = memberMapper.selectById(ywSmsEmailBillCallDTO.getUserId());
            if(Objects.isNull(member)){
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"存在未查询到的人员信息");
@@ -947,11 +966,10 @@
                if(Constants.equalsInteger(ywSmsEmailBillCallDTO.getSendEmail(),Constants.ONE) && StringUtils.isNotBlank(member.getEmail())
                        && emailTempConfigOptional.isPresent()){
                    String content = this.dealTempSmsEmailData(emailTempConfigOptional.get().getTitle(),tempList,ywContractBill,loginUserInfo);
                    smsEmailService.sendEmail(content,member.getEmail(),ywContractBill.getId());
                    smsEmailService.sendEmail(member.getEmail(),content,ywContractBill.getId());
                }
            }
        }
    }
@@ -963,82 +981,87 @@
        for (YwTempConfig y:ywTempConfigList) {
            if(y.getTitle().equals("${费用名称}")&&Objects.nonNull(ywContractBill.getCostType())){
                //费用类型:0=租赁费;1=物业费;2=租赁押金;3=物业押金;4=水电费;5=杂项费;6=其他; 7=保证金
                if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ZERO)){
                    tempStr.replace("${费用名称}","租赁费");
                if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ZERO)){
                    tempStr = tempStr.replace("${费用名称}","租赁费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ONE)){
                    tempStr.replace("${费用名称}","物业费");
                    tempStr = tempStr.replace("${费用名称}","物业费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.TWO)){
                    tempStr.replace("${费用名称}","租赁押金");
                    tempStr = tempStr.replace("${费用名称}","租赁押金");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.THREE)){
                    tempStr.replace("${费用名称}","物业押金");
                  tempStr =   tempStr.replace("${费用名称}","物业押金");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FOUR)){
                    tempStr.replace("${费用名称}","水电费");
                  tempStr =   tempStr.replace("${费用名称}","水电费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FIVE)){
                    tempStr.replace("${费用名称}","杂项费");
                  tempStr =   tempStr.replace("${费用名称}","杂项费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SIX)){
                    tempStr.replace("${费用名称}","其他");
                  tempStr =   tempStr.replace("${费用名称}","其他");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SEVEN)){
                    tempStr.replace("${费用名称}","保证金");
                  tempStr =   tempStr.replace("${费用名称}","保证金");
                }
            }else if(y.getTitle().equals("${计费周期}")&&Objects.nonNull(ywContractBill.getDetailType())){
                if(Constants.equalsInteger(ywContractBill.getDetailType(),Constants.ZERO)){
                    //租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                    if(Objects.nonNull(ywContractBill.getZlPayType())){
                        if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ZERO)){
                            tempStr.replace("${计费周期}","一次性付款");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ONE)){
                            tempStr.replace("${计费周期}","每三个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.TWO)){
                            tempStr.replace("${计费周期}","六个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.THREE)){
                            tempStr.replace("${计费周期}","一年一付");
            }else if(y.getTitle().equals("${计费周期}")){
                if(Objects.nonNull(ywContractBill.getDetailType())){
                    if(Constants.equalsInteger(ywContractBill.getDetailType(),Constants.ZERO)){
                        //租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                        if(Objects.nonNull(ywContractBill.getZlPayType())){
                            if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ZERO)){
                                tempStr = tempStr.replace("${计费周期}","一次性付款");
                            }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ONE)){
                                tempStr = tempStr.replace("${计费周期}","每三个月一付");
                            }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.TWO)){
                                tempStr = tempStr.replace("${计费周期}","六个月一付");
                            }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.THREE)){
                                tempStr = tempStr.replace("${计费周期}","一年一付");
                            }
                        }
                    }else{
                        //物业支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                        if(Objects.nonNull(ywContractBill.getWyPayType())){
                            if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ZERO)){
                                tempStr = tempStr.replace("${计费周期}","一次性付款");
                            }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ONE)){
                                tempStr = tempStr.replace("${计费周期}","每三个月一付");
                            }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.TWO)){
                                tempStr = tempStr.replace("${计费周期}","六个月一付");
                            }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.THREE)){
                                tempStr.replace("${计费周期}","一年一付");
                            }
                        }
                    }
                }else{
                    //物业支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                    if(Objects.nonNull(ywContractBill.getWyPayType())){
                        if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ZERO)){
                            tempStr.replace("${计费周期}","一次性付款");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ONE)){
                            tempStr.replace("${计费周期}","每三个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.TWO)){
                            tempStr.replace("${计费周期}","六个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.THREE)){
                            tempStr.replace("${计费周期}","一年一付");
                        }
                    }
                    tempStr = tempStr.replace("${计费周期}","");
                }
            }else if(y.getTitle().equals("${单价}")&&Objects.nonNull(ywContractBill.getPrice())){
                tempStr.replace("${单价}",ywContractBill.getPrice().toString());
                tempStr = tempStr.replace("${单价}",ywContractBill.getPrice().setScale(2).toString());
            }else if(y.getTitle().equals("${单位}")&&Objects.nonNull(ywContractBill.getCircleType())){
                //付款周期类型 0=元每平米天;1=元每平米月;2=元每平米年;3=元每天;4=元每月;5=元每年;6=元每场;
                if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ZERO)){
                    tempStr.replace("${单位}","元每平米天");
                  tempStr =   tempStr.replace("${单位}","元每平米天");
                }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    tempStr.replace("${单位}","元每平米月");
                  tempStr =   tempStr.replace("${单位}","元每平米月");
                }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.TWO)){
                    tempStr.replace("${单位}","元每平米年");
                  tempStr =   tempStr.replace("${单位}","元每平米年");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.THREE)){
                    tempStr.replace("${单位}","元每天");
                  tempStr =   tempStr.replace("${单位}","元每天");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FOUR)){
                    tempStr.replace("${单位}","元每月");
                  tempStr =   tempStr.replace("${单位}","元每月");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FIVE)){
                    tempStr.replace("${单位}","元每年");
                  tempStr =   tempStr.replace("${单位}","元每年");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.SIX)){
                    tempStr.replace("${单位}","元每场");
                  tempStr =   tempStr.replace("${单位}","元每场");
                }
            }else if(y.getTitle().equals("${应收日期}")&&Objects.nonNull(ywContractBill.getPlanPayDate())){
                tempStr.replace("${应收日期}",DateUtil.formatDate(ywContractBill.getPlanPayDate(),"yyyy-MM-dd"));
                tempStr = tempStr.replace("${应收日期}",DateUtil.formatDate(ywContractBill.getPlanPayDate(),"yyyy-MM-dd"));
            }else if(y.getTitle().equals("${应收金额}")&&Objects.nonNull(ywContractBill.getReceivableFee())){
                tempStr.replace("${应收金额}",ywContractBill.getReceivableFee().toString());
                tempStr = tempStr.replace("${应收金额}",(ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee())).setScale(2).toString());
            }else if(y.getTitle().equals("${账单备注}")){
                if(StringUtils.isNotBlank(ywContractBill.getRemark())){
                    tempStr.replace("${账单备注}",ywContractBill.getRemark());
                  tempStr =   tempStr.replace("${账单备注}",ywContractBill.getRemark());
                }else{
                    tempStr.replace("${账单备注}","");
                  tempStr =   tempStr.replace("${账单备注}","");
                }
            }else if(y.getTitle().equals("${租客名称}")&&StringUtils.isNotBlank(ywContractBill.getCustomerName())){
                tempStr.replace("${租客名称}",ywContractBill.getCustomerName());
                tempStr = tempStr.replace("${租客名称}",ywContractBill.getCustomerName());
            }else if(y.getTitle().equals("${房间信息}")){
                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBill.getYwContractRoomList())){
                    StringBuilder roomPathName = new StringBuilder();
@@ -1059,32 +1082,32 @@
                            roomPathName.append(";");
                        }
                    }
                    tempStr.replace("${房间信息}",roomPathName.toString());
                    tempStr = tempStr.replace("${房间信息}",roomPathName.toString());
                }
            }else if(y.getTitle().equals("${租赁面积}")&&Objects.nonNull(ywContractBill.getTotalArea())){
                tempStr.replace("${租赁面积}",ywContractBill.getTotalArea().toString());
            }else if(y.getTitle().equals("${所属公司账户名称}")){
                if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){
                    tempStr.replace("${所属公司账户名称}",ywAccount.getName());
                  tempStr =   tempStr.replace("${所属公司账户名称}",ywAccount.getName());
                }else{
                    tempStr.replace("${所属公司账户名称}","-");
                  tempStr =   tempStr.replace("${所属公司账户名称}","-");
                }
            }else if(y.getTitle().equals("${所属公司银行账号}")){ 
                if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){
                    tempStr.replace("${所属公司银行账号}",ywAccount.getName());
                  tempStr =   tempStr.replace("${所属公司银行账号}",ywAccount.getName());
                }else{
                    tempStr.replace("${所属公司银行账号}","-");
                  tempStr =   tempStr.replace("${所属公司银行账号}","-");
                }
            }else if(y.getTitle().equals("${所属公司开户银行}")){
                if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getBankNo())){
                    tempStr.replace("${所属公司开户银行}",ywAccount.getBankNo());
                  tempStr =   tempStr.replace("${所属公司开户银行}",ywAccount.getBankNo());
                }else{
                    tempStr.replace("${所属公司开户银行}","-");
                  tempStr =   tempStr.replace("${所属公司开户银行}","-");
                }
            }else if(y.getTitle().equals("${通知单生成日期}")){
                tempStr.replace("${通知单生成日期}",DateUtil.formatDate(new Date(),"yyyy-MM-dd"));
                tempStr = tempStr.replace("${通知单生成日期}",DateUtil.formatDate(new Date(),"yyyy-MM-dd"));
            }else if(y.getTitle().equals("${制表人名称}")){
                tempStr.replace("${制表人名称}",loginUserInfo.getRealname());
                tempStr = tempStr.replace("${制表人名称}",loginUserInfo.getRealname());
            } 
        }
        return tempStr;
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -84,7 +84,7 @@
        model.setEditor(model.getCreator());
        if(model.getStartDate().getTime() > System.currentTimeMillis()){
            model.setStatus(Constants.ZERO);
        }else if(model.getStartDate().getTime() <= System.currentTimeMillis() && model.getEndDate().getTime() > System.currentTimeMillis()){
        }else if(model.getStartDate().getTime() <= System.currentTimeMillis() && Utils.Date.getEnd(model.getEndDate()).getTime() > System.currentTimeMillis()){
            model.setStatus(Constants.ONE);
        }else{
            model.setStatus(Constants.TWO);
@@ -112,6 +112,12 @@
            t.setEditor(model.getCreator());
            t.setType(Constants.ZERO);
            list.add(t);
        }
        if(Constants.equalsInteger(model.getStatus(),Constants.ONE)){
            //更新房源数据为租赁中
            roomMapper.update(new UpdateWrapper<YwRoom>().lambda().set(YwRoom::getLeaseNowStatus,Constants.ONE)
                    .in(YwRoom::getId,model.getRoomList().stream().map(i->i.getId()).collect(Collectors.toList()))
            );
        }
        ywContractRoomMapper.insert(list);
    }
@@ -341,6 +347,13 @@
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public  Integer backRent(YwContract param){
        isParamValidBackRent(param);
        YwContract model = ywContractMapper.selectById(param.getId());
        if(Objects.isNull(model)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!(model.getStartDate().getTime()<=param.getBtDate().getTime()&&model.getEndDate().getTime()>=param.getBtDate().getTime())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"退租日期错误,请检查退租日期需在合同日期内!");
        }
        param.setEditDate(new Date());
        param.setEditor(param.getLoginUserInfo().getId());
        //处理
@@ -364,30 +377,47 @@
        update.setBtRemark(getbackRentRemarkByParam(param));
        ywContractMapper.updateById(update);
        dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK, param.getLoginUserInfo().getRealname(),getbackRentLogByParam(param));
        //如果退租日期小于当前日期 åˆ™ç›´æŽ¥é‡Šæ”¾æˆ¿æºä¿¡æ¯ æœªç§Ÿèµ
        if(Utils.Date.getEnd(param.getBtDate()).getTime()<System.currentTimeMillis()){
            List<YwContractRoom> contractRoomList = ywContractRoomMapper.selectList(new QueryWrapper<YwContractRoom>().lambda()
                    .eq(YwContractRoom::getContractId, param.getId()));
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(contractRoomList)){
                //更新房源数据为未租赁
                roomMapper.update(new UpdateWrapper<YwRoom>().lambda().set(YwRoom::getLeaseNowStatus,Constants.ZERO)
                        .in(YwRoom::getId,contractRoomList.stream().map(i->i.getRoomId()).collect(Collectors.toList()))
                );
            }
        }
        return param.getId();
    }
    @Override
    public  void dealTimeOut(){
        //定时处理合同执行中
        ywContractMapper.update(new UpdateWrapper<YwContract>()
                .lambda()
                .set(YwContract::getStatus,Constants.ONE)
                .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
        List<YwContract> listA = ywContractMapper.selectList(new QueryWrapper<YwContract>().lambda()
                .eq(YwContract::getIsdeleted,Constants.ZERO)
                .in(YwContract::getStatus,Constants.ZERO)
                .apply(" START_DATE < NOW()  AND END_DATE > NOW() ")
        );
        //定时处理合同已过期
        ywContractMapper.update(new UpdateWrapper<YwContract>()
                        .lambda()
                .set(YwContract::getStatus,Constants.TWO)
                .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
                .eq(YwContract::getIsdeleted,Constants.ZERO)
                .in(YwContract::getStatus,Constants.ONE,Constants.ZERO)
                .apply(" END_DATE < CURRENT_DATE ")
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(listA)){
            //定时处理合同执行中
            ywContractMapper.update(new UpdateWrapper<YwContract>()
                    .lambda()
                    .set(YwContract::getStatus,Constants.ONE)
                    .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
                    .in(YwContract::getId,listA.stream().map(i->i.getId()).collect(Collectors.toList()))
            );
            List<YwContractRoom> contractRoomList = ywContractRoomMapper.selectList(new QueryWrapper<YwContractRoom>().lambda().in(YwContractRoom::getContractId,
                    listA.stream().map(i->i.getId()).collect(Collectors.toList())));
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(contractRoomList)){
                //更新房源数据为租赁中
                roomMapper.update(new UpdateWrapper<YwRoom>().lambda().set(YwRoom::getLeaseNowStatus,Constants.ONE)
                        .in(YwRoom::getId,contractRoomList.stream().map(i->i.getRoomId()).collect(Collectors.toList()))
                );
            }
        }
    }
@@ -420,7 +450,7 @@
                        ||Constants.equalsInteger(bill.getPayStatus(),Constants.THREE)){
                    if(bill.getStartDate().getTime()<=param.getBtDate().getTime()){
                        canBills.add(bill);
                        canBillCount = canBillCount ++;
                        canBillCount = canBillCount + 1 ;
                    }else{
                        //如果还没开始,账单直接关闭
                        closeBills.add(bill);
@@ -432,11 +462,11 @@
                        noBills.add(bill);
                    }else{
                        canBills.add(bill);
                        canBillCount = canBillCount ++;
                        canBillCount = canBillCount + 1 ;
                    }
                }else  if(Constants.equalsInteger(bill.getPayStatus(),Constants.TWO) ){
                     canBills.add(bill);
                    canBillCount = canBillCount ++;
                    canBillCount = canBillCount + 1 ;
                }
            }
        }
@@ -464,12 +494,17 @@
                    if(fee.compareTo(new BigDecimal(0))== 0){
                        //如果费用正好,则修改账单信息为已结清
                        b.setPayStatus(Constants.ONE);
                        canBillCount = canBillCount --;
                    }else if(fee.compareTo(new BigDecimal(0))> 0){
                        canBillCount = canBillCount - 1 ;
                    }else if(fee.compareTo(new BigDecimal(0))< 0){
                        //如果需要进行退款,更新账单信息为待退款
                        b.setPayStatus(Constants.FOUR);
                    }else if(fee.compareTo(new BigDecimal(0)) < 0){
                        //如果账单还有款待收,则保持状态不变
                    }else if(fee.compareTo(new BigDecimal(0)) > 0){
                        //如果账单还有款待收,则更新账单为待收款
                        if(b.getPayStatus()==Constants.ZERO){
                            b.setPayStatus(Constants.ZERO);
                        }else if(b.getPayStatus()!=Constants.TWO){
                            b.setPayStatus(Constants.TWO);
                        }
                    }
                    b.setReceivableFee(editBill.getReceivableFee());
                }
@@ -654,8 +689,8 @@
            //2025-1-23 13:56:53 åŠ å…¥ å‰ç«¯å…¥å‚调整后的账单信息
            List<YwContractBill> ywContractBillList = new ArrayList<>();
            //查询租赁条款
            if(Constants.equalsInteger(model.getType(),Constants.ZERO )
                    || Constants.equalsInteger(model.getType(),Constants.TWO)&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details1)){
            if((Constants.equalsInteger(model.getType(),Constants.ZERO )
                    || Constants.equalsInteger(model.getType(),Constants.TWO))&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details1)){
                YwContractDetail ywContractDetail = details1.get(Constants.ZERO);
                YwContractBill zlBill = new YwContractBill();
                BeanUtils.copyProperties(model.getZlBillDTO(),zlBill);
@@ -691,8 +726,8 @@
                }
            }
            //查询物业账单
            if(Constants.equalsInteger(model.getType(),Constants.ZERO )
                    || Constants.equalsInteger(model.getType(),Constants.TWO)&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details2)){
            if((Constants.equalsInteger(model.getType(),Constants.ZERO )
                    || Constants.equalsInteger(model.getType(),Constants.ONE))&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details2)){
                YwContractDetail ywContractDetail = details2.get(Constants.ZERO);
                YwContractBill wyBill = new YwContractBill();
                BeanUtils.copyProperties(model.getWyBillDTO(),wyBill);
@@ -1396,7 +1431,7 @@
                .selectAs(YwCustomer::getName, YwContract::getRenterName)
                .selectAs(YwProject::getName, YwContract::getProjectName)
                .select("t3.realname", YwContract::getCreatorName)
                .select("(select sum(r.area) from yw_contract_room cr left join yw_room r on r.id = cr.room_id where r.isdeleted=0 and cr.contract_id =t.id)", YwContract::getTotalArea)
                .select("(select sum(r.RENT_AREA) from yw_contract_room cr left join yw_room r on r.id = cr.room_id where r.isdeleted=0 and cr.contract_id =t.id)", YwContract::getTotalArea)
                .leftJoin(Company.class, Company::getId, YwContract::getCompanyId)
                .leftJoin(SystemUser.class, SystemUser::getId, YwContract::getUserId)
                .leftJoin(SystemUser.class, SystemUser::getId, YwContract::getCreator)
@@ -1457,14 +1492,12 @@
        //查询账单集合
        model.setBillList(ywContractBillMapper.selectJoinList(YwContractBill.class,new MPJLambdaWrapper<YwContractBill>()
                .selectAll(YwContractBill.class )
                //.select(" ( select ifnull(sum(case when yw.REVENUE_TYPE = 0 then yw.ACT_RECEIVABLE_FEE  else  -yw.ACT_RECEIVABLE_FEE end),0) from  yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as  actReceivableFee  ")
                .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when  t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE  when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else  yw.ACT_RECEIVABLE_FEE END),0) from  yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as  actReceivableFee  ")
                .eq(  YwContractBill::getContractId,model.getId())
                .eq(YwContractBill::getIsdeleted,Constants.ZERO)
                .orderByAsc(YwContractBill::getSortnum,YwContractBill::getCreateDate)));
        for (YwContractBill ywContractBill:model.getBillList()) {
            ywContractBill.setNeedReceivableFee(ywContractBill.getReceivableFee());
//            ywContractBill.setNeedReceivableFee(ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee()));
        }
        model.setCanBackRentBills(new ArrayList<>());
        long nowStart = Utils.Date.getStart(date).getTime();
@@ -1574,6 +1607,9 @@
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.ge(YwContract::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.le(YwContract::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        if (pageWrap.getModel().getStatusList() != null) {
            queryWrapper.in(YwContract::getStatus, pageWrap.getModel().getStatusList());
        }
        if (pageWrap.getModel().getEditor() != null) {
            queryWrapper.eq(YwContract::getEditor, pageWrap.getModel().getEditor());
@@ -1712,4 +1748,63 @@
        QueryWrapper<YwContract> wrapper = new QueryWrapper<>(ywContract);
        return ywContractMapper.selectCount(wrapper);
    }
    /**
     * åˆ°æœŸåˆåŒ æœªå‘起退租的进行数据调整 æŠŠåˆåŒä¸‹çš„æˆ¿æºé‡Šæ”¾ å®šæ—¶æ—¶é—´éœ€è¦åœ¨æ¯å¤©æ™šä¸Š12点前
     */
    @Override
    public void updRoomLeaseNowStatus(){
        //定时处理合同已过期
        List<YwContract> ywContractList = ywContractMapper.selectList(new QueryWrapper<YwContract>().lambda()
                .eq(YwContract::getIsdeleted,Constants.ZERO)
                .in(YwContract::getStatus,Constants.ONE,Constants.ZERO)
                .apply(" DATE(END_DATE) = CURRENT_DATE ")
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractList)){
            ywContractMapper.update(new UpdateWrapper<YwContract>()
                    .lambda()
                    .set(YwContract::getStatus,Constants.TWO)
                    .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
                    .in(YwContract::getId,ywContractList.stream().map(i->i.getId()).collect(Collectors.toList()))
            );
            List<YwContractRoom> contractRoomList = ywContractRoomMapper.selectList(new QueryWrapper<YwContractRoom>().lambda().in(YwContractRoom::getContractId,
                    ywContractList.stream().map(i->i.getId()).collect(Collectors.toList())));
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(contractRoomList)){
                //更新房源数据为租赁中
                roomMapper.update(new UpdateWrapper<YwRoom>().lambda().set(YwRoom::getLeaseNowStatus,Constants.ZERO)
                        .in(YwRoom::getId,contractRoomList.stream().map(i->i.getRoomId()).collect(Collectors.toList()))
                );
            }
        }
    }
    /**
     * é€€ç§Ÿä¸­/已退租合同 æŠŠåˆ°äº†é€€ç§Ÿæ—¥æœŸæ—¶é—´çš„æ•°æ® è¿›è¡Œæˆ¿æºé‡Šæ”¾ å®šæ—¶æ—¶é—´éœ€è¦åœ¨æ¯å¤©æ™šä¸Š12点前
     */
    @Override
    public void updRentContractStatus(){
        List<YwContract> ywContractList = ywContractMapper.selectList(new QueryWrapper<YwContract>().lambda()
                .eq(YwContract::getIsdeleted,Constants.ZERO)
                .in(YwContract::getStatus,Constants.THREE,Constants.FOUR)
                .eq(YwContract::getBtDate,DateUtil.getCurrDate())
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractList)){
            List<YwContractRoom> contractRoomList = ywContractRoomMapper.selectList(new QueryWrapper<YwContractRoom>().lambda().in(YwContractRoom::getContractId,
                    ywContractList.stream().map(i->i.getId()).collect(Collectors.toList())));
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(contractRoomList)){
                //更新房源数据为待租赁
                roomMapper.update(new UpdateWrapper<YwRoom>().lambda().set(YwRoom::getLeaseNowStatus,Constants.ZERO)
                        .in(YwRoom::getId,contractRoomList.stream().map(i->i.getRoomId()).collect(Collectors.toList()))
                );
            }
        }
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwDeviceServiceImpl.java
@@ -430,7 +430,7 @@
        ywDeviceStatusDataVO.setAmount(ywDeviceList.size());
        ywDeviceStatusDataVO.setWorkAmount(ywDeviceList.stream().filter(i->Objects.nonNull(i.getStatus())&&Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size());
        ywDeviceStatusDataVO.setExceptionAmount(ywDeviceList.stream().filter(i->Objects.nonNull(i.getStatus())&&Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size());
        ywDeviceStatusDataVO.setErrAmount(ywDeviceList.stream().filter(i->Objects.nonNull(i.getStatus())&&Constants.equalsInteger(i.getStatus(),Constants.THREE)).collect(Collectors.toList()).size());
        ywDeviceStatusDataVO.setErrAmount(ywDeviceList.stream().filter(i->Objects.nonNull(i.getStatus())&&Constants.equalsInteger(i.getStatus(),Constants.TWO)).collect(Collectors.toList()).size());
        return ywDeviceStatusDataVO;
    }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java
@@ -1,6 +1,8 @@
package com.doumee.service.business.impl;
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.annotation.excel.ExcelImporter;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
@@ -9,11 +11,14 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CategoryMapper;
import com.doumee.dao.business.YwMaterialMapper;
import com.doumee.dao.business.YwOutinboundMapper;
import com.doumee.dao.business.YwOutinboundRecordMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.system.MultifileMapper;
import com.doumee.dao.system.dto.ImportMaterialDTO;
import com.doumee.dao.system.dto.ImportSystemUserDTO;
import com.doumee.dao.system.model.Multifile;
import com.doumee.service.business.YwMaterialService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -22,16 +27,19 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseMapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import javafx.scene.paint.Material;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
 * è¿ç»´èµ„产信息表Service实现
@@ -51,6 +59,9 @@
    private YwOutinboundRecordMapper ywOutinboundRecordMapper;
    @Autowired
    private CategoryMapper categoryMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Override
@@ -67,8 +78,17 @@
        ywMaterial.setId(null);
        if(StringUtils.isBlank(ywMaterial.getCode())){
            //自动生成 TODO å­˜åœ¨é—®é¢˜
            Long countCode = ywMaterialMapper.selectCount(new QueryWrapper<YwMaterial>().lambda().eq(YwMaterial::getAutoCode, Constants.ONE));
            String nextCode = StringUtils.leftPad(Long.toString(countCode + 1),4,"0");
            YwMaterial lastAutoMaterial = ywMaterialMapper.selectOne(new QueryWrapper<YwMaterial>().lambda().eq(YwMaterial::getAutoCode,Constants.ONE).last("limit 1 "));
            Long countCode = 0L;
            String nextCode = StringUtils.leftPad(Long.toString(countCode + 1 ),4,"0");
            if(Objects.nonNull(lastAutoMaterial)){
                Long maxCode = Long.valueOf(lastAutoMaterial.getCode().replace("P",""));
                nextCode = StringUtils.leftPad(Long.toString(maxCode + 1),4,"0");
                while (ywMaterialMapper.selectCount(new QueryWrapper<YwMaterial>().lambda().eq(YwMaterial::getCode, "P"+nextCode))>Constants.ZERO){
                    countCode = countCode + 1 ;
                    nextCode = StringUtils.leftPad(Long.toString(countCode),4,"0");
                }
            }
            ywMaterial.setCode("P"+nextCode);
            ywMaterial.setAutoCode(Constants.ONE);
        }else{
@@ -247,4 +267,67 @@
        QueryWrapper<YwMaterial> wrapper = new QueryWrapper<>(ywMaterial);
        return ywMaterialMapper.selectCount(wrapper);
    }
    @Override
    public Integer importMaterialBatch(MultipartFile file,LoginUserInfo loginUserInfo) {
        try {
            ExcelImporter ie = new ExcelImporter(file, 0, 0);
            List<ImportMaterialDTO> dataList = ie.getDataList(ImportMaterialDTO.class, null);
            if (CollectionUtils.isEmpty(dataList)) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,录入数据为空!");
            }
            List<Category> allCategory = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
                    .eq(Category::getIsdeleted,Constants.ZERO).eq(Category::getIsdeleted,Constants.ZERO)
                    .eq(Category::getType,Constants.SEVEN)
            );
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(allCategory)){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,无分类基础数据!");
            }
            List<Category> categoryList = allCategory.stream().filter(i->Objects.isNull(i.getParentId())).collect(Collectors.toList());
            for (Category category: categoryList) {
                category.setChildCategoryList(
                        allCategory.stream().filter(i->Objects.nonNull(i.getParentId())&&Constants.equalsInteger(i.getParentId(),category.getId())).collect(Collectors.toList())
                );
            }
            List<YwMaterial> ywMaterialList = new ArrayList<>();
            for (int i = 0; i < dataList.size(); i++) {
                ImportMaterialDTO importMaterialDTO = dataList.get(i);
                if(Objects.isNull(importMaterialDTO)
                    || StringUtils.isBlank(importMaterialDTO.getName())
                    || StringUtils.isBlank(importMaterialDTO.getCategoryName())
                    || StringUtils.isBlank(importMaterialDTO.getCategoryChildName())
                    || StringUtils.isBlank(importMaterialDTO.getQrcode())
                ){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,第"+(i+1)+"行必填项缺失!");
                }
                YwMaterial ywMaterial = new YwMaterial();
                BeanUtils.copyProperties(importMaterialDTO,ywMaterial);
                Optional<Category> categoryOptional = categoryList.stream().filter(j->j.getName().equals(importMaterialDTO.getCategoryName())).findAny();
                if(categoryOptional.isPresent()){
                    Category category = categoryOptional.get();
                    ywMaterial.setParentCateId(category.getId());
                    Optional<Category> childCategoryOptional = category.getChildCategoryList().stream().filter(j->j.getName().equals(importMaterialDTO.getCategoryChildName())).findAny();
                    if(childCategoryOptional.isPresent()){
                        ywMaterial.setCateId(childCategoryOptional.get().getId());
                    }else{
                        throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,第"+(i+1)+"行物料子分类未查询到!");
                    }
                }else{
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,第"+(i+1)+"行物料分类未查询到!");
                }
                ywMaterialList.add(ywMaterial);
            }
            for (YwMaterial ywMaterial:ywMaterialList) {
                ywMaterial.setLoginUserInfo(loginUserInfo);
                this.create(ywMaterial);
            }
        } catch (Exception e) {
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),e.getMessage());
        }
        return null;
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java
@@ -95,7 +95,7 @@
    public List<YwOutinboundRecord> verifyData(YwOutinbound ywOutinbound){
        if(Objects.isNull(ywOutinbound)
                || Objects.isNull(ywOutinbound.getType())
//                || (Objects.nonNull(ywOutinbound.getType()) && (!(ywOutinbound.getType() == Constants.ZERO || ywOutinbound.getType() == Constants.ONE)))
                || ((ywOutinbound.getType() >= 5 && ywOutinbound.getType() <= 9 ) && Objects.isNull(ywOutinbound.getOutUserId()) )
                || Objects.isNull(ywOutinbound.getWarehouseId())
                || Objects.isNull(ywOutinbound.getDoneDate())
                || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywOutinbound.getRecordList())
@@ -158,9 +158,9 @@
                //出库
                if(Objects.isNull(ywStock) || ywStock.getStock().compareTo(ywOutinboundRecord.getStock()) < Constants.ZERO){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), ywMaterial.getName() + "库存不足,请刷新重试");
                }else if(ywStock.getStock().compareTo(ywOutinboundRecord.getStock()) == Constants.ZERO){
                }/*else if(ywStock.getStock().compareTo(ywOutinboundRecord.getStock()) == Constants.ZERO){
                    ywStockMapper.deleteById(ywStock.getId());
                }else{
                }*/else{
                    ywStockMapper.update(new UpdateWrapper<YwStock>().lambda()
                            .setSql(" stock = ( stock - "+ywOutinboundRecord.getStock()+") ")
                            .set(YwStock::getEditDate, DateUtil.getCurrDateTime())
@@ -252,22 +252,29 @@
        }
        List<Integer> typeList  = Constants.ywOutInType.getAllTypeKey(model.getInOut());
        queryWrapper.selectAll(YwOutinbound.class)
                .selectAs(SystemUser::getRealname,YwOutinbound::getCreateUserName)
                .select(" s1.realname  ",YwOutinbound::getCreateUserName)
                .select(" s2.realname  ",YwOutinbound::getOutUserName)
                .selectAs(YwWarehouse::getName,YwOutinbound::getWarehouseName)
                .leftJoin(SystemUser.class,SystemUser::getId,YwOutinbound::getCreator)
                .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwOutinbound::getWarehouseId)
                .leftJoin("system_user s1 on t.creator = s1.id")
                .leftJoin("system_user s2 on t.out_user_id = s2.id")
                .like(StringUtils.isNotBlank(model.getCode()),YwOutinbound::getCode,model.getCode())
                .eq(Objects.nonNull(model.getType()),YwOutinbound::getType,model.getType())
                .eq(Objects.nonNull(model.getWarehouseId()),YwOutinbound::getWarehouseId,model.getWarehouseId())
                .in(Objects.nonNull(model.getInOut()),YwOutinbound::getType,typeList)
        ;
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(pageWrap.getSorts())){
            for(PageWrap.SortData sortData: pageWrap.getSorts()) {
                if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                    queryWrapper.orderByDesc(sortData.getProperty());
                } else {
                    queryWrapper.orderByAsc(sortData.getProperty());
                }
            }
        }else{
            queryWrapper.orderByDesc(YwOutinbound::getCode);
        }
        IPage iPage = ywOutinboundMapper.selectJoinPage(page,YwOutinbound.class,queryWrapper);
        if(Objects.nonNull(iPage.getRecords())){
            iPage.setRecords(this.getDetailData(iPage.getRecords()));
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolSchemeServiceImpl.java
@@ -123,7 +123,7 @@
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywPatrolSchemeList)){
            for (YwPatrolScheme ywPatrolScheme:ywPatrolSchemeList) {
                this.createTask(new Date(),ywPatrolScheme);
                this.createTask(DateUtil.getXDayAfterDate(new Date(),2),ywPatrolScheme);
            }
        }
    }
@@ -301,6 +301,7 @@
        ywPatrolScheme.setEditDate(new Date());
        ywPatrolScheme.setEditor(loginUserInfo.getId());
        ywPatrolSchemeMapper.updateById(ywPatrolScheme);
        this.createThreeDaysData(ywPatrolScheme);
    }
    @Override
@@ -356,15 +357,9 @@
        YwPatrolScheme model = pageWrap.getModel();
        queryWrapper.selectAll(YwPatrolScheme.class)
                .select(" t2.realName as createUserName ")
//                .select(" t1.realName as userName ")
//                .leftJoin(SystemUser.class,SystemUser::getId,YwPatrolScheme::getUserIds)
                .leftJoin(" system_user t2 on t.creator =  t2.id  ")
                .eq(YwPatrolScheme::getIsdeleted,Constants.ZERO)
                .like(StringUtils.isNotBlank(model.getTitle()),YwPatrolScheme::getTitle,model.getTitle())
                //查询有时段交集的数据
              /*  .apply(Objects.nonNull(model.getStartDate())&&Objects.nonNull(model.getEndDate()),
                        " t.START_DATE <= '"+pageWrap.getModel().getEndDate()+"' or t.END_DATE >= '"+pageWrap.getModel().getStartDate()+"' "
                )*/
                .ge( model.getStartDate()!=null,YwPatrolScheme::getStartDate, Utils.Date.getStart(pageWrap.getModel().getStartDate()))
                .le(Objects.nonNull(model.getEndDate()),YwPatrolScheme::getStartDate, Utils.Date.getStart(pageWrap.getModel().getEndDate()))
                .ge(Objects.nonNull(model.getStartDateSec()),YwPatrolScheme::getEndDate, Utils.Date.getStart(pageWrap.getModel().getStartDateSec()))
@@ -405,21 +400,24 @@
            ywPatrolScheme.setTimeOutTaskNum(Constants.ZERO);
            return;
        }
        //过滤数据是不是全部未开始
        if(Constants.equalsInteger(ywPatrolTaskList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO))
                .collect(Collectors.toList()).size(),ywPatrolTaskList.size())){
            ywPatrolScheme.setSchemeStatus(Constants.ZERO);
            ywPatrolScheme.setTimeOutTaskNum(ywPatrolTaskList.stream().filter(i->i.getEndDate().getTime()>System.currentTimeMillis())
                    .collect(Collectors.toList()).size());
            return;
        }
        //过滤数据是否存在进行中的
        if(ywPatrolTaskList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size()>Constants.ZERO){
        if(ywPatrolTaskList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)||Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size()>Constants.ZERO){
            ywPatrolScheme.setSchemeStatus(Constants.ONE);
            ywPatrolScheme.setTimeOutTaskNum(ywPatrolTaskList.stream().filter(i->i.getEndDate().getTime()>System.currentTimeMillis())
                    .collect(Collectors.toList()).size());
            return;
        }
        //过滤数据是不是全部未开始
        if(Constants.equalsInteger(ywPatrolTaskList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size(),ywPatrolTaskList.size())){
            ywPatrolScheme.setSchemeStatus(Constants.ZERO);
            ywPatrolScheme.setTimeOutTaskNum(ywPatrolTaskList.stream().filter(i->i.getEndDate().getTime()>System.currentTimeMillis())
                    .collect(Collectors.toList()).size());
            return;
        }
        //过滤数据是不是全部已完成
        if(Constants.equalsInteger(ywPatrolTaskList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.THREE)).collect(Collectors.toList()).size()
                ,ywPatrolTaskList.size())){
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskRecordServiceImpl.java
@@ -28,9 +28,11 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * è¿ç»´å·¡æ£€ä»»åŠ¡ - å·¡æ£€ç‚¹ä¿¡æ¯è¡¨Service实现
@@ -134,7 +136,7 @@
                .selectAs(SystemUser::getRealname,YwPatrolTaskRecord::getRealname)
                .selectAs(YwPatrolScheme::getTitle,YwPatrolTaskRecord::getSchemeTitle)
                .selectAs(YwPatrolTask::getTitle,YwPatrolTaskRecord::getTaskCode)
                .selectAs(YwPatrolTask::getCode,YwPatrolTaskRecord::getTaskCode)
                .selectAs(YwPatrolTask::getStartDate,YwPatrolTaskRecord::getStartDate)
                .selectAs(YwPatrolTask::getEndDate,YwPatrolTaskRecord::getEndDate)
@@ -213,7 +215,8 @@
        if(Objects.isNull(ywPatrolScheme)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到巡检计划信息");
        }
        if(!ywPatrolScheme.getUserIds().equals(loginUserInfo.getId().toString())){
        List<String>  userIdList = Arrays.asList(ywPatrolScheme.getUserIds().split(","));
        if(userIdList.stream().filter(i->Constants.equalsInteger(Integer.valueOf(i),loginUserInfo.getId())).collect(Collectors.toList()).size()<=0){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"非您的巡检任务无法进行处理");
        }
        YwPatrolTask ywPatrolTask = ywPatrolTaskMapper.selectById(model.getTaskId());
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolTaskServiceImpl.java
@@ -85,6 +85,7 @@
                .selectAll(YwPatrolTask.class)
                .selectAs(YwPatrolScheme::getCode,YwPatrolTask::getPlanCode)
                .selectAs(YwPatrolScheme::getTitle,YwPatrolTask::getPlanTitle)
                .selectAs(YwPatrolScheme::getUserIds,YwPatrolTask::getUserIds)
                .selectAs(SystemUser::getRealname,YwPatrolTask::getUserName)
                .select(" ( select count(1) from yw_patrol_task_record ytr where ytr.TASK_ID = t.id  and ytr.ISDELETED = 0  ) ",YwPatrolTask::getPatrolNum)
                .select(" ( select count(1) from yw_patrol_task_record ytr where ytr.TASK_ID = t.id  and ytr.STATUS = 1 and ytr.ISDELETED = 0) ",YwPatrolTask::getFinishNum)
@@ -139,6 +140,7 @@
        queryWrapper.selectAll(YwPatrolTask.class)
                .selectAs(YwPatrolScheme::getCode,YwPatrolTask::getPlanCode)
                .selectAs(YwPatrolScheme::getTitle,YwPatrolTask::getPlanTitle)
                .selectAs(YwPatrolScheme::getUserIds,YwPatrolTask::getUserIds)
                .selectAs(SystemUser::getRealname,YwPatrolTask::getUserName)
                .select(" ( select count(1) from yw_patrol_task_record ytr where ytr.TASK_ID = t.id  and ytr.ISDELETED = 0  ) ",YwPatrolTask::getPatrolNum)
                .select(" ( select count(1) from yw_patrol_task_record ytr where ytr.TASK_ID = t.id  and ytr.STATUS = 1 and ytr.ISDELETED = 0) ",YwPatrolTask::getFinishNum)
@@ -146,7 +148,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()),YwPatrolScheme::getUserIds, model.getDealUserId())
                .apply(Objects.nonNull(model.getDealUserId())," find_in_set("+model.getDealUserId()+",t2.USER_IDS) ")
                .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
@@ -296,13 +296,7 @@
        List<YwRoom>  ywRoomList = ywRoomMapper.selectJoinList(YwRoom.class,new MPJLambdaWrapper<YwRoom>()
                .selectAll(YwRoom.class)
//                        .select("  ( SELECT count(1) FROM  yw_contract y1 " +
//                                " left join yw_contract_room y2 on y1.id = y2.contract_id " +
//                                " where 1 = 1 and y2.type = 0  and y1.`STATUS` in( 0,1,2) " +
//                                " and y1.START_DATE <  now() and y1.END_DATE >  now() and y2.ROOM_ID = yw_room.id ) as investmentStatus ")
                .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  ) ,0) ",YwRoom::getLeaseStatus)
                .select(" ifnull( (  case when t.IS_INVESTMENT = 0 then 2 else t.LEASE_NOW_STATUS end  ) ,0) ",YwRoom::getLeaseStatus)
                .eq(YwRoom::getIsdeleted,Constants.ZERO)
                .eq(YwRoom::getStatus,Constants.ZERO)
                .eq(YwRoom::getIsInvestment,Constants.ONE)
@@ -313,7 +307,7 @@
                        "  ) ")
                .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' " +
                        " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.BT_DATE >= '"+ dataDTO.getStartDate() +"  00:00:00' " +
                        "  ) ")
                .orderByAsc(YwRoom::getRoomNum)
        );
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwRoomServiceImpl.java
@@ -67,6 +67,7 @@
        model.setStatus(Constants.ZERO);
        model.setEditDate(model.getCreateDate());
        model.setEditor(model.getCreator());
        model.setLeaseNowStatus(Constants.ZERO);
        ywRoomMapper.insert(model);
        return model.getId();
    }
@@ -138,9 +139,10 @@
        queryWrapper.selectAll(YwRoom.class )
                .selectAs(YwProject::getName,YwRoom::getProjectName)
                .selectAs(YwFloor::getName,YwRoom::getFloorName)
                .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  ) ,0) ",YwRoom::getLeaseStatus)
//                .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  ) ,0) ",YwRoom::getLeaseStatus)
                .select(" ifnull( (  case when t.IS_INVESTMENT = 0 then 2 else t.LEASE_NOW_STATUS end  ) ,0) ",YwRoom::getLeaseStatus)
                .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
                .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId)
@@ -173,9 +175,10 @@
                .selectAs(YwProject::getName,YwRoom::getProjectName)
                .selectAs(YwFloor::getName,YwRoom::getFloorName)
                .selectAs(YwBuilding::getName,YwRoom::getBuildingName)
                .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  ) ,0) ",YwRoom::getLeaseStatus)
//                .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  ) ,0) ",YwRoom::getLeaseStatus)
                .select(" ifnull( (  case when t.IS_INVESTMENT = 0 then 2 else t.LEASE_NOW_STATUS end  ) ,0) ",YwRoom::getLeaseStatus)
                .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId)
                .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId)
                .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor);
@@ -245,11 +248,11 @@
        }
        queryWrapper.orderByAsc(YwRoom::getRoomNum);
        IPage<YwRoom> iPage = ywRoomMapper.selectJoinPage(page,YwRoom.class, queryWrapper);
        for (YwRoom ywRoom:iPage.getRecords()) {
            if(Constants.equalsInteger(ywRoom.getIsInvestment(),Constants.ZERO)){
                ywRoom.setLeaseStatus(Constants.TWO);
            }
        }
//        for (YwRoom ywRoom:iPage.getRecords()) {
//            if(Constants.equalsInteger(ywRoom.getIsInvestment(),Constants.ZERO)){
//                ywRoom.setLeaseStatus(Constants.TWO);
//            }
//        }
        return PageData.from(iPage);
    }
@@ -302,10 +305,34 @@
                        .eq(YwContractRoom::getType,Constants.ZERO)
                        .eq(YwContractRoom::getRoomId,ywRoom.getId())
                        .orderByDesc(YwContract::getStartDate)
                        .orderByDesc(YwContract::getId)
                );
                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(roomContractList)){
                    roomStatusDataVO.setRoomStatus(Constants.ZERO);
                    roomStatusDataVO.setFreeDayAmount(Constants.ZERO);
                    //查询是否有已退租合同
                    List<YwContract> roomRentContractList =   ywContractMapper.selectJoinList(YwContract.class,new MPJLambdaWrapper<YwContract>()
                            .selectAll(YwContract.class)
                            .selectAs(YwCustomer::getName,YwContract::getRenterName)
                            .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId)
                            .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                            .eq(YwContract::getIsdeleted,Constants.ZERO)
                            .eq(YwContract::getStatus,Constants.FOUR)
                            .eq(YwContractRoom::getType,Constants.ZERO)
                            .eq(YwContractRoom::getRoomId,ywRoom.getId())
                            .orderByDesc(YwContract::getStartDate)
                            .orderByDesc(YwContract::getId)
                    );
                    if(CollectionUtils.isEmpty(roomRentContractList)){
                        roomStatusDataVO.setFreeDayAmount(Constants.ZERO);
                    }else{
                        YwContract ywContract = roomRentContractList.get(Constants.ZERO);
                        //查询退租日期和当前日期相差天数
                        Integer btDays = DateUtil.daysBetweenDates(new Date(),ywContract.getBtDate());
                        if(btDays>=Constants.ZERO){
                            roomStatusDataVO.setFreeDayAmount(btDays);
                        }
                    }
                }else{
                    YwContract ywContract = roomContractList.get(Constants.ZERO);
                    //合同状态 0待执行 1执行中 2已到期 3退租中 4已退租
@@ -397,7 +424,7 @@
                .select(" ( select  ifnull(sum(yr.RENT_AREA),0)  from yw_contract_room y left join yw_room yr on y.room_id = yr.id  where y.type = 0 and y.CONTRACT_ID = t.id ) " , YwContract::getTotalArea)
                .select(" ( select  ifnull(sum(y.TOTLE_FEE),0)  from yw_contract_bill y   where y.CONTRACT_ID = t.id and y.type = 0 and y.COST_TYPE=0 and y.BILL_TYPE = 0  ) " , YwContract::getTotalFee)
                .eq(YwContract::getIsdeleted,Constants.ZERO)
                .in(YwContract::getStatus,Constants.ONE,Constants.TWO,Constants.THREE)
                .in(YwContract::getStatus,Constants.ZERO,Constants.ONE,Constants.TWO,Constants.THREE)
                .apply(Objects.nonNull(model.getBuildingId()),
                        " t.id in ( select y.CONTRACT_ID from yw_contract_room y left join yw_room yr on y.room_id = yr.id  where y.type = 0 and  yr.BUILDING_ID = "+model.getBuildingId()+" ) ")
                .apply(Objects.nonNull(model.getProjectId()),
@@ -434,7 +461,8 @@
                .eq(Objects.nonNull(model.getBuildingId()),YwRoom::getBuildingId,model.getBuildingId())
                .eq(Objects.nonNull(model.getProjectId()),YwRoom::getProjectId,model.getProjectId())
                .in(YwContractRoom::getContractId,contractId)
                .orderByAsc(YwRoom::getSortnum)
                .last(" group by t.id  " +
                        "ORDER BY t.sortnum ASC  ")
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywLeaseRoomList)){
            ywRoomContractDataVO.setLeaseArea(
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java
@@ -195,6 +195,7 @@
                .set(YwStocktakingRecord::getActStock,ywStocktakingRecord.getActStock())
                .set(YwStocktakingRecord::getUserId,loginUserInfo.getId())
                .set(YwStocktakingRecord::getPlanDate, DateUtil.getCurrDateTime())
                .set(StringUtils.isNotBlank(ywStocktakingRecord.getRemark()),YwStocktakingRecord::getRemark, ywStocktakingRecord.getRemark())
                .eq(YwStocktakingRecord::getId,ywStocktakingRecord.getId())
        );
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java
@@ -442,7 +442,7 @@
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(recordList)){
            //合计盘点数据
            ywStocktaking.setFinishAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size());
            ywStocktaking.setUnFinishAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size());
            ywStocktaking.setUnFinishAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.TWO)).collect(Collectors.toList()).size());
            ywStocktaking.setEqualAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList()).size());
            ywStocktaking.setLossAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.ONE)).collect(Collectors.toList()).size());
            ywStocktaking.setProfitAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.TWO)).collect(Collectors.toList()).size());
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwTempConfigServiceImpl.java
@@ -232,8 +232,6 @@
                .set(YwTempConfig::getUrl,leasesTemp.getUrl())
                .eq(YwTempConfig::getId,leasesTemp.getId())
        );
        YwTempConfig otherTemp = ywCallTempDataDTO.getOtherTemp();
        if(Objects.isNull(otherTemp.getId())
                || Objects.isNull(otherTemp.getTitle())
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java
@@ -132,7 +132,7 @@
        if(ywStockMapper.selectCount(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO)
                .gt(YwStock::getStock,Constants.ZERO)
                .eq(YwStock::getWarehouseId,ywWarehouse.getId()))>Constants.ZERO){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前仓库内有库存的物料,不可删除");
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前仓库内有库存的物料,不可禁用");
        };
        ywWarehouseMapper.update(new UpdateWrapper<YwWarehouse>().lambda().eq(YwWarehouse::getId,ywWarehouse.getId()).set(YwWarehouse::getStatus,ywWarehouse.getStatus()));
    }
server/visits/dmvisit_service/src/main/resources/application-test.yml
@@ -28,7 +28,7 @@
debug_model: true
########################压缩包文件位置  ########################
zip_file_path: d://
zip_file_path: /usr/local/static_resources/fn/
########################同步数据模式  ########################
data-sync:
  org-user-data-origin: 0 #组织数据 0自建 2以海康为主 1华晟ERP系统