renkang
2024-11-28 410227e469df13201cfe7b6d9c254b02fba5e11b
客户资料 巡检任务业务
已添加1个文件
已修改11个文件
154 ■■■■ 文件已修改
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContract.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwDeviceServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolLineServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolPointServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -86,6 +86,13 @@
    @GetMapping("/timer/sms/sendWaitingSmsNotice")
    ApiResponse sendWaitingSmsNotice();
    @ApiOperation("【阜宁运维】定时处理合同账单编码")
    @GetMapping("/timer/yw/ywDealContractBillCodeTimer")
    ApiResponse ywDealContractBillCodeTimer();
    @ApiOperation("【阜宁运维】定时处理合同过期")
    @GetMapping("/timer/yw/ywDealContractTimeOutTimer")
    ApiResponse ywDealContractTimeOutTimer();
}
server/system_timer/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
spring:
  profiles:
    active: pro
    active: dev
  application:
    name: systemTimer
    # å®‰å…¨é…ç½®
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.doumee.api;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.YwContract;
import com.doumee.service.business.PlatformJobService;
import com.doumee.service.business.YwContractBillService;
import com.doumee.service.business.YwContractService;
import com.doumee.service.system.SystemDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/11/28 10:58
 */
@Api(tags = "阜宁运维系统定时器接口")
@RestController
@RequestMapping("/timer/yw")
public class YwTimerController  extends BaseController {
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private SystemDictDataService systemDictDataService;
    @Autowired
    private YwContractBillService ywContractBillService;
    @Autowired
    private YwContractService ywContractService;
    @ApiOperation("定时处理合同账单编码")
    @GetMapping("/ywDealContractBillCodeTimer")
    public ApiResponse ywDealContractBillCodeTimer() {
        ywContractBillService.dealDayBillCode();
        return ApiResponse.success("定时处理合同账单编码");
    }
    @ApiOperation("定时处理合同过期与执行中")
    @GetMapping("/ywDealContractTimeOutTimer")
    public ApiResponse ywDealContractTimeOutTimer() {
        ywContractService.dealTimeOut();
        return ApiResponse.success("定时处理合同过期与执行中");
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContract.java
@@ -54,9 +54,10 @@
    @ExcelColumn(name="合同摘要")
    private String remark;
    @ApiModelProperty(value = "状态 0待执行 1执行中 2已到期 3已退租", example = "1")
    @ExcelColumn(name="状态 0待执行 1执行中 2已到期 3已退租")
    @ApiModelProperty(value = "状态 0待执行 1执行中 2已到期 3退租中 4已退租", example = "1")
    @ExcelColumn(name="状态 0待执行 1执行中 2已到期 3退租中 4已退租")
    private Integer status;
    @ApiModelProperty(value = "账单结清状态: 0待付款 1部分收款 2已结清 3已关闭", example = "1")
    @ExcelColumn(name="账单结清状态: 0待付款 1部分收款 2已结清 3已关闭")
    private Integer billStatus;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
@@ -12,6 +12,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
@@ -60,9 +62,11 @@
    @ApiModelProperty(value = "开始时间")
    @ExcelColumn(name="计费开始日期",index = 10,width = 6,dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @ApiModelProperty(value = "结束时间")
    @ExcelColumn(name="计费结束日期",index = 11,width = 6,dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    @ApiModelProperty(value = "实际付款日")
@@ -71,6 +75,7 @@
    @ApiModelProperty(value = "计划付款日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date planPayDate;
    @ApiModelProperty(value = "合同条款编码(关联yw_contract_detail)", example = "1")
@@ -177,7 +182,7 @@
    @ApiModelProperty(value = "实收金额")
    @TableField(exist = false)
    @ExcelColumn(name="实收金额",index = 6,width = 6)
    private BigDecimal actReceivableFee;
    private BigDecimal actReceivableFee = BigDecimal.ZERO;
    @ApiModelProperty(value = "需收金额")
    @TableField(exist = false)
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractService.java
@@ -100,5 +100,7 @@
    Integer backRent(YwContract ywContract);
    void dealTimeOut();
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
@@ -389,16 +389,17 @@
                            .isNotNull(YwContractBill::getCode)
                            .apply(" CREATE_DATE like '"+codeDate+"%' ")
                            .orderByDesc(YwContractBill::getId)
                            .last(" limit  1 ")
                    );
                    Integer maxCode = Constants.ONE;
                    Integer maxCode = Constants.ZERO;
                    if(Objects.nonNull(ywContractBill)){
                        maxCode = Integer.valueOf(ywContractBill.getCode().replace("ZD"+codeDate,""));
                        maxCode = Integer.valueOf(ywContractBill.getCode().replace(("ZD"+codeDate+"-"),""));
                    }
                    for (YwContractBill contractBill:codeDateBillList) {
                        maxCode = maxCode + 1;
                        contractBill.setCode("ZD" + codeDate + "-" + StringUtils.leftPad(maxCode.toString() , 4,"0"));
                        ywContractBillMapper.update(null, new UpdateWrapper<YwContractBill>().lambda().set(YwContractBill::getCode,contractBill.getCode())
                                .eq(YwContractBill::getId,ywContractBill.getId()));
                                .eq(YwContractBill::getId,contractBill.getId()));
                    }
                }
            }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
@@ -6,6 +6,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dao.CompanyMapper;
@@ -322,14 +323,14 @@
        ywContractBillMapper.update(null,new UpdateWrapper<YwContractBill>().lambda()
                .set(YwContractBill::getPayStatus,ywContractBill.getPayStatus())
                .set(YwContractBill::getEditor,loginUserInfo.getId())
                .set(YwContractBill::getEditDate," now() ")
                .set(YwContractBill::getEditDate, DateUtil.getCurrDateTime())
                .eq(YwContractBill::getId,ywContractBill.getId())
        );
        ywContractRevenueMapper.update(null,new UpdateWrapper<YwContractRevenue>().lambda()
                .set(YwContractRevenue::getStatus,Constants.ONE)
                .set(YwContractRevenue::getEditor,loginUserInfo.getId())
                .set(YwContractRevenue::getEditDate," now() ")
                .set(YwContractRevenue::getEditDate,DateUtil.getCurrDateTime())
                .eq(YwContractRevenue::getId,id));
    }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -294,11 +294,16 @@
        //处理
        dealBackRentBillBiz(param);
        YwContract update = new YwContract();
        update.setId(param.getId());
        update.setEditDate(new Date());
        update.setEditor(param.getLoginUserInfo().getId());
        update.setBtActDate(update.getEditDate());
        update.setBtActUserId(update.getEditor());
        update.setStatus(Constants.THREE);
        if(Objects.nonNull(param.getBtWaitBill()) && param.getBtWaitBill() > Constants.ZERO){
            update.setStatus(Constants.THREE);
        }else{
            update.setStatus(Constants.FOUR);
        }
        update.setBtInfo(param.getBtInfo());
        update.setBtDate(param.getBtDate());
        update.setBtType(param.getBtType());
