diff --git a/air/src/main/java/com/air/applets/controller/SysMessageController.java b/air/src/main/java/com/air/applets/controller/SysMessageController.java new file mode 100644 index 0000000..cbbfd3d --- /dev/null +++ b/air/src/main/java/com/air/applets/controller/SysMessageController.java @@ -0,0 +1,98 @@ +package com.air.applets.controller; + +import cn.hutool.core.util.StrUtil; +import com.air.enums.SysMessageStatusEnum; +import com.air.sysMessage.entity.SysMessage; +import com.air.sysMessage.service.SysMessageService; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.cinderella.framework.common.core.util.R; +import com.cinderella.framework.common.data.mybatis.QueryPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + + + +/** + * 小程序消息管理 + * @author peihao + * @date 2021/7/14 + **/ +@RestController("applets_sysMessage") +@AllArgsConstructor +@RequestMapping("/applets/message") +@Api(value = "message", tags = "小程序消息管理") +public class SysMessageController { + + private final SysMessageService sysMessageService; + + /** + * 分页查询 + * @param page 分页对象 + * @param messageType 消息类型 + * @return + */ + @ApiOperation(value = "分页查询", notes = "分页查询") + @GetMapping("/page") + public R getSysMessagePage(QueryPage page, String messageType) { + Page result = sysMessageService.page(page.toPage(), Wrappers.query().lambda() + .eq(StrUtil.isNotEmpty(messageType),SysMessage::getMessageType, messageType) + .eq(SysMessage::getStatusCd, SysMessageStatusEnum.SYS_MESSAGE_STATUS_1000.getCode()) + .orderByDesc(SysMessage::getCreateDate)); + return R.ok(result); + } + + /** + * 通过id查询系统消息 + * @param messageId id + * @return R + */ + @ApiOperation(value = "通过id查询", notes = "通过id查询") + @GetMapping("/{messageId}") + public R getById(@PathVariable("messageId") Long messageId) { + return R.ok(sysMessageService.getSysMessageDetail(messageId)); + } + + /** + * 新增系统消息 + * @param sysMessage 系统消息 + * @return R + */ + @ApiOperation(value = "新增系统消息", notes = "新增系统消息") + @PostMapping + public R save(@RequestBody @Validated SysMessage sysMessage) { + return R.ok(sysMessageService.saveSysMessage(sysMessage)); + } + + /** + * 修改系统消息 + * @param sysMessage 系统消息 + * @return R + */ + @ApiOperation(value = "修改系统消息", notes = "修改系统消息") + @PutMapping + public R updateById(@RequestBody @Validated SysMessage sysMessage) { + return R.ok(sysMessageService.updateSysMessage(sysMessage)); + } + + /** + * 通过id删除系统消息 + * @param messageId id + * @return R + */ + @ApiOperation(value = "通过id删除系统消息", notes = "通过id删除系统消息") + @DeleteMapping("/{messageId}") + public R removeById(@PathVariable Long messageId) { + return R.ok(sysMessageService.deleteSysMessage(messageId)); + } + + + @ApiOperation(value = "发布消息", notes = "发布消息") + @GetMapping("/publish/{messageId}") + public R publishSysMessage(@PathVariable Long messageId) { + return R.ok(sysMessageService.publishSysMessage(messageId)); + } +} diff --git a/air/src/main/java/com/air/land/controller/AuctionRecordController.java b/air/src/main/java/com/air/land/controller/AuctionRecordController.java index 225e76b..4c2e950 100644 --- a/air/src/main/java/com/air/land/controller/AuctionRecordController.java +++ b/air/src/main/java/com/air/land/controller/AuctionRecordController.java @@ -3,6 +3,7 @@ package com.air.land.controller; import cn.hutool.core.bean.BeanUtil; import com.air.land.entity.AuctionRecord; import com.air.land.service.AuctionRecordService; +import com.air.land.vo.AuctionRecordPageVo; import com.air.land.vo.AuctionRecordVo; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -39,18 +40,13 @@ public class AuctionRecordController { /** * 查询参拍记录列表 * - * @param landListedId 已挂牌地块标识 + * @param recordPageVo 已挂牌地块标识 * @return */ @ApiOperation(value = "查询参拍记录列表", notes = "查询参拍记录列表") @GetMapping("/list") - public R> getAuctionRecordPage(QueryPage page, @RequestParam(required = false) String landListedId) { - LambdaQueryWrapper lambda = Wrappers.query().lambda(); - if (landListedId != null) { - lambda.eq(AuctionRecord::getLandListedId, landListedId); - } - IPage recordPage = auctionRecordService.page(page.toPage(), - lambda.orderByDesc(AuctionRecord::getUpdateDate)); + public R> getAuctionRecordPage(QueryPage page, AuctionRecordPageVo recordPageVo) { + IPage recordPage = auctionRecordService.selectPage(page.toPage(),recordPageVo); return R.ok(recordPage, "查询成功"); } diff --git a/air/src/main/java/com/air/land/entity/AuctionRecord.java b/air/src/main/java/com/air/land/entity/AuctionRecord.java index 68680d3..8c4a8e6 100644 --- a/air/src/main/java/com/air/land/entity/AuctionRecord.java +++ b/air/src/main/java/com/air/land/entity/AuctionRecord.java @@ -1,5 +1,6 @@ package com.air.land.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; @@ -89,4 +90,8 @@ public class AuctionRecord extends Model { @ApiModelProperty(value = "备注") private String remark; + + @TableField(exist = false) + @ApiModelProperty(value = "地块编号") + private String landCode; } diff --git a/air/src/main/java/com/air/land/entity/LandListed.java b/air/src/main/java/com/air/land/entity/LandListed.java index b12c26a..11046fa 100644 --- a/air/src/main/java/com/air/land/entity/LandListed.java +++ b/air/src/main/java/com/air/land/entity/LandListed.java @@ -92,6 +92,9 @@ public class LandListed extends Model { @ApiModelProperty(value = "商务面积") private String commerceSpace; + @ApiModelProperty(value = "商业商务占比") + private String bizCommerceRate; + @ApiModelProperty(value = "配建-计容") private String allocationCapacity; @@ -161,6 +164,9 @@ public class LandListed extends Model { @ApiModelProperty(value = "经纬度(百度BD09)") private String lonLatBd; + @ApiModelProperty(value = "是否成交") + private Integer deal; + @ApiModelProperty(value = "出让方式") private String transferMode; diff --git a/air/src/main/java/com/air/land/entity/LandToList.java b/air/src/main/java/com/air/land/entity/LandToList.java index 6bee4b2..66fbf32 100644 --- a/air/src/main/java/com/air/land/entity/LandToList.java +++ b/air/src/main/java/com/air/land/entity/LandToList.java @@ -111,6 +111,9 @@ public class LandToList extends Model { @ApiModelProperty(value = "商务面积") private String commerceSpace; + @ApiModelProperty(value = "商业商务占比") + private String bizCommerceRate; + @ApiModelProperty(value = "配建-计容") private String allocationCapacity; diff --git a/air/src/main/java/com/air/land/mapper/AuctionRecordMapper.java b/air/src/main/java/com/air/land/mapper/AuctionRecordMapper.java index 876df73..5addc22 100644 --- a/air/src/main/java/com/air/land/mapper/AuctionRecordMapper.java +++ b/air/src/main/java/com/air/land/mapper/AuctionRecordMapper.java @@ -1,7 +1,12 @@ package com.air.land.mapper; import com.air.land.entity.AuctionRecord; +import com.air.land.vo.AuctionRecordPageVo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 参拍记录表 @@ -11,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface AuctionRecordMapper extends BaseMapper { + List selectPage(Page page, @Param("param") AuctionRecordPageVo recordPageVo); } diff --git a/air/src/main/java/com/air/land/service/AuctionRecordService.java b/air/src/main/java/com/air/land/service/AuctionRecordService.java index b8bc65b..8f72398 100644 --- a/air/src/main/java/com/air/land/service/AuctionRecordService.java +++ b/air/src/main/java/com/air/land/service/AuctionRecordService.java @@ -1,6 +1,9 @@ package com.air.land.service; import com.air.land.entity.AuctionRecord; +import com.air.land.vo.AuctionRecordPageVo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import org.springframework.web.multipart.MultipartFile; @@ -25,4 +28,7 @@ public interface AuctionRecordService extends IService { * @return */ List readRecordExcel(MultipartFile file); + + + IPage selectPage(Page page, AuctionRecordPageVo recordPageVo); } diff --git a/air/src/main/java/com/air/land/service/impl/AuctionRecordServiceImpl.java b/air/src/main/java/com/air/land/service/impl/AuctionRecordServiceImpl.java index fe03fbc..8090c41 100644 --- a/air/src/main/java/com/air/land/service/impl/AuctionRecordServiceImpl.java +++ b/air/src/main/java/com/air/land/service/impl/AuctionRecordServiceImpl.java @@ -10,6 +10,9 @@ import cn.hutool.json.JSONUtil; import com.air.land.entity.AuctionRecord; import com.air.land.mapper.AuctionRecordMapper; import com.air.land.service.AuctionRecordService; +import com.air.land.vo.AuctionRecordPageVo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -72,6 +75,12 @@ public class AuctionRecordServiceImpl extends ServiceImpl selectPage(Page page, AuctionRecordPageVo recordPageVo) { + List auctionRecords = baseMapper.selectPage(page, recordPageVo); + return page.setRecords(auctionRecords); + } + private void getAllDirFiles(File file, List files) { for (File f : Objects.requireNonNull(file.listFiles())) { if (f.isDirectory()) { diff --git a/air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java b/air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java index 3c03279..fe8a60a 100644 --- a/air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java +++ b/air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java @@ -106,6 +106,7 @@ public class LandListedServiceImpl extends ServiceImplquery().lambda() + .eq(StrUtil.isNotEmpty(macroData.getYear()), MacroData::getYear, macroData.getYear()) + .eq(StrUtil.isNotEmpty(macroData.getCity()), MacroData::getCity, macroData.getCity()) + .orderByDesc(MacroData::getCreateDate)); + return R.ok(page1); } diff --git a/air/src/main/java/com/air/macro/entity/MacroData.java b/air/src/main/java/com/air/macro/entity/MacroData.java index eb02e03..bb75946 100644 --- a/air/src/main/java/com/air/macro/entity/MacroData.java +++ b/air/src/main/java/com/air/macro/entity/MacroData.java @@ -29,7 +29,7 @@ public class MacroData extends Model { private Long dataId; @ApiModelProperty(value = "年份") - private int year; + private String year; @ApiModelProperty(value = "城市") private String city; diff --git a/air/src/main/java/com/air/macro/service/MacroDataService.java b/air/src/main/java/com/air/macro/service/MacroDataService.java index 4dfb124..06de4bd 100644 --- a/air/src/main/java/com/air/macro/service/MacroDataService.java +++ b/air/src/main/java/com/air/macro/service/MacroDataService.java @@ -16,14 +16,6 @@ import java.util.List; */ public interface MacroDataService extends IService { - /** - * 分页查询宏观数据 - * @param page - * @param macroData - * @return Page - */ - Page getMacroDataPage(Page page, MacroData macroData); - /** * 保存宏观数据 * @param macroData diff --git a/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java b/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java index f538874..24d0778 100644 --- a/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java +++ b/air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java @@ -1,11 +1,8 @@ package com.air.macro.service.impl; -import com.air.enums.CommonStatusEnum; import com.air.macro.entity.MacroData; import com.air.macro.mapper.MacroDataMapper; import com.air.macro.service.MacroDataService; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.api.client.util.Lists; import org.springframework.stereotype.Service; @@ -23,26 +20,14 @@ import java.util.List; @Service public class MacroDataServiceImpl extends ServiceImpl implements MacroDataService { - private final MacroDataMapper macroDataMapper; - - public MacroDataServiceImpl(MacroDataMapper macroDataMapper) { - this.macroDataMapper = macroDataMapper; - } - - @Override - public Page getMacroDataPage(Page page, MacroData macroData) { - Page p = macroDataMapper.selectPage(page,Wrappers.lambdaQuery().eq(MacroData::getStatusCd, CommonStatusEnum.SYS_MESSAGE_STATUS_1000.getCode())); - return p; - } - @Override public Integer saveMacroData(MacroData macroData) { - return macroDataMapper.insert(macroData); + return baseMapper.insert(macroData); } @Override public Integer updateMacroData(MacroData macroData) { - return macroDataMapper.updateById(macroData); + return baseMapper.updateById(macroData); } @Override @@ -53,19 +38,19 @@ public class MacroDataServiceImpl extends ServiceImpl exportMacroData(Long[] ids) { List list = Lists.newArrayList(); - Arrays.asList(ids).forEach(id ->{ - list.add(macroDataMapper.selectById(id)); + Arrays.asList(ids).forEach(id -> { + list.add(baseMapper.selectById(id)); }); return list; } @Override public MacroData getMacroDataDetail(Long id) { - return macroDataMapper.selectById(id); + return baseMapper.selectById(id); } @Override public Integer deleteMacroData(Long id) { - return macroDataMapper.deleteById(id); + return baseMapper.deleteById(id); } } diff --git a/air/src/main/java/com/air/sysMessage/controller/SysMessageController.java b/air/src/main/java/com/air/sysMessage/controller/SysMessageController.java index 533444d..cba0fbf 100644 --- a/air/src/main/java/com/air/sysMessage/controller/SysMessageController.java +++ b/air/src/main/java/com/air/sysMessage/controller/SysMessageController.java @@ -1,5 +1,6 @@ package com.air.sysMessage.controller; +import cn.hutool.core.util.StrUtil; import com.air.enums.SysMessageStatusEnum; import com.air.sysMessage.entity.SysMessage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -22,7 +23,7 @@ import org.springframework.web.bind.annotation.*; */ @RestController @AllArgsConstructor -@RequestMapping("/applets/message") +@RequestMapping("/message") @Api(value = "message", tags = "系统消息管理") public class SysMessageController { @@ -36,9 +37,9 @@ public class SysMessageController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") - public R getSysMessagePage(QueryPage page, @RequestParam String messageType) { + public R getSysMessagePage(QueryPage page, String messageType) { Page result = sysMessageService.page(page.toPage(), Wrappers.query().lambda() - .eq(SysMessage::getMessageType, messageType) + .eq(StrUtil.isNotEmpty(messageType),SysMessage::getMessageType, messageType) .eq(SysMessage::getStatusCd, SysMessageStatusEnum.SYS_MESSAGE_STATUS_1000.getCode()) .orderByDesc(SysMessage::getCreateDate)); return R.ok(result); diff --git a/air/src/main/resources/application.yml b/air/src/main/resources/application.yml index 799648b..2eda14e 100644 --- a/air/src/main/resources/application.yml +++ b/air/src/main/resources/application.yml @@ -8,9 +8,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: pUxtaIoE!1^s@vDJ - url: jdbc:mysql://139.9.239.248:4001/air?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true + username: air + password: air123456 + url: jdbc:mysql://124.71.210.242:4000/air?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true stat-view-servlet: enabled: true url-pattern: /druid/* diff --git a/air/src/main/resources/mapper/AuctionRecordMapper.xml b/air/src/main/resources/mapper/AuctionRecordMapper.xml index f5884ed..4b55415 100644 --- a/air/src/main/resources/mapper/AuctionRecordMapper.xml +++ b/air/src/main/resources/mapper/AuctionRecordMapper.xml @@ -4,4 +4,34 @@ + + diff --git a/air/src/main/resources/mapper/LandListedMapper.xml b/air/src/main/resources/mapper/LandListedMapper.xml index a87803a..b6b6973 100644 --- a/air/src/main/resources/mapper/LandListedMapper.xml +++ b/air/src/main/resources/mapper/LandListedMapper.xml @@ -111,6 +111,7 @@ and date_format(ll.auction_date,'%Y-%m-%d') <= #{landVo.endDate} + order by ll.create_date desc diff --git a/air/src/main/resources/mapper/LandToListMapper.xml b/air/src/main/resources/mapper/LandToListMapper.xml index 3628b6e..b344143 100644 --- a/air/src/main/resources/mapper/LandToListMapper.xml +++ b/air/src/main/resources/mapper/LandToListMapper.xml @@ -25,6 +25,7 @@ and ll.canton = #{landVo.canton} + order by ll.create_date desc