Authored by csgyoho

消息盒子-跳转规则

@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <result column="is_del" property="isDel" jdbcType="CHAR"/> 12 <result column="is_del" property="isDel" jdbcType="CHAR"/>
13 <result column="content" property="content" jdbcType="LONGVARCHAR"/> 13 <result column="content" property="content" jdbcType="LONGVARCHAR"/>
14 <result column="business_type" property="businessType" jdbcType="INTEGER" /> 14 <result column="business_type" property="businessType" jdbcType="INTEGER" />
  15 + <result column="action" property="action" jdbcType="VARCHAR" />
15 </resultMap> 16 </resultMap>
16 <resultMap id="TypeCountInboxMap" type="com.yohoufo.dal.user.model.TypeCountInbox"> 17 <resultMap id="TypeCountInboxMap" type="com.yohoufo.dal.user.model.TypeCountInbox">
17 <result column="type" property="type" jdbcType="INTEGER"/> 18 <result column="type" property="type" jdbcType="INTEGER"/>
@@ -19,13 +20,13 @@ @@ -19,13 +20,13 @@
19 </resultMap> 20 </resultMap>
20 21
21 <sql id="Base_Column_List"> 22 <sql id="Base_Column_List">
22 - id, uid, title, type, is_read, create_time, read_time, is_del,content,business_type 23 + id, uid, title, type, is_read, create_time, read_time, is_del,content,business_type,action
23 </sql> 24 </sql>
24 <insert id="insertInbox"> 25 <insert id="insertInbox">
25 - INSERT INTO ${tableName} (uid,title,content,type,is_read,create_time,is_del, business_type) 26 + INSERT INTO ${tableName} (uid,title,content,type,is_read,create_time,is_del, business_type,action)
26 values 27 values
27 (#{inBox.uid},#{inBox.title},#{inBox.content},#{inBox.type},#{inBox.isRead}, 28 (#{inBox.uid},#{inBox.title},#{inBox.content},#{inBox.type},#{inBox.isRead},
28 - #{inBox.createTime},#{inBox.isDel},#{inBox.businessType}) 29 + #{inBox.createTime},#{inBox.isDel},#{inBox.businessType}),#{inBox.action}
29 </insert> 30 </insert>
30 <update id="updateReadedByUidAndType"> 31 <update id="updateReadedByUidAndType">
31 update ${tableName} set is_read='Y', read_time=#{readTime} where uid = ${uid} and is_read='N' 32 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 { @@ -149,14 +149,6 @@ public class InBoxServiceImpl implements IInBoxService {
149 } 149 }
150 List<InBox> inBoxes = inBoxDao.selectInboxs(getTableName(reqVO.getUid()),reqVO.getType(), 150 List<InBox> inBoxes = inBoxDao.selectInboxs(getTableName(reqVO.getUid()),reqVO.getType(),
151 reqVO.getUid(),reqVO.getRowNo(),reqVO.getLimit()); 151 reqVO.getUid(),reqVO.getRowNo(),reqVO.getLimit());
152 - if(!CollectionUtils.isEmpty(inBoxes)){  
153 - for(InBox inBox : inBoxes){  
154 - InboxBusinessTypeEnum typeEnum = InboxBusinessTypeEnum.getByTypeAndBusinessType(inBox.getType(),inBox.getBusinessType());  
155 - if(typeEnum != null){  
156 - inBox.setAction(typeEnum.getAction());  
157 - }  
158 - }  
159 - }  
160 response.setList(inBoxes); 152 response.setList(inBoxes);
161 response.setPage(reqVO.getPage()); 153 response.setPage(reqVO.getPage());
162 response.setSize(reqVO.getLimit()); 154 response.setSize(reqVO.getLimit());
@@ -218,11 +210,21 @@ public class InBoxServiceImpl implements IInBoxService { @@ -218,11 +210,21 @@ public class InBoxServiceImpl implements IInBoxService {
218 inBox.setCreateTime(DateUtil.getCurrentTimeSecond()); 210 inBox.setCreateTime(DateUtil.getCurrentTimeSecond());
219 inBox.setContent(createContent(businessTypeEnum.getContent(),params)); 211 inBox.setContent(createContent(businessTypeEnum.getContent(),params));
220 inBox.setBusinessType(businessType); 212 inBox.setBusinessType(businessType);
  213 + //处理附加业务
  214 + dealAddition(inBox,params);
221 inBoxDao.insertInbox(getTableName(inBox.getUid()),inBox); 215 inBoxDao.insertInbox(getTableName(inBox.getUid()),inBox);
222 //清空redis缓存 216 //清空redis缓存
223 deleteIboxsByRedis(uid,type); 217 deleteIboxsByRedis(uid,type);
224 } 218 }
225 219
  220 + private void dealAddition(InBox inBox,String params) {
  221 + if(InboxBusinessTypeEnum.NOTICE_PROBLEM_ORDER.getBusinessType().equals(inBox.getBusinessType())){
  222 + //瑕疵订单确认-跳转规则处理
  223 + inBox.setAction(createContent(InboxBusinessTypeEnum.NOTICE_PROBLEM_ORDER.getAction(),params));
  224 + return;
  225 + }
  226 + }
  227 +
226 @Override 228 @Override
227 public JSONObject getTotalUnread(int uid) { 229 public JSONObject getTotalUnread(int uid) {
228 JSONObject result = new JSONObject(); 230 JSONObject result = new JSONObject();