Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei
| | |
| | | * æä½ç±»å 0å·¥åå建 1ææ´¾ 2å¤ç 3ååå建 4åååæ´ 5ååéç§ |
| | | */ |
| | | public enum YwLogType{ |
| | | WORKORDER_CREATE(0, "å·¥åå建", "å·¥åå建"), |
| | | WORKORDER_DISPATCH(1, "工忿´¾", "工忿´¾"), |
| | | WORKORDER_DEAL(2, "å·¥åå¤ç ", "å·¥åå¤ç "), |
| | | WORKORDER_CREATE(0, "å建工å", "å建工å"), |
| | | WORKORDER_DISPATCH(1, "åæ´¾å·¥å", "åæ´¾å·¥å"), |
| | | WORKORDER_DEAL(2, "å¤çå·¥å", "å¤çå·¥å"), |
| | | CONTRACT_CREATE(3, "ååæ°å»º ", "æ°å»º "), |
| | | CONTRACT_UPDATE(4, "åååæ´ ", "åæ´ "), |
| | | CONTRACT_BACK(5, "ååéç§ ", "éç§ "), |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | //é®ç®±æ ¼å¼çéªè¯ |
| | | public static boolean validEmail(String email) { |
| | | Pattern p = Pattern.compile("[a-zA-Z0-9]+@[A-Za-z0-9]+\\.[a-z0-9]"); |
| | | Matcher m = p.matcher(email); |
| | | if(m.find()){ |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°ç¶æ") |
| | | @PostMapping("/updateStatusById") |
| | | @CloudRequiredPermission("business:ywpatrolline:update") |
| | | public ApiResponse updateStatusById(@RequestBody YwPatrolLine ywPatrolLine,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywPatrolLine.setLoginUserInfo(this.getLoginUser(token)); |
| | | ywPatrolLineService.updateStatusById(ywPatrolLine); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:ywpatrolline:query") |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | ExcelExporter.build(YwPatrolTask.class).export(ywPatrolTaskService.findPage(pageWrap).getRecords(), "è¿ç»´å·¡æ£ä»»å¡ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | | import com.doumee.core.utils.aliyun.ALiYunUtil; |
| | | import com.doumee.dao.business.YwDeviceMapper; |
| | | import com.doumee.dao.business.vo.YwDeviceDataVO; |
| | | import com.doumee.service.business.YwDeviceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private YwDeviceService ywDeviceService; |
| | | |
| | | @ApiOperation("è·åè¿ç»´è®¾å¤æ
åµ") |
| | | @GetMapping("/getDeviceData") |
| | | public ApiResponse<YwDeviceDataVO> getDeviceData() { |
| | | return ApiResponse.success(ywDeviceService.getYwDeviceData()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ ", notes = "ä¸ä¼ ", httpMethod = "POST", position = 6) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "folder", value = "æä»¶å¤¹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | |
| | | @ExcelColumn(name="æå±é¡¹ç®ç¼ç ï¼å
³èyw_project)") |
| | | private Integer projectId; |
| | | |
| | | @ApiModelProperty(value = "å¯æåæ¿æºæ°") |
| | | @TableField(exist = false) |
| | | private Integer roomRentNum; |
| | | @ApiModelProperty(value = "æ¿æºæ°") |
| | | @TableField(exist = false) |
| | | private Integer roomNum; |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @TableField(exist = false) |
| | | private String projectName; |
| | | @ApiModelProperty(value = "å¯æåæ¿æºæ°") |
| | | @TableField(exist = false) |
| | | private Integer roomeRentNum; |
| | | } |
| | |
| | | private String accountTitle; |
| | | |
| | | |
| | | @ApiModelProperty(value = "è´¦åç±»å", example = "1" , hidden = true) |
| | | @TableField(exist = false) |
| | | private Integer billType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å建人åç§°") |
| | | @ExcelColumn(name="å建人",index = 9,width = 10) |
| | | @TableField(exist = false) |
| | |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "è¿ç»´æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dealDate; |
| | | |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | |
| | | @ApiModelProperty(value = "å¤ç夿³¨") |
| | | private String dealInfo; |
| | | |
| | | @ApiModelProperty(value = "循ç¯å¨æ 0æ¯å¤© 1æ¯å¨ 2æ¯å¤©", example = "1") |
| | | @ApiModelProperty(value = "循ç¯å¨æ 0æ¯å¤© 1æ¯å¨ 2æ¯æ", example = "1") |
| | | private Integer circleType; |
| | | |
| | | @ApiModelProperty(value = "循ç¯éå¤è§å 1-31ï¼å¤ä¸ªè±æéå·éå¼") |
| | |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡ç¶æï¼å¤ä¸ªä»¥,åå² 0å¾
å¼å§ 1è¿è¡ä¸ 2å·²è¶
æ 3已宿 4已忶") |
| | | @TableField(exist = false) |
| | | private String queryStatus; |
| | | |
| | | @ApiModelProperty(value = "计åç¼å·") |
| | | @ExcelColumn(name="计åç¼å·",index = 1,width = 6) |
| | | @TableField(exist = false) |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | private Integer roomNum; |
| | | @ApiModelProperty(value = "å¯æåæ¿æºæ°") |
| | | @TableField(exist = false) |
| | | private Integer roomeRentNum; |
| | | private Integer roomRentNum; |
| | | @ApiModelProperty(value = "管çé¢ç§¯") |
| | | @TableField(exist = false) |
| | | private BigDecimal area; |
| | | @ApiModelProperty(value = "åå¸åç§°") |
| | | @TableField(exist = false) |
| | | private String cityName; |
| | |
| | | @ExcelColumn(name="æå±æ¥¼å®ç¼ç ï¼å
³èyw_building)") |
| | | private Integer buildingId; |
| | | |
| | | @ApiModelProperty(value = "ç§èµç¶æï¼0=å¾
ç§èµï¼1=å·²ç§èµ ;2=æªå¼å¯ç§èµ", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer leaseStatus; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @TableField(exist = false) |
| | | private String projectName; |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "ä¸é¨æ¶é´") |
| | | @ExcelColumn(name="ä¸é¨æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date getDate; |
| | | |
| | | @ApiModelProperty(value = "æå±é¡¹ç®ç¼ç ï¼å
³èyw_project)", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "ææ¥æ¶é´") |
| | | @ExcelColumn(name="ææ¥æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date submitDate; |
| | | |
| | | @ApiModelProperty(value = "å·¥ååç±»ç¼ç (å
³ècategoryï¼", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "åæ´¾æ¶é´") |
| | | @ExcelColumn(name="åæ´¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dispatchDate; |
| | | |
| | | @ApiModelProperty(value = "åæ´¾å¤ç说æ") |
| | |
| | | |
| | | @ApiModelProperty(value = "å¤çæ¶é´") |
| | | @ExcelColumn(name="å¤çæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dealDate; |
| | | |
| | | @ApiModelProperty(value = "å¤ç夿³¨") |
| | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @TableField(exist = false) |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡ç¶æï¼å¤ä¸ªä»¥,åå² 0å¾
å¤ç 1已忴¾ 2å·²å¤ç") |
| | | @TableField(exist = false) |
| | | private String queryStatus; |
| | | |
| | | @ApiModelProperty(value = "楼å®åç§°") |
| | | @TableField(exist = false) |
| | |
| | | @ApiModelProperty(value = "ææ¥äººå§å") |
| | | @TableField(exist = false) |
| | | private String creatorName; |
| | | @ApiModelProperty(value = "ææ¥äººçµè¯") |
| | | @TableField(exist = false) |
| | | private String creatorMobile; |
| | | @ApiModelProperty(value = "å¤ç人å§å") |
| | | @TableField(exist = false) |
| | | private String dealUserName; |
| | | @ApiModelProperty(value = "å¤ç人ç»ç»") |
| | | @TableField(exist = false) |
| | | private String dealUserCompany; |
| | | @ApiModelProperty(value = "ç±»å«åç§°") |
| | | @TableField(exist = false) |
| | | private String categoryName; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/12/2 10:02 |
| | | */ |
| | | @Data |
| | | public class YwDeviceDataVO { |
| | | |
| | | @ApiModelProperty(value = "è®¾å¤æ»æ°", example = "1") |
| | | private Integer totalNum = 0 ; |
| | | |
| | | @ApiModelProperty(value = "å¨ä¿è®¾å¤æ°", example = "1") |
| | | private Integer qualityNum = 0 ; |
| | | |
| | | @ApiModelProperty(value = "æ£å¸¸è®¾å¤æ°", example = "1") |
| | | private Integer normalNum = 0 ; |
| | | |
| | | @ApiModelProperty(value = "æåè®¾å¤æ°", example = "1") |
| | | private Integer abnormalNum = 0 ; |
| | | |
| | | @ApiModelProperty(value = "æ¥åºè®¾å¤æ»æ°", example = "1") |
| | | private Integer scrapNum = 0 ; |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.YwDevice; |
| | | import com.doumee.dao.business.vo.YwDeviceDataVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | long count(YwDevice ywDevice); |
| | | |
| | | YwDevice getDetail(Integer id); |
| | | |
| | | |
| | | YwDeviceDataVO getYwDeviceData(); |
| | | |
| | | } |
| | |
| | | void updateById(YwPatrolLine ywPatrolLine); |
| | | |
| | | /** |
| | | * æ´æ°ç¶æ |
| | | * @param ywPatrolLine |
| | | */ |
| | | void updateStatusById(YwPatrolLine ywPatrolLine); |
| | | |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param ywPatrolLines å®ä½é |
| | |
| | | private void checkUnique(Category category){ |
| | | QueryWrapper<Category> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(Objects.nonNull(category.getId()),Category::getId,category.getId()) |
| | | .eq(Category::getIsdeleted,Constants.ZERO) |
| | | .eq(Category::getType,category.getType()) |
| | | .eq(Category::getName,category.getName()); |
| | |
| | | ){ |
| | | 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()); |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | 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.model.YwBuilding; |
| | | import com.doumee.dao.business.model.YwFloor; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.service.business.YwBuildingService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | @Autowired |
| | | private YwProjectMapper ywProjectMapper; |
| | | @Autowired |
| | | private YwFloorMapper ywFloorMapper; |
| | | |
| | | @Override |
| | | public Integer create(YwBuilding model) { |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | //æ¥è¯¢æ¥¼å®ä¸çæ°æ® |
| | | if(ywFloorMapper.selectCount(new QueryWrapper<YwFloor>().lambda().eq(YwFloor::getIsdeleted,Constants.ZERO) |
| | | .eq(YwFloor::getBuildingId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"楼å®ä¸å卿¥¼å±æ°æ®!"); |
| | | }; |
| | | |
| | | YwBuilding model = new YwBuilding(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | |
| | | |
| | | @Override |
| | | public YwBuilding findById(Integer id) { |
| | | return ywBuildingMapper.selectById(id); |
| | | |
| | | |
| | | MPJLambdaWrapper<YwBuilding> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(YwBuilding.class ) |
| | | .selectAs(YwProject::getName,YwBuilding::getProjectName) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwBuilding::getProjectId) |
| | | .eq(YwBuilding::getId,id) |
| | | .last(" limit 1 ") |
| | | ; |
| | | |
| | | return ywBuildingMapper.selectJoinOne(YwBuilding.class, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | IPage<YwContractRevenue> iPage = ywContractRevenueMapper.selectJoinPage(page,YwContractRevenue.class, |
| | | queryWrapper.selectAll(YwContractRevenue.class) |
| | | .selectAs(YwContractBill::getCode,YwContractRevenue::getBillCode) |
| | | .selectAs(YwContractBill::getType,YwContractRevenue::getBillType) |
| | | .selectAs(YwContract::getCode,YwContractRevenue::getContractCode) |
| | | .selectAs(YwCustomer::getName,YwContractRevenue::getCustomerName) |
| | | .selectAs(SystemUser::getRealname,YwContractRevenue::getRealname) |
| | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){ |
| | | StringBuilder roomPathName = new StringBuilder(); |
| | | for (YwContractRoom ywContractRoom:ywContractRoomList) { |
| | | if(Constants.equalsInteger(ywContractRevenue.getBillType(),Constants.ZERO)){ |
| | | if(!(Constants.equalsInteger(ywContractRevenue.getContractId(),ywContractRoom.getContractId()) |
| | | && Constants.equalsInteger(ywContractRoom.getType(),Constants.ZERO))){ |
| | | continue; |
| | | } |
| | | }else{ |
| | | if(!(Constants.equalsInteger(ywContractRevenue.getBillId(),ywContractRoom.getContractId()) |
| | | && Constants.equalsInteger(ywContractRoom.getType(),Constants.ONE))){ |
| | | continue; |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){ |
| | | roomPathName.append(ywContractRoom.getProjectName()+"/"); |
| | | } |
| | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRevenueList)){ |
| | | //è·åæææ°æ® |
| | | List<Integer> billIdList = ywContractRevenueList.stream().map(i->i.getBillId()).collect(Collectors.toList()); |
| | | List<Integer> contractIdList = ywContractRevenueList.stream().map(i->i.getContractId()).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(billIdList)){ |
| | | List<YwContractRoom> ywContractRoomList = ywContractRoomMapper.selectJoinList(YwContractRoom.class,new MPJLambdaWrapper<YwContractRoom>() |
| | | .selectAll(YwContractRoom.class) |
| | | .selectAs(YwProject::getName,YwRoom::getProjectName) |
| | | .selectAs(YwFloor::getName,YwRoom::getFloorName) |
| | | .selectAs(YwBuilding::getName,YwRoom::getBuildingName) |
| | | .selectAs(YwRoom::getName,YwContractRoom::getRoomName) |
| | | .selectAs(YwRoom::getCode,YwContractRoom::getRoomName) |
| | | .leftJoin(YwRoom.class,YwRoom::getId,YwContractRoom::getRoomId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId) |
| | | .in(YwContractRoom::getContractId,billIdList) |
| | | .eq(YwContractRoom::getType,Constants.ONE) |
| | | .and(i->i.in(YwContractRoom::getContractId,billIdList).eq(YwContractRoom::getType,Constants.ONE) |
| | | .or().in(YwContractRoom::getContractId,contractIdList).eq(YwContractRoom::getType,Constants.ZERO) |
| | | ) |
| | | // .in(YwContractRoom::getContractId,billIdList) |
| | | // .eq(YwContractRoom::getType,Constants.ONE) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){ |
| | | for (YwContractRevenue ywContractRevenue:ywContractRevenueList) { |
| | | ywContractRevenue.setYwContractRoomList( |
| | | ywContractRoomList.stream().filter(i->Constants.equalsInteger(i.getContractId(),ywContractRevenue.getBillId())).collect(Collectors.toList()) |
| | | ywContractRoomList.stream().filter(i-> |
| | | Constants.equalsInteger(i.getContractId(),ywContractRevenue.getBillId())||Constants.equalsInteger(i.getContractId(),ywContractRevenue.getContractId())) |
| | | .collect(Collectors.toList()) |
| | | ); |
| | | } |
| | | } |
| | |
| | | dealMultifileBiz(model);//å¤çéä»¶ä¿¡æ¯ |
| | | dealRoomsForContract(model);//å¤çæ¿æºå
³è表 |
| | | dealLogBiz(model,Constants.YwLogType.CONTRACT_CREATE,model.getLoginUserInfo().getRealname(),"ã"+model.getRemark().replace("ååæè¦ï¼","")+"ã");//è®°å½æ°å»ºæ¥å¿ |
| | | |
| | | return model.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | for(YwContractDetail d :model.getWyDetailList()){ |
| | | if( d.getStartDate() == null |
| | | ||d.getEditDate() == null |
| | | ||d.getEndDate() == null |
| | | ||d.getPrice() == null |
| | | ||d.getCircleType() == null |
| | | || d.getCircleType()>6 |
| | |
| | | |
| | | String str = ""; |
| | | //èµ·ç§æ¥2024/06/01ï¼ç§èµæ°ä¸º500ã¡ã馿ç§èµä¸æä¸ä»ï¼ç§éåä»·35å
/ã¡Â·æã馿ç©ä¸ä¸æä¸ä»ï¼ç©ä¸åä»·4.3å
/ã¡Â·æ |
| | | String str0 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼ç§èµæ°ä¸º{param2}ã¡ã馿ç§èµ{param3}ï¼ç§éåä»·{param4}å
{param5}ã馿ç©ä¸{param6}ï¼ç©ä¸åä»·{param7}{param8}"; |
| | | String str1 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼ç§èµæ°ä¸º{param2}ã¡ã馿ç§èµ{param3}ï¼ç§éåä»·{param4}å
{param5}ã"; |
| | | String str2 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼é¦æç©ä¸{param6}ï¼ç©ä¸åä»·{param7}å
{param8}"; |
| | | String str0 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼ç§èµæ°ä¸º{param2}ã¡ã馿ç§èµ{param3}ï¼ç§éåä»·{param4}{param5}ã馿ç©ä¸{param6}ï¼ç©ä¸åä»·{param7}{param8}"; |
| | | String str1 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼ç§èµæ°ä¸º{param2}ã¡ã馿ç§èµ{param3}ï¼ç§éåä»·{param4}{param5}ã"; |
| | | String str2 = "ååæè¦ï¼èµ·ç§æ¥{param1}ï¼é¦æç©ä¸{param6}ï¼ç©ä¸åä»·{param7}{param8}"; |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO)){ |
| | | str= str0; |
| | | } |
| | |
| | | .replace("{param2}",model.getTotalArea().intValue()+"") |
| | | .replace("{param3}",Constants.getPayTypeByNum(model.getZlPayType())) |
| | | .replace("{param4}",Constants.formatBigdecimal(model.getZlFirstPrice()).intValue()+"") |
| | | .replace("{param5}",Constants.getUnitTypeByNum(model.getZlFirstCircle()) |
| | | .replace("{param5}",Constants.getUnitTypeByNum(model.getZlFirstCircle())) |
| | | .replace("{param6}",Constants.getPayTypeByNum(model.getWyPayType())) |
| | | .replace("{param7}",Constants.formatBigdecimal(model.getWyFirstPrice()).intValue()+"") |
| | | .replace("{param8}",Constants.getUnitTypeByNum(model.getWyFirstCircle()))); |
| | | .replace("{param8}",Constants.getUnitTypeByNum(model.getWyFirstCircle())); |
| | | return str; |
| | | } |
| | | private String getbackRentRemarkByParam(YwContract model) { |
| | |
| | | } |
| | | int num =1; |
| | | for(int i=0;i<billList1.size();i++){ |
| | | if(Constants.equalsInteger( billList1.get(i).getCostType(),Constants.ZERO)){ |
| | | billList1.get(i).setSortnum(num++); |
| | | billList1.get(i).setSortnum(num); |
| | | num++; |
| | | } |
| | | } |
| | | num =1; |
| | | for(int i=0;i<billList2.size();i++){ |
| | | if(Constants.equalsInteger( billList2.get(i).getCostType(),Constants.ONE)){ |
| | | billList2.get(i).setSortnum(num++); |
| | | } |
| | | billList2.get(i).setSortnum(num); |
| | | 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()); |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | |
| | | //æ¥è¯¢å®¢æ·ä¿¡æ¯ä¸æ¯å¦åå¨äººåä¿¡æ¯ |
| | | if(memberMapper.selectCount(new QueryWrapper<Member>().lambda().eq(Member::getType,Constants.memberType.customer) |
| | | .eq(Member::getCustomerId,id) |
| | | .eq(Member::getIsdeleted,Constants.ZERO))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨äººåä¿¡æ¯æªå é¤ï¼è¯·å
å é¤å®¢æ·ä¸äººåä¿¡æ¯!"); |
| | | } |
| | | |
| | | ywCustomerMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | if(memberMapper.selectCount(new QueryWrapper<Member>().lambda().eq(Member::getType,Constants.memberType.customer) |
| | | .in(Member::getCustomerId,ids) |
| | | .eq(Member::getIsdeleted,Constants.ZERO))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨äººåä¿¡æ¯æªå é¤ï¼è¯·å
å é¤å®¢æ·ä¸äººåä¿¡æ¯!"); |
| | | } |
| | | ywCustomerMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | |
| | | .selectAs(SystemUser::getMobile,YwDeviceRecord::getMobile) |
| | | .selectAs(Company::getName,YwDeviceRecord::getCompanyName) |
| | | .selectAs(YwDevice::getName,YwDeviceRecord::getDeviceName) |
| | | .selectAs(YwDevice::getCode,YwDeviceRecord::getDeviceCode) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwDeviceRecord::getUserId) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .leftJoin(YwDevice.class,YwDevice::getId,YwDeviceRecord::getDeviceId) |
| | |
| | | .last(" limit 1 ") |
| | | ); |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_RECORD_FILE)); |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_RECORD_FILE.getKey())); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifiles)) { |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP, Constants.FTP_RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.FTP, Constants.YW_DEVICE).getCode(); |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwDeviceMapper; |
| | | import com.doumee.dao.business.YwDeviceRecordMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.YwDevice; |
| | | import com.doumee.dao.business.model.YwDeviceRecord; |
| | | import com.doumee.dao.business.vo.YwDeviceDataVO; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.YwDeviceRecordService; |
| | | import com.doumee.service.business.YwDeviceService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * è¿ç»´è®¾å¤ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | @Autowired |
| | | private YwDeviceRecordMapper ywDeviceRecordMapper; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String,Object> redisTemplate; |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | ywDeviceMapper.update(new UpdateWrapper<YwDevice>().lambda().set(YwDevice::getIsdeleted,Constants.ONE) |
| | | //æ¥è¯¢è®¾å¤æ¯å¦åå¨è¿ç»´è®°å½ |
| | | if(ywDeviceRecordMapper.selectCount(new QueryWrapper<YwDeviceRecord>().lambda().eq(YwDeviceRecord::getDeviceId,id).eq(YwDeviceRecord::getIsdeleted,Constants.ZERO))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½å设å¤åå¨è¿ç»´è®°å½ï¼æ æ³å é¤"); |
| | | }; |
| | | ywDeviceMapper.update(new UpdateWrapper<YwDevice>() |
| | | .lambda().set(YwDevice::getIsdeleted,Constants.ONE) |
| | | .set(YwDevice::getEditDate, DateUtil.getCurrDateTime()) |
| | | .set(YwDevice::getEditor,user.getId()) |
| | | .eq(YwDevice::getId,user.getId()) |
| | | .eq(YwDevice::getId,id) |
| | | ); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public YwDevice getDetail(Integer id) { |
| | | YwDevice ywDevice = ywDeviceMapper.selectById(id); |
| | | Multifile multifile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_FILE).last(" limit 1")); |
| | | Multifile multifile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_FILE.getKey()).last(" limit 1")); |
| | | if(Objects.nonNull(multifile)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_DEVICE).getCode(); |
| | |
| | | QueryWrapper<YwDevice> wrapper = new QueryWrapper<>(ywDevice); |
| | | return ywDeviceMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public YwDeviceDataVO getYwDeviceData(){ |
| | | YwDeviceDataVO ywDeviceDataVO = new YwDeviceDataVO(); |
| | | List<YwDevice> ywDeviceList = ywDeviceMapper.selectList(new QueryWrapper<YwDevice>().lambda().eq(YwDevice::getIsdeleted,Constants.ZERO)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywDeviceList)){ |
| | | ywDeviceDataVO.setQualityNum(ywDeviceList.size()); |
| | | ywDeviceDataVO.setTotalNum(ywDeviceList.size()); |
| | | ywDeviceDataVO.setNormalNum(ywDeviceList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size()); |
| | | ywDeviceDataVO.setAbnormalNum(ywDeviceList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size()); |
| | | ywDeviceDataVO.setScrapNum(ywDeviceList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.TWO)).collect(Collectors.toList()).size()); |
| | | } |
| | | return ywDeviceDataVO; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwBuildingMapper; |
| | | import com.doumee.dao.business.YwFloorMapper; |
| | | import com.doumee.dao.business.YwRoomMapper; |
| | | import com.doumee.dao.business.model.YwBuilding; |
| | | import com.doumee.dao.business.model.YwFloor; |
| | | import com.doumee.dao.business.model.YwRoom; |
| | |
| | | private YwFloorMapper ywFloorMapper; |
| | | @Autowired |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | @Autowired |
| | | private YwRoomMapper ywRoomMapper; |
| | | |
| | | @Override |
| | | public Integer create(YwFloor model) { |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | //æ¥è¯¢æ¥¼å±ä¸çæ°æ® |
| | | if(ywRoomMapper.selectCount(new QueryWrapper<YwRoom>().lambda().eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwRoom::getFloor,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"楼å±å卿¿é´æ°æ®!"); |
| | | }; |
| | | |
| | | |
| | | YwFloor model = new YwFloor(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwLinePointMapper; |
| | | import com.doumee.dao.business.YwPatrolSchemeMapper; |
| | | import com.doumee.dao.business.model.YwLinePoint; |
| | | import com.doumee.dao.business.model.YwPatrolScheme; |
| | | import com.doumee.service.business.YwLinePointService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | @Autowired |
| | | private YwLinePointMapper ywLinePointMapper; |
| | | |
| | | |
| | | @Override |
| | | public Integer create(YwLinePoint ywLinePoint) { |
| | | ywLinePointMapper.insert(ywLinePoint); |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | |
| | | ywLinePointMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwLinePointMapper; |
| | | import com.doumee.dao.business.YwPatrolLineMapper; |
| | | import com.doumee.dao.business.YwPatrolSchemeMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.YwPatrolLineService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * è¿ç»´å·¡æ£è·¯çº¿ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | @Autowired |
| | | private YwLinePointMapper ywLinePointMapper; |
| | | |
| | | @Autowired |
| | | private YwPatrolSchemeMapper ywPatrolSchemeMapper; |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer create(YwPatrolLine ywPatrolLine) { |
| | |
| | | ywPatrolLine.setStatus(Constants.ZERO); |
| | | ywPatrolLineMapper.insert(ywPatrolLine); |
| | | //循ç¯å¤ç åéæ°æ® |
| | | |
| | | List<YwLinePoint> ywLinePointList = ywPatrolLine.getLinePointList(); |
| | | //æ¯å¦åå¨ç¸åæ°æ® |
| | | Set<Integer> setIds = new HashSet<Integer>(ywLinePointList.stream().map(i->i.getPointId()).collect(Collectors.toList())); |
| | | if(setIds.size()!=ywLinePointList.size()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨ç¸åå·¡æ£ç¹!"); |
| | | } |
| | | for (YwLinePoint ywLinePoint:ywLinePointList) { |
| | | if(Objects.isNull(ywLinePoint) |
| | | || Objects.isNull(ywLinePoint.getPointId()) |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | //æ¥è¯¢æ¯å¦åå¨å·¡æ£è®¡å |
| | | if(ywPatrolSchemeMapper.selectCount(new QueryWrapper<YwPatrolScheme>().lambda().eq(YwPatrolScheme::getIsdeleted, Constants.ZERO) |
| | | .eq(YwPatrolScheme::getLineId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åå·¡æ£çº¿è·¯å·²è¢«ä½¿ç¨ï¼æ æ³å é¤"); |
| | | }; |
| | | ywPatrolLineMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | .eq(YwLinePoint::getLineId,ywPatrolLine.getId())); |
| | | //循ç¯å¤ç åéæ°æ® |
| | | List<YwLinePoint> ywLinePointList = ywPatrolLine.getLinePointList(); |
| | | //æ¯å¦åå¨ç¸åæ°æ® |
| | | Set<Integer> setIds = new HashSet<Integer>(ywLinePointList.stream().map(i->i.getLineId()).collect(Collectors.toList())); |
| | | if(setIds.size()!=ywLinePointList.size()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨ç¸åå·¡æ£ç¹!"); |
| | | } |
| | | for (YwLinePoint ywLinePoint:ywLinePointList) { |
| | | if(Objects.isNull(ywLinePoint) |
| | | || Objects.isNull(ywLinePoint.getPointId()) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatusById(YwPatrolLine ywPatrolLine) { |
| | | YwPatrolLine model = new YwPatrolLine(); |
| | | model.setId(ywPatrolLine.getId()); |
| | | model.setStatus(ywPatrolLine.getStatus()); |
| | | ywPatrolLineMapper.updateById(model); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<YwPatrolLine> ywPatrolLines) { |
| | | if (CollectionUtils.isEmpty(ywPatrolLines)) { |
| | | return; |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Multifile multifile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjId,id) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.FN_PATROL_POINT_FILE).last(" limit 1")); |
| | | .eq(Multifile::getObjType,Constants.MultiFile.FN_PATROL_POINT_FILE.getKey()).orderByDesc(Multifile::getId).last(" limit 1")); |
| | | if(Objects.nonNull(multifile) && StringUtils.isNotBlank(multifile.getFileurl())){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_PATROL).getCode(); |
| | | ywPatrolPoint.setFileFullUrl(path + multifile.getFileurl()); |
| | | ywPatrolPoint.setFileUrl(multifile.getFileurl()); |
| | | } |
| | | |
| | | return ywPatrolPoint; |
| | | } |
| | | |
| | |
| | | public void createThreeDaysData(YwPatrolScheme ywPatrolScheme){ |
| | | //循ç¯çæä¸å¤©å
çæ°æ® |
| | | for (int i = 0; i < 3; i++) { |
| | | Date schemeDate = DateUtil.getXDayAfterDate(new Date(),i); |
| | | Date schemeDate = DateUtil.getXDayAfterDate( |
| | | DateUtil.StringToDate( |
| | | DateUtil.getDate(new Date(),"yyyy-MM-dd"),"yyyy-MM-dd"),i); |
| | | this.createTask(schemeDate,ywPatrolScheme); |
| | | } |
| | | } |
| | |
| | | * @param ywPatrolScheme |
| | | */ |
| | | public void createTask(Date schemeDate,YwPatrolScheme ywPatrolScheme){ |
| | | if(ywPatrolScheme.getStartDate().getTime() > schemeDate.getTime() |
| | | || ywPatrolScheme.getEndDate().getTime() < schemeDate.getTime() ){ |
| | | if(!(ywPatrolScheme.getStartDate().getTime() <= schemeDate.getTime() |
| | | && ywPatrolScheme.getEndDate().getTime() >= schemeDate.getTime()) ){ |
| | | return; |
| | | } |
| | | if(Constants.equalsInteger(ywPatrolScheme.getCircleType(),Constants.ONE)){ |
| | |
| | | return; |
| | | } |
| | | List<String> weeks = Arrays.asList(ywPatrolScheme.getCircleDays().split(",")); |
| | | String weekStr = weeks.stream().filter(i->Constants.equalsInteger(Integer.valueOf(i),week.getNumber())).findFirst().get(); |
| | | if(StringUtils.isBlank(weekStr)){ |
| | | if(weeks.stream().filter(i->Constants.equalsInteger(Integer.valueOf(i),week.getNumber())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | return; |
| | | } |
| | | }else{ |
| | | |
| | | }else if(Constants.equalsInteger(ywPatrolScheme.getCircleType(),Constants.TWO)){ |
| | | //æ¯ææ ¹æ®æ¥æçæ æ ¹æ®æ¥æè·åæ¯åªå¤© |
| | | List<String> days = Arrays.asList(ywPatrolScheme.getCircleDays().split(",")); |
| | | String dayStr = DateUtil.getFomartDate(schemeDate,"dd"); |
| | | Optional<String> optional = days.stream().filter(i->StringUtils.equals(i,dayStr)).findAny(); |
| | | if(Objects.isNull(optional)){ |
| | | Integer dayStr = Integer.valueOf(DateUtil.getFomartDate(schemeDate,"dd")); |
| | | if(days.stream().filter(i->i.equals(dayStr.toString())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | return; |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwContractRevenueMapper; |
| | | import com.doumee.dao.business.YwPatrolTaskRecordMapper; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.model.Multifile; |
| | |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | |
| | | @Autowired |
| | | private YwDeviceMapper ywDeviceMapper; |
| | | |
| | | @Autowired |
| | | private YwPatrolPointMapper ywPatrolPointMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private YwPatrolTaskMapper ywPatrolTaskMapper; |
| | | |
| | | |
| | | |
| | |
| | | queryWrapper.selectAll(YwPatrolTaskRecord.class) |
| | | .selectAs(YwPatrolPoint::getName,YwPatrolTaskRecord::getPointName) |
| | | .selectAs(YwPatrolPoint::getContent,YwPatrolTaskRecord::getContent) |
| | | .selectAs(SystemUser::getRealname,YwPatrolTaskRecord::getRealname) |
| | | .leftJoin(YwPatrolPoint.class,YwPatrolPoint::getId,YwPatrolTaskRecord::getPointId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwPatrolTaskRecord::getDealUserId) |
| | | .eq(YwPatrolScheme::getIsdeleted, Constants.ZERO) |
| | | .eq(Objects.nonNull(model) && Objects.nonNull(model.getTaskId()),YwPatrolTaskRecord::getTaskId, model.getTaskId()) |
| | | .eq(Objects.nonNull(model) && Objects.nonNull(model.getDealUserId()),YwPatrolTaskRecord::getDealUserId, model.getDealUserId()) |
| | | .like(StringUtils.isNotBlank(model.getPointName()),YwPatrolPoint::getName,model.getPointName()) |
| | | .eq(Objects.nonNull(model) && Objects.nonNull(model.getStatus()) , YwPatrolTaskRecord::getStatus,model.getStatus()) |
| | | .orderByDesc(YwPatrolScheme::getCreateDate) |
| | |
| | | public void patrolData(YwPatrolTaskRecord ywPatrolTaskRecord) { |
| | | if(Objects.isNull(ywPatrolTaskRecord) |
| | | || Objects.isNull(ywPatrolTaskRecord.getId()) |
| | | || Objects.isNull(ywPatrolTaskRecord.getDealStatus())){ |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = ywPatrolTaskRecord.getLoginUserInfo(); |
| | |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ°æ®ç¶æå·²æµè½¬"); |
| | | } |
| | | |
| | | YwPatrolPoint ywPatrolPoint = ywPatrolPointMapper.selectById(model.getPointId()); |
| | | if(Objects.isNull(ywPatrolPoint)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | YwDevice ywDevice = ywDeviceMapper.selectById(ywPatrolPoint.getDeviceId()); |
| | | if(Objects.isNull(ywDevice)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | YwPatrolTask ywPatrolTask = ywPatrolTaskMapper.selectById(model.getTaskId()); |
| | | if(Objects.isNull(ywPatrolTask)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(ywPatrolTask.getStartDate().getTime()>System.currentTimeMillis()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªå°å·¡æ£æ¶é´æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | ywPatrolTaskRecordMapper.update(null,new UpdateWrapper<YwPatrolTaskRecord>().lambda() |
| | | .set(YwPatrolTaskRecord::getDealStatus,ywPatrolTaskRecord.getDealStatus()) |
| | | .set(YwPatrolTaskRecord::getDealStatus,ywDevice.getStatus()) |
| | | .set(YwPatrolTaskRecord::getEditor,loginUserInfo.getId()) |
| | | .set(YwPatrolTaskRecord::getEditDate, DateUtil.getCurrDateTime()) |
| | | .set(YwPatrolTaskRecord::getDealDate, DateUtil.getCurrDateTime()) |
| | |
| | | .set(YwPatrolTaskRecord::getDealInfo, ywPatrolTaskRecord.getDealInfo()) |
| | | .eq(YwPatrolTaskRecord::getId,ywPatrolTaskRecord.getId())); |
| | | |
| | | if(ywPatrolTaskRecordMapper.selectCount(new QueryWrapper<YwPatrolTaskRecord>().lambda() |
| | | .eq(YwPatrolTaskRecord::getTaskId,ywPatrolTask.getId()) |
| | | .ne(YwPatrolTaskRecord::getId,ywPatrolTaskRecord.getId()))==Constants.ZERO){ |
| | | ywPatrolTask.setStatus(Constants.THREE); |
| | | }else{ |
| | | ywPatrolTask.setStatus(Constants.ONE); |
| | | } |
| | | //æ¥è¯¢æ¯å¦åå¨å
¶ä»æª |
| | | ywPatrolTaskMapper.update(null,new UpdateWrapper<YwPatrolTask>().lambda().eq(YwPatrolTask::getId,ywPatrolTask.getId()) |
| | | .set(YwPatrolTask::getStatus,ywPatrolTask.getStatus()) |
| | | .set(YwPatrolTask::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(YwPatrolTask::getEditor,loginUserInfo.getId()) |
| | | ); |
| | | //éä»¶æ°æ® |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywPatrolTaskRecord.getMultifileList())){ |
| | | for (Multifile multifile:ywPatrolTaskRecord.getMultifileList()) { |
| | |
| | | .eq(YwPatrolTask::getId,id) |
| | | .last(" limit 1 ")) |
| | | ; |
| | | if(Constants.equalsInteger(ywPatrolTask.getStatus(),Constants.TWO) && |
| | | ywPatrolTask.getEndDate().getTime()<System.currentTimeMillis()){ |
| | | ywPatrolTask.setStatus(Constants.TWO); |
| | | } |
| | | return ywPatrolTask; |
| | | } |
| | | |
| | |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwPatrolTask::getDealUserId) |
| | | .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()) |
| | | .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()) |
| | | .ge(Objects.nonNull(model.getStartDate()), YwPatrolTask::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())) |
| | | .le(Objects.nonNull(model.getEndDate()),YwPatrolTask::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getEndDate())) |
| | | .orderByDesc(YwPatrolTask::getId) |
| | | ; |
| | | IPage<YwPatrolTask> iPage = ywPatrolTaskMapper.selectJoinPage(page,YwPatrolTask.class,queryWrapper); |
| | | for (YwPatrolTask ywPatrolTask:iPage.getRecords()) { |
| | | if(Constants.equalsInteger(ywPatrolTask.getStatus(),Constants.TWO) && |
| | | ywPatrolTask.getEndDate().getTime()<System.currentTimeMillis()){ |
| | | ywPatrolTask.setStatus(Constants.TWO); |
| | | } |
| | | } |
| | | return PageData.from(iPage); |
| | | } |
| | | |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * è¿ç»´é¡¹ç®ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | |
| | | @Override |
| | | public Integer create(YwProject model) { |
| | | if(Objects.isNull(model) |
| | | || StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ywProjectMapper.selectCount(new QueryWrapper<YwProject>().lambda() |
| | | .eq(YwProject::getName,model.getName()) |
| | | .eq(YwProject::getIsdeleted,Constants.ZERO))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ã"+model.getName()+"ãå·²åå¨!"); |
| | | } |
| | | model.setCreator(model.getLoginUserInfo().getId()); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setCreateDate(new Date()); |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | //æ¥è¯¢é¡¹ç®ä¸çæ°æ® |
| | | if(ywBuildingMapper.selectCount(new QueryWrapper<YwBuilding>().lambda().eq(YwBuilding::getIsdeleted,Constants.ZERO) |
| | | .eq(YwBuilding::getProjectId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"项ç®ä¸å卿¥¼å®æ°æ®!"); |
| | | }; |
| | | YwProject model = new YwProject(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | |
| | | |
| | | @Override |
| | | public void updateById(YwProject model) { |
| | | if(Objects.isNull(model) |
| | | || Objects.isNull(model.getId()) |
| | | || StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ywProjectMapper.selectCount(new QueryWrapper<YwProject>().lambda() |
| | | .eq(YwProject::getName,model.getName()) |
| | | .ne(YwProject::getId,model.getId()) |
| | | .eq(YwProject::getIsdeleted,Constants.ZERO))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ã"+model.getName()+"ãå·²åå¨!"); |
| | | } |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(model.getLoginUserInfo().getId()); |
| | | ywProjectMapper.updateById(model); |
| | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | queryWrapper.select("*,(select count(1) from yw_room a where a.isdeleted=0 and a.PROJECT_ID=yw_project.id) as roomNum"+ |
| | | ",(select count(1) from yw_room a where a.isdeleted=0 and a.PROJECT_ID=yw_project.id and a.IS_INVESTMENT=1) as roomRentNum"); |
| | | ",(select count(1) from yw_room a where a.isdeleted=0 and a.PROJECT_ID=yw_project.id and a.IS_INVESTMENT=1) as roomRentNum," + |
| | | "( select ifnull(sum(a.RENT_AREA),0) from yw_room a where a.isdeleted=0 and a.PROJECT_ID=yw_project.id ) as area"); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(YwProject::getId, pageWrap.getModel().getId()); |
| | | } |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwBuildingMapper; |
| | | import com.doumee.dao.business.YwContractRoomMapper; |
| | | import com.doumee.dao.business.YwRoomMapper; |
| | | import com.doumee.dao.business.model.YwBuilding; |
| | | import com.doumee.dao.business.model.YwFloor; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.dao.business.model.YwRoom; |
| | | import com.doumee.dao.business.YwWorkorderMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.YwRoomService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | private YwRoomMapper ywRoomMapper; |
| | | @Autowired |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | @Autowired |
| | | private YwContractRoomMapper ywContractRoomMapper; |
| | | @Autowired |
| | | private YwWorkorderMapper ywWorkorderMapper; |
| | | |
| | | @Override |
| | | public Integer create(YwRoom model) { |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | if(ywContractRoomMapper.selectCount(new QueryWrapper<YwContractRoom>() |
| | | .lambda().eq(YwContractRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwContractRoom::getRoomId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¿é´ä¿¡æ¯å·²ä½¿ç¨,æ æ³è¿è¡å é¤!"); |
| | | }; |
| | | if(ywWorkorderMapper.selectCount(new QueryWrapper<YwWorkorder>() |
| | | .lambda().eq(YwWorkorder::getIsdeleted,Constants.ZERO) |
| | | .eq(YwWorkorder::getRoomId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¿é´ä¿¡æ¯å·²ä½¿ç¨,æ æ³è¿è¡å é¤!"); |
| | | }; |
| | | YwRoom model = new YwRoom(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | |
| | | .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 " + |
| | | "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) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor); |
| | |
| | | queryWrapper.eq(YwRoom::getBuildingId, pageWrap.getModel().getBuildingId()); |
| | | } |
| | | queryWrapper.orderByAsc(YwRoom::getRoomNum); |
| | | return PageData.from(ywRoomMapper.selectJoinPage(page,YwRoom.class, queryWrapper)); |
| | | 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); |
| | | } |
| | | } |
| | | return PageData.from(iPage); |
| | | } |
| | | |
| | | @Override |
| | |
| | | MPJLambdaWrapper<YwWorkorder> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(YwWorkorder.class ) |
| | | .selectAs(SystemUser::getRealname,YwWorkorder::getDealUserName) |
| | | .selectAs(Company::getName,YwWorkorder::getDealUserCompany) |
| | | .select("t3.realname",YwWorkorder::getCreatorName) |
| | | .select("t3.mobile",YwWorkorder::getCreatorMobile) |
| | | .select("t9.name",YwWorkorder::getCreatorCompany) |
| | | .selectAs(Category::getName,YwWorkorder::getCategoryName) |
| | | .selectAs(YwRoom::getName,YwWorkorder::getRoomName) |
| | | .selectAs(YwRoom::getRoomNum,YwWorkorder::getRoomNum) |
| | | .selectAs(YwFloor::getName,YwWorkorder::getFloorName) |
| | | .selectAs(YwBuilding::getName,YwWorkorder::getBuildingName) |
| | | .selectAs(YwProject::getName,YwWorkorder::getProjectName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwWorkorder::getDealUserId) |
| | | .leftJoin(Category.class,Category::getId,YwWorkorder::getCateId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwWorkorder::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .leftJoin(YwRoom.class,YwRoom::getId,YwWorkorder::getRoomId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwWorkorder::getFloorId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwWorkorder::getBuildingId) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId) |
| | | .leftJoin(" company t9 on t9.id = t1.company_id ") |
| | | .eq(YwWorkorder::getId,id); |
| | | YwWorkorder model = ywWorkorderMapper.selectJoinOne(YwWorkorder.class,queryWrapper); |
| | | initFiles(model);//读åéä»¶ä¿¡æ¯ |
| | |
| | | .leftJoin(YwRoom.class,YwRoom::getId,YwWorkorder::getRoomId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwWorkorder::getFloorId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwWorkorder::getBuildingId) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwBuilding::getProjectId); |
| | | .leftJoin(YwProject.class,YwProject::getId,YwBuilding::getProjectId) |
| | | .apply(StringUtils.isNotBlank(pageWrap.getModel().getQueryStatus())," find_in_set(t.DEAL_STATUS ,'"+pageWrap.getModel().getQueryStatus()+"') "); |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.eq(YwWorkorder::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getDispatchUserId() != null) { |
| | | queryWrapper.eq(YwWorkorder::getDispatchUserId, pageWrap.getModel().getDispatchUserId()); |
| | | } |
| | | if(Objects.nonNull(pageWrap.getModel().getRoomName())){ |
| | | queryWrapper.and(i->i.like(YwFloor::getName,pageWrap.getModel().getRoomName()).or() |
| | | .like(YwRoom::getRoomNum,pageWrap.getModel().getRoomName()) |
| | | ); |
| | | } |
| | | |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.eq(YwWorkorder::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | |
| | | } |
| | | if (pageWrap.getModel().getDealStatus() != null) { |
| | | queryWrapper.eq(YwWorkorder::getDealStatus, pageWrap.getModel().getDealStatus()); |
| | | } |
| | | if (pageWrap.getModel().getDispatchUserId() != null) { |
| | | queryWrapper.eq(YwWorkorder::getDispatchUserId, pageWrap.getModel().getDispatchUserId()); |
| | | } |
| | | if (pageWrap.getModel().getDispatchDate() != null) { |
| | | queryWrapper.ge(YwWorkorder::getDispatchDate, Utils.Date.getStart(pageWrap.getModel().getDispatchDate())); |