Authored by caoyan

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

... ... @@ -13,6 +13,8 @@ import com.yoho.order.model.BuyerOrderReq;
public interface BuyerOrderMapper {
int selectCountByStatus(List<Byte> statusList);
int selectCountByStatusForAbnormalSellerDelivery(@Param("list") List<Byte> statusList ,@Param("currentSecondMinus24Hours") Integer currentSecondMinus24Hours);
int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo, @Param("platformExpressInfoFlag")String platformExpressInfoFlag);
... ... @@ -27,4 +29,8 @@ public interface BuyerOrderMapper {
BuyerOrder selectById(@Param("id") Integer id);
BuyerOrder selectByOrderCodeAndStatus(@Param("orderCode") String orderCode, @Param("status") byte status);
// 修改订单的卖家发货 已处理
int updateSellerDeliveryDealByOrderCode(@Param("orderCode")long orderCode, @Param("uid")int uid);
}
... ...
package com.yoho.order.model;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
... ... @@ -52,6 +54,10 @@ public class BuyerOrder implements Serializable {
private Integer platformDeliveryStatus;//1 平台发货给卖家, 2 平台发货给买家
private Integer sellerDeliveryStatus;//卖家的发货物流:1 :已发货且有物流
private Integer sellerDeliveryDeal;//卖家的发货物流,操作员是否已经处理:0:未处理 ,1 :已处理
public Integer getId() {
return id;
}
... ... @@ -180,4 +186,19 @@ public class BuyerOrder implements Serializable {
this.platformDeliveryStatus = platformDeliveryStatus;
}
public Integer getSellerDeliveryStatus() {
return sellerDeliveryStatus;
}
public void setSellerDeliveryStatus(Integer sellerDeliveryStatus) {
this.sellerDeliveryStatus = sellerDeliveryStatus;
}
public Integer getSellerDeliveryDeal() {
return sellerDeliveryDeal;
}
public void setSellerDeliveryDeal(Integer sellerDeliveryDeal) {
this.sellerDeliveryDeal = sellerDeliveryDeal;
}
}
... ...
... ... @@ -114,4 +114,8 @@ public class BuyerOrderReq extends PageRequestBO{
private Integer clientType; //订单来源 1-PC,3-iphone, 4-android, 5-ipad, 6-h5, 7-miniapp
private Integer attributes; //订单类型 1-普通现货订单,2-线下店订单,3-急速发货订单,4-普通预售
private Integer sellerDeliveryStatus ;
private Integer currentSecondMinus24Hours;
}
... ...
... ... @@ -18,11 +18,14 @@
<result column="channel_no" property="channelNo" jdbcType="VARCHAR" />
<result column="attributes" property="attributes" jdbcType="INTEGER" />
<result column="platform_delivery_status" jdbcType="INTEGER" property="platformDeliveryStatus" />
<result column="seller_delivery_status" jdbcType="INTEGER" property="sellerDeliveryStatus" />
<result column="seller_delivery_deal" jdbcType="INTEGER" property="sellerDeliveryDeal" />
</resultMap>
<sql id="Base_Column_List">
id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel,
amount, ship_fee, status, create_time, update_time, channel_no, attributes ,platform_delivery_status
amount, ship_fee, status, create_time, update_time, channel_no, attributes ,platform_delivery_status,
seller_delivery_status,seller_delivery_deal
</sql>
<select id="selectByOrderCode" resultMap="BaseResultMap">
... ... @@ -45,6 +48,20 @@
</foreach>
</if>
</select>
<select id="selectCountByStatusForAbnormalSellerDelivery" resultType="java.lang.Integer">
select count(1)
from buyer_order where 1=1
and seller_delivery_status = 0
and update_time &lt; #{currentSecondMinus24Hours}
<if test="list != null and list.size()>0">
and status in
<foreach collection="list" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</if>
</select>
<select id="selectCountByStatusAndDepotNo" resultType="java.lang.Integer">
select count(1)
... ... @@ -104,6 +121,12 @@
<if test="buyerOrderReq.clientType != null and buyerOrderReq.clientType != '' ">
and a.client_type = #{buyerOrderReq.clientType}
</if>
<if test="buyerOrderReq.sellerDeliveryStatus != null ">
and a.seller_delivery_status = #{buyerOrderReq.sellerDeliveryStatus}
</if>
<if test="buyerOrderReq.currentSecondMinus24Hours != null ">
and a.update_time &lt; #{buyerOrderReq.currentSecondMinus24Hours}
</if>
<if test="buyerOrderReq.status != null ">
and a.status = #{buyerOrderReq.status}
</if>
... ... @@ -226,4 +249,10 @@
where order_code=#{orderCode} and status=#{status}
</select>
<update id="updateSellerDeliveryDealByOrderCode">
update buyer_order set
seller_delivery_deal = 1
where uid = #{uid,jdbcType=INTEGER} and order_code = #{orderCode,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.constant;
import com.yoho.core.config.ConfigReader;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* Created by li.ma on 2019/4/15.
*/
@Service
public class OrderConfigConstant {
private static Map<Integer, String> orderAttributeMap = new HashMap<>();
static {
orderAttributeMap.put(OrderAttributes.ADVANCE_SALE.getCode(), "预售");
orderAttributeMap.put(OrderAttributes.OFFLINE.getCode(), "线下店");
orderAttributeMap.put(OrderAttributes.SECOND_HAND.getCode(), "二手");
orderAttributeMap.put(OrderAttributes.FLAW.getCode(), "全新瑕疵");
orderAttributeMap.put(OrderAttributes.COMMON_IN_STOCK.getCode(), "现货");
orderAttributeMap.put(OrderAttributes.QUICK_DELIVER.getCode(), "急速发货");
}
@Autowired
private ConfigReader configReader;
... ... @@ -16,4 +31,13 @@ public class OrderConfigConstant {
public boolean getVedioConfig() {
return configReader.getBoolean("ufo.Vedio.Config", true);
}
public static Map<Integer, String> getOrderAttributeMap() {
return orderAttributeMap;
}
public static String getOrderAttributeStr(Integer attribute) {
String attributeStr = orderAttributeMap.get(attribute);
return null == attributeStr ? "" : attributeStr;
}
}
... ...
... ... @@ -75,6 +75,14 @@ public class BuyerOrderController {
}
}
//更新订单异常物流的处理状态
@RequestMapping(value = "/updateSellerDeliveryDeal")
public ApiResponse updateSellerDeliveryDeal(BuyerOrderReq req) {
LOGGER.info("confirmReceive in. req is {}", req);
buyerOrderService.updateSellerDeliveryDeal(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("处理订单成功").build();
}
//质检通过
@RequestMapping(value = "/qualityCheckPass")
public ApiResponse qualityCheckPass(BuyerOrderReq req) {
... ...
... ... @@ -24,6 +24,8 @@ public interface IBuyerOrderService {
JSONObject confirmReceive(BuyerOrderReq req);
void updateSellerDeliveryDeal(BuyerOrderReq req);
/**
* 客服取消订单
* @param orderCode
... ...
... ... @@ -28,11 +28,9 @@ import com.yoho.ufo.service.model.PageResponseBO;
import com.yoho.ufo.util.*;
import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohobuy.ufo.model.order.resp.SkupImageInfo;
import com.yohobuy.ufo.model.resp.product.*;
import com.yohobuy.ufo.model.resp.product.SecondDetailResp;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -378,6 +376,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resultMap.put("num_9", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(9)));//瑕疵确认中
resultMap.put("num_10", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(10)));//瑕疵确认通过
resultMap.put("num_11", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(11)));//平台鉴定通过
int currentSecondMinus24Hours = DateUtil.getCurrentTimeSeconds() - 24*60*60;
resultMap.put("num_12", buyerOrderMapper.selectCountByStatusForAbnormalSellerDelivery(getStatusListByNavStatus(12),currentSecondMinus24Hours));//待卖家发货
return resultMap;
}
... ... @@ -733,6 +733,25 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
@Override
public void updateSellerDeliveryDeal(BuyerOrderReq req){
String orderCode = req.getOrderCode();
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if (null == buyerOrder) {
throw new ServiceException(400, "订单不存在");
}
if(1==buyerOrder.getSellerDeliveryDeal()){
return ;
}
//更新
buyerOrderMapper.updateSellerDeliveryDealByOrderCode(Long.valueOf(orderCode),buyerOrder.getUid());
//记录一条操作记录
int operateType =OperateTypeEnum.SELLER_DELIVERY_DEAL_FLAG.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("updateSellerDeliveryDeal saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {}",operateType,buyerOrder.getOrderCode() ,userHelper);
}
@Override
public void cancelBuyerOrder(String orderCode) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if (null == buyerOrder) {
... ... @@ -1612,6 +1631,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatusStr(Constant.convertOrderStatusStr(buyerOrder.getStatus()));
resp.setCreateTimeStr(DateUtil.int2DateStr(buyerOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
resp.setAttributes(buyerOrder.getAttributes());
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(buyerOrder.getAttributes()));
//检查买家是否是线下店的用户
resp.setInnerBuyerType("0");
... ... @@ -2386,6 +2406,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setSkup(skup);
resp.setSellerDeliveryDeal(item.getSellerDeliveryDeal());
resp.setSellerDeliveryDealDesc(1==item.getSellerDeliveryDeal()?"已处理":"未处理");
resp.setSellerWaybillCode(null == expressInfoMap.get(item.getOrderCode()) ? "" : expressInfoMap.get(item.getOrderCode()).getWaybillCode());
resp.setSellerOrderCode(null == sellerOrder ? "-" : sellerOrder.getOrderCode());
resp.setCreateTimeStr(null == item.getCreateTime() ? "" : DateUtil.int2DateStr(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
... ... @@ -2494,6 +2517,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setStatus(item.getStatus());
resp.setAttributes(item.getAttributes());
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes()));
respList.add(resp);
}
... ... @@ -2538,6 +2562,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal());
case 11:
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal());
case 12:
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal());
default:
return Lists.newArrayList();
}
... ... @@ -2550,6 +2576,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if(null != req.getNavStatus()) {
req.setStatusList(getStatusListByNavStatus(req.getNavStatus()));
//特殊处理:物流异常的订单
if(12==req.getNavStatus()){
int currentSecondMinus24Hours = DateUtil.getCurrentTimeSeconds() - 24*60*60;
req.setCurrentSecondMinus24Hours(currentSecondMinus24Hours);
req.setSellerDeliveryStatus(0);
}
}
//attributes=2为门店自提
... ...
... ... @@ -33,6 +33,7 @@
<li><a href="javascript:switchOrderStatus(5);">平台已发货(<span id="num_5"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(6);">订单完成(<span id="num_6"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(7);">已取消(<span id="num_7">)</span>)</a></li>
<li><a href="javascript:switchOrderStatus(12);">物流更新异常(<span id="num_12"></span>)</a></li>
</ul>
</div>
<br>
... ... @@ -203,6 +204,10 @@ $(function() {
function getOrderList(){
var navStatus = document.getElementById("navStatus").value;
var abnormalDeliveryTab=false;
if(12==navStatus){
abnormalDeliveryTab=true;
}
$("#orderListTable").myDatagrid({
fit: true,
fitColumns: true,
... ... @@ -269,6 +274,7 @@ function getOrderList(){
title: "订单状态",
field: "status",
width: 20,
hidden:abnormalDeliveryTab,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.statusStr){
... ... @@ -276,6 +282,12 @@ function getOrderList(){
}
return value;
}
}, {
title: "是否处理",
field: "sellerDeliveryDealDesc",
width: 20,
hidden:!abnormalDeliveryTab,
align: "center"
},{
title: "下单时间",
field: "createTimeStr",
... ... @@ -291,7 +303,11 @@ function getOrderList(){
buttons += "<a role='detail' dataId='"+ rowData.orderCode + "' skup='"+ rowData.skup + "' style='margin-left:10px;background-color: #5cb85c !important;'>详情</a>";
// 卖家已发货
if(rowData.status == 2){
buttons += "<a role='cancelOrder' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #D31225 !important;'>取消订单</a>";
buttons += "<a role='cancelOrder' dataId='"+ rowData.orderCode +"' style='margin-left:10px;color:white;background-color: #D31225 !important;'>取消订单</a>";
if(abnormalDeliveryTab&&(1!=rowData.sellerDeliveryDeal)){
buttons += "<a role='sellerDeliveryDealOrder' dataId='"+ rowData.orderCode +"' style='margin-left:10px;color:white;background-color: #5bc0de !important;'>处理</a>";
}
}
return buttons;
}
... ... @@ -313,6 +329,25 @@ function getOrderList(){
}
});
me.datagrid("getPanel").find("a[role='sellerDeliveryDealOrder']").linkbutton({
onClick: function () {
var orderCode = $(this).attr("dataId");
$.post(contextPath + "/buyerOrder/updateSellerDeliveryDeal", {
orderCode : orderCode
}, function(data) {
if (data.code == 200) {
window.self.$.messager.show({
title : "提示",
msg : "处理订单成功!"
});
me.datagrid('reload');
}else {
window.self.$.messager.alert("失败", data.message, "error");
}
});
}
});
me.datagrid("getPanel").find("a[role='cancelOrder']").linkbutton({
onClick: function () {
var orderCode = $(this).attr("dataId");
... ... @@ -357,9 +392,10 @@ function switchOrderStatus(navStatus){
$("#attributes").combobox('setValue','');
$("#buyerStartTime").datetimebox('setValue','');
$("#buyerEndTime").datetimebox('setValue','');
$("#orderListTable").datagrid("load", {
/*$("#orderListTable").datagrid("load", {
navStatus : navStatus
});
});*/
getOrderList();
}
function getCountByNavStatus(){
... ... @@ -387,6 +423,7 @@ function getCountByNavStatus(){
$("#num_9").html(result.data.num_9);
$("#num_10").html(result.data.num_10);
$("#num_11").html(result.data.num_11);
$("#num_12").html(result.data.num_12);
}
else {
$.messager.alert("失败", result.message, "error");
... ...