Commit 2d9352bf by 陶光胜

通知详情修改

parent c49191a1
......@@ -157,4 +157,5 @@ public interface PushMessageApiService {
* @return
*/
ServiceResponse<Integer> readMessage(Integer messageId);
}
......@@ -66,7 +66,7 @@ public interface TabPushMessageMapper {
@Param("status") Integer status,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime,
@Param("pushClassifyId") Integer pushClassifyId,
@Param("classify") String classify,
@Param("userId") Integer userId);
int readCount(@Param("messageId") Integer messageId);
......
......@@ -16,4 +16,6 @@ public interface PushTypeService {
TabPushClassify getById(Integer id);
List<TabPushClassify> listPushTypeByName(String name);
boolean saveClassify(String classify);
}
......@@ -2,8 +2,10 @@ package com.gic.enterprise.service.impl;
import com.gic.enterprise.dao.mapper.TabPushMessageMapper;
import com.gic.enterprise.dto.UserMessageDTO;
import com.gic.enterprise.entity.TabPushClassify;
import com.gic.enterprise.entity.TabPushMessage;
import com.gic.enterprise.service.PushMessageService;
import com.gic.enterprise.service.PushTypeService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -14,6 +16,8 @@ import java.util.Date;
public class PushMessageServiceImpl implements PushMessageService {
@Autowired
private TabPushMessageMapper tabPushMessageMapper;
@Autowired
private PushTypeService pushTypeService;
@Override
public int savePushMesasge(TabPushMessage tabPushMessage) {
......@@ -46,7 +50,8 @@ public class PushMessageServiceImpl implements PushMessageService {
@Override
public Page<UserMessageDTO> pageUserMessage(String search, Integer status, Date startTime, Date endTime,
Integer pushClassifyId, Integer userId) {
return this.tabPushMessageMapper.pageUserMessage(search, status, startTime, endTime, pushClassifyId, userId);
TabPushClassify byId = this.pushTypeService.getById(pushClassifyId);
return this.tabPushMessageMapper.pageUserMessage(search, status, startTime, endTime, byId.getClassifyName(), userId);
}
@Override
......
......@@ -4,6 +4,7 @@ import com.gic.enterprise.dao.mapper.TabPushClassifyMapper;
import com.gic.enterprise.entity.TabPushClassify;
import com.gic.enterprise.service.PushTypeService;
import com.github.pagehelper.Page;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -47,4 +48,18 @@ public class PushTypeServiceImpl implements PushTypeService {
public List<TabPushClassify> listPushTypeByName(String name) {
return this.tabPushClassifyMapper.listPushTypeByName(name);
}
@Override
public boolean saveClassify(String classify) {
List<TabPushClassify> list = this.listPushTypeByName(classify);
if(CollectionUtils.isNotEmpty(list)){
return true;
}else {
TabPushClassify tabPushType = new TabPushClassify();
tabPushType.setClassifyName(classify);
tabPushType.setClassifyDesc(classify);
this.savePushType(tabPushType);
}
return false;
}
}
......@@ -176,6 +176,7 @@ public class PushMessageApiServiceImpl implements PushMessageApiService {
if(enterpriseId == null || userId == null || StringUtils.isBlank(title) || StringUtils.isBlank(content)){
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getErrorMsg());
}
this.pushTypeService.saveClassify(classify);
int i = this.pushUserMessageService.save(enterpriseId, userId, null, classify, title, content);
if(i > 0){
return ServiceResponse.success(i);
......
......@@ -276,8 +276,8 @@
<if test="endTime != null">
and (t1.create_time &lt;= #{endTime})
</if>
<if test="pushClassifyId != null">
and t3.push_classify_id = #{pushClassifyId}
<if test="classify != null and classify !=''">
and t1.classify = #{classify}
</if>
order by t1.status asc,t1.create_time desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment