diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemTimeoutDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemTimeoutDTO.java new file mode 100644 index 000000000..45150936c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemTimeoutDTO.java @@ -0,0 +1,242 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemTimeoutController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemTimeoutController.java new file mode 100644 index 000000000..a85e52a74 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemTimeoutController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = itemTimeoutService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ItemTimeoutDTO data = itemTimeoutService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = itemTimeoutService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ItemTimeoutExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemTimeoutDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemTimeoutDao.java new file mode 100644 index 000000000..0a8102d33 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemTimeoutDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemTimeoutEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemTimeoutEntity.java new file mode 100644 index 000000000..e7a73bfad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemTimeoutEntity.java @@ -0,0 +1,211 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemTimeoutExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemTimeoutExcel.java new file mode 100644 index 000000000..4d33c23fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemTimeoutExcel.java @@ -0,0 +1,159 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemTimeoutRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemTimeoutRedis.java new file mode 100644 index 000000000..5c4e5f22c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/redis/ItemTimeoutRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemTimeoutService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemTimeoutService.java new file mode 100644 index 000000000..a7952d704 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemTimeoutService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-15 + */ + List list(Map 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); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemTimeoutServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemTimeoutServiceImpl.java new file mode 100644 index 000000000..d916b7619 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemTimeoutServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements ItemTimeoutService { + + @Autowired + private ItemTimeoutRedis itemTimeoutRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ItemTimeoutDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ItemTimeoutDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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)); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemTimeoutDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemTimeoutDao.xml new file mode 100644 index 000000000..66bdf7859 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemTimeoutDao.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +