|
|
|
|
package com.weaver.seconddev.tjzs.controller.banquethall;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.weaver.common.authority.annotation.WeaPermission;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.seconddev.tjzs.tb.config.EbDbDataSourceConfig;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @use:根据人数获取符合条件的宴会厅id列表
|
|
|
|
|
* @author liuhao
|
|
|
|
|
* @return String,id用逗号隔开
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/papi/secondev/tjzs")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class BanquetHallCheckController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private JdbcTemplate jdbcTemplate = new JdbcTemplate(EbDbDataSourceConfig.dbDataSource());
|
|
|
|
|
|
|
|
|
|
@WeaPermission(publicPermission = true)
|
|
|
|
|
@PostMapping("/checkBanquetHallByPeople")
|
|
|
|
|
public WeaResult<String> check(
|
|
|
|
|
@RequestParam("peoplenums") int peoplenums
|
|
|
|
|
){
|
|
|
|
|
log.error("peoplenums:{}",peoplenums);
|
|
|
|
|
String ids = "";
|
|
|
|
|
Map<String,String> rs = new HashMap<>();
|
|
|
|
|
//根据人数判断符合条件数据 表单:uf_ballroom_informat_registrat【宴会厅信息登记】
|
|
|
|
|
String sql = "select id from uf_ballroom_informat_registrat where max_num >= "+peoplenums+" and min_num <= "+peoplenums+" and IS_DELETE = '0'";
|
|
|
|
|
List<Map<String, Object>> infolist = jdbcTemplate.queryForList(sql);
|
|
|
|
|
if(CollectionUtil.isNotEmpty(infolist)) {
|
|
|
|
|
List<String>idslist = new ArrayList<>();
|
|
|
|
|
for(Map<String,Object> rs1 : infolist) {
|
|
|
|
|
String id = String.valueOf(rs1.get("id"));
|
|
|
|
|
idslist.add(id);
|
|
|
|
|
}
|
|
|
|
|
ids = idslist.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
|
|
|
}
|
|
|
|
|
return WeaResult.success(ids);
|
|
|
|
|
}
|
|
|
|
|
}
|