Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
sibu-v-mall
/
sibu-v-mall-third-api
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
d0afcb9f
由
刘嘉
编写于
2018-05-16 17:00:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菠萝派接口- 修改订单备注、发货、商品下载调用新数据源
1 个父辈
f06dcfdb
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
295 行增加
和
28 行删除
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/read/MemberReadDao.java
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/write/MemberWriteDao.java
com.sibu.orderHelper.integralMall/src/main/java/com/sibu/orderHelper/integralMall/controller/pineapple/PineappleController.java
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/read/MemberReadMapper.xml
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/write/MemberWriteMapper.xml
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Seller.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/impl/IMSupplierAppServiceImpl.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/DownloadProductBizServiceImpl.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/PineappleSendBizServiceImpl.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/UpdateSellerMemoBizServiceImpl.java
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/read/MemberReadDao.java
查看文件 @
d0afcb9
package
com
.
sibu
.
orderHelper
.
mall
.
member
.
read
;
import
com.sibu.orderHelper.integral.model.DownloadProductBean
;
import
com.sibu.orderHelper.integral.model.DownloadProductSkuBean
;
import
com.sibu.orderHelper.integral.model.IMSupplierApp
;
import
com.sibu.orderHelper.integral.pineapple.model.*
;
import
com.sibu.orderHelper.integral.reponse.MemberAddressResponse
;
import
com.sibu.orderHelper.integral.request.MemberAddressAddRequest
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -9,4 +13,111 @@ import java.util.Map;
public
interface
MemberReadDao
{
Integer
count
();
IMSupplierApp
findByAppIdAndAppType
(
Map
<
String
,
String
>
params
);
/**
* 根据订单号查询订单信息 只查询不是主订单的订单
* @param params
* @return
*/
Orders
getOrdersByMap
(
Map
<
String
,
Object
>
params
);
/**
* 查询该订单是否有该快递单号
* @param params
* @return
*/
int
checkLogisticsNumber
(
Map
<
String
,
Object
>
params
);
/**
* 商品下载
* @param params
* @return
*/
List
<
DownloadProductBean
>
downloadProductListByMap
(
Map
<
String
,
Object
>
params
);
/**
* 商品下载总数量
* @param params
* @return
*/
int
countDownloadProductListByMap
(
Map
<
String
,
Object
>
params
);
/**
* 根据条件查询商品
* @param params
* @return
*/
DownloadProductBean
getDownloadProductBeanByMap
(
Map
<
String
,
Object
>
params
);
/**
* 根据商品ID获取该商品的所有SKU
* @param productId
* @return
*/
List
<
DownloadProductSkuBean
>
downloadSkuByProductId
(
@Param
(
"productId"
)
String
productId
);
/**
* 订单下载
* @param params
* @return
*/
List
<
Orders
>
getOrdersList
(
Map
<
String
,
Object
>
params
);
/**
* 子订单查询
* @param orderSn
* @return
*/
List
<
OrdersProduct
>
getOrdersProductList
(
@Param
(
"orderSn"
)
String
orderSn
);
/**
* 根据条件查询省市级信息
* @param params
* @return
*/
List
<
Regions
>
getRegionsByMap
(
Map
<
String
,
Object
>
params
);
/**
* 根据id查询省市级信息
* @param id
* @return
*/
Regions
getRegionsById
(
@Param
(
"id"
)
Integer
id
);
/**
* 根据条件查询物流公司
* @return
*/
List
<
CourierCompany
>
getCourierCompanyByName
(
Map
<
String
,
Object
>
params
);
/**
* 根据订单号查询退货信息
* @param orderSn
* @return
*/
List
<
MemberProductBack
>
getMemberProductBackByOrderSn
(
@Param
(
"orderSn"
)
String
orderSn
);
/**
* 根据订单号查询换货信息
* @param orderSn
* @return
*/
List
<
MemberProductExchange
>
getMemberProductExchangeByOrderSn
(
@Param
(
"orderSn"
)
String
orderSn
);
/**
* 根据订单ID查询投诉表
* @param id
* @return
*/
List
<
SellerComplaint
>
getSellerComplaintByOrderId
(
@Param
(
"orderId"
)
Integer
id
);
List
<
Seller
>
getSeller
(
@Param
(
"id"
)
String
id
);
}
...
...
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/write/MemberWriteDao.java
查看文件 @
d0afcb9
package
com
.
sibu
.
orderHelper
.
mall
.
member
.
write
;
import
java.util.Map
;
public
interface
MemberWriteDao
{
Integer
count
();
/**
* 修改订单备注
* @param params
* @return
*/
int
updateOdersRemark
(
Map
<
String
,
Object
>
params
);
/**
* 订单发货更新订单状态与信息
* @param params
* @return
*/
int
updateOrdersState
(
Map
<
String
,
Object
>
params
);
/**
* 根据条件更新sku库存
* @param params
* @return
*/
int
updateSkuStock
(
Map
<
String
,
Object
>
params
);
/**
* 根据商品ID更新商品库存
* @param params
* @return
*/
int
updateProductStock
(
Map
<
String
,
Object
>
params
);
}
...
...
com.sibu.orderHelper.integralMall/src/main/java/com/sibu/orderHelper/integralMall/controller/pineapple/PineappleController.java
查看文件 @
d0afcb9
...
...
@@ -14,6 +14,7 @@ import com.sibu.orderHelper.integral.model.IMSupplier;
import
com.sibu.orderHelper.integral.model.IMSupplierApp
;
import
com.sibu.orderHelper.integral.pineapple.enums.SubErrorEnum
;
import
com.sibu.orderHelper.integral.pineapple.exception.BizException
;
import
com.sibu.orderHelper.integral.pineapple.model.Seller
;
import
com.sibu.orderHelper.integral.pineapple.request.BaseRequest
;
import
com.sibu.orderHelper.integral.pineapple.request.CallRequest
;
import
com.sibu.orderHelper.integral.pineapple.response.BaseResponse
;
...
...
@@ -27,6 +28,7 @@ import com.sibu.orderHelper.integral.service.pineapple.BizService;
import
com.sibu.orderHelper.integral.service.pineapple.util.JsonUtils
;
import
com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst
;
import
com.sibu.orderHelper.integral.service.pineapple.util.XmlUtils
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
net.sf.json.JSONObject
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -67,6 +69,8 @@ public class PineappleController {
private
IMSupplierAppService
imSupplierAppService
;
@Autowired
private
IMSupplierDao
imSupplierDao
;
@Resource
private
MemberReadDao
memberReadDao
;
@RequestMapping
(
value
=
"/pineapple/call"
,
...
...
@@ -169,14 +173,19 @@ public class PineappleController {
}
private
IMSupplier
findAndCheckIMSupplier
(
BaseRequest
request
,
IMSupplierApp
imSupplierApp
)
{
List
<
IMSupplier
>
imSuppliers
=
imSupplierDao
.
findByIdIn
(
Arrays
.
asList
(
imSupplierApp
.
getSupplierId
()));
if
(
CollectionUtils
.
isEmpty
(
imSuppliers
))
{
//List<IMSupplier> imSuppliers = imSupplierDao.findByIdIn(Arrays.asList(imSupplierApp.getSupplierId()));
List
<
Seller
>
seller
=
memberReadDao
.
getSeller
(
imSupplierApp
.
getSupplierId
());
if
(
CollectionUtils
.
isEmpty
(
seller
))
{
throw
new
BizException
(
MessageFormat
.
format
(
"appKey【{0}】的店铺数据为空,请联系客服"
,
request
.
getAppkey
()));
}
if
(
imSuppliers
.
size
()
>
1
)
{
if
(
seller
.
size
()
>
1
)
{
throw
new
BizException
(
MessageFormat
.
format
(
"appKey【{0}】的店铺数据有重复,请联系客服"
,
request
.
getAppkey
()));
}
return
imSuppliers
.
get
(
0
);
Seller
entity
=
seller
.
get
(
0
);
IMSupplier
iMSupplier
=
new
IMSupplier
();
iMSupplier
.
setId
(
String
.
valueOf
(
entity
.
getId
()));
iMSupplier
.
setName
(
entity
.
getName
());
return
iMSupplier
;
}
private
IMSupplierApp
findAndCheckSupplierApp
(
BaseRequest
request
)
{
...
...
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/read/MemberReadMapper.xml
查看文件 @
d0afcb9
此文件的差异被折叠,
点击展开。
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/write/MemberWriteMapper.xml
查看文件 @
d0afcb9
...
...
@@ -7,4 +7,68 @@
<select
id=
"count"
resultType=
"java.lang.Integer"
>
select count(*) from member
</select>
<!-- 修改订单备注 -->
<update
id=
"updateOdersRemark"
parameterType=
"java.util.Map"
>
UPDATE orders SET remark = #{remark},update_time = now() WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
</update>
<!--更改订单状态、电话、地址、发货时间、收货人姓名,快递单号 -->
<update
id=
"updateOrdersState"
>
UPDATE orders
<set>
<if
test=
"name !=null and name !=''"
>
name = #{name},
</if>
<if
test=
"addressInfo !=null and addressInfo !=''"
>
address_info = #{addressInfo},
</if>
<if
test=
"logisticsNumber !=null and logisticsNumber !=''"
>
logistics_number = #{logisticsNumber},
</if>
<if
test=
"mobile !=null and mobile !=''"
>
mobile = #{mobile},
</if>
<if
test=
"addressAll !=null and addressAll !=''"
>
address_all = #{addressAll},
</if>
<if
test=
"orderState !=null and orderState !=''"
>
order_state = #{orderState},
</if>
<if
test=
"provinceId !=null and provinceId !=''"
>
province_id = #{provinceId},
</if>
<if
test=
"areaId !=null and areaId !=''"
>
area_id = #{areaId},
</if>
<if
test=
"cityId !=null and cityId !=''"
>
city_id = #{cityId},
</if>
<if
test=
"deliverTime !=null and deliverTime !=''"
>
deliver_time = now(),
</if>
<if
test=
"logisticsName !=null and logisticsName !=''"
>
logistics_name = #{logisticsName},
</if>
<if
test=
"logisticsId !=null and logisticsId !=''"
>
logistics_id = #{logisticsId},
</if>
update_time = now()
</set>
WHERE order_sn = #{orderSn} AND seller_id = #{sellerId}
</update>
<!-- 更新SKU库存-->
<update
id=
"updateSkuStock"
parameterType=
"java.util.Map"
>
UPDATE product_goods SET product_stock = #{stock} WHERE sku = #{skuId} and product_id = #{productId}
</update>
<!-- 更新产品库存-->
<update
id=
"updateProductStock"
parameterType=
"java.util.Map"
>
UPDATE product SET product_stock = #{productStock} WHERE id = #{productId}
</update>
</mapper>
\ No newline at end of file
...
...
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
查看文件 @
d0afcb9
...
...
@@ -3,13 +3,14 @@ package com.sibu.orderHelper.integral.pineapple.model;
import
lombok.Data
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@Data
@ToString
public
class
Orders
{
public
class
Orders
implements
Serializable
{
private
Integer
id
;
private
String
orderSn
;
private
String
orderPsn
;
...
...
@@ -68,7 +69,7 @@ public class Orders {
private
String
codconfirmRemark
;
private
Integer
codconfirmState
;
private
String
createTime
;
private
String
Date
updateTime
;
private
String
updateTime
;
private
Integer
evaluateState
;
private
String
regionName1
;
private
String
regionName2
;
...
...
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Seller.java
0 → 100644
查看文件 @
d0afcb9
package
com
.
sibu
.
orderHelper
.
integral
.
pineapple
.
model
;
import
lombok.Data
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@ToString
public
class
Seller
implements
Serializable
{
private
Integer
id
;
//id
private
Integer
memberId
;
//用户ID
private
String
name
;
//用户名
private
String
sellerName
;
//店铺名称
private
String
sellerLogo
;
//店铺logo
private
Integer
sellerGrade
;
//店铺等级
private
String
scoreService
;
//店铺评分服务
private
String
scoreDeliverGoods
;
//店铺评分发货
private
String
scoreDescription
;
//店铺评分描述
private
Integer
productNumber
;
//商品数量
private
Integer
collectionNumber
;
//店铺收藏
private
Date
createTime
;
//创建时间
private
BigDecimal
saleMoney
;
//店铺总销售金额
private
Integer
orderCount
;
//店铺总订单量
private
Integer
orderCountOver
;
//店铺完成订单量
private
String
sellerKeyword
;
//SEO关键字
private
String
sellerDes
;
//SEO店铺描述
private
Integer
auditStatus
;
//审核状态 1、待审核;2、审核通过;3、冻结
private
String
storeSlide
;
}
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/impl/IMSupplierAppServiceImpl.java
查看文件 @
d0afcb9
...
...
@@ -6,9 +6,11 @@ import com.sibu.orderHelper.integral.dao.IMSupplierAppDao;
import
com.sibu.orderHelper.integral.model.IMSupplierApp
;
import
com.sibu.orderHelper.integral.pineapple.request.BaseRequest
;
import
com.sibu.orderHelper.integral.service.IMSupplierAppService
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -23,6 +25,9 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
@Autowired
private
IMSupplierAppDao
imSupplierAppDao
;
@Resource
private
MemberReadDao
memberReadDao
;
@Override
public
IMSupplierApp
findByAppIdAndAppType
(
String
appId
,
SupplierAppTypeEnum
appType
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
...
...
@@ -37,6 +42,6 @@ public class IMSupplierAppServiceImpl implements IMSupplierAppService {
params
.
put
(
"appId"
,
requestParams
.
getAppkey
());
params
.
put
(
"appToken"
,
requestParams
.
getToken
());
params
.
put
(
"appType"
,
appType
.
getCode
());
return
imSupplierApp
Dao
.
findByAppIdAndAppType
(
params
);
return
memberRead
Dao
.
findByAppIdAndAppType
(
params
);
}
}
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/DownloadProductBizServiceImpl.java
查看文件 @
d0afcb9
...
...
@@ -10,6 +10,7 @@ import com.sibu.orderHelper.integral.model.DownloadProductSkuBean;
import
com.sibu.orderHelper.integral.pineapple.request.CallRequest
;
import
com.sibu.orderHelper.integral.reponse.DownloadProductResponse
;
import
com.sibu.orderHelper.integral.request.DownloadProductRequest
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
org.apache.log4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -23,13 +24,13 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
private
static
Logger
log
=
Logger
.
getLogger
(
DownloadProductBizServiceImpl
.
class
);
@Resource
private
PineappleDao
pineapple
Dao
;
private
MemberReadDao
memberRead
Dao
;
@Override
public
DownloadProductResponse
call
(
CallRequest
<
DownloadProductRequest
>
callRequest
)
throws
Exception
{
DownloadProductResponse
downloadProductResponse
=
new
DownloadProductResponse
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"s
uppli
erId"
,
callRequest
.
getSupplier
().
getId
());
params
.
put
(
"s
ell
erId"
,
callRequest
.
getSupplier
().
getId
());
if
(!
StringUtil
.
isNull
(
callRequest
.
getBizModel
().
getStatus
())){
params
.
put
(
"state"
,
DownloadProductStatusEnum
.
resolve
(
callRequest
.
getBizModel
().
getStatus
()).
intValue
());
}
...
...
@@ -42,14 +43,15 @@ public class DownloadProductBizServiceImpl extends AbstractBizService<DownloadP
params
.
put
(
"productName"
,
callRequest
.
getBizModel
().
getPageSize
());
}
//查询产品
List
<
DownloadProductBean
>
downloadProductBeanList
=
pineapple
Dao
.
downloadProductListByMap
(
params
);
List
<
DownloadProductBean
>
downloadProductBeanList
=
memberRead
Dao
.
downloadProductListByMap
(
params
);
if
(!
StringUtil
.
isNull
(
downloadProductBeanList
)
&&
!
downloadProductBeanList
.
isEmpty
()){
for
(
DownloadProductBean
product
:
downloadProductBeanList
){
//产品SKU
List
<
DownloadProductSkuBean
>
downloadProductSkuBeanList
=
pineapple
Dao
.
downloadSkuByProductId
(
product
.
getPlatProductID
());
List
<
DownloadProductSkuBean
>
downloadProductSkuBeanList
=
memberRead
Dao
.
downloadSkuByProductId
(
product
.
getPlatProductID
());
product
.
setSkus
(
downloadProductSkuBeanList
);
};
downloadProductResponse
.
setTotalcount
(
downloadProductBeanList
.
size
());
int
count
=
memberReadDao
.
countDownloadProductListByMap
(
params
);
downloadProductResponse
.
setTotalcount
(
count
);
}
else
{
downloadProductResponse
.
setTotalcount
(
0
);
}
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/PineappleSendBizServiceImpl.java
查看文件 @
d0afcb9
...
...
@@ -17,6 +17,8 @@ import com.sibu.orderHelper.integral.pineapple.model.Regions;
import
com.sibu.orderHelper.integral.pineapple.request.CallRequest
;
import
com.sibu.orderHelper.integral.pineapple.response.BaseResponse
;
import
com.sibu.orderHelper.integral.request.PineappleSendRequest
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
com.sibu.orderHelper.mall.member.write.MemberWriteDao
;
import
org.apache.log4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -28,7 +30,9 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
private
static
Logger
log
=
Logger
.
getLogger
(
PineappleSendBizServiceImpl
.
class
);
@Resource
private
PineappleDao
pineappleDao
;
private
MemberReadDao
memberReadDao
;
@Resource
private
MemberWriteDao
memberWriteDao
;
@Override
public
BaseResponse
call
(
CallRequest
<
PineappleSendRequest
>
callRequest
)
throws
Exception
{
...
...
@@ -37,7 +41,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
params
.
put
(
"orderSn"
,
callRequest
.
getBizModel
().
getPlatOrderNo
());
params
.
put
(
"sellerId"
,
callRequest
.
getSupplier
().
getId
());
Orders
orders
=
pineapple
Dao
.
getOrdersByMap
(
params
);
Orders
orders
=
memberRead
Dao
.
getOrdersByMap
(
params
);
if
(
StringUtil
.
isNull
(
orders
)){
log
.
error
(
String
.
format
(
"订单发货,获取订单数据业务异常:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
throw
new
BizException
(
String
.
format
(
"订单发货,获取订单数据业务异常:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
...
...
@@ -65,7 +69,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
if
(!
StringUtil
.
isNull
(
callRequest
.
getBizModel
().
getLogisticNo
())){
//判断该快递订单号是否存在,已存在就不允许把该快递订单号添加进去
int
num
=
pineapple
Dao
.
checkLogisticsNumber
(
params
);
int
num
=
memberRead
Dao
.
checkLogisticsNumber
(
params
);
if
(
num
==
0
){
if
(
StringUtil
.
isNull
(
orders
.
getLogisticsNumber
())){
params
.
put
(
"logisticsNumber"
,
callRequest
.
getBizModel
().
getLogisticNo
());
...
...
@@ -80,7 +84,7 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
throw
new
BizException
(
String
.
format
(
"订单发货接口,该订单状态不允许进行发货操作,订单号:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
}
//修改订单信息
pineappl
eDao
.
updateOrdersState
(
params
);
memberWrit
eDao
.
updateOrdersState
(
params
);
baseResponse
.
setMessage
(
PineappleEnum
.
SUCCESS
.
getMsg
());
baseResponse
.
setCode
(
PineappleEnum
.
SUCCESS
.
getCode
());
return
baseResponse
;
...
...
@@ -102,17 +106,17 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"regionType"
,
3
);
map
.
put
(
"name"
,
str
[
2
]);
Regions
regions
=
pineapple
Dao
.
getRegionsByMap
(
map
);
if
(
StringUtil
.
isNull
(
regions
)){
List
<
Regions
>
regions
=
memberRead
Dao
.
getRegionsByMap
(
map
);
if
(
StringUtil
.
isNull
(
regions
)
||
regions
.
size
()
>
1
){
params
.
put
(
"provinceId"
,
"99999990"
);
params
.
put
(
"cityId"
,
"99999989"
);
params
.
put
(
"areaId"
,
"99999988"
);
}
else
{
params
.
put
(
"area"
,
regions
.
getId
());
Regions
city
=
pineappleDao
.
getRegionsById
(
regions
.
getId
());
params
.
put
(
"area"
,
regions
.
get
(
0
).
get
Id
());
Regions
city
=
memberReadDao
.
getRegionsById
(
regions
.
get
(
0
)
.
getId
());
Regions
province
=
null
;
if
(!
StringUtil
.
isNull
(
city
)){
province
=
pineapple
Dao
.
getRegionsById
(
city
.
getId
());
province
=
memberRead
Dao
.
getRegionsById
(
city
.
getId
());
}
if
(!
StringUtil
.
isNull
(
city
)
&&
!
StringUtil
.
isNull
(
province
)){
params
.
put
(
"provinceId"
,
province
.
getId
());
...
...
@@ -133,8 +137,8 @@ public class PineappleSendBizServiceImpl extends AbstractBizService<PineappleSen
Map
<
String
,
Object
>
m
=
new
HashMap
<>();
m
.
put
(
"name"
,
"orders.getLogisticsName()"
);
m
.
put
(
"sellerId"
,
callRequest
.
getSupplier
().
getId
());
List
<
CourierCompany
>
courierCompanyByName
=
pineapple
Dao
.
getCourierCompanyByName
(
m
);
if
(!
StringUtil
.
isNull
(
courierCompanyByName
)
&&
!
courierCompanyByName
.
isEmpty
()){
List
<
CourierCompany
>
courierCompanyByName
=
memberRead
Dao
.
getCourierCompanyByName
(
m
);
if
(!
StringUtil
.
isNull
(
courierCompanyByName
)
&&
!
courierCompanyByName
.
isEmpty
()
&&
courierCompanyByName
.
size
()
==
1
){
Optional
<
CourierCompany
>
first
=
courierCompanyByName
.
stream
().
findFirst
();
params
.
put
(
"logisticsName"
,
callRequest
.
getBizModel
().
getLogisticName
());
params
.
put
(
"logisticsId"
,
first
.
get
().
getId
());
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/UpdateSellerMemoBizServiceImpl.java
查看文件 @
d0afcb9
...
...
@@ -13,8 +13,11 @@ 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
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
com.sibu.orderHelper.mall.member.write.MemberWriteDao
;
import
org.apache.log4j.Logger
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
...
...
@@ -24,22 +27,25 @@ public class UpdateSellerMemoBizServiceImpl extends AbstractBizService<UpdateS
private
static
Logger
log
=
Logger
.
getLogger
(
UpdateSellerMemoBizServiceImpl
.
class
);
@Resource
private
MemberReadDao
memberReadDao
;
@Resource
private
PineappleDao
pineappl
eDao
;
private
MemberWriteDao
memberWrit
eDao
;
@Override
public
UpdateSellerMemoResponse
call
(
CallRequest
<
UpdateSellerMemoRequest
>
callRequest
)
throws
Exception
{
UpdateSellerMemoResponse
UpdateSellerMemoResponse
=
new
UpdateSellerMemoResponse
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orderSn
"
,
callRequest
.
getBizModel
().
getPlatOrderNo
());
params
.
put
(
"remark
"
,
callRequest
.
getBizModel
().
getSellerMemo
());
params
.
put
(
"orderSn"
,
callRequest
.
getBizModel
().
getPlatOrderNo
());
params
.
put
(
"remark"
,
callRequest
.
getBizModel
().
getSellerMemo
());
params
.
put
(
"sellerId"
,
callRequest
.
getSupplier
().
getId
());
Orders
orders
=
pineapple
Dao
.
getOrdersByMap
(
params
);
Orders
orders
=
memberRead
Dao
.
getOrdersByMap
(
params
);
if
(
StringUtil
.
isNull
(
orders
)){
log
.
error
(
String
.
format
(
"修改订单备注,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
throw
new
BizException
(
String
.
format
(
"修改订单备注,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
}
if
(
pineappl
eDao
.
updateOdersRemark
(
params
)
!=
1
){
if
(
memberWrit
eDao
.
updateOdersRemark
(
params
)
!=
1
){
log
.
error
(
String
.
format
(
"修改订单备注,修改失败,订单号:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
throw
new
BizException
(
String
.
format
(
"修改订单备注,修改失败,订单号:[%s]"
,
callRequest
.
getBizModel
().
getPlatOrderNo
()));
}
...
...
请
注册
或
登录
后发表评论