From 7912a94e5de72b628bde39b16e6c7b21172910eb Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 08 六月 2020 17:15:39 +0800 Subject: [PATCH] 2.1.2bug --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java | 72 ++++-------------------------------- 1 files changed, 8 insertions(+), 64 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java index 429ddf1..916f4ae 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java @@ -5,9 +5,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; -import java.util.HashSet; import java.util.List; -import java.util.Set; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -39,7 +37,6 @@ import com.yeshi.fanli.exception.taobao.TaoKeApiException; import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; import com.yeshi.fanli.exception.user.cloud.UserCloudException; -import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException; import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException; import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.config.ConfigService; @@ -301,6 +298,7 @@ JSONObject data = new JSONObject(); QrcodeLoginDTO dto = AitaokerApiUtil.getQrcodeMacloginCheck(robotId, wId); if (dto != null) { + LogHelper.cloudInfo("鏂规硶macloginCheck: [uid=" + uid + "][wxID=" + dto.getWcId() + "][ NickName=" + dto.getNickName() + "]" ); try { // 鏇存柊寰俊淇℃伅 userCloudService.updateWXInfo(uid, dto.getWcId(), dto.getNickName(), dto.getHeadUrl()); @@ -568,67 +566,15 @@ JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); } + + /** - * 娣诲姞銆佸彇娑堝彂鍗曞簱 + * 鍒犻櫎浜戝彂鍗曞閫夊簱 * * @param callback * @param acceptData * @param uid - * @param goodsId - * @param goodsType - * @param out - */ - @RequestMapping(value = "accordGoods") - public void accordGoods(String callback, AcceptData acceptData, Long uid, String goodsId, Integer goodsType, - PrintWriter out) { - if (uid == null) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�")); - return; - } - - if (goodsType == null || goodsId == null) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "鍙傛暟涓嶅畬鏁�")); - return; - } - - try { - boolean state = false; - String queryGoodsId = goodsId; - if (goodsType == Constant.SOURCE_TYPE_SUNING) { // 鑻忓畞 - String[] ids = SuningUtil.getGoodsIdDetail(goodsId); - queryGoodsId = ids[1]; - } - - UserCloudGoods cloudGoods = userCloudGoodsService.getByUidAndGoods(uid, Long.parseLong(queryGoodsId), goodsType); - if (cloudGoods != null) { // 鍙栨秷鍔犲叆閫夊搧搴� - userCloudGoodsService.deleteByPrimaryKeyAndUid(cloudGoods.getId(), uid); - } else { // 鍔犲叆閫夊搧搴� - Set<String> set = new HashSet<String>(); - set.add(goodsId); - userCloudGoodsService.addGoods(uid, set, goodsType); - state = true; - } - - JSONObject data = new JSONObject(); - data.put("state", state); - out.print(JsonUtil.loadTrueResult(data)); - } catch (UserCloudGoodsException e) { - out.print(JsonUtil.loadFalseResult(e.getMsg())); - } catch (Exception e) { - out.print(JsonUtil.loadFalseResult("鎿嶄綔澶辫触")); - LogHelper.errorDetailInfo(e); - ; - } - } - - /** - * 娣诲姞銆佸彇娑堝彂鍗曞簱 - * - * @param callback - * @param acceptData - * @param uid - * @param goodsId - * @param goodsType + * @param id * @param out */ @RequestMapping(value = "deleteGoods") @@ -752,11 +698,10 @@ userCloudService.sendByDynamic(uid, id); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("涓�閿彂鍗曟垚鍔�")); } catch (UserCloudException e) { - if (e.getCode() > 1000) { + if (e.getCode() > 1000 && e.getCode() < 1100) { JSONObject data = new JSONObject(); - data.put("msg", e.getMsg()); data.put("link", configService.get(ConfigKeyEnum.robotCloudLink.getKey())); - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(1000, data)); + JsonUtil.printMode(out, callback, JsonUtil.loadTrue(e.getCode(), data, e.getMsg()).toString()); } else { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg())); } @@ -795,10 +740,9 @@ } else { gid = Long.parseLong(goodsId); } - userCloudService.sendCustomGoods(uid, gid, goodsType, sellerId); } - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("涓�閿彂鍗曟垚鍔�")); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鍔犲叆鍙戝崟搴撴垚鍔�")); } catch (UserCloudException e) { if (e.getCode() > 1000 && e.getCode() < 1100) { JSONObject data = new JSONObject(); -- Gitblit v1.8.0