25 changed files with 2015 additions and 0 deletions
@ -0,0 +1,116 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryStatsConfigDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
|
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
/** |
||||
|
* 管理平台分类图标 |
||||
|
*/ |
||||
|
private String managementIcon; |
||||
|
|
||||
|
/** |
||||
|
* 数据平台分类图标 |
||||
|
*/ |
||||
|
private String dataIcon; |
||||
|
|
||||
|
/** |
||||
|
* 房屋显示分类图标 |
||||
|
*/ |
||||
|
private String houseShowIcon; |
||||
|
|
||||
|
/** |
||||
|
* 状态 显示:show;隐藏:hidden |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private String revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private String createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,111 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryWarnConfigDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
|
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 等级1阈值 |
||||
|
*/ |
||||
|
private Integer level1; |
||||
|
|
||||
|
/** |
||||
|
* 等级2阈值 |
||||
|
*/ |
||||
|
private Integer level2; |
||||
|
|
||||
|
/** |
||||
|
* 等级3阈值 |
||||
|
*/ |
||||
|
private Integer level3; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private String revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private String createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryStatsConfigFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
public interface UpdateStatusGroup {} |
||||
|
public interface SelectGroup {} |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@NotBlank(message = "配置项id不能为空",groups = {UpdateGroup.class,UpdateStatusGroup.class,SelectGroup.class}) |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 管理平台分类图标 |
||||
|
*/ |
||||
|
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) |
||||
|
private String managementIcon; |
||||
|
|
||||
|
/** |
||||
|
* 数据平台分类图标 |
||||
|
*/ |
||||
|
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) |
||||
|
private String dataIcon; |
||||
|
|
||||
|
/** |
||||
|
* 房屋显示分类图标 |
||||
|
*/ |
||||
|
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) |
||||
|
private String houseShowIcon; |
||||
|
|
||||
|
/** |
||||
|
* 状态 显示:show;隐藏:hidden |
||||
|
*/ |
||||
|
@NotBlank(message = "状态不能为空",groups = {UpdateStatusGroup.class}) |
||||
|
private String status; |
||||
|
|
||||
|
@NotBlank(message = "是否预警",groups = {UpdateGroup.class}) |
||||
|
private String warn; |
||||
|
|
||||
|
private Integer level1; |
||||
|
|
||||
|
private Integer level2; |
||||
|
|
||||
|
private Integer level3; |
||||
|
|
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryStatsConfigSortFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@NotBlank(message = "配置项id不能为空") |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
@NotBlank(message = "排序不能为空") |
||||
|
private Integer sort; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryStatsConfigResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 管理平台分类图标 |
||||
|
*/ |
||||
|
private String managementIcon; |
||||
|
|
||||
|
/** |
||||
|
* 数据平台分类图标 |
||||
|
*/ |
||||
|
private String dataIcon; |
||||
|
|
||||
|
/** |
||||
|
* 房屋显示分类图标 |
||||
|
*/ |
||||
|
private String houseShowIcon; |
||||
|
|
||||
|
/** |
||||
|
* 状态 显示:show;隐藏:hidden |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
private String warn; |
||||
|
/** |
||||
|
* 等级1阈值 |
||||
|
*/ |
||||
|
private Integer level1; |
||||
|
/** |
||||
|
* 等级2阈值 |
||||
|
*/ |
||||
|
private Integer level2; |
||||
|
/** |
||||
|
* 等级3阈值 |
||||
|
*/ |
||||
|
private Integer level3; |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.constant; |
||||
|
|
||||
|
/** |
||||
|
* 常量 |
||||
|
* @author sun |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
public interface IcResiCategoryStatsConfigConstant { |
||||
|
/** |
||||
|
* 是否需要预警 |
||||
|
*/ |
||||
|
String WARN_YES = "1"; |
||||
|
String WARN_NO = "0"; |
||||
|
|
||||
|
String IC_RESI_USER = "ic_resi_user"; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.excel.IcResiCategoryStatsConfigExcel; |
||||
|
import com.epmet.service.IcResiCategoryStatsConfigService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icresicategorystatsconfig") |
||||
|
public class IcResiCategoryStatsConfigController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<IcResiCategoryStatsConfigDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcResiCategoryStatsConfigDTO> page = icResiCategoryStatsConfigService.page(params); |
||||
|
return new Result<PageData<IcResiCategoryStatsConfigDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<IcResiCategoryStatsConfigDTO> get(@PathVariable("id") String id){ |
||||
|
IcResiCategoryStatsConfigDTO data = icResiCategoryStatsConfigService.get(id); |
||||
|
return new Result<IcResiCategoryStatsConfigDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody IcResiCategoryStatsConfigDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icResiCategoryStatsConfigService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody IcResiCategoryStatsConfigDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icResiCategoryStatsConfigService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icResiCategoryStatsConfigService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcResiCategoryStatsConfigDTO> list = icResiCategoryStatsConfigService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryStatsConfigExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcResiCategoryWarnConfigDTO; |
||||
|
import com.epmet.excel.IcResiCategoryWarnConfigExcel; |
||||
|
import com.epmet.service.IcResiCategoryWarnConfigService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icresicategorywarnconfig") |
||||
|
public class IcResiCategoryWarnConfigController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<IcResiCategoryWarnConfigDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcResiCategoryWarnConfigDTO> page = icResiCategoryWarnConfigService.page(params); |
||||
|
return new Result<PageData<IcResiCategoryWarnConfigDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<IcResiCategoryWarnConfigDTO> get(@PathVariable("id") String id){ |
||||
|
IcResiCategoryWarnConfigDTO data = icResiCategoryWarnConfigService.get(id); |
||||
|
return new Result<IcResiCategoryWarnConfigDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody IcResiCategoryWarnConfigDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icResiCategoryWarnConfigService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody IcResiCategoryWarnConfigDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icResiCategoryWarnConfigService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icResiCategoryWarnConfigService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcResiCategoryWarnConfigDTO> list = icResiCategoryWarnConfigService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcResiCategoryWarnConfigExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; |
||||
|
import com.epmet.dto.form.UpGovRoleFormDTO; |
||||
|
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; |
||||
|
import com.epmet.excel.IcResiCategoryStatsConfigExcel; |
||||
|
import com.epmet.service.IcResiCategoryStatsConfigService; |
||||
|
import com.epmet.service.ResiCategoryStatsConfigService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("resicategorystatsconfig") |
||||
|
public class ResiCategoryStatsConfigController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; |
||||
|
@Autowired |
||||
|
private ResiCategoryStatsConfigService resiCategoryStatsConfigService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("list") |
||||
|
public Result<List<IcResiCategoryStatsConfigResultDTO>> list(@LoginUser TokenDto tokenDTO){ |
||||
|
String customerId = tokenDTO.getCustomerId(); |
||||
|
// String customerId = "123123";
|
||||
|
return new Result<List<IcResiCategoryStatsConfigResultDTO>>().ok(resiCategoryStatsConfigService.list(customerId)); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("update") |
||||
|
public Result update(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); |
||||
|
String customerId = tokenDTO.getCustomerId(); |
||||
|
// String customerId = "123123";
|
||||
|
resiCategoryStatsConfigService.update(customerId,formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
@PostMapping("updatestatus") |
||||
|
public Result updateStatus(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.UpdateStatusGroup.class); |
||||
|
String customerId = tokenDTO.getCustomerId(); |
||||
|
// String customerId = "123123";
|
||||
|
resiCategoryStatsConfigService.updateStatus(customerId,formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
@PostMapping("updatesort") |
||||
|
public Result updateSort(@LoginUser TokenDto tokenDTO,@RequestBody List<IcResiCategoryStatsConfigSortFormDTO> formDTOs){ |
||||
|
for(IcResiCategoryStatsConfigSortFormDTO dto : formDTOs){ |
||||
|
ValidatorUtils.validateEntity(dto); |
||||
|
} |
||||
|
String customerId = tokenDTO.getCustomerId(); |
||||
|
// String customerId = "123123";
|
||||
|
resiCategoryStatsConfigService.updateSort(customerId,formDTOs); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("info") |
||||
|
public Result<IcResiCategoryStatsConfigResultDTO> info(@LoginUser TokenDto tokenDTO,@RequestBody IcResiCategoryStatsConfigFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, IcResiCategoryStatsConfigFormDTO.SelectGroup.class); |
||||
|
return new Result<IcResiCategoryStatsConfigResultDTO>().ok(resiCategoryStatsConfigService.info(formDTO.getId())); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiCategoryStatsConfigDao extends BaseDao<IcResiCategoryStatsConfigEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiCategoryWarnConfigEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiCategoryWarnConfigDao extends BaseDao<IcResiCategoryWarnConfigEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,83 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_category_stats_config") |
||||
|
public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
|
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
/** |
||||
|
* 管理平台分类图标 |
||||
|
*/ |
||||
|
private String managementIcon; |
||||
|
|
||||
|
/** |
||||
|
* 数据平台分类图标 |
||||
|
*/ |
||||
|
private String dataIcon; |
||||
|
|
||||
|
/** |
||||
|
* 房屋显示分类图标 |
||||
|
*/ |
||||
|
private String houseShowIcon; |
||||
|
|
||||
|
/** |
||||
|
* 状态 显示:show;隐藏:hidden |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_category_warn_config") |
||||
|
public class IcResiCategoryWarnConfigEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
|
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 等级1阈值 |
||||
|
*/ |
||||
|
private Integer level1; |
||||
|
|
||||
|
/** |
||||
|
* 等级2阈值 |
||||
|
*/ |
||||
|
private Integer level2; |
||||
|
|
||||
|
/** |
||||
|
* 等级3阈值 |
||||
|
*/ |
||||
|
private Integer level3; |
||||
|
|
||||
|
} |
@ -0,0 +1,83 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryStatsConfigExcel { |
||||
|
|
||||
|
@Excel(name = "id") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "客户id") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "项标签") |
||||
|
private String label; |
||||
|
|
||||
|
@Excel(name = "表名") |
||||
|
private String tableName; |
||||
|
|
||||
|
@Excel(name = "列名") |
||||
|
private String columnName; |
||||
|
|
||||
|
@Excel(name = "管理平台分类图标") |
||||
|
private String managementIcon; |
||||
|
|
||||
|
@Excel(name = "数据平台分类图标") |
||||
|
private String dataIcon; |
||||
|
|
||||
|
@Excel(name = "房屋显示分类图标") |
||||
|
private String houseShowIcon; |
||||
|
|
||||
|
@Excel(name = "状态 显示:show;隐藏:hidden") |
||||
|
private String status; |
||||
|
|
||||
|
@Excel(name = "排序") |
||||
|
private Integer sort; |
||||
|
|
||||
|
@Excel(name = "删除标识:0.未删除 1.已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private String revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private String createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiCategoryWarnConfigExcel { |
||||
|
|
||||
|
@Excel(name = "id") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "客户id") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "项标签") |
||||
|
private String label; |
||||
|
|
||||
|
@Excel(name = "表名") |
||||
|
private String tableName; |
||||
|
|
||||
|
@Excel(name = "列名") |
||||
|
private String columnName; |
||||
|
|
||||
|
@Excel(name = "排序") |
||||
|
private Integer sort; |
||||
|
|
||||
|
@Excel(name = "等级1阈值") |
||||
|
private Integer level1; |
||||
|
|
||||
|
@Excel(name = "等级2阈值") |
||||
|
private Integer level2; |
||||
|
|
||||
|
@Excel(name = "等级3阈值") |
||||
|
private Integer level3; |
||||
|
|
||||
|
@Excel(name = "删除标识:0.未删除 1.已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private String revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private String createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcResiCategoryStatsConfigRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcResiCategoryWarnConfigRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCategoryStatsConfigEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcResiCategoryStatsConfigDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
PageData<IcResiCategoryStatsConfigDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcResiCategoryStatsConfigDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
List<IcResiCategoryStatsConfigDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcResiCategoryStatsConfigDTO |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
IcResiCategoryStatsConfigDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void save(IcResiCategoryStatsConfigDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void update(IcResiCategoryStatsConfigDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcResiCategoryWarnConfigDTO; |
||||
|
import com.epmet.entity.IcResiCategoryWarnConfigEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
public interface IcResiCategoryWarnConfigService extends BaseService<IcResiCategoryWarnConfigEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcResiCategoryWarnConfigDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
PageData<IcResiCategoryWarnConfigDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcResiCategoryWarnConfigDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
List<IcResiCategoryWarnConfigDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcResiCategoryWarnConfigDTO |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
IcResiCategoryWarnConfigDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void save(IcResiCategoryWarnConfigDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void update(IcResiCategoryWarnConfigDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-04 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; |
||||
|
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; |
||||
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
public interface ResiCategoryStatsConfigService { |
||||
|
|
||||
|
List<IcResiCategoryStatsConfigResultDTO> list(String customerId); |
||||
|
|
||||
|
IcResiCategoryStatsConfigResultDTO info(String id); |
||||
|
|
||||
|
void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); |
||||
|
|
||||
|
void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO); |
||||
|
|
||||
|
void updateSort(String customerId,List<IcResiCategoryStatsConfigSortFormDTO> formDTOs); |
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.dao.IcResiCategoryStatsConfigDao; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
||||
|
import com.epmet.redis.IcResiCategoryStatsConfigRedis; |
||||
|
import com.epmet.service.IcResiCategoryStatsConfigService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResiCategoryStatsConfigDao, IcResiCategoryStatsConfigEntity> implements IcResiCategoryStatsConfigService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigRedis icResiCategoryStatsConfigRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcResiCategoryStatsConfigDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcResiCategoryStatsConfigEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcResiCategoryStatsConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcResiCategoryStatsConfigDTO> list(Map<String, Object> params) { |
||||
|
List<IcResiCategoryStatsConfigEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryStatsConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcResiCategoryStatsConfigEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcResiCategoryStatsConfigEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcResiCategoryStatsConfigDTO get(String id) { |
||||
|
IcResiCategoryStatsConfigEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcResiCategoryStatsConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcResiCategoryStatsConfigDTO dto) { |
||||
|
IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcResiCategoryStatsConfigDTO dto) { |
||||
|
IcResiCategoryStatsConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryStatsConfigEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.dao.IcResiCategoryWarnConfigDao; |
||||
|
import com.epmet.dto.IcResiCategoryWarnConfigDTO; |
||||
|
import com.epmet.entity.IcResiCategoryWarnConfigEntity; |
||||
|
import com.epmet.redis.IcResiCategoryWarnConfigRedis; |
||||
|
import com.epmet.service.IcResiCategoryWarnConfigService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民类别预警配置表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-04 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcResiCategoryWarnConfigServiceImpl extends BaseServiceImpl<IcResiCategoryWarnConfigDao, IcResiCategoryWarnConfigEntity> implements IcResiCategoryWarnConfigService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiCategoryWarnConfigRedis icResiCategoryWarnConfigRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcResiCategoryWarnConfigDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcResiCategoryWarnConfigEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcResiCategoryWarnConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcResiCategoryWarnConfigDTO> list(Map<String, Object> params) { |
||||
|
List<IcResiCategoryWarnConfigEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcResiCategoryWarnConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcResiCategoryWarnConfigEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcResiCategoryWarnConfigEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcResiCategoryWarnConfigDTO get(String id) { |
||||
|
IcResiCategoryWarnConfigEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcResiCategoryWarnConfigDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcResiCategoryWarnConfigDTO dto) { |
||||
|
IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcResiCategoryWarnConfigDTO dto) { |
||||
|
IcResiCategoryWarnConfigEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCategoryWarnConfigEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,264 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.epmet.constant.IcResiCategoryStatsConfigConstant; |
||||
|
import com.epmet.dao.IcFormItemDao; |
||||
|
import com.epmet.dao.IcFormItemGroupDao; |
||||
|
import com.epmet.dao.IcResiCategoryStatsConfigDao; |
||||
|
import com.epmet.dao.IcResiCategoryWarnConfigDao; |
||||
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
||||
|
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; |
||||
|
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; |
||||
|
import com.epmet.entity.IcFormItemEntity; |
||||
|
import com.epmet.entity.IcFormItemGroupEntity; |
||||
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
||||
|
import com.epmet.entity.IcResiCategoryWarnConfigEntity; |
||||
|
import com.epmet.service.IcResiCategoryStatsConfigService; |
||||
|
import com.epmet.service.IcResiCategoryWarnConfigService; |
||||
|
import com.epmet.service.ResiCategoryStatsConfigService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConfigService { |
||||
|
@Autowired |
||||
|
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; |
||||
|
|
||||
|
@Resource |
||||
|
private IcFormItemDao icFormItemDao; |
||||
|
@Resource |
||||
|
private IcFormItemGroupDao icFormItemGroupDao; |
||||
|
@Resource |
||||
|
private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; |
||||
|
@Resource |
||||
|
private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; |
||||
|
@Autowired |
||||
|
private IcResiCategoryWarnConfigService icResiCategoryWarnConfigService; |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId) { |
||||
|
//1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label
|
||||
|
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getDataAnalyse, 1)); |
||||
|
if(CollectionUtils.isEmpty(icFormItemEntityList)){ |
||||
|
return new ArrayList<>(); |
||||
|
} |
||||
|
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(item->item.getItemGroupId()).collect(Collectors.toSet()); |
||||
|
List<IcFormItemGroupEntity> icFormItemGroupEntityList = icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().in(IcFormItemGroupEntity::getId, groupIds)); |
||||
|
//获取tableName和COLUMN_NAME
|
||||
|
Map<String,IcFormItemEntity> tableColumnMap = new HashMap<>(); |
||||
|
Map<String,String> idTableMap = new HashMap<>(); |
||||
|
icFormItemEntityList.forEach(item->{ |
||||
|
Map<String,String> map = new HashMap<>(); |
||||
|
if("0".equals(item.getItemGroupId())){ |
||||
|
tableColumnMap.put(IcResiCategoryStatsConfigConstant.IC_RESI_USER+"-"+item.getColumnName(),item); |
||||
|
idTableMap.put(item.getId(),IcResiCategoryStatsConfigConstant.IC_RESI_USER); |
||||
|
}else{ |
||||
|
List<IcFormItemGroupEntity> collect = icFormItemGroupEntityList.stream().filter(i -> item.getItemGroupId().equals(i.getId())).collect(Collectors.toList()); |
||||
|
tableColumnMap.put(CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()+"-"+item.getColumnName(),item); |
||||
|
idTableMap.put(item.getId(),CollectionUtils.isEmpty(collect)?IcResiCategoryStatsConfigConstant.IC_RESI_USER:collect.get(0).getTableName()); |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
//2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据
|
||||
|
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(null); |
||||
|
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(null); |
||||
|
//3.新增不存在的,删除不在tableColumnMap的
|
||||
|
|
||||
|
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>(); |
||||
|
statsConfigEntityList.stream().forEach(item->{ |
||||
|
statsTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); |
||||
|
}); |
||||
|
Map<String,IcResiCategoryWarnConfigEntity> warnTableColumnMap = new HashMap<>(); |
||||
|
warnConfigEntityList.stream().forEach(item->{ |
||||
|
warnTableColumnMap.put(item.getTableName()+"-"+item.getColumnName(),item); |
||||
|
}); |
||||
|
//差集
|
||||
|
//新增
|
||||
|
List<String> newStatsList = tableColumnMap.keySet().stream().filter(item -> !statsTableColumnMap.keySet().contains(item)).collect(Collectors.toList()); |
||||
|
|
||||
|
List<IcResiCategoryStatsConfigEntity> newStatsEntityList = new ArrayList<>(); |
||||
|
newStatsList.forEach(item->{ |
||||
|
IcFormItemEntity icFormItemEntity = tableColumnMap.get(item); |
||||
|
IcResiCategoryStatsConfigEntity entity = new IcResiCategoryStatsConfigEntity(); |
||||
|
entity.setCustomerId(customerId); |
||||
|
entity.setLabel(icFormItemEntity.getLabel()); |
||||
|
entity.setTableName(idTableMap.get(icFormItemEntity.getId())); |
||||
|
entity.setColumnName(icFormItemEntity.getColumnName()); |
||||
|
entity.setManagementIcon(""); |
||||
|
entity.setDataIcon(""); |
||||
|
entity.setHouseShowIcon(""); |
||||
|
entity.setStatus("show"); |
||||
|
entity.setSort(0); |
||||
|
newStatsEntityList.add(entity); |
||||
|
}); |
||||
|
if(!CollectionUtils.isEmpty(newStatsEntityList)){ |
||||
|
icResiCategoryStatsConfigService.insertBatch(newStatsEntityList); |
||||
|
} |
||||
|
|
||||
|
List<String> delStatsEntityIdList = new ArrayList<>(); |
||||
|
List<String> delWarnEntityIdList = new ArrayList<>(); |
||||
|
//需要删除的
|
||||
|
List<String> delStatsList = statsTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList()); |
||||
|
List<String> delWarnList = warnTableColumnMap.keySet().stream().filter(item -> !tableColumnMap.keySet().contains(item)).collect(Collectors.toList()); |
||||
|
delStatsList.forEach(item->{ |
||||
|
delStatsEntityIdList.add(statsTableColumnMap.get(item).getId()); |
||||
|
}); |
||||
|
delWarnList.forEach(item->{ |
||||
|
delWarnEntityIdList.add(warnTableColumnMap.get(item).getId()); |
||||
|
}); |
||||
|
if(!CollectionUtils.isEmpty(delStatsEntityIdList)){ |
||||
|
icResiCategoryStatsConfigService.deleteBatchIds(delStatsEntityIdList); |
||||
|
} |
||||
|
if(!CollectionUtils.isEmpty(delWarnEntityIdList)){ |
||||
|
icResiCategoryWarnConfigService.deleteBatchIds(delWarnEntityIdList); |
||||
|
} |
||||
|
|
||||
|
//4.返回数据
|
||||
|
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().orderByAsc(IcResiCategoryStatsConfigEntity::getSort)); |
||||
|
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(null); |
||||
|
Map<String,IcResiCategoryWarnConfigEntity> warnMap =new HashMap<>(); |
||||
|
warnConfigList.forEach(item->{ |
||||
|
warnMap.put(item.getTableName()+"-"+item.getColumnName(),item); |
||||
|
}); |
||||
|
List<IcResiCategoryStatsConfigResultDTO> result = new ArrayList<>(); |
||||
|
statsConfigList.forEach(item->{ |
||||
|
IcResiCategoryStatsConfigResultDTO icResiCategoryStatsConfigResultDTO = new IcResiCategoryStatsConfigResultDTO(); |
||||
|
icResiCategoryStatsConfigResultDTO.setId(item.getId()); |
||||
|
icResiCategoryStatsConfigResultDTO.setLabel(item.getLabel()); |
||||
|
icResiCategoryStatsConfigResultDTO.setManagementIcon(item.getManagementIcon()); |
||||
|
icResiCategoryStatsConfigResultDTO.setDataIcon(item.getDataIcon()); |
||||
|
icResiCategoryStatsConfigResultDTO.setHouseShowIcon(item.getHouseShowIcon()); |
||||
|
icResiCategoryStatsConfigResultDTO.setStatus(item.getStatus()); |
||||
|
icResiCategoryStatsConfigResultDTO.setSort(item.getSort()); |
||||
|
IcResiCategoryWarnConfigEntity warnConfigEntity = warnMap.get(item.getTableName() + "-" + item.getColumnName()); |
||||
|
if(warnConfigEntity==null){ |
||||
|
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_NO); |
||||
|
}else{ |
||||
|
icResiCategoryStatsConfigResultDTO.setWarn(IcResiCategoryStatsConfigConstant.WARN_YES); |
||||
|
icResiCategoryStatsConfigResultDTO.setLevel1(warnConfigEntity.getLevel1()); |
||||
|
icResiCategoryStatsConfigResultDTO.setLevel2(warnConfigEntity.getLevel2()); |
||||
|
icResiCategoryStatsConfigResultDTO.setLevel3(warnConfigEntity.getLevel3()); |
||||
|
} |
||||
|
result.add(icResiCategoryStatsConfigResultDTO); |
||||
|
|
||||
|
}); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public IcResiCategoryStatsConfigResultDTO info(String id) { |
||||
|
IcResiCategoryStatsConfigResultDTO result =new IcResiCategoryStatsConfigResultDTO(); |
||||
|
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(id); |
||||
|
if(null == icResiCategoryStatsConfigDTO){ |
||||
|
return result; |
||||
|
} |
||||
|
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda() |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName())); |
||||
|
|
||||
|
// IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = Optional.ofNullable(entity).orElse(new IcResiCategoryWarnConfigEntity());
|
||||
|
result.setId(icResiCategoryStatsConfigDTO.getId()); |
||||
|
result.setLabel(icResiCategoryStatsConfigDTO.getLabel()); |
||||
|
result.setManagementIcon(icResiCategoryStatsConfigDTO.getManagementIcon()); |
||||
|
result.setDataIcon(icResiCategoryStatsConfigDTO.getDataIcon()); |
||||
|
result.setHouseShowIcon(icResiCategoryStatsConfigDTO.getHouseShowIcon()); |
||||
|
result.setStatus(icResiCategoryStatsConfigDTO.getStatus()); |
||||
|
result.setSort(icResiCategoryStatsConfigDTO.getSort()); |
||||
|
result.setWarn(null==icResiCategoryWarnConfigEntity?IcResiCategoryStatsConfigConstant.WARN_NO:IcResiCategoryStatsConfigConstant.WARN_YES); |
||||
|
if(null!=icResiCategoryWarnConfigEntity){ |
||||
|
result.setLevel1(icResiCategoryWarnConfigEntity.getLevel1()); |
||||
|
result.setLevel2(icResiCategoryWarnConfigEntity.getLevel2()); |
||||
|
result.setLevel3(icResiCategoryWarnConfigEntity.getLevel3()); |
||||
|
} |
||||
|
return result; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { |
||||
|
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(formDTO.getId()); |
||||
|
if(null == icResiCategoryStatsConfigDTO){ |
||||
|
return ; |
||||
|
} |
||||
|
//更新配置类别
|
||||
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
||||
|
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); |
||||
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
||||
|
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); |
||||
|
|
||||
|
//更新配置预警
|
||||
|
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ |
||||
|
//更新
|
||||
|
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda() |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName())); |
||||
|
if(null == icResiCategoryWarnConfigEntity){ |
||||
|
icResiCategoryWarnConfigEntity = new IcResiCategoryWarnConfigEntity(); |
||||
|
icResiCategoryWarnConfigEntity.setCustomerId(customerId); |
||||
|
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel()); |
||||
|
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName()); |
||||
|
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3()); |
||||
|
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort()); |
||||
|
icResiCategoryWarnConfigDao.insert(icResiCategoryWarnConfigEntity); |
||||
|
}else{ |
||||
|
icResiCategoryWarnConfigEntity.setCustomerId(customerId); |
||||
|
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel()); |
||||
|
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName()); |
||||
|
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel1(formDTO.getLevel1()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel2(formDTO.getLevel2()); |
||||
|
icResiCategoryWarnConfigEntity.setLevel3(formDTO.getLevel3()); |
||||
|
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort()); |
||||
|
icResiCategoryWarnConfigDao.updateById(icResiCategoryWarnConfigEntity); |
||||
|
} |
||||
|
}else if(IcResiCategoryStatsConfigConstant.WARN_NO.equals(formDTO.getWarn())){ |
||||
|
//删除
|
||||
|
icResiCategoryWarnConfigDao.delete(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda() |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getTableName,icResiCategoryStatsConfigDTO.getTableName()) |
||||
|
.eq(IcResiCategoryWarnConfigEntity::getColumnName,icResiCategoryStatsConfigDTO.getColumnName())); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void updateStatus(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { |
||||
|
//更新配置类别
|
||||
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
||||
|
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); |
||||
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
||||
|
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void updateSort(String customerId,List<IcResiCategoryStatsConfigSortFormDTO> formDTOs) { |
||||
|
List<IcResiCategoryStatsConfigEntity > entityList = new ArrayList<>(); |
||||
|
for (IcResiCategoryStatsConfigSortFormDTO formDTO : formDTOs) { |
||||
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
||||
|
icResiCategoryStatsConfigEntity.setId(formDTO.getId()); |
||||
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
||||
|
icResiCategoryStatsConfigEntity.setSort(formDTO.getSort()); |
||||
|
entityList.add(icResiCategoryStatsConfigEntity); |
||||
|
} |
||||
|
icResiCategoryStatsConfigService.updateBatchById(entityList); |
||||
|
} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcResiCategoryStatsConfigDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcResiCategoryStatsConfigEntity" id="icResiCategoryStatsConfigMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="label" column="LABEL"/> |
||||
|
<result property="tableName" column="TABLE_NAME"/> |
||||
|
<result property="columnName" column="COLUMN_NAME"/> |
||||
|
<result property="managementIcon" column="MANAGEMENT_ICON"/> |
||||
|
<result property="dataIcon" column="DATA_ICON"/> |
||||
|
<result property="houseShowIcon" column="HOUSE_SHOW_ICON"/> |
||||
|
<result property="status" column="STATUS"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcResiCategoryWarnConfigDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcResiCategoryWarnConfigEntity" id="icResiCategoryWarnConfigMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="label" column="LABEL"/> |
||||
|
<result property="tableName" column="TABLE_NAME"/> |
||||
|
<result property="columnName" column="COLUMN_NAME"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<result property="level1" column="LEVEL_1"/> |
||||
|
<result property="level2" column="LEVEL_2"/> |
||||
|
<result property="level3" column="LEVEL_3"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue