f752d860 刘嘉

新系统应用-菠萝派接口,订单下载(未完成)、商品下载(未完成)、修改订单备注(已完成)、修改库存(已经完成)、订单发货(未完成)

1 个父辈 d0fcac64
正在显示 15 个修改的文件 包含 319 行增加187 行删除
package com.sibu.orderHelper.integral.dao;
import com.sibu.orderHelper.integral.model.*;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.model.OrdersProduct;
import com.sibu.orderHelper.integral.pineapple.model.Product;
import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse;
import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse;
import com.sibu.orderHelper.integral.reponse.SkuApiResponse;
......@@ -11,147 +14,76 @@ import java.util.Map;
public interface PineappleDao {
/**
* 退货退款单下载
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
List<GetRefundBean> pageGetRefundBean(Map<String,Object> params)throws Exception;
PineappleOderDetailBean getOneIMOrderById(Map<String,Object> map)throws Exception;
//获取api中的商品详情
IMAPIProductBean getApiProductDetailById(@Param("productId") String productId) throws Exception;
//根据条件查询退款订单
int countCheckRefundStatusResponse(Map<String,Object> params)throws Exception;
Orders getOrdersByMap(Map<String,Object> params);
/**
* 根据条件判断该订单是否有成功过的退款记录
* 修改订单备注
* @param params
* @return
* @throws Exception
*/
IMDoingOrderBean getIMDoingOrderBean(Map<String,Object> params)throws Exception;
/**
* 根据orderCode查询成功退款明细记录
* @param orderCode
* @return
* @throws Exception
*/
List<CheckRefundStatusBean> childrenrefundStatusBySuccess(@Param("orderCode")String orderCode)throws Exception;
int updateOdersRemark(Map<String,Object> params);
/**
* 根据条件判断该订单是否有退款中的退款记录
* @param orderCode
* @return
* @throws Exception
*/
List<CheckRefundStatusBean> childrenrefundStatusByCourse(@Param("orderCode")String orderCode)throws Exception;
/**
* 根据条件查询产品
* 查询该订单是否有该快递单号
* @param params
* @return
* @throws Exception
*/
IMProductBean getIMProductBeanByMap(Map<String,Object> params)throws Exception;
int checkLogisticsNumber(Map<String,Object> params);
/**
* 修改订单备注
* 订单发货更新订单状态与信息
* @param params
* @return
*/
int updateSelle(Map<String,Object> params)throws Exception;
int updateOrdersState(Map<String,Object> params);
/**
* 订单发货
* @param params
* @return
* @throws Exception
*/
int updateBusinessSend(Map<String,Object> params)throws Exception;
/**
* 订单发货时判断订单号是否存在,已存在就不添加该订单号
* 商品下载
* @param params
* @return
* @throws Exception
*/
int getOrderByMap(Map<String,Object> params)throws Exception;
List<DownloadProductBean> downloadProductListByMap(Map<String,Object> params);
/**
* 根据条件查SKU
* @param params
* @return
* @throws Exception
*/
SkuBean getSkuBeanByMap(Map<String,Object> params)throws Exception;
/**
* 根据产品ID查询所有SKU
* 根据商品ID获取该商品的所有SKU
* @param productId
* @return
* @throws Exception
*/
List<SkuApiResponse> getSkuBeanListByMap(String productId)throws Exception;
List<DownloadProductSkuBean> downloadSkuByProductId(@Param("productId") String productId);
/**
* 更新SKU库存
* @param skuBean
* @return
* @throws Exception
*/
int updateSku(SkuBean skuBean)throws Exception;
//更新产品库存
int updateProductInventory(IMProductInventory productInventory) throws Exception;
/**
* 更新产品库存
* 根据条件更新sku库存
* @param params
* @return
* @throws Exception
*/
int updateProduct(Map<String,Object> params)throws Exception;
int updateSkuStock(Map<String,Object> params);
/**
* 商品下载 查询产品
* 根据商品ID更新商品库存
* @param params
* @return
* @throws Exception
*/
List<DownloadProductBean> getProductListByMap(Map<String,Object> params)throws Exception;
int updateProductStock(Map<String,Object> params);
/**
* 根据产品ID查询SKU
* @param productid
* 订单下载
* @param params
* @return
* @throws Exception
*/
List<DownloadProductSkuBean> getDownloadProductSkuBeanList(String productid)throws Exception;
List<Orders> getOrdersList(Map<String,Object> params);
/**
* 根据产品ID查询SKU属性
* @param skuId
* 子订单查询
* @param orderSn
* @return
* @throws Exception
*/
List<DownloadProductSkuBean> getDownloadSkuBean(@Param("skuId") String skuId)throws Exception;
List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn);
IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception;
IMProductBean getIMProductBeanById(@Param("productId") String productId)throws Exception;
}
......
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@ToString
public class Orders {
private Integer id;
private String orderSn;
private String orderPsn;
private Integer isParent;
private Integer isShow;
private String relationOrderSn;
private Integer orderType;
private Integer sellerId;
private String sellerName;
private Integer memberId;
private String memberName;
private Integer orderState;
private Date payTime;
private Integer paymentStatus;
private Integer invoiceStatus;
private String invoiceTitle;
private String invoiceType;
private BigDecimal moneyProduct;
private BigDecimal moneyLogistics;
private BigDecimal moneyOrder;
private BigDecimal moneyPaidBalance;
private BigDecimal moneyPaidReality;
private BigDecimal moneyCoupon;
private BigDecimal moneyActFull;
private BigDecimal moneyDiscount;
private BigDecimal moneyBack;
private BigDecimal moneyIntegral;
private Integer integral;
private Integer couponUserId;
private Integer actFullId;
private Integer activityId;
private String ip;
private String paymentName;
private String paymentCode;
private String name;
private Integer provinceId;
private Integer cityId;
private Integer areaId;
private String addressAll;
private String addressInfo;
private String mobile;
private String email;
private String zipCode;
private String remark;
private Date deliverTime;
private Date finishTime;
private String tradeSn;
private Integer source;
private Integer logisticsId;
private String logisticsName;
private String logisticsNumber;
private Integer isCodconfim;
private Integer codconfirmId;
private String codconfirmName;
private Date codconfirmTime;
private String codconfirmRemark;
private Integer codconfirmState;
private Date createTime;
private Date DateupdateTime;
private Integer evaluateState;
private String regionName1;
private String regionName2;
private String regionName3;
private List<OrdersProduct> goodinfos;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class OrdersProduct {
private Integer id;
private Integer ordersId;
private String ordersSn;
private String ordersPsn;
private Integer sellerId;
private String sellerName;
private Integer productCateId;
private Integer productId;
private Integer productGoodsId;
private String specInfo;
private String productName;
private String productSku;
private Integer packageGroupsId;
private Integer mallGroupsId;
private Integer giftId;
private Integer isGift;
private BigDecimal moneyPrice;
private Integer number;
private BigDecimal moneyAmount;
private BigDecimal moneyActSingle;
private Integer actSingleId;
private Integer actGroupId;
private Integer actFlashSaleId;
private Integer actFlashSaleProductId;
private Integer actBiddingId;
private Integer actIntegralId;
private Integer actIntegralNum;
private BigDecimal actIntegralMoney;
private String systemRemark;
private Integer backNumber;
private Integer exchangeNumber;
private Date createTime;
private Date updateTime;
private Integer isEvaluate;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class Product {
private Integer id;
private Integer productCateId;
private String productCatePath;
private String name1;
private String name2;
private String keyword;
private Integer productBrandId;
private Integer isSelf;
private BigDecimal costPrice;
private BigDecimal protectedPrice;
private BigDecimal marketPrice;
private BigDecimal mallPcPrice;
private BigDecimal malMobilePrice;
private Integer virtualSales;
private Integer actualSales;
private Integer productStock;
private Integer isNorm;
private String normIds;
private String normName;
private Integer state;
private Integer isTop;
private Date upTime;
private String description;
private String packing;
private Integer sellerId;
private Integer createId;
private Date createTime;
private Date updateTime;
private Integer sellerCateId;
private Integer sellerIsTop;
private Integer sellerState;
private Integer commentsNumber;
private Integer productCateState;
private Integer isInventedProduct;
private Integer transportType;
private Integer transportId;
private String masterImg;
private String productCode;
private BigDecimal saleScale1;
private BigDecimal saleScale2;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ProductGoods {
private Long id;
private Long productId;
private String normAttrId;
private String normName;
private Double mallPcPrice;
private Double mallMobilePrice;
private Long productStock;
private Long productStockWarning;
private Long actualSales;
private String sku;
private String images;
private Long state;
private Double weight;
private Long length;
private Long width;
private Long height;
}
......@@ -12,6 +12,7 @@ public class PineappleSyncStockRequest {
@JsonProperty("PlatProductID")
private String platProductID;
@NotBlank(message = "skuid参数不能为空")
@JsonProperty("SkuID")
private String skuID;
......
......@@ -45,7 +45,7 @@ public class PineappleServiceImpl implements PineappleService {
params.put("endTime","");
params.put("pageNow","1");
params.put("PageSize","10");
return pineappleDao.pageGetRefundBean(params);
return null;
}
@Override
......@@ -68,7 +68,7 @@ public class PineappleServiceImpl implements PineappleService {
@Override
public PineappleSyncStockResponse updateSyncStock(PineappleSyncStockRequest pineappleSyncStockRequest) throws Exception {
PineappleSyncStockResponse pineappleSyncStockResponse = new PineappleSyncStockResponse();
Map<String,Object> params = new HashMap<>();
/* Map<String,Object> params = new HashMap<>();
params.put("supplierId","");
params.put("productId",pineappleSyncStockRequest.getPlatProductID());
//先判断SKU在判断产品
......@@ -144,12 +144,13 @@ public class PineappleServiceImpl implements PineappleService {
pineappleSyncStockResponse.setQuantity(String.valueOf(pineappleSyncStockRequest.getQuantity()));
pineappleSyncStockResponse.setMessage(PineappleEnum.ERROR.getMsg());
pineappleSyncStockResponse.setCode(PineappleEnum.ERROR.getCode());
return pineappleSyncStockResponse;
return pineappleSyncStockResponse;*/
return null;
}
@Override
public BaseResponse shipments(PineappleSendRequest pineappleSend) throws Exception {
BaseResponse baseResponse =new BaseResponse();
/*BaseResponse baseResponse =new BaseResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
//订单号不符合
......@@ -200,12 +201,13 @@ public class PineappleServiceImpl implements PineappleService {
pineappleDao.updateBusinessSend(params);
baseResponse.setMessage(PineappleEnum.ERROR.getMsg());
baseResponse.setCode(PineappleEnum.ERROR.getCode());
return baseResponse;
return baseResponse;*/
return null;
}
@Override
public UpdateSellerMemoResponse updateSelle(UpdateSellerMemoRequest updateSellerMemoRequest)throws Exception {
UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
/* UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
//订单号不符合
......@@ -226,6 +228,7 @@ public class PineappleServiceImpl implements PineappleService {
UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode());
UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
return UpdateSellerMemoResponse;
return UpdateSellerMemoResponse;*/
return null;
}
}
......
......@@ -32,7 +32,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
params.put("orderCode",callRequest.getBizModel().getOrderID());
List<CheckRefundStatusBean> checkRefundStatusBeanList = new ArrayList<>();
/*
//先判断是否有退款
if(pineappleDao.countCheckRefundStatusResponse(params)>0){
Map<String,Object> map = new HashMap<>();
......@@ -112,7 +112,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.JH_07.getMsg());
checkRefundStatusResponse.setChildrenrefundStatus(new ArrayList());
checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode());
checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg());*/
return checkRefundStatusResponse;
}
......
......@@ -30,9 +30,9 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
DownloadProductResponse downloadProductResponse = new DownloadProductResponse();
Map<String,Object> params =new HashMap<>();
params.put("supplierId",callRequest.getSupplier().getId());
if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){
/*if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){
params.put("isShow", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue());
}
}*/
params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize());
params.put("PageSize",callRequest.getBizModel().getPageSize());
if(!StringUtil.isNull(callRequest.getBizModel().getProductId())){
......@@ -42,34 +42,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
params.put("productName",callRequest.getBizModel().getPageSize());
}
//查询产品
List<DownloadProductBean> downloadProductBeanList = pineappleDao.getProductListByMap(params);
List<DownloadProductBean> downloadProductBeanList = pineappleDao.downloadProductListByMap(params);
if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){
for(DownloadProductBean product : downloadProductBeanList){
//产品SKU
List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.getDownloadProductSkuBeanList(product.getPlatProductID());
if(!StringUtil.isNull(downloadProductSkuBeanList) && !downloadProductSkuBeanList.isEmpty()){
for(int i=0;i<downloadProductSkuBeanList.size();i++){
DownloadProductSkuBean sku = downloadProductSkuBeanList.get(i);
//查询SKU规格名称
List<DownloadProductSkuBean> skuList = pineappleDao.getDownloadSkuBean(sku.getSkuID());
if(!StringUtil.isNull(skuList) && !skuList.isEmpty()){
StringBuffer sb = new StringBuffer();
for(int j = 0;j<skuList.size();j++){
if(j ==0){
sb.append(skuList.get(j).getSkuname());
}else{
sb.append(","+skuList.get(j).getSkuname());
}
}
sku.setSkuname(sb.toString());
sku.setSkupictureurl(product.getPictureurl());
}
}
}
List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.downloadSkuByProductId(product.getPlatProductID());
product.setSkus(downloadProductSkuBeanList);
};
downloadProductResponse.setTotalcount(downloadProductBeanList.size());
}else{
downloadProductResponse.setTotalcount(0);
......
......@@ -11,6 +11,7 @@ import com.sibu.orderHelper.integral.model.IMProductBean;
import com.sibu.orderHelper.integral.model.IMSupplier;
import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest;
......@@ -57,11 +58,27 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
@Override
public BaseResponse call(CallRequest<GetOrderRequest> callRequest) {
if (StringUtils.isNotBlank(callRequest.getBizModel().getPlatOrderNo())) {
return this.findByOrderCode(callRequest);
} else {
return this.findList(callRequest);
Map<String,Object> params = new HashMap<>();
if(!StringUtil.isNull(callRequest.getBizModel().getPlatOrderNo())){
params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
}
params.put("sellerId",callRequest.getSupplier().getId());
if(!StringUtil.isNull(callRequest.getBizModel().getStartTime())){
params.put("startTime",callRequest.getBizModel().getStartTime());
}
if(!StringUtil.isNull(callRequest.getBizModel().getEndTime())){
params.put("endTime",callRequest.getBizModel().getEndTime());
}
params.put("PageIndex",(callRequest.getBizModel().getPageIndex() - 1) * callRequest.getBizModel().getPageSize());
params.put("PageSize",callRequest.getBizModel().getPageSize());
List<Orders> ordersList = pineappleDao.getOrdersList(params);
GetOrderResponse response = new GetOrderResponse();
response.setNumTotalOrder(0);
response.setOrders(null);
response.setCode(PineAppleConst.SUCCESS_CODE);
return response;
}
......@@ -70,7 +87,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
return "Differ.JH.Business.GetOrder";
}
/*
private GetOrderResponse findByOrderCode(CallRequest<GetOrderRequest> callRequest) {
DoingOrderDetailResponse order = null;
try {
......@@ -184,5 +201,5 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
response.setCode(PineAppleConst.SUCCESS_CODE);
return response;
}
}*/
}
......
......@@ -34,7 +34,7 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
@Override
public GetRefundResponse call(CallRequest<GetRefundRequest> callRequest) throws Exception {
GetRefundResponse getRefundResponse =new GetRefundResponse();
/*GetRefundResponse getRefundResponse =new GetRefundResponse();
Map<String,Object> params = new HashMap<>();
params.put("supplierId",callRequest.getSupplier().getId());
params.put("beginTime",callRequest.getBizModel().getBeginTime());
......@@ -83,8 +83,8 @@ public class GetRefundBizServiceImpl extends AbstractBizService<GetRefundReques
getRefundResponse.setRefunds(refundBeanList);
getRefundResponse.setSuccess(true);
getRefundResponse.setCode(PineappleEnum.SUCCESS.getCode());
getRefundResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
return getRefundResponse;
getRefundResponse.setMessage(PineappleEnum.SUCCESS.getMsg());*/
return null;
}
@Override
......
......@@ -10,6 +10,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum;
import com.sibu.orderHelper.integral.dao.PineappleDao;
import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
import com.sibu.orderHelper.integral.request.PineappleSendRequest;
......@@ -32,53 +33,42 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception {
BaseResponse baseResponse =new BaseResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo());
String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo());
redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue());
params.put("doingOrderTable","im_doing_order_" + tableIndex);
params.put("orderCode",callRequest.getBizModel().getPlatOrderNo());
params.put("supplierId",callRequest.getSupplier().getId());
params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
params.put("sellerId",callRequest.getSupplier().getId());
//只有订单状态为3 4 5 才允许修改地址,快递单号,其中状态为3还可以修改ERP状态与时间,发货时间,订单状态,其他订单状态直接报业务异常
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params);
if(StringUtil.isNull(iMDoingOrderBean)){
log.error("获取订单数据业务异常");
throw new BizException("获取订单数据业务异常");
Orders orders = pineappleDao.getOrdersByMap(params);
if(StringUtil.isNull(orders)){
log.error("获取订单数据业务异常:"+callRequest.getBizModel().getPlatOrderNo());
throw new BizException("获取订单数据业务异常:"+callRequest.getBizModel().getPlatOrderNo());
}
if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasReceived.getCode() || iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasDelive.getCode()
|| iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){
if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){
params.put("orderStatus",PayOrderStatus.HasReceived.getCode());
params.put("erpImportDt",new Date());
params.put("shipDt",new Date());
if(orders.getOrderState().intValue() == PayOrderStatus.HasReceived.getCode() || orders.getOrderState().intValue() == PayOrderStatus.HasDelive.getCode()
|| orders.getOrderState().intValue() == PayOrderStatus.WaitShip.getCode()){
if(orders.getOrderState().intValue() == PayOrderStatus.WaitShip.getCode()){
params.put("orderState",PayOrderStatus.HasReceived.getCode());
params.put("deliverTime",new Date());
}
if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
params.put("expressCode",callRequest.getBizModel().getLogisticNo());
}
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
//判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去
int num = pineappleDao.getOrderByMap(params);
if(num > 0){
params.put("expressCode","");
}else{
int num = pineappleDao.checkLogisticsNumber(params);
if(num == 0){
if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
if(StringUtil.isNull(iMDoingOrderBean.getExpressCode())){
params.put("expressCode",callRequest.getBizModel().getLogisticNo());
if(StringUtil.isNull(orders.getLogisticsNumber())){
params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo());
}else{
params.put("expressCode",iMDoingOrderBean.getExpressCode()+";"+callRequest.getBizModel().getLogisticNo());
params.put("logisticsNumber",orders.getLogisticsNumber()+";"+callRequest.getBizModel().getLogisticNo());
}
}
}
if(StringUtil.isNull(callRequest.getBizModel().getSenderName())){
params.put("buyerUsername","");
//收货人名字
if(!StringUtil.isNull(callRequest.getBizModel().getSenderName())){
params.put("name",callRequest.getBizModel().getSenderName());
}
//电话
if(!StringUtil.isNull(callRequest.getBizModel().getSenderTel())){
params.put("buyerPhone",callRequest.getBizModel().getSenderTel());
params.put("mobile",callRequest.getBizModel().getSenderTel());
}
if(!StringUtil.isNull(callRequest.getBizModel().getSenderAddress())){
//地址 良品不需要更改地址
/* if(!StringUtil.isNull(callRequest.getBizModel().getSenderAddress())){
String [] str = callRequest.getBizModel().getSenderAddress().split(" ");
if(!StringUtil.isNull(str) && str.length >3){
params.put("province",str[0]);
......@@ -88,20 +78,24 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
for(int i = 3;i<str.length;i++){
address.append(str[i]);
}
params.put("address",str[0]+"-"+str[1]+"-"+str[2]+"-"+address);
params.put("addressAll",str[0]+"-"+str[1]+"-"+str[2]);
params.put("addressInfo",str[0]+"-"+str[1]+"-"+str[2]+"-"+address);
}else{
log.error(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey()));
throw new BizException(String.format("订单号:%s,地址不符合要求:%s,请求method:%s,appket:%s",callRequest.getBizModel().getPlatOrderNo(),callRequest.getBizModel().getSenderAddress(),callRequest.getRequest().getMethod(),callRequest.getRequest().getAppkey()));
}
}
}*/
//物流公司名字
if(StringUtil.isNull(orders.getLogisticsName())){
params.put("expressName",callRequest.getBizModel().getLogisticName());
}
}else{
log.error("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo());
throw new BizException("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo());
}
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
pineappleDao.updateBusinessSend(params);
//修改订单信息
pineappleDao.updateOrdersState(params);
baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
baseResponse.setCode(PineappleEnum.SUCCESS.getCode());
return baseResponse;
......
......@@ -9,6 +9,7 @@ import com.sibu.orderHelper.enums.PineappleMethodsEnum;
import com.sibu.orderHelper.integral.dao.PineappleDao;
import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
import com.sibu.orderHelper.integral.pineapple.exception.BizException;
import com.sibu.orderHelper.integral.pineapple.model.Orders;
import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse;
import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest;
......@@ -30,22 +31,18 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception {
UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = "";
Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo());
String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo());
params.put("doingOrderTable","im_doing_order_" + tableIndex);
params.put("orderCode",callRequest.getBizModel().getPlatOrderNo());
params.put("sellerRemark",callRequest.getBizModel().getSellerMemo());
params.put("supplierId",callRequest.getSupplier().getId());
redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue());
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params);
if(StringUtil.isNull(iMDoingOrderBean)){
params.put("orderSn ",callRequest.getBizModel().getPlatOrderNo());
params.put("remark ",callRequest.getBizModel().getSellerMemo());
params.put("sellerId",callRequest.getSupplier().getId());
Orders orders = pineappleDao.getOrdersByMap(params);
if(StringUtil.isNull(orders)){
log.error("获取订单数据业务异常");
throw new BizException("获取订单数据业务异常");
}
if(pineappleDao.updateOdersRemark(params) != 1){
log.error("获取订单数据业务异常");
throw new BizException("获取订单数据业务异常");
}
DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
pineappleDao.updateSelle(params);
UpdateSellerMemoResponse.setCode(PineappleEnum.SUCCESS.getCode());
UpdateSellerMemoResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
return UpdateSellerMemoResponse;
......