bug修复
This commit is contained in:
parent
8c99faacf5
commit
56b19822b3
@ -130,4 +130,17 @@ public class XzNoticeController {
|
|||||||
xzNoticeService.markRead(paramMap);
|
xzNoticeService.markRead(paramMap);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "ids", value = "星纵-消息中心IDs(选择的消息删除)", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "accountId", value = "推送到的账号ID(此账号下所有消息删除)", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/batchDelete")
|
||||||
|
public Result batchDelete(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
|
xzNoticeService.batchDelete(paramMap);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,6 @@ import java.util.HashMap;
|
|||||||
public interface XzNoticeMapper extends BaseMapper<XzNotice> {
|
public interface XzNoticeMapper extends BaseMapper<XzNotice> {
|
||||||
|
|
||||||
Boolean markRead(HashMap<String, Object> paramMap);
|
Boolean markRead(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
void batchDelete(HashMap<String, Object> paramMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,16 +3,28 @@
|
|||||||
<mapper namespace="com.zhgd.xmgl.modules.xz.mapper.XzNoticeMapper">
|
<mapper namespace="com.zhgd.xmgl.modules.xz.mapper.XzNoticeMapper">
|
||||||
<select id="markRead" resultType="java.lang.Boolean">
|
<select id="markRead" resultType="java.lang.Boolean">
|
||||||
update xz_notice
|
update xz_notice
|
||||||
set isRead = 1
|
set is_read = 1
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
<if test="accountId != null and accountId != ''">
|
<if test="accountId != null and accountId != ''">
|
||||||
and account_id = #{accountId}
|
and account_id = #{accountId}
|
||||||
</if>
|
</if>
|
||||||
<if test="ids != null and ids != ''">
|
<if test="idList != null and idList != ''">
|
||||||
and id in
|
and id in
|
||||||
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="batchDelete">
|
||||||
|
delete from xz_notice
|
||||||
|
where 1=1
|
||||||
|
and account_id = #{accountId}
|
||||||
|
<if test="idList != null and idList != ''">
|
||||||
|
and id in
|
||||||
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -26,4 +26,6 @@ public interface IXzNoticeService extends IService<XzNotice> {
|
|||||||
void delete(String id);
|
void delete(String id);
|
||||||
|
|
||||||
void markRead(HashMap<String, Object> paramMap);
|
void markRead(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
void batchDelete(HashMap<String, Object> paramMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -81,9 +82,22 @@ public class XzNoticeServiceImpl extends ServiceImpl<XzNoticeMapper, XzNotice> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markRead(HashMap<String, Object> paramMap) {
|
public void markRead(HashMap<String, Object> paramMap) {
|
||||||
|
String ids = MapUtils.getString(paramMap, "ids");
|
||||||
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
|
paramMap.put("idList", Arrays.asList(StringUtils.split(ids, ",")));
|
||||||
|
}
|
||||||
baseMapper.markRead(paramMap);
|
baseMapper.markRead(paramMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchDelete(HashMap<String, Object> paramMap) {
|
||||||
|
String ids = MapUtils.getString(paramMap, "ids");
|
||||||
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
|
paramMap.put("idList", Arrays.asList(StringUtils.split(ids, ",")));
|
||||||
|
}
|
||||||
|
baseMapper.batchDelete(paramMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user