17 changed files with 576 additions and 5 deletions
@ -0,0 +1,23 @@ |
|||
package com.elink.esua.epdc.constant; |
|||
|
|||
/** |
|||
* 项目消息用常量 |
|||
* @Author Lpf |
|||
* @Date 2019/11/20 17:07 |
|||
*/ |
|||
public interface ItemInformationConstant { |
|||
/** |
|||
* 消息类型 0-项目 |
|||
*/ |
|||
int INFORMATION_TYPE_ITEM = 0; |
|||
/** |
|||
* 是否已读 1-是 |
|||
*/ |
|||
String READ_FLAG_YES = "1"; |
|||
/** |
|||
* 是否已读 0-否 |
|||
*/ |
|||
String READ_FLAG_NO = "0"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.elink.esua.epdc.dto.item.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.Min; |
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Author LC |
|||
* @Date 2019/9/9 16:24 |
|||
*/ |
|||
@Data |
|||
public class ItemInformationFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3034807666143092535L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
@NotNull(message = "用户网格ID不能为空") |
|||
private Long deptId; |
|||
/** |
|||
* 页码,从1开始 |
|||
*/ |
|||
@Min(value = 1, message = "页码必须大于0") |
|||
private int pageIndex; |
|||
/** |
|||
* 页容量,默认20页 |
|||
*/ |
|||
@Min(value = 1, message = "每页条数必须大于必须大于0") |
|||
private int pageSize = 20; |
|||
/** |
|||
* 第一页查询发起时的时间 |
|||
*/ |
|||
@NotBlank(message = "时间戳不能为空") |
|||
private String timestamp; |
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.elink.esua.epdc.dto.item.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目消息列表DTO |
|||
* @Author LC |
|||
* @Date 2019/9/9 16:25 |
|||
*/ |
|||
@Data |
|||
public class ItemInformationResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -2494874960456321677L; |
|||
|
|||
|
|||
/** |
|||
* 消息类型 0-项目 |
|||
*/ |
|||
private Integer type; |
|||
|
|||
/** |
|||
* 处理意见(内部) |
|||
*/ |
|||
private String handleAdvice; |
|||
|
|||
/** |
|||
* 消息所属业务类型 0 -回应,1 -吹哨,5 -关闭,10- 结案 |
|||
*/ |
|||
private Integer businessType; |
|||
|
|||
/** |
|||
* 消息所属业务ID(查看详情用) |
|||
*/ |
|||
private String associatedBusinessId; |
|||
|
|||
/** |
|||
* 消息关联业务内容(议题的评论,评论的回复等) |
|||
*/ |
|||
private String associatedBusinessContent; |
|||
|
|||
/** |
|||
* 处理部门 |
|||
*/ |
|||
private String handleDept; |
|||
|
|||
/** |
|||
* 被吹哨部门(多个以逗号分隔) |
|||
*/ |
|||
private String whistleDept; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private String createdTime; |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
/** |
|||
* 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.dto.item.form.ItemFormDTO; |
|||
import com.elink.esua.epdc.dto.item.form.ItemInformationFormDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemInformationResultDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemHandleProcessEntity; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemInformationEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目消息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-06 |
|||
*/ |
|||
@Mapper |
|||
public interface ItemInformationDao extends BaseDao<ItemInformationEntity> { |
|||
/** |
|||
* 移动端-项目消息列表 |
|||
* @Params: [formDto] |
|||
* @Return: java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO> |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/9 16:50 |
|||
*/ |
|||
List<ItemInformationResultDTO> selectNoticeListOfItems(ItemInformationFormDTO formDto); |
|||
|
|||
/** |
|||
* 修改消息已读标识 |
|||
* |
|||
* @Params: [formDto] |
|||
* @return: int |
|||
* @author: lipengfei |
|||
* @date: 2019/11/21 15:59 |
|||
*/ |
|||
int updateInformationReadFlag(ItemInformationFormDTO formDto); |
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
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 javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 项目消息Form DTO |
|||
* @Author Lpf |
|||
* @Date 2019/11/20 19:01 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_item_information") |
|||
public class ItemInformationEntity extends BaseEpdcEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 消息类型 0-项目 |
|||
*/ |
|||
private Integer type; |
|||
|
|||
/** |
|||
* 处理意见(内部) |
|||
*/ |
|||
private String handleAdvice; |
|||
|
|||
/** |
|||
* 消息所属业务类型 0 -回应,1 -吹哨,5 -关闭,10- 结案 |
|||
*/ |
|||
private Integer businessType; |
|||
|
|||
/** |
|||
* 消息所属业务ID(查看详情用) |
|||
*/ |
|||
private String associatedBusinessId; |
|||
|
|||
/** |
|||
* 消息关联业务内容(议题的评论,评论的回复等) |
|||
*/ |
|||
private String associatedBusinessContent; |
|||
|
|||
/** |
|||
* 处理部门ID |
|||
*/ |
|||
private Long handleDeptId; |
|||
/** |
|||
* 处理部门 |
|||
*/ |
|||
private String handleDept; |
|||
|
|||
/** |
|||
* 被吹哨部门(多个以逗号分隔) |
|||
*/ |
|||
private String whistleDept; |
|||
|
|||
/** |
|||
* 被吹哨部门(多个以逗号分隔) |
|||
*/ |
|||
private String readFlag; |
|||
|
|||
} |
@ -0,0 +1,55 @@ |
|||
/** |
|||
* 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.utils.Result; |
|||
import com.elink.esua.epdc.dto.item.form.ItemInformationFormDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemInformationResultDTO; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemHandleProcessEntity; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemInformationEntity; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目消息 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-06 |
|||
*/ |
|||
public interface ItemInformationService extends BaseService<ItemInformationEntity> { |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author |
|||
* @date |
|||
*/ |
|||
void delete(String[] ids); |
|||
/** |
|||
* 项目消息列表--移动app端用 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:46 |
|||
*/ |
|||
Result<List<ItemInformationResultDTO>> notice(ItemInformationFormDTO formDto); |
|||
} |
@ -0,0 +1,75 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.constant.EventIssueItemState; |
|||
import com.elink.esua.epdc.dto.item.form.ItemFormDTO; |
|||
import com.elink.esua.epdc.dto.item.form.ItemInformationFormDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemInformationResultDTO; |
|||
import com.elink.esua.epdc.dto.item.result.ItemResultDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemHandleProcessDao; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemInformationDao; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemHandleProcessEntity; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemInformationEntity; |
|||
import com.elink.esua.epdc.modules.item.service.ItemHandleProcessService; |
|||
import com.elink.esua.epdc.modules.item.service.ItemInformationService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目消息 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-06 |
|||
*/ |
|||
@Service |
|||
public class ItemInformationServiceImpl extends BaseServiceImpl<ItemInformationDao, ItemInformationEntity> implements ItemInformationService { |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
/** |
|||
* 项目列表-移动app端用 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/10/19 16:47 |
|||
*/ |
|||
@Override |
|||
public Result<List<ItemInformationResultDTO>> notice(ItemInformationFormDTO formDto){ |
|||
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); |
|||
formDto.setPageIndex(pageIndex); |
|||
// 更新已读标识
|
|||
baseDao.updateInformationReadFlag(formDto); |
|||
// 查询项目消息列表
|
|||
List<ItemInformationResultDTO> data = baseDao.selectNoticeListOfItems(formDto); |
|||
return new Result<List<ItemInformationResultDTO>>().ok(data); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
<?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.ItemInformationDao"> |
|||
|
|||
<resultMap id="itemsInformationMap" type="com.elink.esua.epdc.dto.item.result.ItemInformationResultDTO"> |
|||
<result property="type" column="TYPE"/> |
|||
<result property="businessType" column="BUSINESS_TYPE"/> |
|||
<result property="handleDept" column="HANDLE_DEPT"/> |
|||
<result property="handleAdvice" column="HANDLE_ADVICE"/> |
|||
<result property="whistleDept" column="WHISTLE_DEPT"/> |
|||
<result property="associatedBusinessId" column="ASSOCIATED_BUSINESS_ID"/> |
|||
<result property="associatedBusinessContent" column="ASSOCIATED_BUSINESS_CONTENT"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
</resultMap> |
|||
<select id="selectNoticeListOfItems" resultMap="itemsInformationMap"> |
|||
SELECT |
|||
TYPE, |
|||
BUSINESS_TYPE, |
|||
ASSOCIATED_BUSINESS_ID, |
|||
ASSOCIATED_BUSINESS_CONTENT, |
|||
HANDLE_DEPT, |
|||
HANDLE_ADVICE, |
|||
WHISTLE_DEPT, |
|||
CREATED_TIME |
|||
FROM |
|||
epdc_item_information information |
|||
|
|||
WHERE |
|||
information.DEL_FLAG = '0' |
|||
AND information.READ_FLAG = '1' |
|||
AND information.DEPT_ID = #{deptId} |
|||
<if test="timestamp != null"> |
|||
<![CDATA[ AND DATE_FORMAT(information.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp} |
|||
</if> |
|||
ORDER BY |
|||
information.CREATED_TIME DESC |
|||
LIMIT #{pageIndex},#{pageSize} |
|||
</select> |
|||
<update id="updateInformationReadFlag"> |
|||
UPDATE epdc_item_information SET READ_FLAG = '1' WHERE DEPT_ID = #{deptId} AND DEL_FLAG = '0' |
|||
</update> |
|||
</mapper> |
Loading…
Reference in new issue