Authored by qinchao

Merge branch 'dev_6.8.5_qc_状态拆分' into test6.8.5

package com.yoho.ufo.order.constant;
import lombok.Getter;
/**
* 操作日志类型
*/
@Getter
public enum OperateTypeEnum {
OPERATE_TYPE_UPDATE_SELLER_WAY_BILL_CODE(1,"修改卖家物流单号"),
OPERATE_TYPE_UPDATE_RECEIVE_INFO(2,"修改收货人信息"),
OPERATE_TYPE_CONFIRM_RECEIVE(3,"确认收货"),
OPERATE_TYPE_JUDGE_BEGIN(4,"开始鉴定"),
OPERATE_TYPE_JUDGE_PASS(5,"鉴定通过"),
OPERATE_TYPE_JUDGE_REJECT(6,"开始不通过"),
OPERATE_TYPE_DELIVERY_GOODS(7,"发货给买家"),
OPERATE_TYPE_RETURN_CAUSE_OF_JUDGE_FAILURE(8,"发货给卖家(鉴定不通过)"),
OPERATE_TYPE_RETURN_CAUSE_OF_BUYER_CANCEL_AFTER_SELLER_SELL_OUT(9,"发货给卖家(买家在卖家发货后取消)"),
;
private Integer code;
private String desc;
OperateTypeEnum(Integer code, String desc){
this.code = code;
this.desc = desc;
}
public static String getDescByCode(Integer code){
if(code==null){
return "";
}
for(OperateTypeEnum item: OperateTypeEnum.values()){
if(code.intValue() == item.code.intValue()){
return item.desc;
}
}
return "";
}
}
... ...
package com.yoho.ufo.order.controller;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.ExpressCompany;
... ...
... ... @@ -12,6 +12,7 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.yoho.order.model.*;
import com.yoho.ufo.order.constant.OperateTypeEnum;
import com.yohobuy.ufo.model.order.common.EnumExpressType;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -138,10 +139,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = EnumExpressType.EXPRESS_TYPE_3.getCode();
private static final Integer EXPRESS_TYPE_RETURN_BACK_TO_SELLER = EnumExpressType.EXPRESS_TYPE_REBACK.getCode();
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
private static final Integer OPERATE_TYPE_UPDATE_RECEIVE_INFO = 2;//修改收货人信息
@Value("${ip.port.uic.server}")
private String uicServerIpAndPort;
... ... @@ -363,6 +361,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
String args = "ufo-gateway.confirmReceive";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_CONFIRM_RECEIVE.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(),userHelper, operateType, "");
LOGGER.info("confirmReceive saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -382,6 +386,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
String args = "ufo-gateway.judgeBegin";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_BEGIN.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("judgeBegin saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -403,6 +414,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
String args = "orderAppraise.appraiseSuccess";
LOGGER.info("judgePass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_PASS.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("judgePass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -424,6 +442,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
String args = "orderAppraise.appraiseFail";
LOGGER.info("judgeReject begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
JSONObject jsonObject = asyncCallJudgeResultUpdate(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_REJECT.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("judgeReject saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -542,6 +567,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
restMobileFromBuyer(req,buyerOrder.getOrderCode());
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_DELIVERY_GOODS.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("deliverGoods saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -572,6 +603,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resetMobileFromSeller(req,buyerOrder.getOrderCode());
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_RETURN_CAUSE_OF_JUDGE_FAILURE.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("returnBackOrderCauseOfJudgeFailure saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -602,6 +639,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resetMobileFromSeller(req,buyerOrder.getOrderCode());
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_RETURN_CAUSE_OF_BUYER_CANCEL_AFTER_SELLER_SELL_OUT.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("returnBackOrder cause of buyer cancel after seller sell out saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
... ... @@ -916,6 +959,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
for(OrderOperateRecord item : list) {
OrderOperateRecordResp rsp = new OrderOperateRecordResp();
rsp.setType(item.getType());
rsp.setTypeStr(OperateTypeEnum.getDescByCode(item.getType()));
rsp.setUserName(item.getUserName());
rsp.setUpdateTimeStr(DateUtil.long2DateStr(item.getUpdateTime().longValue()*1000, "yyyy-MM-dd HH:mm:ss"));
rspList.add(rsp);
... ... @@ -958,7 +1002,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return 0;
}
int operateType = OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE;
int operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_SELLER_WAY_BILL_CODE.getCode();
String oldInfo = "";
//卖家已发货,更新卖家物流单号,卖家信息
... ... @@ -980,7 +1024,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//调用前台接口更新物流信息
noticeFrontUpdateExpressInfo(req);
}else {//修改买家信息
operateType = OPERATE_TYPE_UPDATE_RECEIVE_INFO;
operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_RECEIVE_INFO.getCode();
BuyerOrderMeta buyerMeta = buyerOrderMetaMapper.selectByOrderCodeAndKey(req.getOrderCode(), BUYER_ORDER_META_KEY_DELIVERY_ADDRESS);
if(null == buyerMeta) {
return 0;
... ... @@ -995,7 +1039,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}else if(buyerOrder.getStatus().byteValue() != Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal()
&&buyerOrder.getStatus().byteValue() < 4) {//平台鉴定前,更新收货人信息
operateType = OPERATE_TYPE_UPDATE_RECEIVE_INFO;
LOGGER.info("updateReceiveInfo change address before judge ,buyerOrder = {}",buyerOrder);
operateType = OperateTypeEnum.OPERATE_TYPE_UPDATE_RECEIVE_INFO.getCode();
BuyerOrderMeta buyerMeta = buyerOrderMetaMapper.selectByOrderCodeAndKey(req.getOrderCode(), BUYER_ORDER_META_KEY_DELIVERY_ADDRESS);
if(null == buyerMeta) {
return 0;
... ...
... ... @@ -577,16 +577,17 @@ function getOperateRecord(orderCode){
columns: [[{
title: "操作日志",
field: "type",
field: "typeStr",
width: 20,
align: "center",
align: "center"
/*,
formatter: function (value, rowData, rowIndex) {
if(value == 1){
return "修改卖家物流单号";
}else if(value == 2){
return "修改收货人信息";
}
}
}*/
}, {
title: "操作人",
field: "userName",
... ...