| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.DataDTO; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.dao.business.model.YwRoom; |
| | | import com.doumee.dao.business.vo.ProjectDataVO; |
| | |
| | | @ApiOperation("é¡¹ç®æ ") |
| | | @PostMapping("/tree") |
| | | @CloudRequiredPermission("business:ywproject:query") |
| | | public ApiResponse<List<ProjectDataVO>> tree (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywProjectService.projectTree()); |
| | | public ApiResponse<List<ProjectDataVO>> tree (@RequestBody DataDTO dataDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywProjectService.projectTree(dataDTO)); |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/5/20 14:54 |
| | | */ |
| | | @Data |
| | | @ApiModel("æ¥ææ¥è¯¢ç±»") |
| | | public class DataDTO { |
| | | |
| | | @ApiModelProperty(value = "项ç®ä¸»é®") |
| | | private Integer projectId; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ: yyyy-MM-dd") |
| | | private String startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ: yyyy-MM-dd") |
| | | private String endDate; |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.DataDTO; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.dao.business.vo.ProjectDataVO; |
| | | |
| | |
| | | long count(YwProject ywProject); |
| | | |
| | | |
| | | List<ProjectDataVO> projectTree(); |
| | | List<ProjectDataVO> projectTree(DataDTO dataDTO); |
| | | } |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(StringUtils.isNotBlank(member.getEmail())&&!Constants.validEmail(member.getEmail())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"è¯·å¡«åæ£ç¡®çemail"); |
| | | } |
| | | LoginUserInfo loginUserInfo = member.getLoginUserInfo(); |
| | | member.setCreator(loginUserInfo.getId()); |
| | | member.setCreateDate(new Date()); |
| | |
| | | @Override |
| | | public List<Member> ywList(Member member) { |
| | | List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>() |
| | | .lambda().eq(Member::getIsdeleted,Constants.ZERO) |
| | | .lambda() |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(member.getCustomerId()),Member::getCustomerId,member.getCustomerId()) |
| | | .eq(Member::getType,Constants.memberType.customer) |
| | | ); |
| | | return memberList; |
| | |
| | | ywContractBill.setEndDate(ywContractBill.getPlanPayDate()); |
| | | } |
| | | //æ¥è¯¢ååä¸çæå¤§çåºå· |
| | | List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContract.getId()).orderByDesc(YwContractBill::getId)); |
| | | List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>() |
| | | .lambda().eq(YwContractBill::getContractId,ywContract.getId()) |
| | | .in(YwContractBill::getCostType,Constants.ZERO,Constants.SIX,Constants.FOUR,Constants.FIVE,7) |
| | | .orderByDesc(YwContractBill::getId)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){ |
| | | ywContractBill.setSortnum(ywContractBillList.size() + 1 ); |
| | | }else{ |
| | | ywContractBill.setSortnum(Constants.ZERO); |
| | | ywContractBill.setSortnum(0); |
| | | } |
| | | ywContractBillMapper.insert(ywContractBill); |
| | | |
| | |
| | | } |
| | | |
| | | private void dealRoomsForContract(YwContract model) { |
| | | this.dealRoomsValid(model); |
| | | List<YwContractRoom> list = new ArrayList<>(); |
| | | for(YwRoom room :model.getRoomList()){ |
| | | YwContractRoom t = new YwContractRoom(); |
| | |
| | | } |
| | | ywContractRoomMapper.insert(list); |
| | | } |
| | | |
| | | private void dealRoomsValid(YwContract model){ |
| | | List<Integer> roomIds = model.getRoomList().stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(roomIds)){ |
| | | if(ywContractMapper.selectJoinCount(new MPJLambdaWrapper<YwContract>() |
| | | .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId) |
| | | .eq(YwContractRoom::getType,Constants.ZERO) |
| | | .in(YwContractRoom::getRoomId,roomIds) |
| | | .in(YwContract::getStatus,Constants.ZERO,Constants.ONE,Constants.TWO) |
| | | .apply(" (" + |
| | | " ( t.START_DATE < '"+DateUtil.getFomartDate(model.getEndDate(),"yyyy-MM-dd HH:mm:ss")+"' and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " + |
| | | "or " + |
| | | " ( t.START_DATE < '"+DateUtil.getFomartDate(model.getEndDate(),"yyyy-MM-dd HH:mm:ss")+"' and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " + |
| | | " ) ") |
| | | |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¿æºå·²è¢«å ç¨è¯·å·æ°éè¯"); |
| | | }; |
| | | |
| | | if(ywContractMapper.selectJoinCount(new MPJLambdaWrapper<YwContract>() |
| | | .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId) |
| | | .eq(YwContractRoom::getType,Constants.ZERO) |
| | | .in(YwContractRoom::getRoomId,roomIds) |
| | | .in(YwContract::getStatus,Constants.THREE) |
| | | .apply(" ( t.START_DATE < '"+DateUtil.getFomartDate(model.getBtDate(),"yyyy-MM-dd HH:mm:ss")+"' " + |
| | | " and t.END_DATE > '"+DateUtil.getFomartDate(model.getStartDate(),"yyyy-MM-dd HH:mm:ss")+"' ) " ) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¿æºå·²è¢«å ç¨è¯·å·æ°éè¯"); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<YwContractBill> getBillList(YwContract model){ |
| | |
| | | update.setBtFee(param.getBtFee()); |
| | | update.setBtRemark(getbackRentRemarkByParam(param)); |
| | | ywContractMapper.updateById(update); |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | // } |
| | | dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK, param.getLoginUserInfo().getRealname(),getbackRentLogByParam(param)); |
| | | return param.getId(); |
| | | } |
| | |
| | | totalBackFee = totalBackFee.add(fee);//ç´¯è®¡éæ¬¾éé¢ |
| | | } |
| | | } |
| | | List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>() |
| | | .lambda().eq(YwContractBill::getContractId,param.getId()).orderByDesc(YwContractBill::getId)); |
| | | Integer sortNum = ywContractBillList.size(); |
| | | if(param.getAddBillList()!=null && param.getAddBillList().size()>0){ |
| | | for(YwContractBill addBill : param.getAddBillList()){ |
| | | sortNum = sortNum + 1 ; |
| | | addBill.setIsdeleted(Constants.ZERO); |
| | | addBill.setContractId(param.getId()); |
| | | addBill.setType(Constants.ONE); |
| | | addBill.setStatus(Constants.ZERO); |
| | | addBill.setTotleFee(addBill.getReceivableFee()); |
| | | if(Constants.equalsInteger(addBill.getFeeType(),Constants.ONE)){ |
| | | addBill.setStartDate(addBill.getPlanPayDate()); |
| | | addBill.setEndDate(addBill.getPlanPayDate()); |
| | |
| | | addBill.setBtUserId(param.getBtUserId()); |
| | | addBill.setBtSignDate(param.getBtSignDate()); |
| | | addBill.setBtType(param.getBtType()); |
| | | addBill.setSortnum(sortNum ); |
| | | newBills.add(addBill); |
| | | } |
| | | ywContractBillMapper.insert(param.getAddBillList());//æ¹éæå
¥æ°æ® |
| | |
| | | } |
| | | int num =1; |
| | | for(int i=0;i<billList1.size();i++){ |
| | | billList1.get(i).setSortnum(num); |
| | | num++; |
| | | if(Constants.equalsInteger( billList1.get(i).getCostType(),Constants.ZERO)){ |
| | | billList1.get(i).setSortnum(num++); |
| | | } |
| | | } |
| | | num =1; |
| | | for(int i=0;i<billList2.size();i++){ |
| | | billList2.get(i).setSortnum(num); |
| | | num++; |
| | | if(Constants.equalsInteger( billList2.get(i).getCostType(),Constants.ONE)){ |
| | | billList2.get(i).setSortnum(num++); |
| | | } |
| | | } |
| | | if(model.getId()!=null){ |
| | | ywContractBillMapper.insert(billList1); |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = ywCustomer.getLoginUserInfo(); |
| | | if(StringUtils.isNotBlank(ywCustomer.getEmail())&&!Constants.validEmail(ywCustomer.getEmail())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"è¯·å¡«åæ£ç¡®çemail"); |
| | | } |
| | | ywCustomer.setStatus(Constants.ZERO); |
| | | ywCustomer.setIsdeleted(Constants.ZERO); |
| | | ywCustomer.setCreator(loginUserInfo.getId()); |
| | |
| | | .leftJoin(YwPatrolScheme.class,YwPatrolScheme::getId,YwPatrolTask::getSchemeId) |
| | | .eq(YwPatrolTask::getIsdeleted, Constants.ZERO) |
| | | .eq(Objects.nonNull(model.getStatus()) && !Constants.equalsInteger(model.getStatus(),Constants.TWO),YwPatrolTask::getStatus, model.getStatus()) |
| | | .eq(Objects.nonNull(model.getDealUserId()),YwPatrolTask::getDealUserId, model.getDealUserId()) |
| | | .apply(Objects.nonNull(model.getStatus()) && Constants.equalsInteger(model.getStatus(),Constants.TWO)," t.status = 1 and t.END_DATE > now() ") |
| | | .apply(StringUtils.isNotBlank(model.getQueryStatus())," find_in_set(t.status ,'"+model.getQueryStatus()+"') ") |
| | | .like(StringUtils.isNotBlank(model.getPlanTitle()),YwPatrolScheme::getTitle,model.getPlanTitle()) |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwBuildingMapper; |
| | | import com.doumee.dao.business.YwFloorMapper; |
| | | import com.doumee.dao.business.YwProjectMapper; |
| | | import com.doumee.dao.business.YwRoomMapper; |
| | | import com.doumee.dao.business.dto.DataDTO; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CompanyTree; |
| | | import com.doumee.dao.business.vo.ProjectDataVO; |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<ProjectDataVO> projectTree(){ |
| | | public List<ProjectDataVO> projectTree(DataDTO dataDTO){ |
| | | List<ProjectDataVO> projectDataVOList = new ArrayList<>(); |
| | | List<YwProject> ywProjectList = ywProjectMapper.selectList(new QueryWrapper<YwProject>().lambda() |
| | | .eq(YwProject::getIsdeleted,Constants.ZERO) |
| | | .eq(YwProject::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(dataDTO.getProjectId()),YwProject::getId,dataDTO.getProjectId()) |
| | | .orderByAsc(YwProject::getSortnum) |
| | | ); |
| | | for (YwProject ywProject:ywProjectList) { |
| | |
| | | List<YwBuilding> ywBuildingList = ywBuildingMapper.selectList(new QueryWrapper<YwBuilding>().lambda() |
| | | .eq(YwBuilding::getIsdeleted,Constants.ZERO) |
| | | .eq(YwBuilding::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(dataDTO.getProjectId()),YwBuilding::getProjectId,dataDTO.getProjectId()) |
| | | .orderByAsc(YwBuilding::getSortnum) |
| | | ); |
| | | |
| | |
| | | List<YwFloor> ywFloorList = ywFloorMapper.selectList(new QueryWrapper<YwFloor>().lambda() |
| | | .eq(YwFloor::getIsdeleted,Constants.ZERO) |
| | | .eq(YwFloor::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(dataDTO.getProjectId()),YwFloor::getProjectId,dataDTO.getProjectId()) |
| | | .orderByAsc(YwFloor::getSortnum) |
| | | ); |
| | | |
| | |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | |
| | | |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda() |
| | | .eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwRoom::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(dataDTO.getProjectId()),YwRoom::getProjectId,dataDTO.getProjectId()) |
| | | .apply(Objects.nonNull(dataDTO)&&Objects.nonNull(dataDTO.getStartDate())&&Objects.nonNull(dataDTO.getEndDate())," id not in (" + |
| | | " SELECT y2.room_id FROM yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` in( 0,1,2) " + |
| | | " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.END_DATE > '"+ dataDTO.getStartDate() +" 00:00:00' " + |
| | | " ) ") |
| | | .apply(Objects.nonNull(dataDTO)&&Objects.nonNull(dataDTO.getStartDate())&&Objects.nonNull(dataDTO.getEndDate())," id not in (" + |
| | | " SELECT y2.room_id FROM yw_contract y1 left join yw_contract_room y2 on y1.id = y2.contract_id where 1 = 1 and y1.`STATUS` = 3 " + |
| | | " and y1.START_DATE < '"+dataDTO.getEndDate()+" 00:00:00' and y1.BT_DATE > '"+ dataDTO.getStartDate() +" 00:00:00' " + |
| | | " ) ") |
| | | .orderByAsc(YwRoom::getSortnum) |
| | | ); |
| | | |
| | | |
| | | for (YwRoom data:ywRoomList) { |
| | | ProjectDataVO projectDataVO = new ProjectDataVO(); |
| | | BeanUtils.copyProperties(data,projectDataVO); |
| | | projectDataVO.setName(data.getCode()); |
| | | projectDataVO.setName(data.getCode() + " " + data.getArea() +"ã¡"); |
| | | projectDataVO.setPId(data.getFloor()); |
| | | projectDataVO.setLv(Constants.THREE); |
| | | projectDataVOList.add(projectDataVO); |
| | |
| | | .selectAs(YwProject::getName,YwRoom::getProjectName) |
| | | .selectAs(YwFloor::getName,YwRoom::getFloorName) |
| | | .selectAs(YwBuilding::getName,YwRoom::getBuildingName) |
| | | .select(" select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END " + |
| | | .select(" ifnull( ( select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END " + |
| | | "from yw_contract y1 left join yw_contract_room y2 on y1.id = y2.CONTRACT_ID and y2.TYPE = 0 " + |
| | | "where y1.`STATUS` <> 4 and y2.room_id = t.id order by y1.create_date desc limit 1 ",YwRoom::getLeaseStatus) |
| | | "where y1.`STATUS` <> 4 and y2.room_id = t.id order by y1.create_date desc limit 1 ) ,0) ",YwRoom::getLeaseStatus) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor); |