...
|
...
|
@@ -19,9 +19,11 @@ import java.util.stream.Collectors; |
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.qiniu.util.Auth;
|
|
|
import com.yoho.service.model.union.bo.*;
|
|
|
import com.yoho.service.model.union.request.*;
|
|
|
import com.yoho.service.model.union.response.*;
|
|
|
import com.yoho.unions.common.service.IQNUploadService;
|
|
|
import com.yoho.unions.dal.*;
|
|
|
import com.yoho.unions.dal.model.*;
|
|
|
import com.yoho.unions.helper.SendMessageHelper;
|
...
|
...
|
@@ -33,6 +35,7 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.BeansException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
...
|
...
|
@@ -145,6 +148,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
|
|
|
@Autowired
|
|
|
private ISendSmsService sendSmsService;
|
|
|
@Autowired
|
|
|
private IQNUploadService qNUploadService;
|
|
|
|
|
|
private AtomicInteger atomicInt = new AtomicInteger(0);
|
|
|
|
...
|
...
|
@@ -188,6 +193,9 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
|
|
|
private static final String UNION_SHARE_USER_APPLY_REJECT_SMS_CONTENT = "真抱歉,您填写信息有误未能通过审核!关注“有货有赚”公众号,重新提交申请";
|
|
|
|
|
|
private final String yohoCardUrlPre = "http://yhgidcard.static.yhbimg.com/yohocard";
|
|
|
private long EXPIRE_TIME = 3 * 24 * 3600;
|
|
|
|
|
|
/**
|
|
|
* 获取用户可提现金额、已提现金额、是否可以提现
|
|
|
* */
|
...
|
...
|
@@ -3734,19 +3742,29 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
}
|
|
|
//信息格式校验
|
|
|
checkUserIdentityCard(bo);
|
|
|
// 设置身份证照片完整url
|
|
|
bo.setCardFrontUrl(yohoCardUrlPre + bo.getCardFrontUrl());
|
|
|
bo.setCardBackUrl(yohoCardUrlPre + bo.getCardBackUrl());
|
|
|
UnionShareUserIdentityCard identityCard = new UnionShareUserIdentityCard();
|
|
|
BeanUtils.copyProperties(bo, identityCard);
|
|
|
identityCard.setStatus((byte)1);
|
|
|
identityCard.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
identityCard.setUpdateTime(identityCard.getCreateTime());
|
|
|
int result = unionShareUserIdentityCardMapper.insert(identityCard);
|
|
|
// 查询是否存在
|
|
|
UnionShareUserIdentityCard identityCardDb = unionShareUserIdentityCardMapper.selectByUid(bo.getUid());
|
|
|
int result = 0;
|
|
|
if(identityCardDb==null){
|
|
|
result = unionShareUserIdentityCardMapper.insert(identityCard);
|
|
|
}else{
|
|
|
identityCard.setId(identityCardDb.getId());
|
|
|
result = unionShareUserIdentityCardMapper.updateByPrimaryKey(identityCard);
|
|
|
}
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(), bo.getUid());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public UnionShareUserIdentityCardBo getUserIdentityCard(Integer uid){
|
|
|
logger.info("getUserIdentityCard, uid is {}", uid);
|
|
|
public UnionShareUserIdentityCardBo getUserIdentityCard(Integer uid){
|
|
|
if (uid==null || uid < 1) {
|
|
|
return null;
|
|
|
}
|
...
|
...
|
@@ -3756,10 +3774,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
logger.info("getUserIdentityCard end, get redis cache ,uid is {},cacheResult is {}",uid,cacheResult);
|
|
|
return cacheResult;
|
|
|
}
|
|
|
UnionShareUserBank req = new UnionShareUserBank();
|
|
|
req.setUid(uid);
|
|
|
req.setStatus((byte)1);
|
|
|
UnionShareUserIdentityCard identityCard = unionShareUserIdentityCardMapper.selectByUid(uid);
|
|
|
UnionShareUserIdentityCard identityCard = unionShareUserIdentityCardMapper.selectActiveByUid(uid);
|
|
|
if (identityCard==null) {
|
|
|
return null;
|
|
|
}
|
...
|
...
|
@@ -3773,8 +3788,32 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<UnionShareUserIdentityCardBo> batchGetIdentityCard(List<Integer> uids) {
|
|
|
List<UnionShareUserIdentityCard> identityCards = unionShareUserIdentityCardMapper.selectByUids(uids);
|
|
|
if (CollectionUtils.isEmpty(identityCards)) {
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
List<UnionShareUserIdentityCardBo> boList = Lists.newArrayList();
|
|
|
for (UnionShareUserIdentityCard item : identityCards) {
|
|
|
UnionShareUserIdentityCardBo bo = new UnionShareUserIdentityCardBo();
|
|
|
bo.setId(item.getId());
|
|
|
bo.setUid(item.getUid());
|
|
|
// http://img02.static.yohobuy.com/goodsimg/2016/09/14/13/024d16b0106473e0f114cd1aa8e0a0a6d4.jpg?watermark/2/text/5pyJ6LSn/gravity/SouthWest/dx/300/dy/500/fontsize/1000
|
|
|
bo.setCardFrontUrl(qNUploadService.getSignPrivateUrl(item.getCardFrontUrl(), EXPIRE_TIME));
|
|
|
bo.setCardBackUrl(qNUploadService.getSignPrivateUrl(item.getCardBackUrl(), EXPIRE_TIME));
|
|
|
boList.add(bo);
|
|
|
}
|
|
|
return boList;
|
|
|
}
|
|
|
|
|
|
public void reject(int uid) {
|
|
|
unionShareUserIdentityCardMapper.updateStatusByUid(uid);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(), uid);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|