@@ -308,6 +313,30 @@
        ywContractMapper.updateById(update);
        dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK, param.getLoginUserInfo().getRealname(),getbackRentLogByParam(param));
        return param.getId();
    }
    @Override
    public  void dealTimeOut(){
        //定时处理合同执行中
        ywContractMapper.update(new UpdateWrapper<YwContract>()
                .lambda()
                .set(YwContract::getStatus,Constants.ONE)
                .set(YwContract::getEditDate,DateUtil.getCurrDateTime())
                .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 < NOW() ")
        );
    }
    private void dealBackRentBillBiz(YwContract param) {
@@ -328,7 +357,7 @@
                //付款状态:0=待收款;1=已结清;2=部分结清;3=待付款;4=待退款;5=已关闭
                // å¦‚果是押金或者保证金,不支持退款,保持原来的状态, 0=租赁费;1=物业费;2=租赁押金;3=物业押金;4=水电费;5=杂项费;6=其他;7=保证金
                if(Constants.equalsInteger(Constants.THREE,bill.getCostType())
                        ||  Constants.equalsInteger(Constants.FOUR,bill.getCostType())
                        ||  Constants.equalsInteger(Constants.TWO,bill.getCostType())
                        ||Constants.equalsInteger(Constants.SEVEN,bill.getCostType())){
                    //押金和保证金
                    yjBills.add(bill);
@@ -466,7 +495,7 @@
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,合同信息不存在,请返回列表刷新重试!");
        }
        SystemUser user = systemUserMapper.selectById(param.getUserId());
        SystemUser user = systemUserMapper.selectById(param.getBtUserId());
        if(user ==null ||  (user.getDeleted()!=null&& user.getDeleted() )){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,经办人信息不存在!");
        }
@@ -538,7 +567,7 @@
            //如果有租赁条款
            if(Constants.formatBigdecimal(model.getZlDeposit()).compareTo(new BigDecimal(0))>0){
                    //如果有租赁押金
                billList1.add(initDepoistBill(Constants.THREE,model,details));
                billList1.add(initDepoistBill(Constants.TWO,model,details));
            }
            if(Constants.equalsInteger(model.getZlPayType(), Constants.ZERO)){
                //如果是一次性付清
@@ -559,7 +588,7 @@
            //如果物业条款
            if(Constants.formatBigdecimal(model.getWyDeposit()).compareTo(new BigDecimal(0))>0){
                //如果有租赁押金
                billList2.add(initDepoistBill(Constants.FOUR,model,details));
                billList2.add(initDepoistBill(Constants.THREE,model,details));
            }
            if(Constants.equalsInteger(model.getWyPayType(), Constants.ZERO)){
                //如果是一次性付清
@@ -578,7 +607,7 @@
        if(model.getBillType() == 0){
            model.setBillList(billList1);
        }else  if(model.getBillType() == 0){
        }else  if(model.getBillType() == 1){
            model.setBillList(billList2);
        }
        int num =1;
@@ -1114,6 +1143,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 )
                .leftJoin(Company.class,Company::getId,YwContract::getCompanyId)
                .leftJoin(SystemUser.class,SystemUser::getId,YwContract::getUserId)
                .leftJoin(SystemUser.class,SystemUser::getId,YwContract::getCreator)
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwDeviceServiceImpl.java
@@ -7,6 +7,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwDeviceMapper;
import com.doumee.dao.business.model.Category;
@@ -86,7 +87,7 @@
    @Override
    public void deleteById(Integer id, LoginUserInfo user) {
        ywDeviceMapper.update(new UpdateWrapper<YwDevice>().lambda().set(YwDevice::getIsdeleted,Constants.ONE)
                .set(YwDevice::getEditDate," now() ")
                .set(YwDevice::getEditDate, DateUtil.getCurrDateTime())
                .set(YwDevice::getEditor,user.getId())
                .eq(YwDevice::getId,user.getId())
        );
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolLineServiceImpl.java
@@ -65,6 +65,7 @@
            ){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"巡检点配置错误");
            }
            ywLinePoint.setId(null);
            ywLinePoint.setCreateDate(new Date());
            ywLinePoint.setCreator(loginUserInfo.getId());
            ywLinePoint.setIsdeleted(Constants.ZERO);
@@ -117,6 +118,7 @@
            ){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"巡检点配置错误");
            }
            ywLinePoint.setId(null);
            ywLinePoint.setLineId(ywPatrolLine.getId());
            ywLinePoint.setCreateDate(new Date());
            ywLinePoint.setCreator(loginUserInfo.getId());
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwPatrolPointServiceImpl.java
@@ -7,6 +7,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwPatrolPointMapper;
import com.doumee.dao.business.model.Category;
@@ -82,7 +83,7 @@
    @Override
    public void deleteById(Integer id, LoginUserInfo user) {
        ywPatrolPointMapper.update(new UpdateWrapper<YwPatrolPoint>().lambda().set(YwPatrolPoint::getIsdeleted,Constants.ONE)
                .set(YwPatrolPoint::getEditDate," now() ")
                .set(YwPatrolPoint::getEditDate, DateUtil.getCurrDateTime())
                .set(YwPatrolPoint::getEditor,user.getId())
                .eq(YwPatrolPoint::getId,user.getId())
        );