0716a07e 刘嘉

1.菠萝派发货接口-只有订单状态为3 4 5 才允许修改地址,快递单号,其中状态为3还可以修改ERP状态与时间,发货时间,订单状态,其他订单状态直接报业务异常

1 个父辈 e24fa9bc
...@@ -149,4 +149,7 @@ public interface PineappleDao { ...@@ -149,4 +149,7 @@ public interface PineappleDao {
149 * @throws Exception 149 * @throws Exception
150 */ 150 */
151 List<DownloadProductSkuBean> getDownloadSkuBean(@Param("skuId") String skuId)throws Exception; 151 List<DownloadProductSkuBean> getDownloadSkuBean(@Param("skuId") String skuId)throws Exception;
152
153
154 IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception;
152 } 155 }
......
...@@ -357,6 +357,63 @@ ...@@ -357,6 +357,63 @@
357 AND supplier_id = #{supplierId} 357 AND supplier_id = #{supplierId}
358 </select> 358 </select>
359 359
360 <resultMap type="com.sibu.orderHelper.integral.model.IMDoingOrderBean" id="iMDoingOrderBean2">
361 <id column="order_id" property="orderId"/>
362 <result column="member_id" property="memberId"/>
363 <result column="order_code" property="orderCode"/>
364 <result column="main_order_code" property="mainOrderCode"/>
365 <result column="order_status" property="orderStatus"/>
366 <result column="order_from" property="orderFrom"/>
367 <result column="order_platform" property="orderPlatform"/>
368 <result column="contact" property="contact"/>
369 <result column="phone" property="phone"/>
370 <result column="province" property="province"/>
371 <result column="city" property="city"/>
372 <result column="area" property="area"/>
373 <result column="address" property="address"/>
374 <result column="zipcode" property="zipcode"/>
375 <result column="buyer_remark" property="buyerRemark"/>
376 <result column="seller_remark" property="sellerRemark"/>
377 <result column="total_integral" property="totalIntegral"/>
378 <result column="total_money" property="totalMoney"/>
379 <result column="freight" property="freight"/>
380 <result column="express_name" property="expressName"/>
381 <result column="express_code" property="expressCode"/>
382 <result column="express_code2" property="expressCode2"/>
383 <result column="create_dt" property="createDt"/>
384 <result column="pay_dt" property="payDt"/>
385 <result column="transaction_id" property="transactionId"/>
386 <result column="pay_type" property="payType"/>
387 <result column="open_id" property="openId"/>
388 <result column="buyer_username" property="buyerUsername"></result>
389 <result column="buyer_phone" property="buyerPhone"></result>
390 <result column="erp_import" property="erpImport"></result>
391 <result column="erp_import_dt" property="erpImportDt"></result>
392 <result column="ship_dt" property="shipDt"></result>
393 <result column="receive_dt" property="receiveDt"/>
394 <result column="user_coupon_money" property="userCouponMoney"/>
395 <result column="deduction_vb" property="deductionVb"/>
396 <result column="deduction_money" property="deductionMoney"/>
397 <result column="prerefund_original_order_status" property="prerefundOriginalOrderStatus"/>
398 <result column="share_member_id" property="shareMemberId"/>
399 <result column="share_order_money" property="shareOrderMoney"/>
400 <result column="platform_type" property="platformType"/>
401 <result column="supplier_id" property="supplierId"/>
402 <result column="supplier_name" property="supplierName"/>
403 <result column="sign_pay_status" property="signPayStatus"/>
404 </resultMap>
405
406
407
408 <select id="getOrderListByMap" parameterType="java.util.Map" resultMap="iMDoingOrderBean2">
409 SELECT order_id,member_id,order_code,order_status,order_from,
410 contact,phone,total_integral,freight,create_dt,pay_dt,total_money,buyer_username,buyer_phone,open_id,
411 province,city,area,address,zipcode,buyer_remark,pay_type,transaction_id,user_coupon_id,user_coupon_money,
412 express_name,express_code,express_code2,order_platform,
413 erp_import,prerefund_original_order_status FROM ${doingOrderTable} WHERE order_code = #{orderCode}
414 AND supplier_id = #{supplierId}
415 </select>
416
360 <update id="updateBusinessSend" parameterType="java.util.Map"> 417 <update id="updateBusinessSend" parameterType="java.util.Map">
361 UPDATE ${doingOrderTable} 418 UPDATE ${doingOrderTable}
362 <set> 419 <set>
...@@ -387,11 +444,19 @@ ...@@ -387,11 +444,19 @@
387 <if test="buyerUsername !=null and buyerUsername !='' "> 444 <if test="buyerUsername !=null and buyerUsername !='' ">
388 buyer_username =#{buyerUsername}, 445 buyer_username =#{buyerUsername},
389 </if> 446 </if>
390 erp_import = 1,erp_import_dt = now(),ship_dt = now(), 447 <if test="erpImportDt !=null and erpImportDt !='' ">
391 order_status = 4 448 erp_import_dt =#{erpImportDt},
449 </if>
450 <if test="shipDt !=null and shipDt !='' ">
451 ship_dt =#{shipDt},
452 </if>
453 <if test="orderStatus !=null and orderStatus !='' ">
454 order_status =#{orderStatus},
455 </if>
456 erp_import = 1
392 </set> 457 </set>
393 WHERE order_code = #{orderCode} 458 WHERE order_code = #{orderCode}
394 AND supplier_id = #{supplierId} AND order_status =#{orderStatus} 459 AND supplier_id = #{supplierId}
395 </update> 460 </update>
396 461
397 462
......
...@@ -8,6 +8,7 @@ import com.sibu.orderHelper.enums.PayOrderStatus; ...@@ -8,6 +8,7 @@ import com.sibu.orderHelper.enums.PayOrderStatus;
8 import com.sibu.orderHelper.enums.PineappleEnum; 8 import com.sibu.orderHelper.enums.PineappleEnum;
9 import com.sibu.orderHelper.enums.PineappleMethodsEnum; 9 import com.sibu.orderHelper.enums.PineappleMethodsEnum;
10 import com.sibu.orderHelper.integral.dao.PineappleDao; 10 import com.sibu.orderHelper.integral.dao.PineappleDao;
11 import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
11 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 12 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
12 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 13 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
13 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; 14 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
...@@ -16,6 +17,7 @@ import org.apache.log4j.Logger; ...@@ -16,6 +17,7 @@ import org.apache.log4j.Logger;
16 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
17 18
18 import javax.annotation.Resource; 19 import javax.annotation.Resource;
20 import java.util.Date;
19 import java.util.HashMap; 21 import java.util.HashMap;
20 import java.util.Map; 22 import java.util.Map;
21 23
...@@ -31,14 +33,27 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -31,14 +33,27 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
31 BaseResponse baseResponse =new BaseResponse(); 33 BaseResponse baseResponse =new BaseResponse();
32 Map<String,Object> params = new HashMap<>(); 34 Map<String,Object> params = new HashMap<>();
33 String redisMysqlDbConfig = ""; 35 String redisMysqlDbConfig = "";
34
35
36 Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo()); 36 Integer dataBaseModule = DbUtil.getOrderInWhichDataBase(callRequest.getBizModel().getPlatOrderNo());
37 String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo()); 37 String tableIndex = DbUtil.getOrderInWhichTable(callRequest.getBizModel().getPlatOrderNo());
38 redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue()); 38 redisMysqlDbConfig = String.format(AppConstants.REDIS_DB_TYPE, AppConstants.INTEGRALMALL_ORDER_DATABASE, dataBaseModule.intValue());
39 params.put("doingOrderTable","im_doing_order_" + tableIndex); 39 params.put("doingOrderTable","im_doing_order_" + tableIndex);
40 params.put("orderCode",callRequest.getBizModel().getPlatOrderNo()); 40 params.put("orderCode",callRequest.getBizModel().getPlatOrderNo());
41 params.put("supplierId",callRequest.getSupplier().getId()); 41 params.put("supplierId",callRequest.getSupplier().getId());
42 //只有订单状态为3 4 5 才允许修改地址,快递单号,其中状态为3还可以修改ERP状态与时间,发货时间,订单状态,其他订单状态直接报业务异常
43 DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
44 IMDoingOrderBean iMDoingOrderBean = pineappleDao.getOrderListByMap(params);
45 if(StringUtil.isNull(iMDoingOrderBean)){
46 log.error("获取订单数据业务异常");
47 throw new BizException("获取订单数据业务异常");
48 }
49
50 if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasReceived.getCode() || iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.HasDelive.getCode()
51 || iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){
52 if(iMDoingOrderBean.getOrderStatus().intValue() == PayOrderStatus.WaitShip.getCode()){
53 params.put("orderStatus",PayOrderStatus.HasReceived.getCode());
54 params.put("erpImportDt",new Date());
55 params.put("shipDt",new Date());
56 }
42 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ 57 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
43 params.put("expressCode",callRequest.getBizModel().getLogisticNo()); 58 params.put("expressCode",callRequest.getBizModel().getLogisticNo());
44 } 59 }
...@@ -68,7 +83,11 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -68,7 +83,11 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
68 } 83 }
69 } 84 }
70 params.put("expressName",callRequest.getBizModel().getLogisticName()); 85 params.put("expressName",callRequest.getBizModel().getLogisticName());
71 params.put("orderStatus",PayOrderStatus.WaitShip.getCode()); 86
87 }else{
88 log.error("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo());
89 throw new BizException("订单发货接口,该订单状态不允许进行发货操作,订单号:"+callRequest.getBizModel().getPlatOrderNo());
90 }
72 DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源 91 DBContextHolder.setDBType(redisMysqlDbConfig);//切换数据源
73 pineappleDao.updateBusinessSend(params); 92 pineappleDao.updateBusinessSend(params);
74 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); 93 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
......