菠萝派接口-订单下载,传商品条形码不传商户ID,商品下载根据产品编号或条形码查询
正在显示
5 个修改的文件
包含
51 行增加
和
1 行删除
| ... | @@ -152,4 +152,6 @@ public interface PineappleDao { | ... | @@ -152,4 +152,6 @@ public interface PineappleDao { |
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception; | 154 | IMDoingOrderBean getOrderListByMap(Map<String,Object> params)throws Exception; |
| 155 | |||
| 156 | IMProductBean getIMProductBeanById(@Param("productId") String productId)throws Exception; | ||
| 155 | } | 157 | } | ... | ... |
| ... | @@ -132,6 +132,7 @@ | ... | @@ -132,6 +132,7 @@ |
| 132 | <result column="market_price" property="marketPrice" /> | 132 | <result column="market_price" property="marketPrice" /> |
| 133 | <result column="product_type" property="productType" /> | 133 | <result column="product_type" property="productType" /> |
| 134 | <result column="is_show" property="isShow"/> | 134 | <result column="is_show" property="isShow"/> |
| 135 | <result column="bar_code" property="barCode"/> | ||
| 135 | <result column="is_open_spec" property="isOpenSpec"/> | 136 | <result column="is_open_spec" property="isOpenSpec"/> |
| 136 | <result column="spec" property="spec"/> | 137 | <result column="spec" property="spec"/> |
| 137 | <result column="mini_purchase_number" property="miniPurchaseNumber"/> | 138 | <result column="mini_purchase_number" property="miniPurchaseNumber"/> |
| ... | @@ -168,7 +169,7 @@ | ... | @@ -168,7 +169,7 @@ |
| 168 | and p.is_show = 1 | 169 | and p.is_show = 1 |
| 169 | </if> | 170 | </if> |
| 170 | <if test="productId !=null and productId !=''"> | 171 | <if test="productId !=null and productId !=''"> |
| 171 | AND p.im_product_id =#{productId} | 172 | AND (p.im_product_id =#{productId} OR p.bar_code =#{productId}) |
| 172 | </if> | 173 | </if> |
| 173 | <if test="productName !=null and productName !=''"> | 174 | <if test="productName !=null and productName !=''"> |
| 174 | AND p.name =#{productName} | 175 | AND p.name =#{productName} |
| ... | @@ -297,6 +298,15 @@ | ... | @@ -297,6 +298,15 @@ |
| 297 | AND s.supplier_id = #{supplierId} | 298 | AND s.supplier_id = #{supplierId} |
| 298 | </select> | 299 | </select> |
| 299 | 300 | ||
| 301 | <select id="getIMProductBeanById" parameterType="java.lang.String" resultMap="listAPIIMProduct"> | ||
| 302 | SELECT | ||
| 303 | <include refid="Base_Product_Column" />,imp.bar_code | ||
| 304 | FROM | ||
| 305 | im_product imp | ||
| 306 | WHERE imp.im_product_id = #{productId} | ||
| 307 | </select> | ||
| 308 | |||
| 309 | |||
| 300 | <update id="updateProductInventory" parameterType="com.sibu.orderHelper.integral.model.IMProductInventory"> | 310 | <update id="updateProductInventory" parameterType="com.sibu.orderHelper.integral.model.IMProductInventory"> |
| 301 | update im_product_inventory set stock_num=#{stockNum} where im_product_id=#{imProductId} | 311 | update im_product_inventory set stock_num=#{stockNum} where im_product_id=#{imProductId} |
| 302 | </update> | 312 | </update> | ... | ... |
| ... | @@ -60,6 +60,16 @@ public class DoingOrder1DetailResponse implements Serializable { | ... | @@ -60,6 +60,16 @@ public class DoingOrder1DetailResponse implements Serializable { |
| 60 | 60 | ||
| 61 | private BigDecimal deductionLineVbPrice; | 61 | private BigDecimal deductionLineVbPrice; |
| 62 | 62 | ||
| 63 | private String barCode; | ||
| 64 | |||
| 65 | public String getBarCode() { | ||
| 66 | return barCode; | ||
| 67 | } | ||
| 68 | |||
| 69 | public void setBarCode(String barCode) { | ||
| 70 | this.barCode = barCode; | ||
| 71 | } | ||
| 72 | |||
| 63 | public Integer getRefundOperateTypeCode() { | 73 | public Integer getRefundOperateTypeCode() { |
| 64 | if (refundOperateTypeEnum != null) { | 74 | if (refundOperateTypeEnum != null) { |
| 65 | return refundOperateTypeEnum.getCode(); | 75 | return refundOperateTypeEnum.getCode(); | ... | ... |
| 1 | package com.sibu.orderHelper.integral.service.pineapple.converter; | 1 | package com.sibu.orderHelper.integral.service.pineapple.converter; |
| 2 | 2 | ||
| 3 | import com.sibu.orderHelper.common.util.StringUtil; | ||
| 3 | import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum; | 4 | import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum; |
| 4 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 5 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
| 5 | import com.sibu.orderHelper.integral.pineapple.response.OrderGoodResponse; | 6 | import com.sibu.orderHelper.integral.pineapple.response.OrderGoodResponse; |
| ... | @@ -54,6 +55,9 @@ public class PlatformOrderItemToPineAppleOrderItemConverter implements Converter | ... | @@ -54,6 +55,9 @@ public class PlatformOrderItemToPineAppleOrderItemConverter implements Converter |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | private String convertAndCheckProductId(DoingOrder1DetailResponse source) { | 57 | private String convertAndCheckProductId(DoingOrder1DetailResponse source) { |
| 58 | if(StringUtil.isNotBlank(source.getBarCode())){ | ||
| 59 | return source.getBarCode(); | ||
| 60 | } | ||
| 57 | if (StringUtils.isNotBlank(source.getSkuId())) { | 61 | if (StringUtils.isNotBlank(source.getSkuId())) { |
| 58 | return source.getSkuId(); | 62 | return source.getSkuId(); |
| 59 | } | 63 | } | ... | ... |
| ... | @@ -3,8 +3,11 @@ package com.sibu.orderHelper.integral.service.pineapple.impl; | ... | @@ -3,8 +3,11 @@ package com.sibu.orderHelper.integral.service.pineapple.impl; |
| 3 | import com.sibu.orderHelper.common.constants.AppConstants; | 3 | import com.sibu.orderHelper.common.constants.AppConstants; |
| 4 | import com.sibu.orderHelper.common.database.DBContextHolder; | 4 | import com.sibu.orderHelper.common.database.DBContextHolder; |
| 5 | import com.sibu.orderHelper.common.strategy.DbUtil; | 5 | import com.sibu.orderHelper.common.strategy.DbUtil; |
| 6 | import com.sibu.orderHelper.common.util.StringUtil; | ||
| 6 | import com.sibu.orderHelper.integral.dao.IMDoingOrderDao; | 7 | import com.sibu.orderHelper.integral.dao.IMDoingOrderDao; |
| 8 | import com.sibu.orderHelper.integral.dao.PineappleDao; | ||
| 7 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; | 9 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; |
| 10 | import com.sibu.orderHelper.integral.model.IMProductBean; | ||
| 8 | import com.sibu.orderHelper.integral.model.IMSupplier; | 11 | import com.sibu.orderHelper.integral.model.IMSupplier; |
| 9 | import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; | 12 | import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; |
| 10 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 13 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
| ... | @@ -14,6 +17,7 @@ import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest; | ... | @@ -14,6 +17,7 @@ import com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest; |
| 14 | import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; | 17 | import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; |
| 15 | import com.sibu.orderHelper.integral.pineapple.response.GetOrderResponse; | 18 | import com.sibu.orderHelper.integral.pineapple.response.GetOrderResponse; |
| 16 | import com.sibu.orderHelper.integral.pineapple.response.OrderResponse; | 19 | import com.sibu.orderHelper.integral.pineapple.response.OrderResponse; |
| 20 | import com.sibu.orderHelper.integral.reponse.DoingOrder1DetailResponse; | ||
| 17 | import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse; | 21 | import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse; |
| 18 | import com.sibu.orderHelper.integral.service.IIMDoingOrderService; | 22 | import com.sibu.orderHelper.integral.service.IIMDoingOrderService; |
| 19 | import com.sibu.orderHelper.integral.service.impl.IMDoingOrderService; | 23 | import com.sibu.orderHelper.integral.service.impl.IMDoingOrderService; |
| ... | @@ -48,6 +52,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -48,6 +52,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
| 48 | @Autowired | 52 | @Autowired |
| 49 | private PlatformOrderToPineAppleOrderConverter platformOrderToPineAppleOrderConverter; | 53 | private PlatformOrderToPineAppleOrderConverter platformOrderToPineAppleOrderConverter; |
| 50 | 54 | ||
| 55 | @Resource | ||
| 56 | PineappleDao pineappleDao; | ||
| 57 | |||
| 51 | @Override | 58 | @Override |
| 52 | public BaseResponse call(CallRequest<GetOrderRequest> callRequest) { | 59 | public BaseResponse call(CallRequest<GetOrderRequest> callRequest) { |
| 53 | if (StringUtils.isNotBlank(callRequest.getBizModel().getPlatOrderNo())) { | 60 | if (StringUtils.isNotBlank(callRequest.getBizModel().getPlatOrderNo())) { |
| ... | @@ -68,6 +75,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -68,6 +75,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
| 68 | DoingOrderDetailResponse order = null; | 75 | DoingOrderDetailResponse order = null; |
| 69 | try { | 76 | try { |
| 70 | order = iimDoingOrderService.getIMOrderDetailByOrderCode(callRequest.getBizModel().getPlatOrderNo()); | 77 | order = iimDoingOrderService.getIMOrderDetailByOrderCode(callRequest.getBizModel().getPlatOrderNo()); |
| 78 | if (order != null) { | ||
| 79 | this.getBarCode(order); | ||
| 80 | } | ||
| 71 | } catch (Exception e) { | 81 | } catch (Exception e) { |
| 72 | log.error("获取订单数据业务异常", e); | 82 | log.error("获取订单数据业务异常", e); |
| 73 | throw new BizException("获取订单数据业务异常", e); | 83 | throw new BizException("获取订单数据业务异常", e); |
| ... | @@ -89,6 +99,17 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -89,6 +99,17 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
| 89 | return this.platformOrderToPineAppleOrderConverter.convert(order); | 99 | return this.platformOrderToPineAppleOrderConverter.convert(order); |
| 90 | } | 100 | } |
| 91 | 101 | ||
| 102 | public DoingOrderDetailResponse getBarCode(DoingOrderDetailResponse source) throws Exception { | ||
| 103 | for (DoingOrder1DetailResponse entity:source.getOrder1s()){ | ||
| 104 | IMProductBean product = pineappleDao.getIMProductBeanById(entity.getProductId()); | ||
| 105 | if(StringUtil.isNotBlank(product.getBarCode())){ | ||
| 106 | entity.setBarCode(product.getBarCode()); | ||
| 107 | } | ||
| 108 | } | ||
| 109 | return source; | ||
| 110 | } | ||
| 111 | |||
| 112 | |||
| 92 | private BaseResponse findList(CallRequest<GetOrderRequest> callRequest) { | 113 | private BaseResponse findList(CallRequest<GetOrderRequest> callRequest) { |
| 93 | List<IMDoingOrderBean> list = new ArrayList<IMDoingOrderBean>(); | 114 | List<IMDoingOrderBean> list = new ArrayList<IMDoingOrderBean>(); |
| 94 | //默认获取订单数量值 | 115 | //默认获取订单数量值 |
| ... | @@ -146,6 +167,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> | ... | @@ -146,6 +167,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest> |
| 146 | DoingOrderDetailResponse order = null; | 167 | DoingOrderDetailResponse order = null; |
| 147 | try { | 168 | try { |
| 148 | order = iimDoingOrderService.getIMOrderDetailByOrderCode(p.getOrderCode()); | 169 | order = iimDoingOrderService.getIMOrderDetailByOrderCode(p.getOrderCode()); |
| 170 | if(!StringUtil.isNull(order)){ | ||
| 171 | this.getBarCode(order); | ||
| 172 | } | ||
| 149 | } catch (Exception e) { | 173 | } catch (Exception e) { |
| 150 | log.error("获取订单数据业务异常", e); | 174 | log.error("获取订单数据业务异常", e); |
| 151 | throw new BizException("获取订单数据业务异常", e); | 175 | throw new BizException("获取订单数据业务异常", e); | ... | ... |
-
请 注册 或 登录 后发表评论