d0afcb9f 刘嘉

菠萝派接口- 修改订单备注、发货、商品下载调用新数据源

1 个父辈 f06dcfdb
1 package com.sibu.orderHelper.mall.member.read; 1 package com.sibu.orderHelper.mall.member.read;
2 2
3 import com.sibu.orderHelper.integral.model.DownloadProductBean;
4 import com.sibu.orderHelper.integral.model.DownloadProductSkuBean;
5 import com.sibu.orderHelper.integral.model.IMSupplierApp;
6 import com.sibu.orderHelper.integral.pineapple.model.*;
3 import com.sibu.orderHelper.integral.reponse.MemberAddressResponse; 7 import com.sibu.orderHelper.integral.reponse.MemberAddressResponse;
4 import com.sibu.orderHelper.integral.request.MemberAddressAddRequest; 8 import com.sibu.orderHelper.integral.request.MemberAddressAddRequest;
5 import org.apache.ibatis.annotations.Param; 9 import org.apache.ibatis.annotations.Param;
...@@ -9,4 +13,111 @@ import java.util.Map; ...@@ -9,4 +13,111 @@ import java.util.Map;
9 13
10 public interface MemberReadDao { 14 public interface MemberReadDao {
11 Integer count(); 15 Integer count();
16
17
18 IMSupplierApp findByAppIdAndAppType(Map<String, String> params);
19 /**
20 * 根据订单号查询订单信息 只查询不是主订单的订单
21 * @param params
22 * @return
23 */
24 Orders getOrdersByMap(Map<String,Object> params);
25
26 /**
27 * 查询该订单是否有该快递单号
28 * @param params
29 * @return
30 */
31 int checkLogisticsNumber(Map<String,Object> params);
32
33 /**
34 * 商品下载
35 * @param params
36 * @return
37 */
38 List<DownloadProductBean> downloadProductListByMap(Map<String,Object> params);
39
40
41 /**
42 * 商品下载总数量
43 * @param params
44 * @return
45 */
46 int countDownloadProductListByMap(Map<String,Object> params);
47
48
49 /**
50 * 根据条件查询商品
51 * @param params
52 * @return
53 */
54 DownloadProductBean getDownloadProductBeanByMap(Map<String,Object> params);
55
56 /**
57 * 根据商品ID获取该商品的所有SKU
58 * @param productId
59 * @return
60 */
61 List<DownloadProductSkuBean> downloadSkuByProductId(@Param("productId") String productId);
62
63 /**
64 * 订单下载
65 * @param params
66 * @return
67 */
68 List<Orders> getOrdersList(Map<String,Object> params);
69
70 /**
71 * 子订单查询
72 * @param orderSn
73 * @return
74 */
75 List<OrdersProduct> getOrdersProductList(@Param("orderSn")String orderSn);
76
77
78 /**
79 * 根据条件查询省市级信息
80 * @param params
81 * @return
82 */
83 List<Regions> getRegionsByMap(Map<String,Object> params);
84
85 /**
86 * 根据id查询省市级信息
87 * @param id
88 * @return
89 */
90 Regions getRegionsById(@Param("id") Integer id);
91
92
93 /**
94 * 根据条件查询物流公司
95 * @return
96 */
97 List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
98
99 /**
100 * 根据订单号查询退货信息
101 * @param orderSn
102 * @return
103 */
104 List<MemberProductBack> getMemberProductBackByOrderSn(@Param("orderSn") String orderSn);
105
106 /**
107 * 根据订单号查询换货信息
108 * @param orderSn
109 * @return
110 */
111 List<MemberProductExchange> getMemberProductExchangeByOrderSn(@Param("orderSn") String orderSn);
112
113
114 /**
115 * 根据订单ID查询投诉表
116 * @param id
117 * @return
118 */
119 List<SellerComplaint> getSellerComplaintByOrderId(@Param("orderId") Integer id);
120
121
122 List<Seller> getSeller(@Param("id") String id);
12 } 123 }
......
1 package com.sibu.orderHelper.mall.member.write; 1 package com.sibu.orderHelper.mall.member.write;
2 2
3 import java.util.Map;
4
3 public interface MemberWriteDao { 5 public interface MemberWriteDao {
4 Integer count(); 6 Integer count();
7
8 /**
9 * 修改订单备注
10 * @param params
11 * @return
12 */
13 int updateOdersRemark(Map<String,Object> params);
14
15 /**
16 * 订单发货更新订单状态与信息
17 * @param params
18 * @return
19 */
20 int updateOrdersState(Map<String,Object> params);
21
22 /**
23 * 根据条件更新sku库存
24 * @param params
25 * @return
26 */
27 int updateSkuStock(Map<String,Object> params);
28
29 /**
30 * 根据商品ID更新商品库存
31 * @param params
32 * @return
33 */
34 int updateProductStock(Map<String,Object> params);
35
5 } 36 }
......
...@@ -14,6 +14,7 @@ import com.sibu.orderHelper.integral.model.IMSupplier; ...@@ -14,6 +14,7 @@ import com.sibu.orderHelper.integral.model.IMSupplier;
14 import com.sibu.orderHelper.integral.model.IMSupplierApp; 14 import com.sibu.orderHelper.integral.model.IMSupplierApp;
15 import com.sibu.orderHelper.integral.pineapple.enums.SubErrorEnum; 15 import com.sibu.orderHelper.integral.pineapple.enums.SubErrorEnum;
16 import com.sibu.orderHelper.integral.pineapple.exception.BizException; 16 import com.sibu.orderHelper.integral.pineapple.exception.BizException;
17 import com.sibu.orderHelper.integral.pineapple.model.Seller;
17 import com.sibu.orderHelper.integral.pineapple.request.BaseRequest; 18 import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
18 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 19 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
19 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; 20 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
...@@ -27,6 +28,7 @@ import com.sibu.orderHelper.integral.service.pineapple.BizService; ...@@ -27,6 +28,7 @@ import com.sibu.orderHelper.integral.service.pineapple.BizService;
27 import com.sibu.orderHelper.integral.service.pineapple.util.JsonUtils; 28 import com.sibu.orderHelper.integral.service.pineapple.util.JsonUtils;
28 import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst; 29 import com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst;
29 import com.sibu.orderHelper.integral.service.pineapple.util.XmlUtils; 30 import com.sibu.orderHelper.integral.service.pineapple.util.XmlUtils;
31 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
30 import net.sf.json.JSONObject; 32 import net.sf.json.JSONObject;
31 import org.apache.commons.collections.CollectionUtils; 33 import org.apache.commons.collections.CollectionUtils;
32 import org.apache.commons.lang3.StringUtils; 34 import org.apache.commons.lang3.StringUtils;
...@@ -67,6 +69,8 @@ public class PineappleController { ...@@ -67,6 +69,8 @@ public class PineappleController {
67 private IMSupplierAppService imSupplierAppService; 69 private IMSupplierAppService imSupplierAppService;
68 @Autowired 70 @Autowired
69 private IMSupplierDao imSupplierDao; 71 private IMSupplierDao imSupplierDao;
72 @Resource
73 private MemberReadDao memberReadDao;
70 74
71 @RequestMapping( 75 @RequestMapping(
72 value = "/pineapple/call", 76 value = "/pineapple/call",
...@@ -169,14 +173,19 @@ public class PineappleController { ...@@ -169,14 +173,19 @@ public class PineappleController {
169 } 173 }
170 174
171 private IMSupplier findAndCheckIMSupplier(BaseRequest request, IMSupplierApp imSupplierApp) { 175 private IMSupplier findAndCheckIMSupplier(BaseRequest request, IMSupplierApp imSupplierApp) {
172 List<IMSupplier> imSuppliers = imSupplierDao.findByIdIn(Arrays.asList(imSupplierApp.getSupplierId())); 176 //List<IMSupplier> imSuppliers = imSupplierDao.findByIdIn(Arrays.asList(imSupplierApp.getSupplierId()));
173 if (CollectionUtils.isEmpty(imSuppliers)) { 177 List<Seller> seller = memberReadDao.getSeller(imSupplierApp.getSupplierId());
178 if (CollectionUtils.isEmpty(seller)) {
174 throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据为空,请联系客服", request.getAppkey())); 179 throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据为空,请联系客服", request.getAppkey()));
175 } 180 }
176 if (imSuppliers.size() > 1) { 181 if (seller.size() > 1) {
177 throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据有重复,请联系客服", request.getAppkey())); 182 throw new BizException(MessageFormat.format("appKey【{0}】的店铺数据有重复,请联系客服", request.getAppkey()));
178 } 183 }
179 return imSuppliers.get(0); 184 Seller entity = seller.get(0);
185 IMSupplier iMSupplier = new IMSupplier();
186 iMSupplier.setId(String.valueOf(entity.getId()));
187 iMSupplier.setName(entity.getName());
188 return iMSupplier;
180 } 189 }
181 190
182 private IMSupplierApp findAndCheckSupplierApp(BaseRequest request) { 191 private IMSupplierApp findAndCheckSupplierApp(BaseRequest request) {
......
...@@ -7,4 +7,68 @@ ...@@ -7,4 +7,68 @@
7 <select id="count" resultType="java.lang.Integer"> 7 <select id="count" resultType="java.lang.Integer">
8 select count(*) from member 8 select count(*) from member
9 </select> 9 </select>
10
11 <!-- 修改订单备注 -->
12 <update id="updateOdersRemark" parameterType="java.util.Map">
13 UPDATE orders SET remark = #{remark},update_time = now() WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
14 </update>
15
16
17 <!--更改订单状态、电话、地址、发货时间、收货人姓名,快递单号 -->
18 <update id="updateOrdersState">
19 UPDATE orders
20 <set>
21 <if test="name !=null and name !=''">
22 name = #{name},
23 </if>
24 <if test="addressInfo !=null and addressInfo !=''">
25 address_info = #{addressInfo},
26 </if>
27 <if test="logisticsNumber !=null and logisticsNumber !=''">
28 logistics_number = #{logisticsNumber},
29 </if>
30 <if test="mobile !=null and mobile !=''">
31 mobile = #{mobile},
32 </if>
33 <if test="addressAll !=null and addressAll !=''">
34 address_all = #{addressAll},
35 </if>
36 <if test="orderState !=null and orderState !=''">
37 order_state = #{orderState},
38 </if>
39 <if test="provinceId !=null and provinceId !=''">
40 province_id = #{provinceId},
41 </if>
42 <if test="areaId !=null and areaId !=''">
43 area_id = #{areaId},
44 </if>
45 <if test="cityId !=null and cityId !=''">
46 city_id = #{cityId},
47 </if>
48 <if test="deliverTime !=null and deliverTime !=''">
49 deliver_time = now(),
50 </if>
51 <if test="logisticsName !=null and logisticsName !=''">
52 logistics_name = #{logisticsName},
53 </if>
54 <if test="logisticsId !=null and logisticsId !=''">
55 logistics_id = #{logisticsId},
56 </if>
57 update_time = now()
58 </set>
59 WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
60 </update>
61
62
63
64 <!-- 更新SKU库存-->
65 <update id="updateSkuStock" parameterType="java.util.Map">
66 UPDATE product_goods SET product_stock = #{stock} WHERE sku = #{skuId} and product_id = #{productId}
67 </update>
68
69 <!-- 更新产品库存-->
70 <update id="updateProductStock" parameterType="java.util.Map">
71 UPDATE product SET product_stock = #{productStock} WHERE id = #{productId}
72 </update>
73
10 </mapper> 74 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,13 +3,14 @@ package com.sibu.orderHelper.integral.pineapple.model; ...@@ -3,13 +3,14 @@ package com.sibu.orderHelper.integral.pineapple.model;
3 import lombok.Data; 3 import lombok.Data;
4 import lombok.ToString; 4 import lombok.ToString;
5 5
6 import java.io.Serializable;
6 import java.math.BigDecimal; 7 import java.math.BigDecimal;
7 import java.util.Date; 8 import java.util.Date;
8 import java.util.List; 9 import java.util.List;
9 10
10 @Data 11 @Data
11 @ToString 12 @ToString
12 public class Orders { 13 public class Orders implements Serializable{
13 private Integer id; 14 private Integer id;
14 private String orderSn; 15 private String orderSn;
15 private String orderPsn; 16 private String orderPsn;
...@@ -68,7 +69,7 @@ public class Orders { ...@@ -68,7 +69,7 @@ public class Orders {
68 private String codconfirmRemark; 69 private String codconfirmRemark;
69 private Integer codconfirmState; 70 private Integer codconfirmState;
70 private String createTime; 71 private String createTime;
71 private String DateupdateTime; 72 private String updateTime;
72 private Integer evaluateState; 73 private Integer evaluateState;
73 private String regionName1; 74 private String regionName1;
74 private String regionName2; 75 private String regionName2;
......
1 package com.sibu.orderHelper.integral.pineapple.model;
2
3 import lombok.Data;
4 import lombok.ToString;
5
6 import java.io.Serializable;
7 import java.math.BigDecimal;
8 import java.util.Date;
9
10 @Data
11 @ToString
12 public class Seller implements Serializable{
13
14
15 private Integer id; //id
16 private Integer memberId; //用户ID
17 private String name; //用户名
18 private String sellerName; //店铺名称
19 private String sellerLogo; //店铺logo
20 private Integer sellerGrade; //店铺等级
21 private String scoreService; //店铺评分服务
22 private String scoreDeliverGoods; //店铺评分发货
23 private String scoreDescription; //店铺评分描述
24 private Integer productNumber; //商品数量
25 private Integer collectionNumber; //店铺收藏
26 private Date createTime; //创建时间
27 private BigDecimal saleMoney; //店铺总销售金额
28 private Integer orderCount; //店铺总订单量
29 private Integer orderCountOver; //店铺完成订单量
30 private String sellerKeyword; //SEO关键字
31 private String sellerDes; //SEO店铺描述
32 private Integer auditStatus; //审核状态 1、待审核;2、审核通过;3、冻结
33 private String storeSlide;
34 }
...@@ -6,9 +6,11 @@ import com.sibu.orderHelper.integral.dao.IMSupplierAppDao; ...@@ -6,9 +6,11 @@ import com.sibu.orderHelper.integral.dao.IMSupplierAppDao;
6 import com.sibu.orderHelper.integral.model.IMSupplierApp; 6 import com.sibu.orderHelper.integral.model.IMSupplierApp;
7 import com.sibu.orderHelper.integral.pineapple.request.BaseRequest; 7 import com.sibu.orderHelper.integral.pineapple.request.BaseRequest;
8 import com.sibu.orderHelper.integral.service.IMSupplierAppService; 8 import com.sibu.orderHelper.integral.service.IMSupplierAppService;
9 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
9 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
11 12
13 import javax.annotation.Resource;
12 import java.util.HashMap; 14 import java.util.HashMap;
13 import java.util.Map; 15 import java.util.Map;
14 16
...@@ -23,6 +25,9 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService { ...@@ -23,6 +25,9 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
23 @Autowired 25 @Autowired
24 private IMSupplierAppDao imSupplierAppDao; 26 private IMSupplierAppDao imSupplierAppDao;
25 27
28 @Resource
29 private MemberReadDao memberReadDao;
30
26 @Override 31 @Override
27 public IMSupplierApp findByAppIdAndAppType(String appId, SupplierAppTypeEnum appType) { 32 public IMSupplierApp findByAppIdAndAppType(String appId, SupplierAppTypeEnum appType) {
28 Map<String, String> params = new HashMap<>(); 33 Map<String, String> params = new HashMap<>();
...@@ -37,6 +42,6 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService { ...@@ -37,6 +42,6 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
37 params.put("appId", requestParams.getAppkey()); 42 params.put("appId", requestParams.getAppkey());
38 params.put("appToken", requestParams.getToken()); 43 params.put("appToken", requestParams.getToken());
39 params.put("appType", appType.getCode()); 44 params.put("appType", appType.getCode());
40 return imSupplierAppDao.findByAppIdAndAppType(params); 45 return memberReadDao.findByAppIdAndAppType(params);
41 } 46 }
42 } 47 }
......
...@@ -10,6 +10,7 @@ import com.sibu.orderHelper.integral.model.DownloadProductSkuBean; ...@@ -10,6 +10,7 @@ import com.sibu.orderHelper.integral.model.DownloadProductSkuBean;
10 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 10 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
11 import com.sibu.orderHelper.integral.reponse.DownloadProductResponse; 11 import com.sibu.orderHelper.integral.reponse.DownloadProductResponse;
12 import com.sibu.orderHelper.integral.request.DownloadProductRequest; 12 import com.sibu.orderHelper.integral.request.DownloadProductRequest;
13 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
13 import org.apache.log4j.Logger; 14 import org.apache.log4j.Logger;
14 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
15 16
...@@ -23,13 +24,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP ...@@ -23,13 +24,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
23 24
24 private static Logger log = Logger.getLogger(DownloadProductBizServiceImpl.class); 25 private static Logger log = Logger.getLogger(DownloadProductBizServiceImpl.class);
25 @Resource 26 @Resource
26 private PineappleDao pineappleDao; 27 private MemberReadDao memberReadDao;
27 28
28 @Override 29 @Override
29 public DownloadProductResponse call(CallRequest<DownloadProductRequest> callRequest) throws Exception { 30 public DownloadProductResponse call(CallRequest<DownloadProductRequest> callRequest) throws Exception {
30 DownloadProductResponse downloadProductResponse = new DownloadProductResponse(); 31 DownloadProductResponse downloadProductResponse = new DownloadProductResponse();
31 Map<String,Object> params =new HashMap<>(); 32 Map<String,Object> params =new HashMap<>();
32 params.put("supplierId",callRequest.getSupplier().getId()); 33 params.put("sellerId",callRequest.getSupplier().getId());
33 if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){ 34 if(!StringUtil.isNull(callRequest.getBizModel().getStatus())){
34 params.put("state", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue()); 35 params.put("state", DownloadProductStatusEnum.resolve(callRequest.getBizModel().getStatus()).intValue());
35 } 36 }
...@@ -42,14 +43,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP ...@@ -42,14 +43,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
42 params.put("productName",callRequest.getBizModel().getPageSize()); 43 params.put("productName",callRequest.getBizModel().getPageSize());
43 } 44 }
44 //查询产品 45 //查询产品
45 List<DownloadProductBean> downloadProductBeanList = pineappleDao.downloadProductListByMap(params); 46 List<DownloadProductBean> downloadProductBeanList = memberReadDao.downloadProductListByMap(params);
46 if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){ 47 if(!StringUtil.isNull(downloadProductBeanList) && !downloadProductBeanList.isEmpty()){
47 for(DownloadProductBean product : downloadProductBeanList){ 48 for(DownloadProductBean product : downloadProductBeanList){
48 //产品SKU 49 //产品SKU
49 List<DownloadProductSkuBean> downloadProductSkuBeanList = pineappleDao.downloadSkuByProductId(product.getPlatProductID()); 50 List<DownloadProductSkuBean> downloadProductSkuBeanList = memberReadDao.downloadSkuByProductId(product.getPlatProductID());
50 product.setSkus(downloadProductSkuBeanList); 51 product.setSkus(downloadProductSkuBeanList);
51 }; 52 };
52 downloadProductResponse.setTotalcount(downloadProductBeanList.size()); 53 int count = memberReadDao.countDownloadProductListByMap(params);
54 downloadProductResponse.setTotalcount(count);
53 }else{ 55 }else{
54 downloadProductResponse.setTotalcount(0); 56 downloadProductResponse.setTotalcount(0);
55 } 57 }
......
...@@ -17,6 +17,8 @@ import com.sibu.orderHelper.integral.pineapple.model.Regions; ...@@ -17,6 +17,8 @@ import com.sibu.orderHelper.integral.pineapple.model.Regions;
17 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 17 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
18 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse; 18 import com.sibu.orderHelper.integral.pineapple.response.BaseResponse;
19 import com.sibu.orderHelper.integral.request.PineappleSendRequest; 19 import com.sibu.orderHelper.integral.request.PineappleSendRequest;
20 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
21 import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
20 import org.apache.log4j.Logger; 22 import org.apache.log4j.Logger;
21 import org.springframework.stereotype.Service; 23 import org.springframework.stereotype.Service;
22 24
...@@ -28,7 +30,9 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -28,7 +30,9 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
28 30
29 private static Logger log = Logger.getLogger(PineappleSendBizServiceImpl.class); 31 private static Logger log = Logger.getLogger(PineappleSendBizServiceImpl.class);
30 @Resource 32 @Resource
31 private PineappleDao pineappleDao; 33 private MemberReadDao memberReadDao;
34 @Resource
35 private MemberWriteDao memberWriteDao;
32 36
33 @Override 37 @Override
34 public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception { 38 public BaseResponse call(CallRequest<PineappleSendRequest> callRequest) throws Exception {
...@@ -37,7 +41,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -37,7 +41,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
37 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo()); 41 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
38 params.put("sellerId",callRequest.getSupplier().getId()); 42 params.put("sellerId",callRequest.getSupplier().getId());
39 43
40 Orders orders = pineappleDao.getOrdersByMap(params); 44 Orders orders = memberReadDao.getOrdersByMap(params);
41 if(StringUtil.isNull(orders)){ 45 if(StringUtil.isNull(orders)){
42 log.error(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo())); 46 log.error(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
43 throw new BizException(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo())); 47 throw new BizException(String.format("订单发货,获取订单数据业务异常:[%s]",callRequest.getBizModel().getPlatOrderNo()));
...@@ -65,7 +69,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -65,7 +69,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
65 69
66 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){ 70 if(!StringUtil.isNull(callRequest.getBizModel().getLogisticNo())){
67 //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去 71 //判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去
68 int num = pineappleDao.checkLogisticsNumber(params); 72 int num = memberReadDao.checkLogisticsNumber(params);
69 if(num == 0){ 73 if(num == 0){
70 if(StringUtil.isNull(orders.getLogisticsNumber())){ 74 if(StringUtil.isNull(orders.getLogisticsNumber())){
71 params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo()); 75 params.put("logisticsNumber",callRequest.getBizModel().getLogisticNo());
...@@ -80,7 +84,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -80,7 +84,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
80 throw new BizException(String.format("订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 84 throw new BizException(String.format("订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
81 } 85 }
82 //修改订单信息 86 //修改订单信息
83 pineappleDao.updateOrdersState(params); 87 memberWriteDao.updateOrdersState(params);
84 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); 88 baseResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
85 baseResponse.setCode(PineappleEnum.SUCCESS.getCode()); 89 baseResponse.setCode(PineappleEnum.SUCCESS.getCode());
86 return baseResponse; 90 return baseResponse;
...@@ -102,17 +106,17 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -102,17 +106,17 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
102 Map<String,Object> map = new HashMap<>(); 106 Map<String,Object> map = new HashMap<>();
103 map.put("regionType",3); 107 map.put("regionType",3);
104 map.put("name",str[2]); 108 map.put("name",str[2]);
105 Regions regions = pineappleDao.getRegionsByMap(map); 109 List<Regions> regions = memberReadDao.getRegionsByMap(map);
106 if(StringUtil.isNull(regions)){ 110 if(StringUtil.isNull(regions) || regions.size() > 1){
107 params.put("provinceId","99999990"); 111 params.put("provinceId","99999990");
108 params.put("cityId", "99999989"); 112 params.put("cityId", "99999989");
109 params.put("areaId","99999988"); 113 params.put("areaId","99999988");
110 }else{ 114 }else{
111 params.put("area",regions.getId()); 115 params.put("area",regions.get(0).getId());
112 Regions city = pineappleDao.getRegionsById(regions.getId()); 116 Regions city = memberReadDao.getRegionsById(regions.get(0).getId());
113 Regions province = null; 117 Regions province = null;
114 if(!StringUtil.isNull(city)){ 118 if(!StringUtil.isNull(city)){
115 province = pineappleDao.getRegionsById(city.getId()); 119 province = memberReadDao.getRegionsById(city.getId());
116 } 120 }
117 if(!StringUtil.isNull(city) && !StringUtil.isNull(province)){ 121 if(!StringUtil.isNull(city) && !StringUtil.isNull(province)){
118 params.put("provinceId", province.getId()); 122 params.put("provinceId", province.getId());
...@@ -133,8 +137,8 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen ...@@ -133,8 +137,8 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
133 Map<String,Object> m = new HashMap<>(); 137 Map<String,Object> m = new HashMap<>();
134 m.put("name","orders.getLogisticsName()"); 138 m.put("name","orders.getLogisticsName()");
135 m.put("sellerId",callRequest.getSupplier().getId()); 139 m.put("sellerId",callRequest.getSupplier().getId());
136 List<CourierCompany> courierCompanyByName = pineappleDao.getCourierCompanyByName(m); 140 List<CourierCompany> courierCompanyByName = memberReadDao.getCourierCompanyByName(m);
137 if(!StringUtil.isNull(courierCompanyByName) && !courierCompanyByName.isEmpty()){ 141 if(!StringUtil.isNull(courierCompanyByName) && !courierCompanyByName.isEmpty() && courierCompanyByName.size() == 1){
138 Optional<CourierCompany> first = courierCompanyByName.stream().findFirst(); 142 Optional<CourierCompany> first = courierCompanyByName.stream().findFirst();
139 params.put("logisticsName",callRequest.getBizModel().getLogisticName()); 143 params.put("logisticsName",callRequest.getBizModel().getLogisticName());
140 params.put("logisticsId", first.get().getId()); 144 params.put("logisticsId", first.get().getId());
......
...@@ -13,8 +13,11 @@ import com.sibu.orderHelper.integral.pineapple.model.Orders; ...@@ -13,8 +13,11 @@ import com.sibu.orderHelper.integral.pineapple.model.Orders;
13 import com.sibu.orderHelper.integral.pineapple.request.CallRequest; 13 import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
14 import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse; 14 import com.sibu.orderHelper.integral.reponse.UpdateSellerMemoResponse;
15 import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest; 15 import com.sibu.orderHelper.integral.request.UpdateSellerMemoRequest;
16 import com.sibu.orderHelper.mall.member.read.MemberReadDao;
17 import com.sibu.orderHelper.mall.member.write.MemberWriteDao;
16 import org.apache.log4j.Logger; 18 import org.apache.log4j.Logger;
17 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
20 import org.springframework.transaction.annotation.Transactional;
18 21
19 import javax.annotation.Resource; 22 import javax.annotation.Resource;
20 import java.util.HashMap; 23 import java.util.HashMap;
...@@ -24,22 +27,25 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS ...@@ -24,22 +27,25 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
24 27
25 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class); 28 private static Logger log = Logger.getLogger(UpdateSellerMemoBizServiceImpl.class);
26 29
30
31 @Resource
32 private MemberReadDao memberReadDao;
27 @Resource 33 @Resource
28 private PineappleDao pineappleDao; 34 private MemberWriteDao memberWriteDao;
29 35
30 @Override 36 @Override
31 public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception { 37 public UpdateSellerMemoResponse call(CallRequest<UpdateSellerMemoRequest> callRequest) throws Exception {
32 UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse(); 38 UpdateSellerMemoResponse UpdateSellerMemoResponse =new UpdateSellerMemoResponse();
33 Map<String,Object> params = new HashMap<>(); 39 Map<String,Object> params = new HashMap<>();
34 params.put("orderSn ",callRequest.getBizModel().getPlatOrderNo()); 40 params.put("orderSn",callRequest.getBizModel().getPlatOrderNo());
35 params.put("remark ",callRequest.getBizModel().getSellerMemo()); 41 params.put("remark",callRequest.getBizModel().getSellerMemo());
36 params.put("sellerId",callRequest.getSupplier().getId()); 42 params.put("sellerId",callRequest.getSupplier().getId());
37 Orders orders = pineappleDao.getOrdersByMap(params); 43 Orders orders = memberReadDao.getOrdersByMap(params);
38 if(StringUtil.isNull(orders)){ 44 if(StringUtil.isNull(orders)){
39 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 45 log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
40 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 46 throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
41 } 47 }
42 if(pineappleDao.updateOdersRemark(params) != 1){ 48 if(memberWriteDao.updateOdersRemark(params) != 1){
43 log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 49 log.error(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
44 throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo())); 50 throw new BizException(String.format("修改订单备注,修改失败,订单号:[%s]",callRequest.getBizModel().getPlatOrderNo()));
45 } 51 }
......