yujian
2020-06-11 b74ae64915b5f9550e283306a191f964079ae51d
饿了么订单中商品id改为0
7个文件已修改
130 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudGroupServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/alipay/UserCloudAlipayManager.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/ImageToBase64.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/aitaoker/AitaokerApiUtil.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserCloudControllerV2.java
@@ -8,8 +8,6 @@
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -502,27 +500,6 @@
        JSONArray array = new JSONArray();
        JSONObject data = new JSONObject();
        if (list.size() > 0) {
            List<Long> listGid = new ArrayList<Long>();
            for (UserCloudGoods cloudGoods : list) {
                CommonGoods commonGoods = cloudGoods.getCommonGoods();
                if (commonGoods == null) {
                    continue;
                }
                listGid.add(commonGoods.getGoodsId());
            }
            // API网络接口验证是否在售
            List<TaoBaoGoodsBrief> listTaoKeGoods = null;
            try {
                listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
            } catch (TaoKeApiException e) {
                e.printStackTrace();
            } catch (TaobaoGoodsDownException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
@@ -532,22 +509,6 @@
                CommonGoods commonGoods = cloudGoods.getCommonGoods();
                if (commonGoods == null) {
                    continue;
                }
                // 淘宝商品验证在售
                if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
                    if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
                        int state = 1; // 默认停售
                        Long goodsId = commonGoods.getGoodsId();
                        for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
                            Long auctionId = taoKeGoods.getAuctionId();
                            if (goodsId == auctionId || goodsId.equals(auctionId)) {
                                state = 0; // 在售
                                break;
                            }
                        }
                        commonGoods.setState(state);
                    }
                }
                // 判断是否已分享, 已分享显示已下架
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -2109,6 +2109,7 @@
                    Integer goodsType = commonGoodsVO.getGoodsType();
                    if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) {
                        order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单
                        commonGoodsVO.setGoodsId("0");
                    }
                    
                    if (goodsType == Constant.SOURCE_TYPE_SUNING) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudGroupServiceImpl.java
