Authored by caoyan

Merge branch 'test6.8.4' of http://git.yoho.cn/ufo/ufo-platform into test6.8.4

... ... @@ -14,4 +14,6 @@ public interface QiniuLiveRecordMapper {
int updateVedioBySkup(QiniuLiveRecord record);
int updateStatusBySkup(@Param("skup")Integer skup, @Param("status")Integer status);
int updateShowFlagBySkup(@Param("skup")Integer skup, @Param("showFlag")Integer showFlag, @Param("id") Integer id);
}
\ No newline at end of file
... ...
... ... @@ -35,6 +35,26 @@ public class QiniuLiveRecord {
private Integer productId;
private Integer showFlag;
private Integer notInId;
public Integer getNotInId() {
return notInId;
}
public void setNotInId(Integer notInId) {
this.notInId = notInId;
}
public Integer getShowFlag() {
return showFlag;
}
public void setShowFlag(Integer showFlag) {
this.showFlag = showFlag;
}
public Integer getId() {
return id;
}
... ...
... ... @@ -18,10 +18,11 @@
<result column="storage_id" property="storageId" jdbcType="INTEGER" />
<result column="goods_id" property="goodsId" jdbcType="INTEGER" />
<result column="product_id" property="productId" jdbcType="INTEGER" />
<result column="show_flag" property="showFlag" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, skup, seller_order_code, depot_no, start_time, end_time, persist_id,
vedio_file_url, create_time, update_time, pid, status, storage_id, goods_id, product_id
vedio_file_url, create_time, update_time, pid, status, storage_id, goods_id, product_id, show_flag
</sql>
<select id="selectByOrderCodes" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
... ... @@ -33,7 +34,7 @@
</foreach>
</select>
<insert id="insert" parameterType="com.yoho.order.model.QiniuLiveRecord" >
<insert id="insert" parameterType="com.yoho.order.model.QiniuLiveRecord" useGeneratedKeys="true" keyProperty="id">
insert into qiniu_live_record (order_code, skup,
seller_order_code, depot_no, start_time,
end_time, persist_id, vedio_file_url,
... ... @@ -73,4 +74,11 @@
set status = #{status,jdbcType=INTEGER}
where skup = #{skup,jdbcType=INTEGER}
</update>
<update id="updateShowFlagBySkup">
update qiniu_live_record
set show_flag = #{showFlag,jdbcType=INTEGER}
where skup = #{skup,jdbcType=INTEGER} and id != #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -47,6 +47,15 @@
<if test="saleCategory.orderBy != null">
order_by = #{saleCategory.orderBy},
</if>
<if test="saleCategory.linkType != null">
link_type = #{saleCategory.linkType},
</if>
<if test="saleCategory.linkDetail != null">
link_detail = #{saleCategory.linkDetail},
</if>
<if test="saleCategory.imageUrl != null">
image_url = #{saleCategory.imageUrl},
</if>
update_time = #{saleCategory.updateTime}
</set>
where id = #{saleCategory.id}
... ...
... ... @@ -40,6 +40,9 @@ public class LiveEventsListener implements ApplicationListener<QiniuLiveRecordEv
public void onApplicationEvent(QiniuLiveRecordEvent event) {
LOGGER.info("LiveEventsListener.onApplicationEvent method in. param is {}", event);
QiniuLiveRecord record = event.getRecord();
qiniuLiveRecordMapper.updateShowFlagBySkup(record.getSkup(), 0, record.getNotInId());
List<SellerOrderGoods> sellerOrderGoodses = sellerOrderGoodsMapper.selectByIds(Lists.newArrayList(record.getSkup()));
if (CollectionUtils.isEmpty(sellerOrderGoodses)) {
return;
... ...
... ... @@ -375,7 +375,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
bo.setExpressCompanyId(req.getExpressCompanyId());
bo.setWayBillCode(req.getWaybillCode());
bo.setDepotNum(req.getDepotNo());
LOGGER.info("callAppraise orderCode is {}, startTime is {}", orderCode, DateUtil.getCurrentTimeSecond());
bo.setMobile(req.getMobile());
if(StringUtils.isBlank(bo.getMobile())){
throw new ServiceException(400,"错误:物流收货人手机号不能为空!");
}
LOGGER.info("callAppraise orderCode is {}, AppraiseExpressInfoBo is {}, startTime is {}", orderCode, bo ,DateUtil.getCurrentTimeSecond());
JSONObject jsonObject = serviceCaller.asyncCall(args, bo, JSONObject.class).get(5, TimeUnit.SECONDS);
LOGGER.info("callAppraise orderCode is {}, endTime is {}", orderCode, DateUtil.getCurrentTimeSecond());
... ...
... ... @@ -75,6 +75,8 @@ public class UfoLiveService implements ApplicationContextAware {
record.setVedioFileUrl(fileName + ".mp4");
qiniuLiveRecordMapper.insert(record);
record.setNotInId(record.getId());
context.publishEvent(record); // 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见
}
... ...
... ... @@ -5,6 +5,9 @@ import com.yoho.ufo.dal.SaleCategoryMapper;
import com.yoho.ufo.exception.CommonException;
import com.yoho.ufo.model.salecategory.SaleCategory;
import com.yoho.ufo.service.ISaleCategoryService;
import com.yoho.ufo.util.CollectionUtil;
import com.yoho.ufo.util.ImagesConstant;
import com.yoho.ufo.util.ImagesHelper;
import com.yoho.ufo.util.OrikaUtils;
import com.yohobuy.ufo.model.response.salecategory.SaleCategoryResponseBo;
import com.yohobuy.ufo.model.response.salecategory.SaleCategoryTreeViewResponseBo;
... ... @@ -71,6 +74,10 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
public void saveOrUpdateSaleCategory(SaleCategoryResponseBo saleCategoryResponseBo){
log.info("saveOrUpdateSaleCategory param = {}", saleCategoryResponseBo);
SaleCategory saleCategory = OrikaUtils.map(saleCategoryResponseBo, SaleCategory.class);
saleCategory.setImageUrl(ImagesHelper.getImageRelativeUrl(saleCategory.getImageUrl(), ImagesConstant.BUCKET_SALE_CATEGORY_IMG));
if(StringUtils.isBlank(saleCategory.getLinkType())){
saleCategory.setLinkType(StringUtils.EMPTY);
}
if (saleCategory.getId() == null || saleCategory.getId() == 0) {
// 新增
if (saleCategory.getParentId() == null || saleCategory.getParentId() == 0) {
... ... @@ -101,8 +108,11 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
if(db_saleCategory==null){
throw new CommonException(201, "找不到销售类目!");
}
db_saleCategory.setCategoryName(saleCategoryResponseBo.getCategoryName());
db_saleCategory.setOrderBy(saleCategoryResponseBo.getOrderBy());
db_saleCategory.setCategoryName(saleCategory.getCategoryName());
db_saleCategory.setOrderBy(saleCategory.getOrderBy());
db_saleCategory.setImageUrl(saleCategory.getImageUrl());
db_saleCategory.setLinkType(saleCategory.getLinkType());
db_saleCategory.setLinkDetail(saleCategory.getLinkDetail());
db_saleCategory.setUpdateTime(DateUtil.currentTimeSeconds());
List<SaleCategory> sameNameList = saleCategoryMapper.selectByNameAndParentId(saleCategory.getCategoryName(),saleCategory.getParentId());
... ... @@ -123,6 +133,7 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
log.info("enter getSaleCategoryById param = {}",id);
SaleCategory saleCategory = saleCategoryMapper.selectById(id);
if(saleCategory!=null){
saleCategory.setImageUrl(ImagesHelper.getImageAbsoluteUrl(saleCategory.getImageUrl(), ImagesConstant.BUCKET_SALE_CATEGORY_IMG));
return OrikaUtils.map(saleCategory, SaleCategoryResponseBo.class);
}
return null;
... ...
... ... @@ -750,6 +750,7 @@ function addQueryPage(skup, order_code, id) {
function deliverGoods(id){
var expressCompanyId = $("#expressCompany").myCombobox("getValue");
var waybillCode = $("#waybillCode").textbox("getValue");
var mobile = $("#receiveInfo_mobile").val();
if(expressCompanyId==''){
alert("请选择快递公司!");
return;
... ... @@ -758,11 +759,16 @@ function deliverGoods(id){
alert("请填写快递单号!");
return;
}
if(!mobile){
alert("收货人手机号为空!");
return;
}
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
id : id,
status : 4,
expressCompanyId : expressCompanyId,
waybillCode : waybillCode,
mobile:mobile,
depotNo: $("#depotNo").combobox("getValue")
}, function(data) {
if (data.code == 200) {
... ... @@ -785,6 +791,7 @@ function deliverGoods(id){
function reBackGoods(id){
var expressCompanyId = $("#expressCompany").myCombobox("getValue");
var waybillCode = $("#waybillCode").textbox("getValue");
var mobile = $("#sendBackInfo_mobile").val();
if(expressCompanyId==''){
alert("请选择快递公司!");
return;
... ... @@ -793,11 +800,16 @@ function reBackGoods(id){
alert("请填写快递单号!");
return;
}
if(!mobile){
alert("收货人手机号为空!");
return;
}
$.post(contextPath + "/buyerOrder/returnBackOrder", {
id : id,
status : 17,
expressCompanyId : expressCompanyId,
waybillCode : waybillCode,
mobile:mobile,
depotNo: $("#depotNo").combobox("getValue")
}, function(data) {
if (data.code == 200) {
... ... @@ -818,6 +830,7 @@ function reBackGoods(id){
function sendBackGoods(id){
var expressCompanyId = $("#expressCompany").myCombobox("getValue");
var waybillCode = $("#waybillCode").textbox("getValue");
var mobile = $("#sendBackInfo_mobile").val();
if(expressCompanyId==''){
alert("请选择快递公司!");
return;
... ... @@ -826,11 +839,16 @@ function sendBackGoods(id){
alert("请填写快递单号!");
return;
}
if(!mobile){
alert("收货人手机号为空!");
return;
}
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
id : id,
status : 13,
expressCompanyId : expressCompanyId,
waybillCode : waybillCode,
mobile:mobile,
depotNo: $("#depotNo").combobox("getValue")
}, function(data) {
if (data.code == 200) {
... ...
... ... @@ -12,6 +12,7 @@
<tr>
<td>买家地址:</td>
<td colspan="2" >
<input type="hidden" id="receiveInfo_mobile"/>
<span id="receiveInfo"></span>
</td>
</tr>
... ... @@ -57,11 +58,13 @@
var name = result.data.receiveName;
var mobile = result.data.receiveMobile;
var address = result.data.receiveAddress;
$("#receiveInfo_mobile").val(mobile);
$("#receiveInfo").html("姓名:" + name + "<br>" + "手机号:" + mobile + "<br>" + "地址:" + address + "&nbsp;<button id='addressCopy'>复制</button>");
new ClipboardJS('#addressCopy', {
text: function() {
return address;
return name + '\r\n' + mobile + '\r\n' + address;
}
});
}
... ...
... ... @@ -12,6 +12,7 @@
<tr>
<td>商品寄回地址:</td>
<td colspan="2" >
<input type="hidden" id="sendBackInfo_mobile">
<span id="sendBackInfo"></span>
</td>
</tr>
... ... @@ -57,11 +58,13 @@
var name = result.data.receiveName;
var mobile = result.data.receiveMobile;
var address = result.data.receiveAddress;
$("#sendBackInfo_mobile").val(mobile);
$("#sendBackInfo").html("姓名:" + name + "<br>" + "手机号:" + mobile + "<br>" + "地址:" + address + "&nbsp;<button id='rejectAddressCopy'>复制</button>");
new ClipboardJS('#rejectAddressCopy', {
text: function() {
return address;
return name + '\r\n' + mobile + '\r\n' + address;
}
});
}
... ...
<!DOCTYPE html>
<style>
.sale-category-detail-page .goods-image {
display: flex;
}
.sale-category-detail-page .goods-image .img {
width: 104px;
height: 104px;
margin-right: 10px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
}
.sale-category-detail-page .goods-image .img:hover:before {
content: "删除";
width: 100%;
display: block;
position: absolute;
top: 0;
background: #000;
opacity: 0.5;
color: #fff;
text-align: center;
line-height: 104px;
}
</style>
<div class="sale-category-detail-page" style="overflow-y: scroll">
<form name="categoryEditForm" id="categoryEditForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" />
<input type="hidden" name="parentId" id="parentId"/>
<input type="hidden" name="imageUrl" id="imageUrl"/>
<div style="margin-top: 5px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>名称</label></td>
<td>
<div style="width:200px;">
<input class="easyui-textbox" id="categoryName" name="categoryName" data-options="validType:'length[1,30]'" />
</div>
</td>
</tr>
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>排序值</label></td>
<td>
<input class="easyui-numberbox" id="orderBy" name="orderBy" data-options="validType:'length[1,10]'" />
</td>
</tr>
</table>
</div>
<div class="goods-image" style="margin-top: 5px;margin-left: 30px">
<div style="width:20%;margin-top:5px;line-height:30px;" >
<span style="color:red">*</span><label>分类图标</label>
</div>
<div id="imageUpload"></div>
</div>
<div style="margin-top: 5px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" >
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>跳转类型</label></td>
<td>
<div style="width:200px;">
<select name="linkType" class="easyui-combobox" style="width:200px;" panelHeight="auto" required="true">
<option value="series" selected>系列</option>
<option value="brand">品牌</option>
<option value="sort">品类</option>
<option value="productPool">商品池</option>
<option value="h5">h5</option>
</select>
</div>
</td>
</tr>
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>跳转目的</label></td>
<td>
<input class="easyui-textbox" name="linkDetail" data-options="validType:'length[1,500]'" style="width:500px;" required="true"/>
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
this.dom = {
imageUpload: $('#categoryEditForm #imageUpload')
};
$("#categoryEditForm #categoryName").textbox({
required: true,
missingMessage: "销售类目名称不能为空",
prompt: "请输入",
width: "200px"
});
$("#categoryEditForm #orderBy").numberbox({
required: true,
precision:0,
min:1,
missingMessage: "排序值不能为空",
prompt: "请输入",
width:"200px"
});
this.dom.imageUpload.imageUpload({
width: 104,
height: 104,
realInputName: "imageUrl",
url: contextPath + '/fileupload/upload',
queryParams: {
bucket: "salecategoryimg"
},
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.url;
},
onLoadSuccess: function (data) {
console.log(data.data );
$.messager.progress("close");
$(document).find('.file-close').click();
//只保留最佳的成功的
$(".sale-category-detail-page .goods-image .img").remove();
$('#categoryEditForm #imageUpload').before('<div class="img" data-url="' + data.data + '" style="background-image:url(' + data.data + ');">');
return false;
}
});
$(document).on('click', '.goods-image .img', function() {
$(this).remove();
});
$("#categoryEditForm #parentId").val(saleCategoryParentId);
if (saleCategoryId > 0) {
$.post(contextPath + "/saleCategory/getSaleCategoryById", {
id: saleCategoryId
}, function (data) {
$("#categoryEditForm").form("load", data.data);
if (data.data.imageUrl && data.data.imageUrl.length > 0) {
const item = data.data.imageUrl;
$('#categoryEditForm #imageUpload').before('<div class="img" data-url="' + item + '" style="background-image:url(' + item + ');">');
}
});
}
});
</script>
\ No newline at end of file
... ...
... ... @@ -23,6 +23,16 @@
.div_search .easyui-linkbutton {
margin-top: 20px;
}
.sale-category-detail-page .img222 {
width: 104px;
height: 104px;
margin-right: 10px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
}
</style>
<div style="margin-left: 30px;" class="div_search">
<a id="addSaleCategory" class="easyui-linkbutton btn-success">添加一级销售类目</a>
... ... @@ -117,17 +127,16 @@
if(1== rowData.level||2==rowData.level) {
str += "<a role='edit' dataId='" + rowData.id + "' dataParentId='"+rowData.parentId+"' style='margin-left:10px;background-color: #5bc0de'>编辑</a>"
str += "<a role='edit' dataId='" + rowData.id + "' dataParentId='"+rowData.parentId+"' style='margin-left:10px;background-color: #5bc0de'>编辑</a>";
}else{
str += "<a role='addOrEditThirdLevel' dataId='" + rowData.id + "' dataParentId='"+rowData.parentId+"' style='margin-left:10px;background-color: #5bc0de'>编辑</a>"
str += "<a role='editThirdLevel' dataId='" + rowData.id + "' dataParentId='"+rowData.parentId+"' style='margin-left:10px;background-color: #5bc0de'>编辑</a>"
}
if(1== rowData.level||2==rowData.level) {
str = "<a role='edit' dataId='" + rowData.id + "' dataParentId='"+rowData.parentId+"' style='margin-left:10px;background-color: #5bc0de'>编辑</a>";
if(1==rowData.level){
str += "<a role='addSecondLevel' dataId='" + rowData.id + "' style='margin-left:10px;background-color: #5bc0de;color:white;'>添加子类</a>";
}else {
str += "<a role='addOrEditThirdLevel' dataId='" + rowData.id + "' style='margin-left:10px;background-color: #5bc0de;color:white;'>添加子类</a>";
str += "<a role='addThirdLevel' dataId='" + rowData.id + "' style='margin-left:10px;background-color: #5bc0de;color:white;'>添加子类</a>";
}
}
... ... @@ -159,12 +168,22 @@
}
});
$(this).myDatagrid("getPanel").find("a[role='addOrEditThirdLevel']").linkbutton({
$(this).myDatagrid("getPanel").find("a[role='addThirdLevel']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
//添加子类,当前类的id作为pid
var id = $(this).attr("dataId");
editRowThird(0,id);
}
});
$(this).myDatagrid("getPanel").find("a[role='editThirdLevel']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
//添加子类,当前类的id作为pid
var id = $(this).attr("dataId");
alert("开发中"+id);
var pid = $(this).attr("dataParentId");
editRowThird(id,pid);
}
});
... ... @@ -201,10 +220,10 @@
saleCategoryId = id;
saleCategoryParentId = pid;
var div = $("<div>").appendTo($(document.body));
var title = "编辑品类";
var title = "编辑销售类目";
var message = "确认修改销售类目信息吗?";
if (id == 0) {
title = "添加品类";
title = "添加销售类目";
message = "确认添加销售类目信息吗?";
}
$(div).myDialog({
... ... @@ -266,6 +285,87 @@
});
}
function editRowThird(id,pid) {
saleCategoryId = id;
saleCategoryParentId = pid;
var div = $("<div>").appendTo($(document.body));
var title = "编辑销售类目";
var message = "确认修改销售类目信息吗?";
if (id == 0) {
title = "添加销售类目";
message = "确认添加销售类目信息吗?";
}
$(div).myDialog({
width: "850px",
height: "500px",
title: title,
href: contextPath + "/html/saleCategory/addOrEditThirdLevel.html",
queryParams: {
saleCategoryParentId:saleCategoryParentId,
id: id
},
modal: true,
collapsible: true,
cache: false,
buttons: [{
id: "saveBtn",
text: "保存",
handler: function () {
$.messager.confirm("确认", message, function (flag) {
if(flag) {
$("#categoryEditForm").form("submit", {
url: contextPath + "/saleCategory/saveOrUpdateSaleCategory",
onSubmit: function () {
if (!$("#categoryEditForm").form("validate")) {
return false;
}
var imageUrlList = [];
$('.goods-image .img').each(function(index, item) {
imageUrlList.push($(item).data('url'));
});
if(imageUrlList.length!=1){
$.messager.alert('操作提示', '必须要上传1张图片,而且只允许有1张!',"warning");
return false;
}
$("#categoryEditForm #imageUrl").val(imageUrlList[0]);
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
});
return true;
},
success: function (data) {
$.messager.progress("close");
data = JSON.parse(data);
if (data.code == 200) {
$(div).dialog("close");
$("#saleCategoryTable").treegrid("reload");
$.messager.show({
title: "提示",
msg: title + "成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}
});
}
});
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
function updateBrandStatus(id, status, parentId) {
var message = "";
var msg = "";
... ...