Authored by qinchao

Merge branch 'dev_qc693' into test6.9.3

... ... @@ -3,7 +3,6 @@ package com.yohoufo.order.service.impl;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.EntrySellerRechargeOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.TradeBillsMapper;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
... ... @@ -27,7 +26,6 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**资产
... ... @@ -37,8 +35,7 @@ import java.util.stream.Collectors;
public class AssetsService {
final Logger logger = LoggerFactory.getLogger(getClass());
private Cache<String,List<TradeBillsBo>> localContentCache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(5, TimeUnit.MINUTES).build();
private Cache<Integer,TradeBillsSummaryBo> localTradeBillsSummaryBoCache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(1, TimeUnit.MINUTES).build();
private Cache<Integer,TradeBillsSummaryBo> localTradeBillsSummaryBoCache = CacheBuilder.newBuilder().maximumSize(2000).expireAfterWrite(1, TimeUnit.MINUTES).build();
@Autowired
private TradeBillsMapper tradeBillsMapper;
... ... @@ -49,9 +46,6 @@ public class AssetsService {
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper;
public AssetsResp getAssetsDetails(int uid, int page, int pageSize){
//TODO get count
... ... @@ -89,24 +83,6 @@ public class AssetsService {
List<TradeBillsBo> buildTradeBills(int uid,int page, int pageSize){
//现在是降序排列,不再缓存第一页
return loadTradeBillFromDb(uid,page,pageSize);
//把第一页缓存
/*String key=uid+"-"+page+"-"+pageSize;
if(page==1){
try{
return localContentCache.get(key, new Callable<List<TradeBillsBo>>() {
@Override
public List<TradeBillsBo> call() throws Exception {
return loadTradeBillFromDb(uid,page,pageSize);
}
});
}catch (ExecutionException e){
throw new RuntimeException(e);
}
}else{
return loadTradeBillFromDb(uid,page,pageSize);
}*/
}
private List<TradeBillsBo> loadTradeBillFromDb(int uid,int page, int pageSize){
... ... @@ -186,25 +162,6 @@ public class AssetsService {
}
}
//计算支出
/*List<Map<String, Object>> spendList=tradeBillsMapper.selectSpendAmountByUid(uid);
if(CollectionUtils.isNotEmpty(spendList)){
for(Map<String, Object> tmpMap:spendList){
if(tmpMap.get("tradeType")==null||tmpMap.get("allAmount")==null){
continue;
}
Integer key = (Integer)tmpMap.get("tradeType");
if(TradeType.goods_income.getCode()==key.intValue()){
goods_income = goods_income.subtract((BigDecimal)tmpMap.get("allAmount"));
}
if(TradeType.compensateIncome.getCode()==key.intValue()){
compensate_income = compensate_income.subtract((BigDecimal)tmpMap.get("allAmount"));
}
}
}*/
summary.setGoods_income(goods_income);
summary.setGoodsIncome(goods_income.setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString());
summary.setCompensate_income(compensate_income);
... ...
... ... @@ -47,10 +47,6 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
@Autowired
StoredSellerCacheService storedSellerCacheService;
//@Value("${zhimacert.switch:true}")
//private boolean zhiMaCertSwitch;
@Autowired
private SellerService sellerService;
... ... @@ -98,16 +94,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
logger.info("StoredSellerServiceImpl entryStatus uid is {} ",uid);
Boolean isZhiMaCert=false;
ZhiMaCert zhiMaCert = null;
/*
if(zhiMaCertSwitch){
zhiMaCert = getZhiMaCertInfo(uid);
if(null != zhiMaCert){
isZhiMaCert = true;
}
}else{
isZhiMaCert = true;
}
*/
zhiMaCert = getZhiMaCertInfo(uid);
if(null != zhiMaCert){
isZhiMaCert = true;
... ... @@ -254,11 +241,6 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
ZhiMaCert zhiMaCert = getZhiMaCertInfo(uid);
int breakZhiMaCert=0;
//芝麻认证没开启,并且没有认证
/*if(!zhiMaCertSwitch&&zhiMaCert==null){
zhiMaCert = new ZhiMaCert();
breakZhiMaCert=1;
}*/
if(null == zhiMaCert){
logger.error("StoredSellerServiceImpl get zhi ma cert info is null , uid is {} ",uid);
... ... @@ -309,14 +291,4 @@ public class StoreSellerServiceImpl implements IStoredSellerService {
return null;
}
/*private boolean isPhotoCheckExceedLimit(int targetUid) {
ApiResponse<Boolean> resp = ufoServiceCaller.call("ufo.user.photoCheckExceedLimit", ApiResponse.class, targetUid);
if (resp != null&&resp.getCode()==200) {
if (resp.getData() != null) {
return (Boolean)resp.getData();
}
}
return false;
}*/
}
... ...
... ... @@ -138,6 +138,7 @@ public class RealNameAuthorizeController {
return new ApiResponse(isZhiMaCert);
}
/* 退出入驻时,不再清除芝麻认证信息,该方法不再使用了
@RequestMapping(params = "method=ufo.user.clearZhiMaCertInfo")
public ApiResponse clearZhiMaCertInfo(@RequestParam("uid") Integer uid) throws GatewayException {
logger.info("enter realNameAuthorize.clearZhiMaCertInfo param uid is {}", uid);
... ... @@ -146,6 +147,7 @@ public class RealNameAuthorizeController {
apiResponse.setData(deleteNum);
return apiResponse;
}
*/
@RequestMapping(params = "method=ufo.user.zhiMaCertInfo")
public ApiResponse zhiMaCertInfo(@RequestParam("uid") Integer uid) throws GatewayException {
... ...
... ... @@ -70,11 +70,6 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
@Autowired
private CertPhotoSwitchComponent certPhotoSwitchComponent;
//@Value("${zhimacert.switch:true}")
//private boolean zhiMaCertSwitch;
@Autowired
private ConfigReader configReader;
... ... @@ -280,11 +275,6 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
}
public boolean isValidZhiMaCert(int uid){
//如果芝麻认知没有开启,默认芝麻认证通过
/*if(!zhiMaCertSwitch){
return true;
}*/
//否则,从db查询认证信息
if(null!=this.getValidZhiMaCert(uid)){
return true;
... ...