Authored by caoyan

物权转移

... ... @@ -366,7 +366,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
@Override
public int applyToBeOwner(String tagId, String nfcUid, Integer uid) throws GatewayException {
IdentifyRecord identifyRecord = queryIdentifyRecord(tagId, nfcUid);
IdentifyRecord identifyRecord = identifyRecordsMapper.selectByTagAndNfcId(tagId, nfcUid);//防止缓存更新失败
if(identifyRecord == null){
throw new GatewayException(402, "鉴定信息不存在");
}
... ... @@ -411,7 +411,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
if(null == status || !(status.equals(OPERATE_TYPE_PASS) || status.equals(OPERATE_TYPE_REJECT))){
throw new GatewayException(402, "参数status错误");
}
IdentifyRecord identifyRecord = identifyRecordsMapper.selectByTagAndNfcId(tagId, nfcUid);
IdentifyRecord identifyRecord = queryIdentifyRecord(tagId, nfcUid);
if(identifyRecord == null){
throw new GatewayException(402, "鉴定信息不存在");
}
... ... @@ -436,9 +436,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
int result = transferRecordsHistoryMapper.insert(histroy);
if(status.equals(OPERATE_TYPE_REJECT)) {
setFinalTimeToEnd(inboxId, fromUid);
setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
//“不同意”则拒绝物权占有,短信通知申请⼈人“您发起商品xxxxxx的物权转 移申请,当前物权所有⼈人拒绝转移申请,您可以重新发起物权申请”
messageFacade.ownerReject(String.valueOf(toUid), queryIdentifyRecord(tagId, nfcUid).getOrderCode());
messageFacade.ownerReject(String.valueOf(toUid), identifyRecord.getOrderCode());
return result;
}
... ... @@ -453,7 +453,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
//更新identify_record
result = identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid);
setFinalTimeToEnd(inboxId, fromUid);
setFinalTimeToEnd(inboxId, identifyRecord.getOwner());
//清理缓存
clearIdentifyCache(tagId, nfcUid);
... ... @@ -478,10 +478,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
jo.replace("finalTime", 0);
inBoxAttrDao.updateJsonContent(uid, inboxId, jo.toJSONString());
//清缓存
deleteIboxsByRedis(uid, 2);
deleteIboxsByRedis(uid, "N");
}
private void deleteIboxsByRedis(int uid, int type){
private void deleteIboxsByRedis(int uid, String type){
logger.info("deleteIboxsByRedis params uid is {} type is {}",uid,type);
RedisKeyBuilder inboxKey = CacheEnum.USERS_INBOX_LIST.generateKey(uid);
redisTemplate.delete(inboxKey);
... ...