Authored by chenchao

Merge branch 'test6.8.9' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.9

1 package com.yohoufo.dal.order; 1 package com.yohoufo.dal.order;
2 2
  3 +import com.yohoufo.dal.order.model.SellerWalletDetail;
3 import com.yohoufo.dal.order.model.StoredSeller; 4 import com.yohoufo.dal.order.model.StoredSeller;
4 import org.apache.ibatis.annotations.Param; 5 import org.apache.ibatis.annotations.Param;
5 6
@@ -25,4 +26,5 @@ public interface StoredSellerMapper { @@ -25,4 +26,5 @@ public interface StoredSellerMapper {
25 26
26 int clearUserData(@Param("uid") Integer uid); 27 int clearUserData(@Param("uid") Integer uid);
27 28
  29 + int insertBak(StoredSeller storedSeller);
28 } 30 }
@@ -3,6 +3,8 @@ package com.yohoufo.dal.user; @@ -3,6 +3,8 @@ package com.yohoufo.dal.user;
3 import com.yohoufo.dal.user.model.ZhiMaCert; 3 import com.yohoufo.dal.user.model.ZhiMaCert;
4 import org.apache.ibatis.annotations.Param; 4 import org.apache.ibatis.annotations.Param;
5 5
  6 +import java.util.List;
  7 +
6 public interface IZhiMaCertDao { 8 public interface IZhiMaCertDao {
7 9
8 //int insert(ZhiMaCert zhiMaCert); 10 //int insert(ZhiMaCert zhiMaCert);
@@ -26,5 +28,7 @@ public interface IZhiMaCertDao { @@ -26,5 +28,7 @@ public interface IZhiMaCertDao {
26 int deleteByUid(int id); 28 int deleteByUid(int id);
27 29
28 30
  31 + int insertbak(ZhiMaCert zhiMaCert);
29 32
  33 + List<ZhiMaCert> selectByUid(int uid);
30 } 34 }
@@ -206,5 +206,14 @@ @@ -206,5 +206,14 @@
206 delete from stored_seller 206 delete from stored_seller
207 where uid = #{uid} 207 where uid = #{uid}
208 </delete> 208 </delete>
209 - 209 +
  210 + <insert id="insertBak" parameterType="com.yohoufo.dal.order.model.StoredSeller" >
  211 + insert into stored_seller (uid, valid_status,cert_no,cert_name,operator_uid,operator_name,
  212 + enter_time,quit_time, create_time, update_time,break_zhi_ma_cert,entry_type,level_func_id, level_func_list)
  213 + values (#{uid},#{validStatus},
  214 + #{certNo},#{certName},#{operatorUid},#{operatorName},
  215 + #{enterTime},#{quitTime},
  216 + #{createTime},#{updateTime},#{breakZhiMaCert},#{entryType},
  217 + #{levelFuncId,jdbcType=INTEGER}, #{levelFuncList,jdbcType=VARCHAR})
  218 + </insert>
210 </mapper> 219 </mapper>
@@ -77,4 +77,18 @@ @@ -77,4 +77,18 @@
77 <delete id="deleteByUid" parameterType="java.lang.Integer"> 77 <delete id="deleteByUid" parameterType="java.lang.Integer">
78 delete from zhima_cert where uid=#{uid} 78 delete from zhima_cert where uid=#{uid}
79 </delete> 79 </delete>
  80 +
  81 + <insert id="insertbak" parameterType="com.yohoufo.dal.user.model.ZhiMaCert" >
  82 + insert into zhima_cert (uid, valid_status, cert_no, cert_name, biz_no,create_time, update_time)
  83 + values (#{uid},#{validStatus},
  84 + #{certNo},#{certName},#{bizNo},
  85 + #{createTime},#{updateTime})
  86 + </insert>
  87 +
  88 + <select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  89 + select
  90 + <include refid="Base_Column_List" />
  91 + from zhima_cert
  92 + where uid = #{uid}
  93 + </select>
80 </mapper> 94 </mapper>
@@ -156,6 +156,8 @@ public class StoreSellerServiceImpl implements IStoredSellerService { @@ -156,6 +156,8 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
156 156
157 @Override 157 @Override
158 public int removeStoredSeller(Integer uid) { 158 public int removeStoredSeller(Integer uid) {
  159 + storedSellerMapper.insertBak(storedSellerMapper.selectByUid(uid));
  160 +
159 int rows = storedSellerMapper.clearUserData(uid); 161 int rows = storedSellerMapper.clearUserData(uid);
160 storedSellerCacheService.removeStoredSeller(uid); 162 storedSellerCacheService.removeStoredSeller(uid);
161 return rows; 163 return rows;
@@ -36,6 +36,7 @@ import java.text.SimpleDateFormat; @@ -36,6 +36,7 @@ import java.text.SimpleDateFormat;
36 import java.time.LocalDateTime; 36 import java.time.LocalDateTime;
37 import java.time.ZoneOffset; 37 import java.time.ZoneOffset;
38 import java.util.Date; 38 import java.util.Date;
  39 +import java.util.List;
39 40
40 41
41 /** 42 /**
@@ -299,6 +300,10 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService { @@ -299,6 +300,10 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
299 logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid); 300 logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
300 int result = 0; 301 int result = 0;
301 if (uid!=null && uid > 0 ){ 302 if (uid!=null && uid > 0 ){
  303 +
  304 + List<ZhiMaCert> zhiMaCerts = zhiMaCertDao.selectByUid(uid);
  305 + zhiMaCerts.stream().forEach(item -> zhiMaCertDao.insertbak(item));
  306 +
302 result = zhiMaCertDao.deleteByUid(uid); 307 result = zhiMaCertDao.deleteByUid(uid);
303 logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo delete uid{} ,delete result is {}", uid, result); 308 logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo delete uid{} ,delete result is {}", uid, result);
304 309