Authored by mali

Merge branch 'test6.9.0' into test6.9.1

... ... @@ -41,6 +41,9 @@ public interface ImagesConstant {
// 品牌图片,与前台兼容
String BUCKET_BRAND_LOGO = "brandLogo";
// 品牌搜索大图
String BUCKET_SEARCH_SHOW_IMAGE = "searchShowImage";
// 销售类目图片
String BUCKET_SALES_CATEGORY = "taobaocms";
... ...
... ... @@ -38,6 +38,7 @@ public class ImagesHelper extends com.yoho.core.common.helpers.ImagesHelper{
BUCKET_LIST.put(ImagesConstant.BUCKET_SNS, ImagesConstant.BUCKET_SNS);
BUCKET_LIST.put(ImagesConstant.BUCKET_EVIDENCE, ImagesConstant.BUCKET_EVIDENCE);
BUCKET_LIST.put(ImagesConstant.BUCKET_BRAND_LOGO, ImagesConstant.BUCKET_BRAND_LOGO);
BUCKET_LIST.put(ImagesConstant.BUCKET_SEARCH_SHOW_IMAGE, ImagesConstant.BUCKET_SEARCH_SHOW_IMAGE);
BUCKET_LIST.put(ImagesConstant.BUCKET_GOODS_VIDEO, ImagesConstant.BUCKET_GOODS_VIDEO);
BUCKET_LIST.put(ImagesConstant.BUCKET_ACTIVITY_PIC, ImagesConstant.BUCKET_ACTIVITY_PIC);
BUCKET_LIST.put(ImagesConstant.BUCKET_PLUSTAR, ImagesConstant.BUCKET_PLUSTAR);
... ...
package com.yoho.order.dal;
import com.yoho.order.model.OrderConfig;
import org.apache.ibatis.annotations.Param;
/**
* Created by craig.qin
*/
public interface OrderConfigMapper {
OrderConfig selectByCode(@Param("code") String code);
}
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
/**
* Created by craig.qin
*/
@ToString
@Data
public class OrderConfig {
private Integer id;
private String code;
private String name;
private String content;
private Integer createTime;
}
... ...
... ... @@ -29,6 +29,8 @@ public class Brand implements Serializable {
private Integer editPid;
private String searchShowImage;
public Integer getId() {
return id;
}
... ... @@ -101,6 +103,13 @@ public class Brand implements Serializable {
this.editPid = editPid;
}
public String getSearchShowImage() {
return searchShowImage;
}
public void setSearchShowImage(String searchShowImage) {
this.searchShowImage = searchShowImage;
}
@Override
public String toString() {
... ... @@ -114,6 +123,7 @@ public class Brand implements Serializable {
", createTime=" + createTime +
", editTime=" + editTime +
", editPid=" + editPid +
", searchShowImage=" + searchShowImage +
'}';
}
}
... ...
... ... @@ -12,15 +12,16 @@
<result property="editTime" column="edit_time"/>
<result property="createTime" column="create_time"/>
<result property="editPid" column="edit_pid"/>
<result property="search_show_image" column="searchShowImage"/>
</resultMap>
<sql id="queryColumns">
id, brand_name, brand_name_en, brand_logo, brand_search, status, create_time
id, brand_name, brand_name_en, brand_logo, brand_search, status, create_time, search_show_image
</sql>
<insert id="insertBrand" parameterType="com.yoho.ufo.model.brand.Brand">
insert into brand(id, brand_name, brand_name_en, brand_logo, brand_search, status, create_time, edit_time, edit_pid)
values (#{id}, #{brandName}, #{brandNameEn}, #{brandLogo}, #{brandSearch}, #{status}, #{createTime}, #{editTime}, #{editPid})
insert into brand(id, brand_name, brand_name_en, brand_logo, search_show_image, brand_search, status, create_time, edit_time, edit_pid)
values (#{id}, #{brandName}, #{brandNameEn}, #{brandLogo}, #{searchShowImage}, #{brandSearch}, #{status}, #{createTime}, #{editTime}, #{editPid})
</insert>
<update id="updateBrandStatus" parameterType="com.yoho.ufo.model.brand.Brand">
... ... @@ -51,7 +52,8 @@
<if test="brand.editPid != null">
edit_pid = #{brand.editPid},
</if>
brand_search = #{brand.brandSearch}
brand_search = #{brand.brandSearch},
search_show_image = #{brand.searchShowImage}
</set>
where id = #{brand.id}
</update>
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.order.dal.OrderConfigMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.OrderConfig">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, code, name, content, create_time
</sql>
<select id="selectByCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from order_config where code=#{code}
</select>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import com.yoho.core.dal.datasource.annotation.Database;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.collect.Maps;
import org.elasticsearch.common.netty.util.internal.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Splitter;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.core.redis.cluster.annotation.Redis;
import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations;
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import com.yoho.service.model.order.request.OrderRequest;
import com.yoho.ufo.constants.PlatformConstant;
import com.yoho.ufo.constants.RedisKeyConstants;
... ... @@ -63,11 +34,28 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
import com.yohobuy.ufo.model.order.resp.OrderDetailResp;
import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;
import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp;
import com.yohobuy.ufo.model.order.resp.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.collect.Maps;
import org.elasticsearch.common.netty.util.internal.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @author caoyan
... ... @@ -138,11 +126,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private BuyerOrderFeedbackService buyerOrderFeedbackService;
@Autowired
private OrderConfigMapper orderConfigMapper;
private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address";
private static final String SELLER_ORDER_META_KEY_FEE = "fee";
private static final String ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE = "inner_buyer_for_offline";
private static final Integer EXPRESS_TYPE_SELLER_TO_JUDGE = EnumExpressType.EXPRESS_TYPE_1.getCode();
... ... @@ -1593,8 +1586,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return resp;
}
@Override
@Override
public QcOrderDetailResp getQcOrderDetail(String orderCode) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if(null == buyerOrder) {
... ... @@ -1605,6 +1598,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatus(buyerOrder.getStatus());
resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
//检查买家是否是线下店的用户
resp.setInnerBuyerType("0");
OrderConfig config = orderConfigMapper.selectByCode(ORDER_CONFIG_INNER_BUYER_FOR_OFFLINE);
if(config!=null&&StringUtils.isNotBlank(config.getContent())&&buyerOrder.getUid()>0){
//
List<String> uidList = Splitter.on(",").trimResults().splitToList(config.getContent());
if(uidList.contains(String.valueOf(buyerOrder.getUid()))){
resp.setInnerBuyerType("1");
}
}
//卖家物流单号
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
... ... @@ -1726,7 +1730,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
LOGGER.info("method getSfWaybillCode Result is {}", data);
yhValueOperations.set(getRedisKey(req.getOrderCode()), JSONObject.toJSONString(data), 10, TimeUnit.HOURS);//10个小时
yhValueOperations.set(getRedisKey(req.getOrderCode()), JSONObject.toJSONString(data), 168, TimeUnit.HOURS); //7天
return data;
}
... ...
... ... @@ -39,6 +39,7 @@ public class BrandServiceImpl implements IBrandService {
brand.setEditTime(DateUtil.currentTimeSeconds());
brand.setEditPid(getUserId());
brand.setBrandLogo(ImagesHelper.getImageRelativeUrl(brand.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
brand.setSearchShowImage(ImagesHelper.getImageRelativeUrl(brand.getSearchShowImage(), ImagesConstant.BUCKET_SEARCH_SHOW_IMAGE));
if (brand.getId() == null || brand.getId() == 0) {
// 默认开启状态
brand.setStatus(1);
... ... @@ -68,6 +69,7 @@ public class BrandServiceImpl implements IBrandService {
responseBo = OrikaUtils.map(brand1, BrandResponseBo.class);
responseBo.setCreateTime(DateUtil.getDateStrBySecond(brand1.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
responseBo.setBrandLogo(ImagesHelper.getImageAbsoluteUrl(brand1.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
responseBo.setSearchShowImage(ImagesHelper.getImageAbsoluteUrl(brand1.getSearchShowImage(), ImagesConstant.BUCKET_SEARCH_SHOW_IMAGE));
brandResponseBos.add(responseBo);
}
return new PageResponseBO<>(count, brandResponseBos, pageModel.getCurrentPage(), pageModel.getPageSize());
... ... @@ -81,6 +83,7 @@ public class BrandServiceImpl implements IBrandService {
BrandResponseBo brandResponseBo = OrikaUtils.map(brand, BrandResponseBo.class);
brandResponseBo.setCreateTime(DateUtil.getDateStrBySecond(brand.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
brandResponseBo.setBrandLogo(ImagesHelper.getImageAbsoluteUrl(brand.getBrandLogo(), ImagesConstant.BUCKET_BRAND_LOGO));
brandResponseBo.setSearchShowImage(ImagesHelper.getImageAbsoluteUrl(brand.getSearchShowImage(), ImagesConstant.BUCKET_SEARCH_SHOW_IMAGE));
return brandResponseBo;
}
... ...
... ... @@ -49,6 +49,7 @@ datasources:
- com.yoho.order.dal.BusinessLicenseMapper
- com.yoho.order.dal.LiveRecordTimeMapper
- com.yoho.order.dal.SignForPackageMapper
- com.yoho.order.dal.OrderConfigMapper
ufo_resource:
servers:
... ...
... ... @@ -49,6 +49,7 @@ datasources:
- com.yoho.order.dal.BusinessLicenseMapper
- com.yoho.order.dal.LiveRecordTimeMapper
- com.yoho.order.dal.SignForPackageMapper
- com.yoho.order.dal.OrderConfigMapper
ufo_resource:
servers:
... ...
... ... @@ -121,6 +121,17 @@
return '<img src="' + value + '" style="width:98px;height:98px"/></a>';
}
}, {
title: "品牌搜索大图",
field: "searchShowImage",
width: 80,
align: "center",
formatter: function (value) {
if (value == null || value == '' || value == undefined) {
return '';
}
return '<img src="' + value + '" style="width:98px;height:98px"/></a>';
}
}, {
title: "品牌名称",
field: "brandName",
width: 100,
... ... @@ -269,8 +280,9 @@
if (!$("#brandEditForm").form("validate")) {
return false;
}
if ($("#brandEditForm #imageUpload").imageUpload("getValue") == null || $("#brandEditForm #imageUpload").imageUpload("getValue") == "") {
$.messager.alert("失败", "请上传图片", "error");
const brandLogoUpload = $("#brandEditForm #brandLogoUpload");
if (brandLogoUpload.imageUpload("getValue") == null || brandLogoUpload.imageUpload("getValue") === "") {
$.messager.alert("失败", "请上传品牌logo", "error");
return false;
}
$.messager.progress({
... ...
... ... @@ -19,10 +19,23 @@
<tr style="height: 60px">
<td width="10%"><span style="color:red">*</span>品牌LOGO</td>
<td>
<div id="imageUpload">
<div id="brandLogoUpload">
</div>
</td>
</tr>
<tr style="height: 60px">
<td width="10%">品牌搜索大图</td>
<td>
<div id="searchShowImageUpload">
</div>
</td>
</tr>
<tr style="line-height: 0px">
<td width="10%"></td>
<td width="50%">
<div style="color: #ab1e1e;margin-top: 0px">*请上传1035*501尺寸图片</div>
</td>
</tr>
<tr class="coupon" style="height: 60px">
<td width="10%"></span>品牌搜索词</td>
... ... @@ -61,7 +74,7 @@
//width: 240
});
$("#brandEditForm #imageUpload").imageUpload({
$("#brandEditForm #brandLogoUpload").imageUpload({
width: 171,
height: 120,
realInputName: "brandLogo",
... ... @@ -91,12 +104,43 @@
}
});
$("#brandEditForm #searchShowImageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "searchShowImage",
url: contextPath + '/fileupload/upload',
queryParams: {
bucket: "searchShowImage"
},
onBeforeSubmit: function () {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data;
},
onLoadSuccess: function (data) {
$.messager.progress("close");
return false;
}
});
if (brandId > 0) {
$.post(contextPath + "/brand/getBrandById", {
id: brandId
}, function (data) {
$("#brandEditForm").form("load", data.data);
$("#brandEditForm #imageUpload").imageUpload("setValue", data.data.brandLogo);
$("#brandEditForm #brandLogoUpload").imageUpload("setValue", data.data.brandLogo);
$("#brandEditForm #searchShowImageUpload").imageUpload("setValue", data.data.searchShowImage);
});
}
});
... ...