9 changed files with 1036 additions and 0 deletions
@ -0,0 +1,242 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.dto.item; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Data |
|||
public class ItemTimeoutDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 统计年月 |
|||
*/ |
|||
private String totalYearMonth; |
|||
|
|||
/** |
|||
* 项目ID |
|||
*/ |
|||
private String itemId; |
|||
|
|||
/** |
|||
* 项目创建时间 |
|||
*/ |
|||
private Date itemCreatedTime; |
|||
|
|||
/** |
|||
* 事件ID |
|||
*/ |
|||
private String eventId; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String userFace; |
|||
|
|||
/** |
|||
* 党员标识 0:否,1:是 |
|||
*/ |
|||
private Integer isPartyMember; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 项目内容 |
|||
*/ |
|||
private String itemContent; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date distributeTime; |
|||
|
|||
/** |
|||
* 网格 |
|||
*/ |
|||
private String grid; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private Long gridId; |
|||
|
|||
/** |
|||
* 议题位置地址 |
|||
*/ |
|||
private String issueAddress; |
|||
|
|||
/** |
|||
* 议题位置纬度 |
|||
*/ |
|||
private BigDecimal issueLatitude; |
|||
|
|||
/** |
|||
* 议题位置经度 |
|||
*/ |
|||
private BigDecimal issueLongitude; |
|||
|
|||
/** |
|||
* 满意度评价得分(0-不满意,1-基本满意,2-非常满意) |
|||
*/ |
|||
private Integer evaluationScore; |
|||
|
|||
/** |
|||
* 满意度评价内容 |
|||
*/ |
|||
private String evaluationContent; |
|||
|
|||
/** |
|||
* 满意度评价时间 |
|||
*/ |
|||
private Date evaluationTime; |
|||
|
|||
/** |
|||
* 项目状态 0-处理中,5-已关闭,10-已结案 |
|||
*/ |
|||
private Integer itemState; |
|||
|
|||
/** |
|||
* 最近一次处理时间 |
|||
*/ |
|||
private Date lastHandleTime; |
|||
|
|||
/** |
|||
* 项目编号 |
|||
*/ |
|||
private String itemCode; |
|||
|
|||
/** |
|||
* 社群ID |
|||
*/ |
|||
private String groupId; |
|||
|
|||
/** |
|||
* 社群名称 |
|||
*/ |
|||
private String groupName; |
|||
|
|||
/** |
|||
* 话题ID |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptIds; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptNames; |
|||
|
|||
/** |
|||
* 所有部门ID |
|||
*/ |
|||
private String allDeptIds; |
|||
|
|||
/** |
|||
* 所有部门名称 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 一级分类编码 |
|||
*/ |
|||
private String firstCategoryCode; |
|||
|
|||
/** |
|||
* 分类全称 |
|||
*/ |
|||
private String categoryFullName; |
|||
|
|||
/** |
|||
* 所有分类ID |
|||
*/ |
|||
private String categoryFullIds; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -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.elink.esua.epdc.modules.item.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.dto.item.ItemTimeoutDTO; |
|||
import com.elink.esua.epdc.modules.item.excel.ItemTimeoutExcel; |
|||
import com.elink.esua.epdc.modules.item.service.ItemTimeoutService; |
|||
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 qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("itemtimeout") |
|||
public class ItemTimeoutController { |
|||
|
|||
@Autowired |
|||
private ItemTimeoutService itemTimeoutService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ItemTimeoutDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ItemTimeoutDTO> page = itemTimeoutService.page(params); |
|||
return new Result<PageData<ItemTimeoutDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ItemTimeoutDTO> get(@PathVariable("id") String id){ |
|||
ItemTimeoutDTO data = itemTimeoutService.get(id); |
|||
return new Result<ItemTimeoutDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ItemTimeoutDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
itemTimeoutService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ItemTimeoutDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
itemTimeoutService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
itemTimeoutService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<ItemTimeoutDTO> list = itemTimeoutService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, ItemTimeoutExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -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.elink.esua.epdc.modules.item.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemTimeoutEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Mapper |
|||
public interface ItemTimeoutDao extends BaseDao<ItemTimeoutEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,211 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.item.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_item_timeout") |
|||
public class ItemTimeoutEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 统计年月 |
|||
*/ |
|||
private String totalYearMonth; |
|||
|
|||
/** |
|||
* 项目ID |
|||
*/ |
|||
private String itemId; |
|||
|
|||
/** |
|||
* 项目创建时间 |
|||
*/ |
|||
private Date itemCreatedTime; |
|||
|
|||
/** |
|||
* 事件ID |
|||
*/ |
|||
private String eventId; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String userFace; |
|||
|
|||
/** |
|||
* 党员标识 0:否,1:是 |
|||
*/ |
|||
private Integer isPartyMember; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 项目内容 |
|||
*/ |
|||
private String itemContent; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date distributeTime; |
|||
|
|||
/** |
|||
* 网格 |
|||
*/ |
|||
private String grid; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private Long gridId; |
|||
|
|||
/** |
|||
* 议题位置地址 |
|||
*/ |
|||
private String issueAddress; |
|||
|
|||
/** |
|||
* 议题位置纬度 |
|||
*/ |
|||
private BigDecimal issueLatitude; |
|||
|
|||
/** |
|||
* 议题位置经度 |
|||
*/ |
|||
private BigDecimal issueLongitude; |
|||
|
|||
/** |
|||
* 满意度评价得分(0-不满意,1-基本满意,2-非常满意) |
|||
*/ |
|||
private Integer evaluationScore; |
|||
|
|||
/** |
|||
* 满意度评价内容 |
|||
*/ |
|||
private String evaluationContent; |
|||
|
|||
/** |
|||
* 满意度评价时间 |
|||
*/ |
|||
private Date evaluationTime; |
|||
|
|||
/** |
|||
* 项目状态 0-处理中,5-已关闭,10-已结案 |
|||
*/ |
|||
private Integer itemState; |
|||
|
|||
/** |
|||
* 最近一次处理时间 |
|||
*/ |
|||
private Date lastHandleTime; |
|||
|
|||
/** |
|||
* 项目编号 |
|||
*/ |
|||
private String itemCode; |
|||
|
|||
/** |
|||
* 社群ID |
|||
*/ |
|||
private String groupId; |
|||
|
|||
/** |
|||
* 社群名称 |
|||
*/ |
|||
private String groupName; |
|||
|
|||
/** |
|||
* 话题ID |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptIds; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptNames; |
|||
|
|||
/** |
|||
* 所有部门ID |
|||
*/ |
|||
private String allDeptIds; |
|||
|
|||
/** |
|||
* 所有部门名称 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 一级分类编码 |
|||
*/ |
|||
private String firstCategoryCode; |
|||
|
|||
/** |
|||
* 分类全称 |
|||
*/ |
|||
private String categoryFullName; |
|||
|
|||
/** |
|||
* 所有分类ID |
|||
*/ |
|||
private String categoryFullIds; |
|||
|
|||
} |
|||
@ -0,0 +1,159 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.item.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Data |
|||
public class ItemTimeoutExcel { |
|||
|
|||
@Excel(name = "ID") |
|||
private String id; |
|||
|
|||
@Excel(name = "统计年月") |
|||
private String totalYearMonth; |
|||
|
|||
@Excel(name = "项目ID") |
|||
private String itemId; |
|||
|
|||
@Excel(name = "项目创建时间") |
|||
private Date itemCreatedTime; |
|||
|
|||
@Excel(name = "事件ID") |
|||
private String eventId; |
|||
|
|||
@Excel(name = "议题ID") |
|||
private String issueId; |
|||
|
|||
@Excel(name = "用户ID") |
|||
private String userId; |
|||
|
|||
@Excel(name = "用户昵称") |
|||
private String nickName; |
|||
|
|||
@Excel(name = "用户头像") |
|||
private String userFace; |
|||
|
|||
@Excel(name = "党员标识 0:否,1:是") |
|||
private Integer isPartyMember; |
|||
|
|||
@Excel(name = "手机号") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "项目内容") |
|||
private String itemContent; |
|||
|
|||
@Excel(name = "发布时间") |
|||
private Date distributeTime; |
|||
|
|||
@Excel(name = "网格") |
|||
private String grid; |
|||
|
|||
@Excel(name = "网格ID") |
|||
private Long gridId; |
|||
|
|||
@Excel(name = "议题位置地址") |
|||
private String issueAddress; |
|||
|
|||
@Excel(name = "议题位置纬度") |
|||
private BigDecimal issueLatitude; |
|||
|
|||
@Excel(name = "议题位置经度") |
|||
private BigDecimal issueLongitude; |
|||
|
|||
@Excel(name = "满意度评价得分(0-不满意,1-基本满意,2-非常满意)") |
|||
private Integer evaluationScore; |
|||
|
|||
@Excel(name = "满意度评价内容") |
|||
private String evaluationContent; |
|||
|
|||
@Excel(name = "满意度评价时间") |
|||
private Date evaluationTime; |
|||
|
|||
@Excel(name = "项目状态 0-处理中,5-已关闭,10-已结案") |
|||
private Integer itemState; |
|||
|
|||
@Excel(name = "最近一次处理时间") |
|||
private Date lastHandleTime; |
|||
|
|||
@Excel(name = "项目编号") |
|||
private String itemCode; |
|||
|
|||
@Excel(name = "社群ID") |
|||
private String groupId; |
|||
|
|||
@Excel(name = "社群名称") |
|||
private String groupName; |
|||
|
|||
@Excel(name = "话题ID") |
|||
private String topicId; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptIds; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptNames; |
|||
|
|||
@Excel(name = "所有部门ID") |
|||
private String allDeptIds; |
|||
|
|||
@Excel(name = "所有部门名称") |
|||
private String allDeptNames; |
|||
|
|||
@Excel(name = "分类编码") |
|||
private String categoryCode; |
|||
|
|||
@Excel(name = "一级分类编码") |
|||
private String firstCategoryCode; |
|||
|
|||
@Excel(name = "分类全称") |
|||
private String categoryFullName; |
|||
|
|||
@Excel(name = "所有分类ID") |
|||
private String categoryFullIds; |
|||
|
|||
@Excel(name = "删除标识 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date 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.elink.esua.epdc.modules.item.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Component |
|||
public class ItemTimeoutRedis { |
|||
@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.elink.esua.epdc.modules.item.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.item.ItemTimeoutDTO; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemTimeoutEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 项目表 项目表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
public interface ItemTimeoutService extends BaseService<ItemTimeoutEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ItemTimeoutDTO> |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
PageData<ItemTimeoutDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ItemTimeoutDTO> |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
List<ItemTimeoutDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ItemTimeoutDTO |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
ItemTimeoutDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
void save(ItemTimeoutDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
void update(ItemTimeoutDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-15 |
|||
*/ |
|||
void delete(String[] 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.elink.esua.epdc.modules.item.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.dto.item.ItemTimeoutDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemTimeoutDao; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemTimeoutEntity; |
|||
import com.elink.esua.epdc.modules.item.redis.ItemTimeoutRedis; |
|||
import com.elink.esua.epdc.modules.item.service.ItemTimeoutService; |
|||
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 qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-15 |
|||
*/ |
|||
@Service |
|||
public class ItemTimeoutServiceImpl extends BaseServiceImpl<ItemTimeoutDao, ItemTimeoutEntity> implements ItemTimeoutService { |
|||
|
|||
@Autowired |
|||
private ItemTimeoutRedis itemTimeoutRedis; |
|||
|
|||
@Override |
|||
public PageData<ItemTimeoutDTO> page(Map<String, Object> params) { |
|||
IPage<ItemTimeoutEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ItemTimeoutDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ItemTimeoutDTO> list(Map<String, Object> params) { |
|||
List<ItemTimeoutEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ItemTimeoutDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ItemTimeoutEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ItemTimeoutEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ItemTimeoutDTO get(String id) { |
|||
ItemTimeoutEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ItemTimeoutDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ItemTimeoutDTO dto) { |
|||
ItemTimeoutEntity entity = ConvertUtils.sourceToTarget(dto, ItemTimeoutEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ItemTimeoutDTO dto) { |
|||
ItemTimeoutEntity entity = ConvertUtils.sourceToTarget(dto, ItemTimeoutEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
<?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.elink.esua.epdc.modules.item.dao.ItemTimeoutDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.item.entity.ItemTimeoutEntity" id="itemTimeoutMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="totalYearMonth" column="TOTAL_YEAR_MONTH"/> |
|||
<result property="itemId" column="ITEM_ID"/> |
|||
<result property="itemCreatedTime" column="ITEM_CREATED_TIME"/> |
|||
<result property="eventId" column="EVENT_ID"/> |
|||
<result property="issueId" column="ISSUE_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="nickName" column="NICK_NAME"/> |
|||
<result property="userFace" column="USER_FACE"/> |
|||
<result property="isPartyMember" column="IS_PARTY_MEMBER"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="itemContent" column="ITEM_CONTENT"/> |
|||
<result property="distributeTime" column="DISTRIBUTE_TIME"/> |
|||
<result property="grid" column="GRID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="issueAddress" column="ISSUE_ADDRESS"/> |
|||
<result property="issueLatitude" column="ISSUE_LATITUDE"/> |
|||
<result property="issueLongitude" column="ISSUE_LONGITUDE"/> |
|||
<result property="evaluationScore" column="EVALUATION_SCORE"/> |
|||
<result property="evaluationContent" column="EVALUATION_CONTENT"/> |
|||
<result property="evaluationTime" column="EVALUATION_TIME"/> |
|||
<result property="itemState" column="ITEM_STATE"/> |
|||
<result property="lastHandleTime" column="LAST_HANDLE_TIME"/> |
|||
<result property="itemCode" column="ITEM_CODE"/> |
|||
<result property="groupId" column="GROUP_ID"/> |
|||
<result property="groupName" column="GROUP_NAME"/> |
|||
<result property="topicId" column="TOPIC_ID"/> |
|||
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
|||
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
|||
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
|||
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="firstCategoryCode" column="FIRST_CATEGORY_CODE"/> |
|||
<result property="categoryFullName" column="CATEGORY_FULL_NAME"/> |
|||
<result property="categoryFullIds" column="CATEGORY_FULL_IDS"/> |
|||
<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