Browse Source

1.0.0 修改PC端接口

feature/v1.0.0
peihao 4 years ago
parent
commit
79d8e28b68
  1. 98
      air/src/main/java/com/air/applets/controller/SysMessageController.java
  2. 12
      air/src/main/java/com/air/land/controller/AuctionRecordController.java
  3. 5
      air/src/main/java/com/air/land/entity/AuctionRecord.java
  4. 6
      air/src/main/java/com/air/land/entity/LandListed.java
  5. 3
      air/src/main/java/com/air/land/entity/LandToList.java
  6. 6
      air/src/main/java/com/air/land/mapper/AuctionRecordMapper.java
  7. 6
      air/src/main/java/com/air/land/service/AuctionRecordService.java
  8. 9
      air/src/main/java/com/air/land/service/impl/AuctionRecordServiceImpl.java
  9. 1
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  10. 12
      air/src/main/java/com/air/land/vo/AuctionRecordPageVo.java
  11. 3
      air/src/main/java/com/air/land/vo/LandListedVo.java
  12. 3
      air/src/main/java/com/air/land/vo/LandToListVo.java
  13. 8
      air/src/main/java/com/air/macro/controller/MacroDataController.java
  14. 2
      air/src/main/java/com/air/macro/entity/MacroData.java
  15. 8
      air/src/main/java/com/air/macro/service/MacroDataService.java
  16. 27
      air/src/main/java/com/air/macro/service/impl/MacroDataServiceImpl.java
  17. 7
      air/src/main/java/com/air/sysMessage/controller/SysMessageController.java
  18. 6
      air/src/main/resources/application.yml
  19. 30
      air/src/main/resources/mapper/AuctionRecordMapper.xml
  20. 1
      air/src/main/resources/mapper/LandListedMapper.xml
  21. 1
      air/src/main/resources/mapper/LandToListMapper.xml

98
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<SysMessage> result = sysMessageService.page(page.toPage(), Wrappers.<SysMessage>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));
}
}