@@ -42,7 +42,7 @@
    @RequestSerializableByKeyService(key = "#uid")
    public void addGroup(Long uid, String groupId, String groupName, int maxNum){
        List<UserCloudGroup> list = userCloudGroupMapper.listByUidAndType(uid, UserCloudGroup.TYPE_GROUP);
        if (list != null && list.size() > maxNum)
        if (list != null && list.size() >= maxNum)
            return;
        
        boolean exist = false;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java
@@ -516,9 +516,12 @@
                        
                    if (listImg.size() > 0) {
                        for (String img: listImg) {
                            picUrl += "," + img;
                            picUrl +=  img + ";" ;
                        }
                    }
                    if (picUrl.endsWith(";"))
                        picUrl = picUrl.substring(0, picUrl.length()-1);
                    sendContent.setTitle(title);
                    sendContent.setPicUrl(picUrl);
                    // 发送图文
@@ -1009,9 +1012,12 @@
                String picUrl = "";
                if (listImg.size() > 0) {
                    for (String img: listImg) {
                        picUrl += "," + img;
                        picUrl +=  img + ";" ;
                    }
                }
                if (picUrl.endsWith(";"))
                    picUrl = picUrl.substring(0, picUrl.length()-1);
                sendContent.setTitle(title);
                sendContent.setPicUrl(picUrl);
                
fanli/src/main/java/com/yeshi/fanli/service/manger/alipay/UserCloudAlipayManager.java
@@ -73,14 +73,7 @@
        // 销售产品码,商家和支付宝签约的产品码
        map.put("product_code", type);
        // 该笔订单允许的最晚付款时间,逾期将关闭交易  30分钟
        map.put("timeout_express", "90m");
//        map.put("goods_id", cloudOrder.getId() +"");
//        map.put("goods_name", "云发单");
//        map.put("quantity", 1 +"");
//        map.put("price", menuEnum.getMoney() + "");
//
        map.put("timeout_express", "1.5h");
        
        // 支付成功后返回哪个前端页面
        String returnUrl = "http://192.168.1.114:8848/flqFront/AppInside/cloudPushOrder/cloudPushOrderManage.html";
fanli/src/main/java/com/yeshi/fanli/util/ImageToBase64.java
@@ -7,17 +7,20 @@
import java.net.HttpURLConnection;
import java.net.URL;
import Decoder.BASE64Encoder;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class ImageToBase64 {
    public static void main(String[] args) {
        // 第一个:把网络图片装换成Base64
        String netImagePath = "http://ec-1255749512.file.myqcloud.com/swiperPic/c7847b574a79400298bc63706fd89faf.jpeg";
//        String netImagePath = "http://ec-1255749512.file.myqcloud.com/swiperPic/c7847b574a79400298bc63706fd89faf.jpeg";
        String netImagePath = "http://ec-1255749512.file.myqcloud.com/editor/img/evaluate/df21d25edd924837b6f8b1f8eaeeac97.jpeg";
        // 下面是网络图片转换Base64的方法
        String netImageToBase64 = NetImageToBase64(netImagePath);
        System.out.println(netImageToBase64);
//        System.out.println(netImageToBase64);
        // 下面是本地图片转换Base64的方法
         //String imagePath = "本地图片路径";
        // ImageToBase64(imagePath);
@@ -45,11 +48,12 @@
            while ((len = is.read(by)) != -1) {
                data.write(by, 0, len);
            }
            // 关闭流
            is.close();
            // 对字节数组Base64编码
            BASE64Encoder encoder = new BASE64Encoder();
            return encoder.encode(data.toByteArray());
            String encode = encoder.encode(data.toByteArray());
            // 关闭流
            is.close();
            return encode;
        } catch (IOException e) {
            e.printStackTrace();
        }
fanli/src/main/java/com/yeshi/fanli/util/aitaoker/AitaokerApiUtil.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.dto.aitaoker.QrcodeLoginDTO;
import com.yeshi.fanli.dto.aitaoker.RobotInfoDTO;
import com.yeshi.fanli.dto.aitaoker.WeiXinGroupDTO;
import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONArray;
@@ -157,13 +158,16 @@
        map.put("robot_id", robotId +"");
        map.put("uuid", wId);
        // 请求结果
        String result = baseRequest("itaoke.robot.check.maclogin", map);
        String result = baseRequest("itaoke.robot.async.mlogin", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        resultJson = resultJson.optJSONObject("data");
        if (resultJson != null && !StringUtil.isNullOrEmpty(resultJson.optString("wcId"))) {
            Type type = new TypeToken<QrcodeLoginDTO>() {}.getType();
            return new Gson().fromJson(resultJson.toString(), type);
        if ("0000".equals(resultJson.optString("status"))) {
            resultJson = resultJson.optJSONObject("data");
            if (resultJson != null) {
                Type type = new TypeToken<QrcodeLoginDTO>() {}.getType();
                return new Gson().fromJson(resultJson.toString(), type);
            }
        }
        return null;
    }
    
@@ -179,7 +183,7 @@
        // 请求结果
        String result = baseRequest("itaoke.robot.check.online", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if ("0000".equals(resultJson.optString("code"))) {
        if ("0000".equals(resultJson.optString("status"))) {
            return true;
        }
        return false;
@@ -198,7 +202,7 @@
        // 请求结果
        String result = baseRequest("itaoke.robot.force.offline", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if ("0000".equals(resultJson.optString("code"))) {
        if ("0000".equals(resultJson.optString("status"))) {
            return true;
        }
        return false;
@@ -319,7 +323,7 @@
    
    
    /**
     * 获取好友-群列表
     * 获取群列表
     * @param robotId
     * @return
     */
@@ -328,25 +332,18 @@
        Map<String, String> map = new HashMap<>();
        map.put("robot_id", robotId +"");
        // 请求结果
        String result = baseRequest("itaoke.robot.get.contract", map);
        String result = baseRequest("itaoke.robot.room.list", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if ("0000".equals(resultJson.optString("code"))) {
            resultJson = resultJson.optJSONObject("data");
            // 订阅号
            //JSONArray publicArray = resultJson.optJSONArray("public");
            // 好友列表
            //JSONArray friendArray = resultJson.optJSONArray("friend");
            // 群列表
            JSONArray groupArray = resultJson.optJSONArray("group");
        if ("0000".equals(resultJson.optString("status"))) {
            JSONArray groupArray = resultJson.optJSONArray("data");
            if (groupArray != null && groupArray.size() > 0) {
                List<WeiXinGroupDTO> listGroup = new ArrayList<>();
                Type type = new TypeToken<RobotInfoDTO>() {}.getType();
                Gson gson = new Gson();
                for (int i = 0 ;i < groupArray.size(); i ++) {
                    listGroup.add(gson.fromJson(groupArray.get(i).toString(), type));
                }
                Type type = new TypeToken<ArrayList<WeiXinGroupDTO>>() {
                }.getType();
                List<WeiXinGroupDTO> goodsList = new Gson().fromJson(groupArray.toString(), type);
                return goodsList;
            }
        }
        return null;
@@ -369,8 +366,9 @@
        // 请求结果
        String result = baseRequest("itaoke.robot.macsend.circle", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if ("1000".equals(resultJson.optString("code"))) {
        if ("0000".equals(resultJson.optString("status"))) {
            resultJson = resultJson.optJSONObject("data");
            resultJson = resultJson.optJSONObject("object");
            return resultJson.optString("id");
        }
        return null;
@@ -415,10 +413,11 @@
        map.put("wx_id", wxId);
        map.put("msg_id", msgId);
        map.put("content", content);
        map.put("comment_id", "0");
        // 请求结果
        String result = baseRequest("itaoke.robot.macsend.circlecomment", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if ("1000".equals(resultJson.optString("code"))) {
        if ("0000".equals(resultJson.optString("status"))) {
            return true;
        }
        return false;
@@ -442,7 +441,7 @@
        // 请求结果
        String result = baseRequest("itaoke.robot.macsend.text", map);
        JSONObject resultJson = JSONObject.fromObject(result);
        if (resultJson.optInt("code") == 1000) {
        if ("0000".equals(resultJson.optString("status"))) {
            return true;
        }
        return false;