Authored by caoyan

物权转移

... ... @@ -11,4 +11,6 @@ public class IdentifyTrackResp {
private Integer time;
private String mobile;
private Integer type;//1:鉴定信息 2:EX主人 3:现主人 4:申请人
private String message;
private String tip;
}
... ...
... ... @@ -138,6 +138,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
public static final Integer OPERATE_TYPE_NO_APPLY = 4; //未申请
public static final Integer OPERATE_TYPE_CANNOT_APPLY = 5; //不能申请
public static final Integer MESSAGE_TYPE_JUDGE_INFO = 1; //鉴定信息
public static final Integer MESSAGE_TYPE_EX_OWNER = 2; //前主人
... ... @@ -418,6 +420,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
transferRecords.setCreateTime(DateUtil.getCurrentTimeSecond());
transferRecordsMapper.insert(transferRecords);
//清理缓存
clearIdentifyCache(tagId, nfcUid);
//更新identify_record
return identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid);
}
... ... @@ -451,6 +456,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
if(null == history || !history.getStatus().equals(OPERATE_TYPE_APPLYING)) {
result.setApplyStatus(OPERATE_TYPE_NO_APPLY);//未申请
}else if(!(history.getToUid().equals(String.valueOf(uid)))) {
result.setApplyStatus(OPERATE_TYPE_CANNOT_APPLY);
return;
}else {
result.setApplyStatus(history.getStatus());
... ... @@ -464,7 +470,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
ProfileInfoRsp profileInfo = profileInfoArray[0];
IdentifyTrackResp track = new IdentifyTrackResp();
track.setUid(uid);
track.setType(MESSAGE_TYPE_APPLICANT);;
track.setType(MESSAGE_TYPE_APPLICANT);
String mobileMask = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位
track.setContent(StringUtils.isEmpty(profileInfo.getNickname()) ? mobileMask : profileInfo.getNickname());
String headIcon = profileInfo.getHead_ico();
... ... @@ -473,6 +479,16 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
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}");
}
track.setHeadIcon(headIcon);
String message = "向" + result.getCurrentOwner() + "申请成为新主人";
String tip = "";
if(result.getApplyStatus().equals(OPERATE_TYPE_REJECT)) {
tip = "当前物权所有⼈人拒绝物权转移";
}else if(result.getApplyStatus().equals(OPERATE_TYPE_TIMEOUT)) {
tip = "当前主人确认申请超时,您可以重新发起申请";
}
track.setMessage(message);
track.setTip(tip);
result.getTrackList().add(track);
}
... ... @@ -698,6 +714,12 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
appendVar(tagId).appendVar(":").appendVar(nfcUid);
clientCache.setEx(kb, result,5 * 60 );
}
private void clearIdentifyCache(String tagId, String nfcUid) {
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:identifyResultInfo:").
appendVar(tagId).appendVar(":").appendVar(nfcUid);
clientCache.delete(kb.toString());
}
private ProductIdentifyResp getIdentifyFromCache(String tagId, String nfcUid) {
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:identifyResultInfo:").
... ...