Authored by qinchao

add:订单状态拆分功能

... ... @@ -14,7 +14,7 @@ public interface BuyerOrderMapper {
int selectCountByStatus(List<Byte> statusList);
int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo);
int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo, @Param("platformExpressInfoFlag")String platformExpressInfoFlag);
int selectTotalByCondition(@Param("buyerOrderReq") BuyerOrderReq req);
... ...
... ... @@ -3,10 +3,14 @@ package com.yoho.order.model;
import java.util.List;
import com.yoho.ufo.service.model.PageRequestBO;
import lombok.Data;
import lombok.ToString;
/**
* Created by caoyan.
*/
@Data
@ToString
public class BuyerOrderReq extends PageRequestBO{
/**
... ... @@ -61,232 +65,10 @@ public class BuyerOrderReq extends PageRequestBO{
private String waybillCode;
private List<Integer> skupList;
//是否存在平台物流信息的检索标记:haveNotExpress , haveExpress
private String platformExpressInfoFlag;
private String queryStr;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Integer getSellerUid() {
return sellerUid;
}
public void setSellerUid(Integer sellerUid) {
this.sellerUid = sellerUid;
}
public String getSellerWaybillCode() {
return sellerWaybillCode;
}
public void setSellerWaybillCode(String sellerWaybillCode) {
this.sellerWaybillCode = sellerWaybillCode;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getStorageId() {
return storageId;
}
public void setStorageId(Integer storageId) {
this.storageId = storageId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Integer getSkup() {
return skup;
}
public void setSkup(Integer skup) {
this.skup = skup;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public List<Byte> getStatusList() {
return statusList;
}
public void setStatusList(List<Byte> statusList) {
this.statusList = statusList;
}
public String getStatusStr() {
return statusStr;
}
public void setStatusStr(String statusStr) {
this.statusStr = statusStr;
}
public Integer getDepotNo() {
return depotNo;
}
public void setDepotNo(Integer depotNo) {
this.depotNo = depotNo;
}
public Integer getNavStatus() {
return navStatus;
}
public void setNavStatus(Integer navStatus) {
this.navStatus = navStatus;
}
public Integer getExpressType() {
return expressType;
}
public void setExpressType(Integer expressType) {
this.expressType = expressType;
}
public String getExpressTypeStr() {
return expressTypeStr;
}
public void setExpressTypeStr(String expressTypeStr) {
this.expressTypeStr = expressTypeStr;
}
public String getReceiveName() {
return receiveName;
}
public void setReceiveName(String receiveName) {
this.receiveName = receiveName;
}
public String getReceiveMobile() {
return receiveMobile;
}
public void setReceiveMobile(String receiveMobile) {
this.receiveMobile = receiveMobile;
}
public String getReceiveAddressDetail() {
return receiveAddressDetail;
}
public void setReceiveAddressDetail(String receiveAddressDetail) {
this.receiveAddressDetail = receiveAddressDetail;
}
public String getReceiveZipCode() {
return receiveZipCode;
}
public void setReceiveZipCode(String receiveZipCode) {
this.receiveZipCode = receiveZipCode;
}
public String getReceiveAreaCode() {
return receiveAreaCode;
}
public void setReceiveAreaCode(String receiveAreaCode) {
this.receiveAreaCode = receiveAreaCode;
}
public Integer getExpressCompanyId() {
return expressCompanyId;
}
public void setExpressCompanyId(Integer expressCompanyId) {
this.expressCompanyId = expressCompanyId;
}
public String getWaybillCode() {
return waybillCode;
}
public void setWaybillCode(String waybillCode) {
this.waybillCode = waybillCode;
}
public List<Integer> getSkupList() {
return skupList;
}
public void setSkupList(List<Integer> skupList) {
this.skupList = skupList;
}
public String getQueryStr() {
return queryStr;
}
public void setQueryStr(String queryStr) {
this.queryStr = queryStr;
}
public String toString() {
return "BuyerOrderListReq{" + '\'' +
"orderCode=" + orderCode + '\'' +
"uid=" + uid + '\'' +
"sellerUid=" + sellerUid + '\'' +
"sellerWaybillCode=" + sellerWaybillCode + '\'' +
"productId=" + productId + '\'' +
"storageId=" + storageId + '\'' +
"skup=" + skup + '\'' +
"status=" + status + '\'' +
"statusList=" + statusList + '\'' +
"statusStr=" + statusStr + '\'' +
"depotNo=" + depotNo + '\'' +
"expressType=" + expressType + '\'' +
"receiveName=" + receiveName + '\'' +
"receiveMobile=" + receiveMobile + '\'' +
"mobile="+mobile+ '\'' +
"receiveAddressDetail=" + receiveAddressDetail + '\'' +
"receiveZipCode=" + receiveZipCode + '\'' +
"receiveAreaCode=" + receiveAreaCode + '\'' +
"expressCompanyId=" + expressCompanyId + '\'' +
"waybillCode=" + waybillCode + '\'' +
"queryStr=" + queryStr + '\'' +
'}';
}
}
... ...
... ... @@ -63,6 +63,16 @@
<if test="depotNo != null">
and c.depot_no=#{depotNo}
</if>
<!-- 平台物流是否存在 -->
<if test="platformExpressInfoFlag != null and platformExpressInfoFlag != '' ">
and
<if test="platformExpressInfoFlag == 'haveNotExpress'">
NOT
</if>
exists (
select tmp.id from express_record tmp where a.order_code = tmp.order_code and tmp.express_type in (2,3,4)
)
</if>
</select>
<sql id="Query_Order_Sql" >
... ... @@ -84,9 +94,6 @@
<if test="buyerOrderReq.productId != null and buyerOrderReq.productId != 0 ">
and c.product_id = #{buyerOrderReq.productId}
</if>
<if test="buyerOrderReq.storageId != null and buyerOrderReq.storageId != 0 ">
and c.storage_id = #{buyerOrderReq.storageId}
</if>
<if test="buyerOrderReq.skup != null and buyerOrderReq.skup != 0 ">
and c.id = #{buyerOrderReq.skup}
</if>
... ... @@ -99,12 +106,22 @@
<if test="buyerOrderReq.sellerWaybillCode != null and buyerOrderReq.sellerWaybillCode != '' ">
and d.waybill_code = #{buyerOrderReq.sellerWaybillCode} and d.express_type=1
</if>
<!-- 平台物流是否存在 -->
<if test="buyerOrderReq.platformExpressInfoFlag != null and buyerOrderReq.platformExpressInfoFlag != '' ">
and
<if test="buyerOrderReq.platformExpressInfoFlag == 'haveNotExpress'">
NOT
</if>
exists (
select tmp.id from express_record tmp where a.order_code = tmp.order_code and tmp.express_type in (2,3,4)
)
</if>
</sql>
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
select count(a.id)
from buyer_order a
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.storageId != null) or (buyerOrderReq.skup != null)">
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null)">
LEFT JOIN buyer_order_goods b
ON( b.order_code=a.order_code)
LEFT JOIN seller_order_goods c
... ... @@ -121,7 +138,7 @@
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BuyerOrderReq">
select a.*
from buyer_order a
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.storageId != null) or (buyerOrderReq.skup != null)">
<if test="(buyerOrderReq.depotNo != null) or (buyerOrderReq.productId != null) or (buyerOrderReq.skup != null)">
LEFT JOIN buyer_order_goods b
ON( b.order_code=a.order_code)
LEFT JOIN seller_order_goods c
... ...
... ... @@ -10,9 +10,15 @@ public enum Constant {
//商品调拨中(卖家发货,可查物流)
BUYER_ORDER_STATUS_ALLOCATING((byte)2,"卖家已发货"),
//平台已收货(卖家发货后,平台确认收货,进入平台已收货)
BUYER_ORDER_STATUS_PLATFORM_RECEIVE((byte)31,"平台已收货"),
//有货平台鉴定中
//有货平台鉴定中(平台已收货,点开始鉴定-->进入鉴定中)
BUYER_ORDER_STATUS_JUDGING((byte)3,"平台鉴定中"),
//平台鉴定通过
BUYER_ORDER_STATUS_JUDGE_PASS((byte)32,"平台鉴定通过"),
//待收货
BUYER_ORDER_STATUS_TO_BE_RECEIVED((byte)4,"平台已发货"),
... ... @@ -40,7 +46,6 @@ public enum Constant {
//买家取消,卖家发货之后
BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY((byte)17,"已取消(买家在卖家发货后取消订单)"),
;
private byte byteVal;
... ...
... ... @@ -63,7 +63,52 @@ public class BuyerOrderController {
PageResponseBO<BuyerOrderResp> result = buyerOrderService.queryOrderList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/confirmReceive")
public ApiResponse confirmReceive(BuyerOrderReq req) {
LOGGER.info("confirmReceive in. req is {}", req);
JSONObject result = buyerOrderService.confirmReceive(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("确认收货成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
@RequestMapping(value = "/judgeBegin")
public ApiResponse judgeBegin(BuyerOrderReq req) {
LOGGER.info("judgeBegin in. req is {}", req);
JSONObject result = buyerOrderService.judgeBegin(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("开始鉴定成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
@RequestMapping(value = "/judgePass")
public ApiResponse judgePass(BuyerOrderReq req) {
LOGGER.info("judgePass in. req is {}", req);
JSONObject result = buyerOrderService.judgePass(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定通过完成").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
@RequestMapping(value = "/judgeReject")
public ApiResponse judgeReject(BuyerOrderReq req) {
LOGGER.info("judgeReject in. req is {}", req);
JSONObject result = buyerOrderService.judgeReject(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定不通过完成").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
/*
@RequestMapping(value = "/updateOrderStatus")
public ApiResponse updateOrderStatus(BuyerOrderReq req) {
LOGGER.info("updateOrderStatus in. req is {}", req);
... ... @@ -75,6 +120,32 @@ public class BuyerOrderController {
}
}
*/
//发货给买家
@RequestMapping(value = "/deliverGoods")
public ApiResponse deliverGoods(BuyerOrderReq req) {
LOGGER.info("deliverGoods in. req is {}", req);
JSONObject result = buyerOrderService.deliverGoods(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
//寄回给卖家
@RequestMapping(value = "/returnBackOrderCauseOfJudgeFailure")
public ApiResponse returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req) {
LOGGER.info("returnBackOrderCauseOfJudgeFailure in. req is {}", req);
JSONObject result = buyerOrderService.returnBackOrderCauseOfJudgeFailure(req);
if(result!=null&&result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message(result.getString("message")).build();
}
}
//退回给卖家
@RequestMapping(value = "/returnBackOrder")
public ApiResponse returnBackOrder(BuyerOrderReq req) {
LOGGER.info("returnBackOrder in. req is {}", req);
... ... @@ -124,7 +195,13 @@ public class BuyerOrderController {
OrderDetailResp result = buyerOrderService.getOrderDetail(req.getOrderCode());
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
@RequestMapping(value = "/queryExpressListAndAddressInfo")
public ApiResponse queryExpressListAndAddressInfo(BuyerOrderReq req) {
Map<String,Object> result = buyerOrderService.queryExpressListAndAddressInfo(req.getOrderCode(), req.getExpressTypeStr());
return new ApiResponse.ApiResponseBuilder().code(200).message("获取信息成功").data(result).build();
}
@RequestMapping(value = "/queryExpressList")
public ApiResponse queryExpressList(BuyerOrderReq req) {
List<ExpressInfoResp> result = buyerOrderService.queryExpressList(req.getOrderCode(), req.getExpressTypeStr());
... ...
... ... @@ -21,9 +21,21 @@ public interface IBuyerOrderService {
Map<String, Integer> getCountByJudgeStatus(BuyerOrderReq req);
PageResponseBO<BuyerOrderResp> queryOrderList(BuyerOrderReq req);
JSONObject confirmReceive(BuyerOrderReq req);
JSONObject judgeBegin(BuyerOrderReq req);
JSONObject judgePass(BuyerOrderReq req);
JSONObject judgeReject(BuyerOrderReq req);
JSONObject updateOrderStatus(BuyerOrderReq req);
JSONObject deliverGoods(BuyerOrderReq req);
JSONObject returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req);
JSONObject returnBackOrder(BuyerOrderReq req);
BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req);
... ... @@ -35,6 +47,8 @@ public interface IBuyerOrderService {
Map<String, Integer> getCountByOrderStatus();
OrderDetailResp getOrderDetail(String orderCode);
Map<String,Object> queryExpressListAndAddressInfo(String orderCode, String expressType);
List<ExpressInfoResp> queryExpressList(String orderCode, String expressType);
... ...
... ... @@ -150,18 +150,32 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private static final String UIC_GETUSERPROFILE_URL = "/uic/profile/getUserProfile";
public Map<String, Integer> getCountByJudgeStatus(BuyerOrderReq req){
List<Byte> toBeReceivedList = Lists.newArrayList();
List<Byte> toBeJudgedList = Lists.newArrayList();
List<Byte> toBeSendOutList = Lists.newArrayList();
List<Byte> alreadyJudgedList = Lists.newArrayList();
toBeJudgedList.add(Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal());
toBeReceivedList.add(Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal());
toBeJudgedList.add(Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal());
toBeJudgedList.add(Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal());
toBeSendOutList.add(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal());
toBeSendOutList.add(Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal());
toBeSendOutList.add(Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal());
alreadyJudgedList.add(Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal());
alreadyJudgedList.add(Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal());
int toBeJudgedNum = buyerOrderMapper.selectCountByStatusAndDepotNo(toBeJudgedList, req.getDepotNo());
int alreadyJudgedNum = buyerOrderMapper.selectCountByStatusAndDepotNo(alreadyJudgedList, req.getDepotNo());
alreadyJudgedList.add(Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal());
int toBeReceivedNum = buyerOrderMapper.selectCountByStatusAndDepotNo(toBeReceivedList, req.getDepotNo(),null);
int toBeJudgedNum = buyerOrderMapper.selectCountByStatusAndDepotNo(toBeJudgedList, req.getDepotNo(),null);
int toBeSendOutNum = buyerOrderMapper.selectCountByStatusAndDepotNo(toBeSendOutList, req.getDepotNo(),"haveNotExpress");
int alreadyJudgedNum = buyerOrderMapper.selectCountByStatusAndDepotNo(alreadyJudgedList, req.getDepotNo(),"haveExpress");
Map<String, Integer> resultMap = Maps.newHashMap();
resultMap.put("toBeReceivedNum", toBeReceivedNum);
resultMap.put("toBeJudgedNum", toBeJudgedNum);
resultMap.put("toBeSendOutNum", toBeSendOutNum);
resultMap.put("alreadyJudgedNum", alreadyJudgedNum);
return resultMap;
... ... @@ -177,6 +191,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resultMap.put("num_5", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(5)));//平台已发货
resultMap.put("num_6", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(6)));//订单完成
resultMap.put("num_7", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(7)));//已取消
resultMap.put("num_8", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(8)));//平台已收货
resultMap.put("num_9", buyerOrderMapper.selectCountByStatus(getStatusListByNavStatus(9)));//平台鉴定通过
return resultMap;
}
... ... @@ -328,6 +344,85 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return result;
}
//确认收货:调用前端接口,前端接口会更新状态的,不用更新状态
public JSONObject confirmReceive(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if( Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal()!=buyerOrder.getStatus().byteValue()){
throw new ServiceException(400,"错误:订单状态变化,不允许确认收货,请重新刷新列表");
}
String args = "ufo-gateway.confirmReceive";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
return jsonObject;
}
public JSONObject judgeBegin(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
throw new ServiceException(400,"错误:订单状态变化,不允许开始鉴定,请重新刷新列表");
}
String args = "ufo-gateway.judgeBegin";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
return jsonObject;
}
//鉴定通过
public JSONObject judgePass(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if( Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()!=buyerOrder.getStatus().byteValue()){
throw new ServiceException(400,"错误:订单状态变化,不允许鉴定通过,请重新刷新列表");
}
String args = "ufo-gateway.judgePass";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
return jsonObject;
}
//鉴定不通过
public JSONObject judgeReject(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if( Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()!=buyerOrder.getStatus().byteValue()){
throw new ServiceException(400,"错误:订单状态变化,不允许鉴定不通过,请重新刷新列表");
}
String args = "ufo-gateway.judgeReject";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
return jsonObject;
}
public JSONObject updateOrderStatus(BuyerOrderReq req) {
if(null == req.getId() || null == req.getStatus()) {
... ... @@ -352,9 +447,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//重新设置mobile
resetMobileFromSeller(req,buyerOrder.getOrderCode());
jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
}else if(req.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGING.getByteVal()) {//确认收货
args = "ufo-gateway.confirmReceive";
jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
}
if(jsonObject.getIntValue("code") == 200) {
... ... @@ -407,6 +499,67 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
//发货
public JSONObject deliverGoods(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if(buyerOrder.getStatus().byteValue()!=Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal()) {
throw new ServiceException(400,"错误:订单状态不是鉴定通过,不允许发货");
}
//查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
buyerOrder.getUid(), EXPRESS_TYPE_JUDGE_TO_BUYER);
if(null != sellerExpressRecord) {
throw new ServiceException(400,"错误:订单已存在物流单["+sellerExpressRecord.getWaybillCode()+"]不允许再次发货");
}
//调用前台接口
String args = "orderAppraise.deliverGoods";
//重新设置mobile
restMobileFromBuyer(req,buyerOrder.getOrderCode());
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
return jsonObject;
}
public JSONObject returnBackOrderCauseOfJudgeFailure(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
}
if(buyerOrder.getStatus().byteValue()!=Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()) {
throw new ServiceException(400,"错误:订单状态不是鉴定不通过,不允许寄回商品");
}
//查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
buyerOrder.getSellerUid(), EXPRESS_TYPE_JUDGE_TO_SELLER);
if(null != sellerExpressRecord) {
throw new ServiceException(400,"错误:订单已存在寄回物流单["+sellerExpressRecord.getWaybillCode()+"]不允许再次寄回");
}
//调用前台接口
String args = "orderAppraise.returnBackOrderCauseOfJudgeFailure";
//重新设置mobile
resetMobileFromSeller(req,buyerOrder.getOrderCode());
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
return jsonObject;
}
public JSONObject returnBackOrder(BuyerOrderReq req){
if(null == req.getId() || null == req.getStatus()) {
return null;
... ... @@ -417,8 +570,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return null;
}
if(buyerOrder.getStatus().byteValue()!=Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()
||req.getStatus().byteValue() != Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()) {
if(buyerOrder.getStatus().byteValue()!=Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()) {
throw new ServiceException(400,"错误:订单状态不合法,不允许寄回商品");
}
... ... @@ -439,6 +591,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
private JSONObject asyncCallConfirmReceive(String args, String orderCode) {
LOGGER.info("call ufo-gateway enter orderCode is {}, interface is {},result is {}", orderCode, args);
OrderRequest request = new OrderRequest();
request.setOrderCode(Long.valueOf(orderCode));
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
... ... @@ -642,6 +795,35 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return resp;
}
public Map<String,Object> queryExpressListAndAddressInfo(String orderCode, String expressType){
LOGGER.info("queryExpressListAndAddressInfo orderCode is {}, expressTypeStr is {}", orderCode, expressType);
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if(null == buyerOrder) {
return null;
}
//如果是鉴定不通过或者已取消(买家再卖家发货后取消),则地址是卖家地址
BuyerOrderResp buyerOrderResp = null;
if(buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_JUDGE_NOT_PASS.getByteVal()
||buyerOrder.getStatus().byteValue() == Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Arrays.asList(orderCode));
if(CollectionUtils.isNotEmpty(buyerGoodsList)) {
BuyerOrderReq reqTmp=new BuyerOrderReq();
reqTmp.setSkup(buyerGoodsList.get(0).getSkup());
reqTmp.setOrderCode(orderCode);
buyerOrderResp = this.getSendBackInfoBySkup(reqTmp);
}
}else{
BuyerOrderReq reqTmp = new BuyerOrderReq();
reqTmp.setOrderCode(orderCode);
buyerOrderResp = this.getReceiveInfoByOrderCode(reqTmp);
}
List<ExpressInfoResp> expressInfoRespList=this.queryExpressList(orderCode,expressType);
Map<String,Object> map = Maps.newHashMap();
map.put("buyerOrderResp",buyerOrderResp);
map.put("expressInfoRespList",expressInfoRespList);
return map;
}
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
... ... @@ -1026,6 +1208,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_PAY.getByteVal(),
Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()
);
case 8: return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal());
case 9: return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal());
default:return Lists.newArrayList();
}
}
... ...
... ... @@ -20,6 +20,41 @@
</select>
</div>
<div id="tt" class="easyui-tabs">
<div id="tab_2" title="待收货" style="padding:20px;display:none;">
<div>
<label>订单编号:</label>
<input id="orderCode_2" type="text" class="easyui-textbox" style="width:150px">
<label>买家UID:</label>
<input id="buyerUid_2" type="text" class="easyui-textbox" style="width:150px"/>
<label>卖家快递单号:</label>
<input id="sellerWaybillCode_2" type="text" class="easyui-textbox" style="width:150px"/>
<label>订单状态:</label>
<select id="status_2" class="easyui-combobox" style="width:250px;" >
<option value="">全部</option>
<option value="2">卖家已发货</option>
</select>
<br>
<label>商品编码:</label>
<input id="productId_2" type="text" class="easyui-textbox" style="width:150px"/>
<label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SKU:</label>
<input id="sku_2" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机号:</label>
<input id="mobile_2" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;SKU-P:</label>
<input id="skup_2" type="text" class="easyui-textbox" style="width:150px"/>
<a id="searchBtn_2" class="btn-info">查询</a>
<a id="allBtn_2" class="btn-success">全部</a>
</div>
</div>
<div id="tab_0" title="待鉴定" style="padding:20px;display:none;">
<div>
<label>订单编号:</label>
... ... @@ -34,9 +69,8 @@
<label>订单状态:</label>
<select id="status_0" class="easyui-combobox" style="width:250px;" >
<option value="">全部</option>
<option value="2">卖家已发</option>
<option value="31">平台已收</option>
<option value="3">平台鉴定中</option>
<option value="17">已取消(买家在卖家发货后取消订单)</option>
</select>
<br>
... ... @@ -57,7 +91,8 @@
<a id="allBtn_0" class="btn-success">全部</a>
</div>
</div>
<div id="tab_1" title="鉴定完成" style="overflow:auto;padding:20px;display:none;">
<div id="tab_1" title="待发货" style="padding:20px;display:none;">
<div>
<label>订单编号:</label>
<input id="orderCode_1" type="text" class="easyui-textbox" style="width:150px">
... ... @@ -68,17 +103,18 @@
<label>卖家快递单号:</label>
<input id="sellerWaybillCode_1" type="text" class="easyui-textbox" style="width:150px"/>
<label>鉴定结果:</label>
<select id="status_1" class="easyui-combobox" style="width:100px;" >
<label>订单状态:</label>
<select id="status_1" class="easyui-combobox" style="width:250px;" >
<option value="">全部</option>
<option value="4">鉴定通过</option>
<option value="13">鉴定不通过</option>
<option value="32">平台鉴定通过</option>
<option value="13">已取消(商品鉴定不通过)</option>
<option value="17">已取消(买家在卖家发货后取消订单)</option>
</select>
<br>
<label>商品编码:</label>
<input id="productId_1" type="text" class="easyui-textbox" style="width:150px"/>
<input id="productId_1" type="text" class="easyui-textbox" style="width:250px"/>
<label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SKU:</label>
<input id="sku_1" type="text" class="easyui-textbox" style="width:150px"/>
... ... @@ -93,6 +129,45 @@
<a id="allBtn_1" class="btn-success">全部</a>
</div>
</div>
<div id="tab_3" title="完成" style="padding:20px;display:none;">
<div>
<label>订单编号:</label>
<input id="orderCode_3" type="text" class="easyui-textbox" style="width:150px">
<label>买家UID:</label>
<input id="buyerUid_3" type="text" class="easyui-textbox" style="width:150px"/>
<label>卖家快递单号:</label>
<input id="sellerWaybillCode_3" type="text" class="easyui-textbox" style="width:150px"/>
<label>订单状态:</label>
<select id="status_3" class="easyui-combobox" style="width:250px;" >
<option value="">全部</option>
<option value="4">平台已发货</option>
<option value="13">已取消(商品鉴定不通过)</option>
<option value="17">已取消(买家在卖家发货后取消订单)</option>
</select>
<br>
<label>商品编码:</label>
<input id="productId_3" type="text" class="easyui-textbox" style="width:150px"/>
<label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SKU:</label>
<input id="sku_3" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机号:</label>
<input id="mobile_3" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;SKU-P:</label>
<input id="skup_3" type="text" class="easyui-textbox" style="width:150px"/>
<a id="searchBtn_3" class="btn-info">查询</a>
<a id="allBtn_3" class="btn-success">全部</a>
</div>
</div>
</div>
</div>
... ... @@ -108,25 +183,38 @@ $(function() {
$("#depotNo").combobox({
onChange : function(newValue, oldValue){
getCountByJudgeStatus();
var depotNo = $("#depotNo").combobox("getValue");
$("#orderListTable").datagrid("reload", {
statusStr : "2,3,17",
depotNo : depotNo
});
//$("#tt").panel('refresh');
var tab = $('#tt').tabs('getSelected');
var index = $('#tt').tabs('getTabIndex',tab);
tabsSelected(index);
}
});
$("#searchBtn_2").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#orderListTable").datagrid("load", {
statusStr : "2",
status : $("#status_2").myCombobox("getValue"),
orderCode : $("#orderCode_2").val(),
uid : $("#buyerUid_2").val(),
productId : $("#productId_2").val(),
skup : $("#skup_2").val(),
sellerWaybillCode : $("#sellerWaybillCode_2").val(),
mobile : $("#mobile_2").val(),
depotNo : $("#depotNo").combobox("getValue")
});
}
});
$("#searchBtn_0").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#orderListTable").datagrid("load", {
statusStr : "2,3,17",
statusStr : "31,3",
status : $("#status_0").myCombobox("getValue"),
orderCode : $("#orderCode_0").val(),
uid : $("#buyerUid_0").val(),
productId : $("#productId_0").val(),
storageId : $("#sku_0").val(),
skup : $("#skup_0").val(),
sellerWaybillCode : $("#sellerWaybillCode_0").val(),
mobile : $("#mobile_0").val(),
... ... @@ -138,32 +226,76 @@ $(function() {
iconCls : "icon-search",
onClick : function() {
$("#orderListTable").datagrid("load", {
statusStr : "4,13",
statusStr : "32,13,17",
platformExpressInfoFlag:"haveNotExpress",
status : $("#status_1").myCombobox("getValue"),
orderCode : $("#orderCode_1").val(),
uid : $("#buyerUid_1").val(),
productId : $("#productId_1").val(),
storageId : $("#sku_1").val(),
skup : $("#skup_1").val(),
sellerWaybillCode : $("#sellerWaybillCode_1").val(),
mobile : $("#mobile_1").val(),
depotNo : $("#depotNo").combobox("getValue")
});
}
})
getToBeJudgedList();
});
$("#searchBtn_3").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#orderListTable").datagrid("load", {
statusStr : "4,13,17",
platformExpressInfoFlag:"haveExpress",
status : $("#status_3").myCombobox("getValue"),
orderCode : $("#orderCode_3").val(),
uid : $("#buyerUid_3").val(),
productId : $("#productId_3").val(),
skup : $("#skup_3").val(),
sellerWaybillCode : $("#sellerWaybillCode_3").val(),
mobile : $("#mobile_3").val(),
depotNo : $("#depotNo").combobox("getValue")
});
}
});
getToBeReceiveList();
$("#tt").tabs({
onSelect:function(title,index){
if(index == 0){
getToBeJudgedList();
}else if(index == 1){
getAlreadyJudgedList();
}
tabsSelected(index);
}
});
});
function tabsSelected(index) {
if(index == 0){
getToBeReceiveList();
}else if(index == 1){
getToBeJudgedList();
}else if(index == 2){
getToBeSendOutList();
}else if(index == 3){
getAlreadyJudgedList();
}
}
//全部按钮
$("#allBtn_2").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#orderCode_2").textbox('setValue','');
$("#uid_2").textbox('setValue','');
$("#sellerWaybillCode_2").textbox('setValue','');
$("#status_2").combobox('setValue','');
$("#productId_2").textbox('setValue','');
$("#sku_2").textbox('setValue','');
$("#mobile_2").textbox('setValue','');
$("#skup_2").textbox('setValue','');
$("#orderListTable").datagrid("load", {
statusStr: "2",
depotNo: $("#depotNo").combobox("getValue")
});
}
});
$("#allBtn_0").linkbutton({
iconCls: "icon-import",
onClick: function () {
... ... @@ -176,7 +308,7 @@ $(function() {
$("#mobile_0").textbox('setValue','');
$("#skup_0").textbox('setValue','');
$("#orderListTable").datagrid("load", {
statusStr: "2,3,17",
statusStr: "31,3",
depotNo: $("#depotNo").combobox("getValue")
});
}
... ... @@ -194,15 +326,53 @@ $(function() {
$("#mobile_1").textbox('setValue','');
$("#skup_1").textbox('setValue','');
$("#orderListTable").datagrid("load", {
statusStr: "4,13",
statusStr: "32,13,17",
platformExpressInfoFlag:"haveNotExpress",
depotNo: $("#depotNo").combobox("getValue")
});
}
});
$("#allBtn_3").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#orderCode_3").textbox('setValue','');
$("#uid_3").textbox('setValue','');
$("#sellerWaybillCode_3").textbox('setValue','');
$("#status_3").combobox('setValue','');
$("#productId_3").textbox('setValue','');
$("#sku_3").textbox('setValue','');
$("#mobile_3").textbox('setValue','');
$("#skup_3").textbox('setValue','');
$("#orderListTable").datagrid("load", {
statusStr: "4,13,17",
platformExpressInfoFlag:"haveExpress",
depotNo: $("#depotNo").combobox("getValue")
});
}
});
});
function getToBeJudgedList(){
function getToBeReceiveList() {
getToBeReceiveListOrJudgedList(false,"2",null);
}
function getToBeJudgedList() {
getToBeReceiveListOrJudgedList(false,"31,3",null,false);
}
function getToBeSendOutList() {
getToBeReceiveListOrJudgedList(false,"32,13,17","haveNotExpress");
}
function getAlreadyJudgedList(){
getToBeReceiveListOrJudgedList(true,"4,13,17","haveExpress");
}
function getToBeReceiveListOrJudgedList(platformWaybillShowFlag,paramStatusStr,platformExpressInfoFlag){
var dynaColumns=getTableColumn(platformWaybillShowFlag);
var table_columns=[dynaColumns];
$("#orderListTable").myDatagrid({
fit: true,
fitColumns: true,
... ... @@ -210,7 +380,8 @@ function getToBeJudgedList(){
url: contextPath + "/buyerOrder/queryOrderList",
method: 'POST',
queryParams: {
statusStr: "2,3,17",
statusStr: paramStatusStr,
platformExpressInfoFlag:platformExpressInfoFlag,
depotNo: $("#depotNo").combobox("getValue")
},
loadFilter: function (data) {
... ... @@ -220,139 +391,43 @@ function getToBeJudgedList(){
return temp;
},
columns: [[{
title: "卖家快递单号",
field: "sellerWaybillCode",
width: 30,
align: "center"
}, {
title: "收货仓库",
field: "depotNo",
width: 12,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (value == 0) {
return "北京";
}else if(value == 1){
return "南京";
}
}
}, {
title: "件数",
field: "productNum",
width: 8,
align: "center"
}, {
title: "SKU",
field: "skuStr",
width: 10,
align: "center"
}, {
title: "订单编号",
field: "orderCode",
width: 25,
align: "center"
}, {
title: "订单状态",
field: "status",
width: 20,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.statusStr){
return rowData.statusStr;
}
return value;
}
},{
title: "货号",
field: "productCode",
width: 20,
align: "center"
},{
title: "商品名称",
field: "productName",
width: 20,
align: "center"
},{
title: "尺码",
field: "sizeName",
width: 20,
align: "center"
},{
title: "下单时间",
field: "createTimeStr",
width: 20,
align: "center"
},{
title: "操作",
field: "asdf",
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.status == 2) {
return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
} else if (rowData.status == 3) {
var operateButton = "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+
"<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important; color: #fff !important;'>鉴定不通过</a>"+
"<a role='record' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5bc0de !important; color: #fff !important;'>录制视频</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #FFCC33 !important;'>查看视频</a>";
}
return operateButton;
} else if (rowData.status == 17) {
if(rowData.platformWaybillCode){
return "<a role='send_back_rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"
+"<a role='send_back_viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>"
//+"<br/><span style='color:darkred;'>已寄回 ["+rowData.platformWaybillCode+"]</span>";
;
}else{
return "<a role='reback' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>寄回</a>";
}
}
}
}]],
columns: table_columns,
cache: false,
pagination: true,
pageSize: 10,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
//确认收货
$(this).datagrid("getPanel").find("a[role='confirm']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
$.messager.confirm("确认收货提醒", "是否确认收货?确认收货前请务必确定货品已到达仓库。", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
id : id,
status : 3
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "确认收货成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
confirmReceive(id);
}
});
//开始鉴定
$(this).datagrid("getPanel").find("a[role='judgeBegin']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
judgeBegin(id);
}
});
//录入鉴定结果:通过
$(this).datagrid("getPanel").find("a[role='pass']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("orderCode");
$("#buyerOrderCode").val(buyerOrderCode);
addPassPage($(this).attr("dataId"));
//var buyerOrderCode = $(this).attr("orderCode");
//$("#buyerOrderCode").val(buyerOrderCode);
judgePass($(this).attr("dataId"));
}
});
//录入鉴定结果:不通过
$(this).datagrid("getPanel").find("a[role='reject']").linkbutton({
onClick: function () {
var skup = $(this).attr("skup");
$("#skup").val(skup);
addRejectPage($(this).attr("dataId"));
//var skup = $(this).attr("skup");
//$("#skup").val(skup);
judgeReject($(this).attr("dataId"));
}
});
... ... @@ -376,26 +451,34 @@ function getToBeJudgedList(){
}
});
$(this).datagrid("getPanel").find("a[role='reback']").linkbutton({
//发货
$(this).datagrid("getPanel").find("a[role='sendOut']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("order_code");
$("#buyerOrderCode").val(buyerOrderCode);
addPassPage($(this).attr("dataId"));
}
});
//鉴定不通过造成的退回
$(this).datagrid("getPanel").find("a[role='reback_cause_of_judge_failure']").linkbutton({
onClick: function () {
var skup = $(this).attr("skup");
$("#skup").val(skup);
addRebackPage($(this).attr("dataId"));
addRejectPage($(this).attr("dataId"));
}
});
$(this).datagrid("getPanel").find("a[role='send_back_rebackAddress']").linkbutton({
//买家取消造成的退回
$(this).datagrid("getPanel").find("a[role='reback_cause_of_buyer_cancel']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("dataId");
$("#buyerOrderCode").val(buyerOrderCode);
var skup = $(this).attr("skup");
$("#skup").val(skup);
rebackAddressPage();
addRebackPage($(this).attr("dataId"));
}
});
$(this).datagrid("getPanel").find("a[role='send_back_viewExpress']").linkbutton({
$(this).datagrid("getPanel").find("a[role='platform_waybill_viewExpress']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("dataId");
$("#buyerOrderCode").val(buyerOrderCode);
... ... @@ -407,7 +490,130 @@ function getToBeJudgedList(){
});
}
function getAlreadyJudgedList(){
function getTableColumn(platformWaybillShowFlag) {
return [{
title: "卖家快递单号",
field: "sellerWaybillCode",
width: 30,
hidden:!platformWaybillShowFlag,
align: "center"
},{
title: "平台快递单号",
field: "platformWaybillCode",
width: 30,
hidden:platformWaybillShowFlag,
align: "center"
}, {
title: "收货仓库",
field: "depotNo",
width: 12,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (value == 0) {
return "北京";
}else if(value == 1){
return "南京";
}
}
}, {
title: "件数",
field: "productNum",
width: 8,
align: "center"
}, {
title: "SKU",
field: "skuStr",
width: 10,
align: "center"
}, {
title: "订单编号",
field: "orderCode",
width: 25,
align: "center"
}, {
title: "订单状态",
field: "status",
width: 20,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.statusStr){
return rowData.statusStr;
}
return value;
}
},{
title: "货号",
field: "productCode",
width: 20,
align: "center"
},{
title: "商品名称",
field: "productName",
width: 20,
align: "center"
},{
title: "尺码",
field: "sizeName",
width: 20,
align: "center"
},{
title: "下单时间",
field: "createTimeStr",
width: 20,
align: "center"
},{
title: "操作",
field: "asdf",
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.status == 2) {
return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
} else if (rowData.status == 31) {
return "<a role='judgeBegin' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>开始鉴定</a>";;
}else if (rowData.status == 3) {
var operateButton = "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+
"<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important; color: #fff !important;'>鉴定不通过</a>"+
"<a role='record' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5bc0de !important; color: #fff !important;'>录制视频</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #FFCC33 !important;'>查看视频</a>";
}
return operateButton;
}else if (rowData.status == 32) {
var operateButton = "<a role='sendOut' dataId='"+ rowData.id + "'" + " order_code='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>发货</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #FFCC33 !important;'>查看视频</a>";
}
return operateButton;
}else if (rowData.status == 4) {
var operateButton = "<a role='platform_waybill_viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #FFCC33 !important;'>查看视频</a>";
}
return operateButton;
} else if (rowData.status == 13||rowData.status == 17) {
var operateButton="";
if(rowData.platformWaybillCode){
operateButton += "<a role='platform_waybill_viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
}else{
var roleName="reback_cause_of_buyer_cancel";
if(rowData.status == 13){
roleName="reback_cause_of_judge_failure"
}
operateButton += "<a role='"+roleName+"' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>寄回</a>";
}
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #FFCC33 !important;'>查看视频</a>";
}
return operateButton;
}
}
}]
}
//放弃不用了
function getAlreadyJudged_BAK_List(){
$("#orderListTable").myDatagrid({
fit: true,
fitColumns: true,
... ... @@ -610,6 +816,90 @@ function viewExpressPage() {
});
}
//确认收货
function confirmReceive(id){
$.messager.confirm("确认收货提醒", "是否确认收货?确认收货前请务必确定货品已到达仓库。", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/confirmReceive", {
id : id
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "确认收货成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
//开始鉴定
function judgeBegin(id) {
$.messager.confirm("开始鉴定提醒", "是否开始鉴定?", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/judgeBegin", {
id : id
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "开始鉴定成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
//鉴定通过
function judgePass() {
$.messager.confirm("鉴定通过提醒", "是否鉴定通过?", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/judgePass", {
id : id
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "鉴定通过成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
//鉴定不通过
function judgeReject() {
$.messager.confirm("鉴定不通过提醒", "是否鉴定不通过?", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/judgeReject", {
id : id
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "鉴定不通过完成!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
//鉴定通过后发货
function addPassPage(id) {
var div = $("<div id='passDiv'>").appendTo($(document.body));
var url = contextPath + "/html/judgeCenter/pass.html?time_version=" + new Date().getTime();
... ... @@ -638,6 +928,8 @@ function addPassPage(id) {
}]
});
}
//买家取消后,卖家已发货的商品直接退回
function addRebackPage(id) {
var div = $("<div id='rebackDiv'>").appendTo($(document.body));
var url = contextPath + "/html/judgeCenter/reject.html?time_version=" + new Date().getTime();
... ... @@ -667,6 +959,7 @@ function addRebackPage(id) {
});
}
//鉴定不通过后退回商品
function addRejectPage(id) {
var div = $("<div id='rejectDiv'>").appendTo($(document.body));
var url = contextPath + "/html/judgeCenter/reject.html?time_version=" + new Date().getTime();;
... ... @@ -808,7 +1101,7 @@ function addQueryPage(skup, order_code, id) {
});
}
//鉴定通过发货
function deliverGoods(id){
var expressCompanyId = $("#expressCompany").myCombobox("getValue");
var waybillCode = $("#waybillCode").textbox("getValue");
... ... @@ -825,7 +1118,7 @@ function deliverGoods(id){
alert("收货人手机号为空!");
return;
}
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
$.post(contextPath + "/buyerOrder/deliverGoods", {
id : id,
status : 4,
expressCompanyId : expressCompanyId,
... ... @@ -840,7 +1133,7 @@ function deliverGoods(id){
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "鉴定通过操作成功!"
msg : "发货操作成功!"
});
}else {
window.self.$.messager.alert("失败", data.message, "error");
... ... @@ -905,7 +1198,7 @@ function sendBackGoods(id){
alert("收货人手机号为空!");
return;
}
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
$.post(contextPath + "/buyerOrder/returnBackOrderCauseOfJudgeFailure", {
id : id,
status : 13,
expressCompanyId : expressCompanyId,
... ... @@ -944,21 +1237,37 @@ function getCountByJudgeStatus(){
dataType: 'json',
success: function (result) {
if(result.code == 200) {
var tab_0 = $('#tt').tabs('getTab',0); // 取得第一个tab
var tab_toBeReveived = $('#tt').tabs('getTab',0); // 取得第一个tab
$('#tt').tabs('update', {
tab: tab_toBeReveived,
options: {
title: '待收货('+ result.data.toBeReceivedNum + ")"
}
});
var tab_toBeJudged = $('#tt').tabs('getTab',1); // 取得第一个tab
$('#tt').tabs('update', {
tab: tab_0,
tab: tab_toBeJudged,
options: {
title: '待鉴定('+ result.data.toBeJudgedNum + ")"
}
});
var tab_1 = $('#tt').tabs('getTab',1); // 取得第一个tab
var tab_toBeSendOutNum = $('#tt').tabs('getTab',2); // 取得第一个tab
$('#tt').tabs('update', {
tab: tab_1,
tab: tab_toBeSendOutNum,
options: {
title: '鉴定完成('+ result.data.alreadyJudgedNum + ")"
title: '待发货('+ result.data.toBeSendOutNum + ")"
}
});
var tab_alreadyJudgedNum = $('#tt').tabs('getTab',3); // 取得第一个tab
$('#tt').tabs('update', {
tab: tab_alreadyJudgedNum,
options: {
title: '完成('+ result.data.alreadyJudgedNum + ")"
}
});
}
else {
... ...
... ... @@ -19,7 +19,7 @@
<tr>
<td>快递公司:</td>
<td colspan="2">
<input id="expressCompany" class="easyui-combobox"/>
<input id="expressCompany" class="easyui-combobox" disabled="disabled" readonly/>
</td>
</tr>
<tr>
... ... @@ -38,6 +38,10 @@
// 快递公司下拉框
initExpressCompanyDropdown();
if($("#waybillCode").next()&&$("#waybillCode").next().children()){
$("#waybillCode").next().children()[0].focus();
}
});
function getReceiveInfo(){
... ... @@ -86,12 +90,13 @@
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#expressCompany").myCombobox({
$("#expressCompany").combobox({
width: 130,
data: data.data,
valueField: "id",
textField: "companyName"
});
$("#expressCompany").combobox("setValue",data.data[0].id);
}
});
}
... ...
... ... @@ -19,7 +19,7 @@
<tr>
<td>快递公司:</td>
<td colspan="2">
<input id="expressCompany" class="easyui-combobox"/>
<input id="expressCompany" class="easyui-combobox" disabled="disabled" readonly/>
</td>
</tr>
<tr>
... ... @@ -38,6 +38,10 @@
// 快递公司下拉框
initExpressCompanyDropdown();
if($("#waybillCode").next()&&$("#waybillCode").next().children()){
$("#waybillCode").next().children()[0].focus();
}
});
function getSendBackInfo(){
... ... @@ -86,12 +90,13 @@
if (data.code != 200 || !data.data || data.data.length == 0) {
return;
}
$("#expressCompany").myCombobox({
$("#expressCompany").combobox({
width: 130,
data: data.data,
valueField: "id",
textField: "companyName"
});
$("#expressCompany").combobox("setValue",data.data[0].id);
}
});
}
... ...
... ... @@ -5,27 +5,41 @@
<script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="margin-left: 25px;margin-top: 5px;">
<label>快递单号:</label>
<span id="waybillCode"></span>
<br/>
<label>姓名:</label>
<span id="receiveName"></span>
<br/>
<label>手机号:</label>
<span id="receiveMobile"></span>
<br/>
<label>地址:</label>
<span id="receiveAddress"></span>
</div>
<div id="viewExpressDiv" region="center">
<table id="expressTable" border="1px" cellpadding="1" cellspacing="0" align="center"
style="margin-top: 30px; line-height: 30px;width:95%;border-color: #999999">
style="margin-top: 15px; line-height: 30px;width:95%;border-color: #999999">
</table>
</div>
<script>
$(function () {
//获取物流信息
getExpressInfo();
getExpressInfoAndAddressInfo();
});
function getExpressInfo(){
function getExpressInfoAndAddressInfo(){
var form = new FormData();
form.append("orderCode", document.getElementById("buyerOrderCode").value);
form.append("expressTypeStr", "2,3,4");
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/buyerOrder/queryExpressList',
url: contextPath + '/buyerOrder/queryExpressListAndAddressInfo',
data: form,
async: false,
cache: false,
... ... @@ -34,7 +48,19 @@
dataType: 'json',
success: function (result) {
if(result.code == 200) {
var arr = result.data;
//地址信息
var addr = result.data.buyerOrderResp;
if(addr){
//$("#expressCompanyName").html(addr.expressCompanyName);
if(addr.platformWaybillCode){
$("#waybillCode").html(addr.platformWaybillCode+"("+addr.expressCompanyName+")");
}
$("#receiveName").html(addr.receiveName);
$("#receiveMobile").html(addr.receiveMobile);
$("#receiveAddress").html(addr.receiveAddress);
}
//物流信息
var arr = result.data.expressInfoRespList;
var str = "<tr><th>运单信息</th><th>时间</th></tr>"
for(i=0; i<arr.length; i++){
str = str + "<tr><td>" + arr[i].acceptRemark + "</td><td>" + arr[i].createTimeStr + "</td></tr>";
... ...
... ... @@ -27,7 +27,9 @@
<li><a href="javascript:switchOrderStatus(2);">待卖家发货(<span id="num_2"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(3);">卖家已发货(<span id="num_3"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(4);">平台鉴定中(<span id="num_4"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(8);">平台已收货(<span id="num_8"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(5);">平台已发货(<span id="num_5"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(9);">平台鉴定通过(<span id="num_9"></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>
</ul>
... ... @@ -35,7 +37,7 @@
<br>
<div style="margin-left: 10px;margin-top: 30px">
<hr style="border:1px solid #ddd;"><br>
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;width:500px:height:200px">
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
<div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
<label>订单编号:</label>
<input id="orderCode" type="text" class="easyui-textbox" style="width:150px">
... ... @@ -52,7 +54,9 @@
<option value="0">待买家付款</option>
<option value="1">待卖家发货</option>
<option value="2">卖家已发货</option>
<option value="31">平台已收货</option>
<option value="3">平台鉴定中</option>
<option value="32">平台鉴定通过</option>
<option value="4">平台已发货</option>
<option value="5">订单完成</option>
<option value="11">已取消(卖家取消交易)</option>
... ... @@ -107,7 +111,6 @@ $(function() {
orderCode : $("#orderCode").val(),
uid : $("#buyerUid").val(),
productId : $("#productId").val(),
storageId : $("#sku").val(),
skup : $("#skup").val(),
sellerWaybillCode : $("#sellerWaybillCode").val(),
mobile : $("#mobile").val()
... ... @@ -119,7 +122,7 @@ $(function() {
$("#allBtn").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#orderCode_").textbox('setValue','');
$("#orderCode").textbox('setValue','');
$("#uid").textbox('setValue','');
$("#sellerWaybillCode").textbox('setValue','');
$("#status").combobox('setValue','');
... ... @@ -237,7 +240,7 @@ function getOrderList(){
function switchOrderStatus(navStatus){
$("#navStatus").val(navStatus);
$("#orderCode_").textbox('setValue','');
$("#orderCode").textbox('setValue','');
$("#uid").textbox('setValue','');
$("#sellerWaybillCode").textbox('setValue','');
$("#status").combobox('setValue','');
... ... @@ -271,6 +274,8 @@ function getCountByNavStatus(){
$("#num_5").html(result.data.num_5);
$("#num_6").html(result.data.num_6);
$("#num_7").html(result.data.num_7);
$("#num_8").html(result.data.num_8);
$("#num_9").html(result.data.num_9);
}
else {
$.messager.alert("失败", result.message, "error");
... ...