Authored by caoyan

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

# Conflicts:
#	dal/src/main/resources/META-INF/mybatis/SellerOrderGoodsMapper.xml
#	order/src/main/java/com/yoho/ufo/order/service/impl/BuyerOrderServiceImpl.java
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
@ToString
@Data
public class SellerOrderGoods implements Serializable {
/**
... ... @@ -40,6 +45,10 @@ public class SellerOrderGoods implements Serializable {
private String imageUrl;
private Integer region;
public Integer getId() {
return id;
}
... ...
... ... @@ -17,6 +17,7 @@
<result column="status" property="status" jdbcType="TINYINT" />
<result column="image_id" property="imageId" jdbcType="INTEGER" />
<result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
<result column="region" property="region" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.ufo.order.constant;
import com.yoho.core.config.ConfigReader;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.constants.RegionEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -13,15 +14,26 @@ import java.util.Map;
*/
@Service
public class OrderConfigConstant {
private static Map<Integer, String> orderAttributeMap = new HashMap<>();
private static Map<Integer, Map<Integer, String>> orderRegionAttributeMap = new HashMap<>();
static {
Map<Integer, String> orderAttributeMap = new HashMap<>();
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(), "急速发货");
orderRegionAttributeMap.put(RegionEnum.MAINLAND.getCode(), orderAttributeMap);
Map<Integer, String> hkAttributeMap = new HashMap<>();
hkAttributeMap.put(OrderAttributes.COMMON_IN_STOCK.getCode(), "海外现货");
orderRegionAttributeMap.put(RegionEnum.HONGKONG.getCode(), hkAttributeMap);
}
@Autowired
... ... @@ -32,12 +44,11 @@ public class OrderConfigConstant {
return configReader.getBoolean("ufo.Vedio.Config", true);
}
public static Map<Integer, String> getOrderAttributeMap() {
return orderAttributeMap;
public static Map<Integer, Map<Integer, String>> getOrderAttributeMap() {
return orderRegionAttributeMap;
}
public static String getOrderAttributeStr(Integer attribute) {
String attributeStr = orderAttributeMap.get(attribute);
return null == attributeStr ? "" : attributeStr;
public static String getOrderAttributeStr(Integer attribute, int region) {
return orderRegionAttributeMap.get(region).get(attribute);
}
}
... ...
... ... @@ -5,13 +5,14 @@ package com.yoho.ufo.order.constant;
* 100:成功;200:失败,201:没有支付宝账号;202:金额不合法;299:转账失败
*/
public enum TradeStatusEnum {
transfering(90,"转账中"),
success(100,"成功"),
fail_200_fail(200,"打款失败"),
fail_201_no_alipayAccount(201,"没有支付宝账号"),
fail_202_invalid_money(202,"金额不合法"),
fail_203_wait_payment(203,"海外卖家待付款"),
fail_299_transfer_failure(299,"转账失败");
TRANSFERING(90,"转账中"),
SUCCESS(100,"成功"),
FAIL_200_FAIL(200,"打款失败"),
FAIL_201_NO_ALIPAY_ACCOUNT(201,"没有支付宝账号"),
FAIL_202_INVALID_MONEY(202,"金额不合法"),
HK_AMOUNT_WAIT_PAYMENT(203,"海外卖家待付款"),
YOHO_STORE_AMOUNT_WAIT_PAYMENT(204,"YOHO!STORE卖家待付款"),
FAIL_299_TRANSFER_FAILURE(299,"转账失败");
private Integer code;
private String desc;
... ...
... ... @@ -5,6 +5,7 @@ import static java.util.stream.Collectors.toList;
import java.util.List;
import java.util.Map;
import com.yohobuy.ufo.model.order.resp.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -22,11 +23,6 @@ import com.yoho.ufo.order.service.IBuyerOrderService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yoho.ufo.util.DateUtil;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
import com.yohobuy.ufo.model.order.resp.OrderDetailResp;
import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;
import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp;
@RestController
@RequestMapping(value = "/buyerOrder")
... ... @@ -493,4 +489,11 @@ public class BuyerOrderController {
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/queryIdentifyCenter")
public ApiResponse queryIdentifyCenter() {
LOGGER.info("method queryIdentifyCenter in");
List<IdentifyCenterResp> result = buyerOrderService.queryIdentifyCenter();
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
}
... ...
... ... @@ -7,11 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.order.model.*;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
import com.yohobuy.ufo.model.order.resp.OrderDetailResp;
import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;
import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp;
import com.yohobuy.ufo.model.order.resp.*;
/**
* @author caoyan
... ... @@ -112,4 +108,7 @@ public interface IBuyerOrderService {
int getPackageCount(Integer depotNo, Integer date);
PageResponseBO<String> queryPackage(Integer depotNo, String sellerWaybillCode, Integer date);
// 查询鉴定室列表
List<IdentifyCenterResp> queryIdentifyCenter();
}
... ...
... ... @@ -8,7 +8,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
... ... @@ -111,10 +110,12 @@ import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.constants.IdentifyCenterEnum;
import com.yohobuy.ufo.model.order.constants.RegionEnum;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
import com.yohobuy.ufo.model.order.resp.ExpressInfoResp;
import com.yohobuy.ufo.model.order.resp.IdentifyCenterResp;
import com.yohobuy.ufo.model.order.resp.OrderDetailResp;
import com.yohobuy.ufo.model.order.resp.OrderOperateRecordResp;
import com.yohobuy.ufo.model.order.resp.QcOrderDetailResp;
... ... @@ -260,10 +261,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private static final Integer PAY_METHOD_FREIGHT_COLLECT = 2;//到付
private static final Integer REGION_MAINLAND = 0;//大陆
private static final Integer REGION_HONGKONG = 1;//香港
//已收货
private static final Byte QC_STATUS_RECEIVED = 0;
... ... @@ -1747,7 +1744,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");
... ... @@ -1806,6 +1803,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
queryProductLimitInfo(resp, sellerGoods.getProductId(), buyerOrder.getSellerUid()); // 独家标识
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(buyerOrder.getAttributes(), sellerGoods.getRegion()));
return resp;
}
... ... @@ -2563,7 +2562,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setProductName(sellerGoodsMap.get(skup).getProductName());
resp.setColorName(sellerGoodsMap.get(skup).getColorName());
resp.setSizeName(sellerGoodsMap.get(skup).getSizeName());
resp.setAttributesStr(getAttributesStr(sellerGoodsMap.get(skup).getRegion(), item.getAttributes()));
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes(), sellerGoodsMap.get(skup).getRegion()));
}
resp.setSkup(skup);
... ... @@ -2633,15 +2632,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return respList;
}
private String getAttributesStr(Integer region, Integer attributes) {
String result = OrderConfigConstant.getOrderAttributeStr(attributes);
if(REGION_HONGKONG.equals(region) && attributes.equals(OrderAttributes.COMMON_IN_STOCK.getCode())) {
result = "香港直邮";
}
return result;
}
private List<BuyerOrderResp> convertToRespForQuery(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
Map<Integer, SellerOrderGoods> sellerGoodsMap, Map<String, ExpressRecord> expressInfoMap,
Map<String, BuyerOrderMeta> buyerOrderMetaMap, Map<String, List<IdentifyRecords>> identifyMap){
... ... @@ -2694,8 +2684,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
resp.setGoodsPrice(String.format("%.2f", buyerGoodsMap.get(item.getOrderCode()).getGoodsPrice().doubleValue()));
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setStatus(item.getStatus());
resp.setRegion(sellerGoodsMap.get(skup).getRegion());
resp.setAttributes(item.getAttributes());
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes()));
resp.setAttributesStr(OrderConfigConstant.getOrderAttributeStr(item.getAttributes(), sellerGoodsMap.get(skup).getRegion()));
respList.add(resp);
}
... ... @@ -2822,7 +2814,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
if(null != req.getAttributes() && req.getAttributes().intValue() == 11) {//香港直邮
req.setRegion(REGION_HONGKONG);
req.setRegion(RegionEnum.HONGKONG.getCode());
req.setAttributes(OrderAttributes.COMMON_IN_STOCK.getCode());
}
... ... @@ -2860,5 +2852,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
}
}
// 查询鉴定室列表
public List<IdentifyCenterResp> queryIdentifyCenter() {
IdentifyCenterEnum[] values = IdentifyCenterEnum.values();
List<IdentifyCenterResp> resps = Lists.newArrayList();
for (IdentifyCenterEnum item : values) {
resps.add(new IdentifyCenterResp(item.getCode(), item.getName(), item.getDesc(), item.getText()));
}
return resps;
}
}
... ...
... ... @@ -505,6 +505,17 @@ function lastImg(){
}
}
function jumpPage() {
if (event.keyCode==37)//左
lastImg();
if (event.keyCode==39)//右
nextImg();
}
document.onkeydown=jumpPage;
//建立 下一张 函数
function nextImg(){
index++;
... ...