Authored by caoyan

物权转移

... ... @@ -8,5 +8,7 @@ public interface IdentifyRecordsMapper {
IdentifyRecord selectByTagAndNfcId(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid);
int updateOwner(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("owner") Integer owner);
int updateAllowPop(@Param("tagId") String tagId, @Param("nfcUid") String nfcUid, @Param("allowPop") Integer allowPop);
}
\ No newline at end of file
... ...
... ... @@ -2,8 +2,6 @@ package com.yohoufo.dal.product.model;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class IdentifyRecord {
private int id;
... ... @@ -14,4 +12,5 @@ public class IdentifyRecord {
private Long orderCode;
private int authTime;
private int authUid;
private int allowPop;//是否允许弹窗,0:不允许, 1允许
}
\ No newline at end of file
... ...
... ... @@ -10,9 +10,10 @@
<result column="order_code" jdbcType="BIGINT" property="orderCode" />
<result column="auth_time" jdbcType="INTEGER" property="authTime" />
<result column="auth_uid" jdbcType="INTEGER" property="authUid" />
<result column="allow_pop" jdbcType="INTEGER" property="allowPop" />
</resultMap>
<sql id="Base_Column_List">
id, tag_id, nfc_uid, owner,allow_transfer, order_code, auth_time, auth_uid
id, tag_id, nfc_uid, owner,allow_transfer, order_code, auth_time, auth_uid, allow_pop
</sql>
<select id="selectByTagAndNfcId" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
... ... @@ -25,7 +26,15 @@
</select>
<update id="updateOwner">
update identify_records set owner=#{owner}
update identify_records set owner=#{owner}
where tag_id = #{tagId,jdbcType=VARCHAR}
<if test="nfcUid != null" >
and nfc_uid = #{nfcUid,jdbcType=VARCHAR}
</if>
</update>
<update id="updateAllowPop">
update identify_records set allow_pop=#{allowPop}
where tag_id = #{tagId,jdbcType=VARCHAR}
<if test="nfcUid != null" >
and nfc_uid = #{nfcUid,jdbcType=VARCHAR}
... ...
... ... @@ -20,4 +20,5 @@ public class ProductIdentifyResp {
private String identifyUserName;//鉴定师名字
private Integer applyStatus;//申请物权转移状态
private String currentOwner;//当前物权所有人
private Integer allowPop;//是否允许弹窗
}
... ...
... ... @@ -178,6 +178,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
public static final Integer MESSAGE_TYPE_APPLICANT = 4;//申请人
public static final int ALLOW_POP = 1;
public static final int NOT_ALLOW_POP = 0;
/**
* 鉴定结果查询接口
* @param tagId
... ... @@ -355,11 +359,15 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
//5)设置当前物权所有人
result.setCurrentOwner(trackList.get(trackList.size()-1).getContent());
//设置是否弹窗
result.setAllowPop(identifyRecord.getAllowPop());
//设置缓存--可能会有延时,不影响的
setIdentifyCache(tagId, nfcUid, result);
//添加申请物权转移人信息
rebuildResult(result, tagId, nfcUid, uid);
logger.info("queryIdentifyInfo success!, tagId = {}, nfcUid={}, result ={}", tagId, nfcUid, result );
return result;
}
... ... @@ -552,9 +560,13 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
boolean isOwner = queryIsOwner(tagId, nfcUid, uid);
result.setIfOwner(isOwner);
if(isOwner) {
if(result.getAllowPop() == ALLOW_POP) {
identifyRecordsMapper.updateAllowPop(tagId, nfcUid, NOT_ALLOW_POP);
}
return;
}
result.setAllowPop(NOT_ALLOW_POP);//非主人不弹窗
//申请人申请状态
TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, null);
result.setApplyStatus(OPERATE_TYPE_NO_APPLY);
... ...