Authored by csgyoho

消息盒子-跳转规则

... ... @@ -12,6 +12,7 @@
<result column="is_del" property="isDel" jdbcType="CHAR"/>
<result column="content" property="content" jdbcType="LONGVARCHAR"/>
<result column="business_type" property="businessType" jdbcType="INTEGER" />
<result column="action" property="action" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="TypeCountInboxMap" type="com.yohoufo.dal.user.model.TypeCountInbox">
<result column="type" property="type" jdbcType="INTEGER"/>
... ... @@ -19,13 +20,13 @@
</resultMap>
<sql id="Base_Column_List">
id, uid, title, type, is_read, create_time, read_time, is_del,content,business_type
id, uid, title, type, is_read, create_time, read_time, is_del,content,business_type,action
</sql>
<insert id="insertInbox">
INSERT INTO ${tableName} (uid,title,content,type,is_read,create_time,is_del, business_type)
INSERT INTO ${tableName} (uid,title,content,type,is_read,create_time,is_del, business_type,action)
values
(#{inBox.uid},#{inBox.title},#{inBox.content},#{inBox.type},#{inBox.isRead},
#{inBox.createTime},#{inBox.isDel},#{inBox.businessType})
#{inBox.createTime},#{inBox.isDel},#{inBox.businessType}),#{inBox.action}
</insert>
<update id="updateReadedByUidAndType">
update ${tableName} set is_read='Y', read_time=#{readTime} where uid = ${uid} and is_read='N'
... ...
... ... @@ -149,14 +149,6 @@ public class InBoxServiceImpl implements IInBoxService {
}
List<InBox> inBoxes = inBoxDao.selectInboxs(getTableName(reqVO.getUid()),reqVO.getType(),
reqVO.getUid(),reqVO.getRowNo(),reqVO.getLimit());
if(!CollectionUtils.isEmpty(inBoxes)){
for(InBox inBox : inBoxes){
InboxBusinessTypeEnum typeEnum = InboxBusinessTypeEnum.getByTypeAndBusinessType(inBox.getType(),inBox.getBusinessType());
if(typeEnum != null){
inBox.setAction(typeEnum.getAction());
}
}
}
response.setList(inBoxes);
response.setPage(reqVO.getPage());
response.setSize(reqVO.getLimit());
... ... @@ -218,11 +210,21 @@ public class InBoxServiceImpl implements IInBoxService {
inBox.setCreateTime(DateUtil.getCurrentTimeSecond());
inBox.setContent(createContent(businessTypeEnum.getContent(),params));
inBox.setBusinessType(businessType);
//处理附加业务
dealAddition(inBox,params);
inBoxDao.insertInbox(getTableName(inBox.getUid()),inBox);
//清空redis缓存
deleteIboxsByRedis(uid,type);
}
private void dealAddition(InBox inBox,String params) {
if(InboxBusinessTypeEnum.NOTICE_PROBLEM_ORDER.getBusinessType().equals(inBox.getBusinessType())){
//瑕疵订单确认-跳转规则处理
inBox.setAction(createContent(InboxBusinessTypeEnum.NOTICE_PROBLEM_ORDER.getAction(),params));
return;
}
}
@Override
public JSONObject getTotalUnread(int uid) {
JSONObject result = new JSONObject();
... ...