Authored by mali

Merge branch 'dev_seller_soft_delete' into test6.8.9

package com.yohoufo.dal.order;
import com.yohoufo.dal.order.model.SellerWalletDetail;
import com.yohoufo.dal.order.model.StoredSeller;
import org.apache.ibatis.annotations.Param;
... ... @@ -25,4 +26,5 @@ public interface StoredSellerMapper {
int clearUserData(@Param("uid") Integer uid);
int insertBak(StoredSeller storedSeller);
}
... ...
... ... @@ -3,6 +3,8 @@ package com.yohoufo.dal.user;
import com.yohoufo.dal.user.model.ZhiMaCert;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface IZhiMaCertDao {
//int insert(ZhiMaCert zhiMaCert);
... ... @@ -26,5 +28,7 @@ public interface IZhiMaCertDao {
int deleteByUid(int id);
int insertbak(ZhiMaCert zhiMaCert);
List<ZhiMaCert> selectByUid(int uid);
}
... ...
... ... @@ -206,5 +206,14 @@
delete from stored_seller
where uid = #{uid}
</delete>
<insert id="insertBak" parameterType="com.yohoufo.dal.order.model.StoredSeller" >
insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,
enter_time,quit_time, create_time, update_time,break_zhi_ma_cert,entry_type,level_func_id, level_func_list)
values (#{uid},#{validStatus},
#{certNo},#{certName},#{operatorUid},#{operatorName},
#{enterTime},#{quitTime},
#{createTime},#{updateTime},#{breakZhiMaCert},#{entryType},
#{levelFuncId,jdbcType=INTEGER}, #{levelFuncList,jdbcType=VARCHAR})
</insert>
</mapper>
\ No newline at end of file
... ...
... ... @@ -77,4 +77,18 @@
<delete id="deleteByUid" parameterType="java.lang.Integer">
delete from zhima_cert where uid=#{uid}
</delete>
<insert id="insertbak" parameterType="com.yohoufo.dal.user.model.ZhiMaCert" >
insert into zhima_cert (uid, valid_status, cert_no, cert_name, biz_no,create_time, update_time)
values (#{uid},#{validStatus},
#{certNo},#{certName},#{bizNo},
#{createTime},#{updateTime})
</insert>
<select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from zhima_cert
where uid = #{uid}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -156,6 +156,8 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
@Override
public int removeStoredSeller(Integer uid) {
storedSellerMapper.insertBak(storedSellerMapper.selectByUid(uid));
int rows = storedSellerMapper.clearUserData(uid);
storedSellerCacheService.removeStoredSeller(uid);
return rows;
... ...
... ... @@ -36,6 +36,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.List;
/**
... ... @@ -299,6 +300,10 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
int result = 0;
if (uid!=null && uid > 0 ){
List<ZhiMaCert> zhiMaCerts = zhiMaCertDao.selectByUid(uid);
zhiMaCerts.stream().forEach(item -> zhiMaCertDao.insertbak(item));
result = zhiMaCertDao.deleteByUid(uid);
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo delete uid{} ,delete result is {}", uid, result);
... ...