Authored by caoyan

Merge branch 'dev_物权转移' into test6.8.6

@@ -12,4 +12,6 @@ public interface TransferRecordsHistoryMapper { @@ -12,4 +12,6 @@ public interface TransferRecordsHistoryMapper {
12 TransferRecordsHistory selectByToUid(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("toUid") Integer toUid); 12 TransferRecordsHistory selectByToUid(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("toUid") Integer toUid);
13 13
14 int updateStatus(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("status") Integer status); 14 int updateStatus(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("status") Integer status);
  15 +
  16 + TransferRecordsHistory selectByStatus(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("status") Integer status);
15 } 17 }
@@ -34,6 +34,20 @@ @@ -34,6 +34,20 @@
34 limit 1 34 limit 1
35 </select> 35 </select>
36 36
  37 + <select id="selectByStatus" resultMap="BaseResultMap">
  38 + select <include refid="Base_Column_List"></include>
  39 + from transfer_records_history
  40 + where tag_id=#{tagId}
  41 + <if test="nfcUid != null and nfcUid != '' ">
  42 + and nfc_uid=#{nfcUid}
  43 + </if>
  44 + <if test="status != null">
  45 + and status=#{status}
  46 + </if>
  47 + order by operate_time desc
  48 + limit 1
  49 + </select>
  50 +
37 <update id="updateStatus"> 51 <update id="updateStatus">
38 update transfer_records_history set status=#{status} 52 update transfer_records_history set status=#{status}
39 where tag_id=#{tagId} 53 where tag_id=#{tagId}
@@ -10,4 +10,5 @@ public class IdentifyTrackResp { @@ -10,4 +10,5 @@ public class IdentifyTrackResp {
10 private String timeStr; 10 private String timeStr;
11 private Integer time; 11 private Integer time;
12 private String mobile; 12 private String mobile;
  13 + private Integer type;//1:鉴定信息 2:EX主人 3:现主人 4:申请人
13 } 14 }
@@ -134,6 +134,14 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -134,6 +134,14 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
134 134
135 public static final Integer OPERATE_TYPE_NO_APPLY = 4; //未申请 135 public static final Integer OPERATE_TYPE_NO_APPLY = 4; //未申请
136 136
  137 + public static final Integer MESSAGE_TYPE_JUDGE_INFO = 1; //鉴定信息
  138 +
  139 + public static final Integer MESSAGE_TYPE_EX_OWNER = 2; //前主人
  140 +
  141 + public static final Integer MESSAGE_TYPE_CURRENT_OWNER = 3; //现主人
  142 +
  143 + public static final Integer MESSAGE_TYPE_APPLICANT = 4;//申请人
  144 +
137 /** 145 /**
138 * 鉴定结果查询接口 146 * 鉴定结果查询接口
139 * @param tagId 147 * @param tagId
@@ -409,9 +417,11 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -409,9 +417,11 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
409 } 417 }
410 418
411 //申请人申请状态 419 //申请人申请状态
412 - TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, uid);  
413 - if(null == history) { 420 + TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, null);
  421 + if(null == history || !history.getStatus().equals(OPERATE_TYPE_APPLYING)) {
414 result.setApplyStatus(OPERATE_TYPE_NO_APPLY);//未申请 422 result.setApplyStatus(OPERATE_TYPE_NO_APPLY);//未申请
  423 + }else if(!(history.getToUid().equals(String.valueOf(uid)))) {
  424 + return;
415 }else { 425 }else {
416 result.setApplyStatus(history.getStatus()); 426 result.setApplyStatus(history.getStatus());
417 } 427 }
@@ -424,6 +434,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -424,6 +434,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
424 ProfileInfoRsp profileInfo = profileInfoArray[0]; 434 ProfileInfoRsp profileInfo = profileInfoArray[0];
425 IdentifyTrackResp track = new IdentifyTrackResp(); 435 IdentifyTrackResp track = new IdentifyTrackResp();
426 track.setUid(uid); 436 track.setUid(uid);
  437 + track.setType(MESSAGE_TYPE_APPLICANT);;
427 String mobileMask = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位 438 String mobileMask = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位
428 track.setContent(StringUtils.isEmpty(profileInfo.getNickname()) ? mobileMask : profileInfo.getNickname()); 439 track.setContent(StringUtils.isEmpty(profileInfo.getNickname()) ? mobileMask : profileInfo.getNickname());
429 String headIcon = profileInfo.getHead_ico(); 440 String headIcon = profileInfo.getHead_ico();
@@ -444,6 +455,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -444,6 +455,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
444 identifyTrack.setTime(authTime); 455 identifyTrack.setTime(authTime);
445 identifyTrack.setTimeStr(formatDate(authTime, "yyyy.MM.dd HH:mm:ss")); 456 identifyTrack.setTimeStr(formatDate(authTime, "yyyy.MM.dd HH:mm:ss"));
446 identifyTrack.setContent(authGroup + "鉴定结果为\"真\""); 457 identifyTrack.setContent(authGroup + "鉴定结果为\"真\"");
  458 + identifyTrack.setType(MESSAGE_TYPE_JUDGE_INFO);
447 //鉴定中心,默认的展示头像 459 //鉴定中心,默认的展示头像
448 String authIco = configReader.getString("ufo.product.defaultAuthHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height}"); 460 String authIco = configReader.getString("ufo.product.defaultAuthHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height}");
449 identifyTrack.setHeadIcon(authIco); 461 identifyTrack.setHeadIcon(authIco);
@@ -477,6 +489,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -477,6 +489,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
477 headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}"); 489 headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}");
478 } 490 }
479 item.setHeadIcon(headIcon); 491 item.setHeadIcon(headIcon);
  492 + item.setType(MESSAGE_TYPE_EX_OWNER);
480 if(null != transferMap.get(String.valueOf(entry.getKey()))) { 493 if(null != transferMap.get(String.valueOf(entry.getKey()))) {
481 Integer createTime = transferMap.get(String.valueOf(entry.getKey())).getCreateTime(); 494 Integer createTime = transferMap.get(String.valueOf(entry.getKey())).getCreateTime();
482 item.setTime(createTime); 495 item.setTime(createTime);
@@ -494,6 +507,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ @@ -494,6 +507,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
494 } 507 }
495 }); 508 });
496 509
  510 + trackList.get(trackList.size()-1).setType(MESSAGE_TYPE_CURRENT_OWNER);
497 return trackList; 511 return trackList;
498 } 512 }
499 513