12
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<IPage<AuctionRecord>> getAuctionRecordPage(QueryPage page, @RequestParam(required = false) String landListedId) {
LambdaQueryWrapper<AuctionRecord> lambda = Wrappers.<AuctionRecord>query().lambda();
if (landListedId != null) {
lambda.eq(AuctionRecord::getLandListedId, landListedId);
}
IPage<AuctionRecord> recordPage = auctionRecordService.page(page.toPage(),
lambda.orderByDesc(AuctionRecord::getUpdateDate));
public R<IPage<AuctionRecord>> getAuctionRecordPage(QueryPage page, AuctionRecordPageVo recordPageVo) {
IPage<AuctionRecord> recordPage = auctionRecordService.selectPage(page.toPage(),recordPageVo);
return R.ok(recordPage, "查询成功");
}

5
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<AuctionRecord> {
@ApiModelProperty(value = "备注")
private String remark;
@TableField(exist = false)
@ApiModelProperty(value = "地块编号")
private String landCode;
}

6
air/src/main/java/com/air/land/entity/LandListed.java

@ -92,6 +92,9 @@ public class LandListed extends Model<LandListed> {
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "商业商务占比")
private String bizCommerceRate;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;
@ -161,6 +164,9 @@ public class LandListed extends Model<LandListed> {
@ApiModelProperty(value = "经纬度(百度BD09)")
private String lonLatBd;
@ApiModelProperty(value = "是否成交")
private Integer deal;
@ApiModelProperty(value = "出让方式")
private String transferMode;

3
air/src/main/java/com/air/land/entity/LandToList.java

@ -111,6 +111,9 @@ public class LandToList extends Model<LandToList> {
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "商业商务占比")
private String bizCommerceRate;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;

6
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<AuctionRecord> {
List<AuctionRecord> selectPage(Page page, @Param("param") AuctionRecordPageVo recordPageVo);
}

6
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<AuctionRecord> {
* @return
*/
List<AuctionRecord> readRecordExcel(MultipartFile file);
IPage<AuctionRecord> selectPage(Page page, AuctionRecordPageVo recordPageVo);
}

9
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<AuctionRecordMapper, A
return readAuction(file.getInputStream(), 0, 7, 21);
}
@Override
public IPage<AuctionRecord> selectPage(Page page, AuctionRecordPageVo recordPageVo) {
List<AuctionRecord> auctionRecords = baseMapper.selectPage(page, recordPageVo);
return page.setRecords(auctionRecords);
}
private void getAllDirFiles(File file, List<File> files) {
for (File f : Objects.requireNonNull(file.listFiles())) {
if (f.isDirectory()) {

1
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -106,6 +106,7 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
for (int i = 2; i < rowSum; i++) {
XSSFRow sheetRow = sheet.getRow(i);
LandListed landListed = new LandListed();
landListed.setDeal(0);
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMddHHmmssSSS"));
landListed.setAnnoId(getCellValue(sheetRow.getCell(0)));
landListed.setLandCode(getCellStrValue(sheetRow.getCell(1)));

12
air/src/main/java/com/air/land/vo/AuctionRecordPageVo.java

@ -19,14 +19,14 @@ import javax.validation.constraints.NotNull;
public class AuctionRecordPageVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long auctionRecordId;
/*@ApiModelProperty(value = "主键")
private Long auctionRecordId;*/
@NotNull(message = "已挂牌地块标识不能为空")
private String landListedId;
@ApiModelProperty(value = "公告id")
private String annoId;
@ApiModelProperty(value = "地块编号")
private String landCode;
@ApiModelProperty(value = "城市")
private String city;
@ -34,8 +34,8 @@ public class AuctionRecordPageVo {
@ApiModelProperty(value = "地块名称")
private String landName;
@ApiModelProperty(value = "地块位置")
private String ranking;
/*@ApiModelProperty(value = "地块位置")
private String ranking;*/
@ApiModelProperty(value = "举牌企业")
private String raiseEnterprise;

3
air/src/main/java/com/air/land/vo/LandListedVo.java

@ -87,6 +87,9 @@ public class LandListedVo {
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "商业商务占比")
private String bizCommerceRate;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;

3
air/src/main/java/com/air/land/vo/LandToListVo.java

@ -100,6 +100,9 @@ public class LandToListVo {
@ApiModelProperty(value = "商务面积")
private String commerceSpace;
@ApiModelProperty(value = "商业商务占比")
private String bizCommerceRate;
@ApiModelProperty(value = "配建-计容")
private String allocationCapacity;

8
air/src/main/java/com/air/macro/controller/MacroDataController.java

@ -1,7 +1,9 @@
package com.air.macro.controller;
import cn.hutool.core.util.StrUtil;
import com.air.macro.entity.MacroData;
import com.air.macro.service.MacroDataService;
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;
@ -33,7 +35,11 @@ public class MacroDataController {
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getMacroDataPage(Page page, MacroData macroData) {
return R.ok(macroDataService.getMacroDataPage(page,macroData));
Page page1 = macroDataService.page(page, Wrappers.<MacroData>query().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);
}

2
air/src/main/java/com/air/macro/entity/MacroData.java

@ -29,7 +29,7 @@ public class MacroData extends Model<MacroData> {
private Long dataId;
@ApiModelProperty(value = "年份")
private int year;
private String year;
@ApiModelProperty(value = "城市")
private String city;

8
air/src/main/java/com/air/macro/service/MacroDataService.java

@ -16,14 +16,6 @@ import java.util.List;
*/
public interface MacroDataService extends IService<MacroData> {
/**
* 分页查询宏观数据
* @param page
* @param macroData
* @return Page
*/
Page<MacroData> getMacroDataPage(Page page, MacroData macroData);
/**
* 保存宏观数据
* @param macroData

27
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<MacroDataMapper, MacroData> 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.<MacroData>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<MacroDataMapper, MacroData
@Override
public List<MacroData> exportMacroData(Long[] ids) {
List<MacroData> 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);
}
}

7
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<SysMessage> result = sysMessageService.page(page.toPage(), Wrappers.<SysMessage>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);

6
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/*

30
air/src/main/resources/mapper/AuctionRecordMapper.xml

@ -4,4 +4,34 @@
<mapper namespace="com.air.land.mapper.AuctionRecordMapper">
<select id="selectPage" resultType="com.air.land.entity.AuctionRecord" parameterType="com.air.land.vo.AuctionRecordPageVo">
SELECT
ar.*,
ll.land_code
FROM
auction_record ar
JOIN land_listed ll ON ar.land_listed_id = ll.land_listed_id
<where>
<if test="param.landListedId != null and param.landListedId != ''">
and ar.land_listed_id = #{param.landListedId}
</if>
<if test="param.city != null and param.city != ''">
and ar.city = #{param.city}
</if>
<if test="param.landCode != null and param.landCode != ''">
and ll.land_code like concat ('%',#{param.landCode},'%')
</if>
<if test="param.landName != null and param.landName != ''">
and ar.land_name like concat ('%',#{param.landName},'%')
</if>
<if test="param.raiseEnterprise != null and param.raiseEnterprise != ''">
and ar.raise_enterprise like concat ('%',#{param.raiseEnterprise},'%')
</if>
<if test="param.winnerEnterprises != null and param.winnerEnterprises != ''">
and ar.winner_enterprises like concat ('%',#{param.winnerEnterprises},'%')
</if>
</where>
order by ar.create_date desc
</select>
</mapper>

1
air/src/main/resources/mapper/LandListedMapper.xml

@ -111,6 +111,7 @@
and date_format(ll.auction_date,'%Y-%m-%d') &lt;= #{landVo.endDate}
</if>
</where>
order by ll.create_date desc
</select>

1
air/src/main/resources/mapper/LandToListMapper.xml

@ -25,6 +25,7 @@
and ll.canton = #{landVo.canton}
</if>
</where>
order by ll.create_date desc
</select>

Loading…
Cancel
Save