|
@@ -4,9 +4,12 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.ImmutableBiMap;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.kmall.admin.dao.*;
|
|
|
+import com.kmall.admin.dao.mk.store.MkStorePromOrderRealDao;
|
|
|
import com.kmall.admin.dto.OrderExpressDto;
|
|
|
import com.kmall.admin.entity.*;
|
|
|
import com.kmall.admin.entity.OrderProcessRecordEntity;
|
|
|
+import com.kmall.admin.entity.mk.store.MkStorePromOrderRealEntity;
|
|
|
+import com.kmall.api.entity.mk.MkStorePromOrderRealVo;
|
|
|
import com.kmall.manager.manager.express.sf.properties.SFPropertiesBuilder;
|
|
|
import com.kmall.manager.manager.express.sf.properties.SFUtil;
|
|
|
import com.kmall.manager.manager.express.sf.entity.SfRouteServiceResponseEntity;
|
|
@@ -68,6 +71,10 @@ public class OrderServiceImpl implements OrderService {
|
|
|
private StoreMngChangeDao storeMngChangeDao;
|
|
|
@Autowired
|
|
|
private ThirdMerchExpressDao thirdMerchExpressDao;
|
|
|
+ @Autowired
|
|
|
+ private MkStorePromOrderRealDao mkStorePromOrderRealDao;
|
|
|
+ @Autowired
|
|
|
+ private UserCampMinusDao userCampMinusDao;
|
|
|
|
|
|
@Override
|
|
|
public OrderEntity queryObject(Long id) {
|
|
@@ -110,18 +117,22 @@ public class OrderServiceImpl implements OrderService {
|
|
|
if (order.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_0.getItem())) {
|
|
|
order.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_101.getItem()));
|
|
|
}
|
|
|
- // 判断是否有优惠券
|
|
|
- UserCouponEntity couponVo = userCouponDao.queryByOrderId(order.getId());
|
|
|
- if (null != couponVo) {
|
|
|
- userCouponDao.cancelOrder(couponVo);
|
|
|
- }
|
|
|
orderDao.update(order);
|
|
|
-
|
|
|
if (!needUpdateStock) {
|
|
|
return;
|
|
|
}
|
|
|
// 更新库存
|
|
|
updateStock(order, "管理后台取消订单");
|
|
|
+ // 释放优惠券
|
|
|
+ UserCouponEntity couponVo = userCouponDao.queryByOrderId(order.getId());
|
|
|
+ if (null != couponVo) {
|
|
|
+ userCouponDao.cancelOrder(couponVo);
|
|
|
+ }
|
|
|
+ //释放促销满减券
|
|
|
+ UserCampMinusEntity userCampMinusVo = userCampMinusDao.queryUserCampByOrderId(order.getId());
|
|
|
+ if (null != userCampMinusVo) {
|
|
|
+ userCampMinusDao.cancelUserCampOrder(userCampMinusVo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -293,7 +304,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
}
|
|
|
orderDao.update(order);//修改为退款中
|
|
|
- // 判断是否有优惠券
|
|
|
+ // TODO: 2019/6/13 定时任务查询退款成功后释放库存、优惠券
|
|
|
+ /*// 判断是否有优惠券
|
|
|
UserCouponEntity couponVo = userCouponDao.queryByOrderId(order.getId());
|
|
|
if (null != couponVo) {
|
|
|
userCouponDao.cancelOrder(couponVo);
|
|
@@ -303,7 +315,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
return;
|
|
|
}
|
|
|
// 更新库存
|
|
|
- updateStock(order, "管理后台订单退款");
|
|
|
+ updateStock(order, "管理后台订单退款");*/
|
|
|
+
|
|
|
+ queryStorePromRealUpdateIsScan(order);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -337,7 +351,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
orderRefundDao.save(orderRefund);//退款记录
|
|
|
}
|
|
|
orderDao.update(order);//修改为退款中
|
|
|
- // 判断是否有优惠券
|
|
|
+ // TODO: 2019/6/13 定时任务查询退款成功后释放库存、优惠券
|
|
|
+ /*// 判断是否有优惠券
|
|
|
UserCouponEntity couponVo = userCouponDao.queryByOrderId(order.getId());
|
|
|
if (null != couponVo) {
|
|
|
userCouponDao.cancelOrder(couponVo);
|
|
@@ -347,7 +362,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
return;
|
|
|
}
|
|
|
// 更新库存
|
|
|
- updateStock(order, "管理后台平安退款订单");
|
|
|
+ updateStock(order, "管理后台平安退款订单");*/
|
|
|
+
|
|
|
+ queryStorePromRealUpdateIsScan(order);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -394,7 +411,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
orderRefundDao.save(orderRefund);//退款记录
|
|
|
}
|
|
|
orderDao.update(order);//修改为退款中
|
|
|
- // 判断是否有优惠券
|
|
|
+ // TODO: 2019/6/13 定时任务查询退款成功后释放库存、优惠券
|
|
|
+ /*// 判断是否有优惠券
|
|
|
UserCouponEntity couponVo = userCouponDao.queryByOrderId(order.getId());
|
|
|
if (null != couponVo) {
|
|
|
userCouponDao.cancelOrder(couponVo);
|
|
@@ -404,7 +422,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
return;
|
|
|
}
|
|
|
// 更新库存
|
|
|
- updateStock(order, "管理后台微信国际退款订单");
|
|
|
+ updateStock(order, "管理后台微信国际退款订单");*/
|
|
|
+
|
|
|
+ queryStorePromRealUpdateIsScan(order);
|
|
|
}
|
|
|
|
|
|
private void updateStock(OrderEntity order, String changeReason){
|
|
@@ -425,92 +445,106 @@ public class OrderServiceImpl implements OrderService {
|
|
|
|
|
|
Integer stockNum = 0;
|
|
|
// TODO: 2019/3/5 普通商品不受共享库存影响,直接取门店配置库存
|
|
|
- if(storeRelaEntity.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
|
|
|
- if (storeRelaEntity.getIsStockShare().equalsIgnoreCase(Dict.isStockShare.item_1.getItem())) {
|
|
|
- //还原商户商品库存
|
|
|
- stockNum = storeRelaEntity.getGoodsNumber();
|
|
|
- GoodsEntity goodsEntity = goodsDao.queryObject(storeRelaEntity.getGoodsId());
|
|
|
- if(goodsEntity!=null){
|
|
|
- goodsEntity.setGoodsNumber(stockNum + orderGoodsEntity.getNumber());
|
|
|
-// goodsEntity.setSellVolume(Integer.parseInt(goodsSellVolume.toString()));
|
|
|
- goodsDao.update(goodsEntity);
|
|
|
-
|
|
|
- storeRelaEntity.setSellVolume(Integer.parseInt(sellVolume.toString()));
|
|
|
- productStoreRelaDao.update(storeRelaEntity);
|
|
|
-
|
|
|
- MngChangeEntity mngChangeEntity = new MngChangeEntity();
|
|
|
- mngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(goodsEntity.getId())));
|
|
|
- mngChangeEntity.setThirdPartyMerchCode(goodsEntity.getThirdPartyMerchCode());
|
|
|
- mngChangeEntity.setChangeReason(changeReason);
|
|
|
- mngChangeEntity.setChangeType(Dict.changeType.item_0.getItem());
|
|
|
- mngChangeEntity.setChangeNum(orderGoodsEntity.getNumber());//变化数
|
|
|
- mngChangeEntity.setOriginalNum(stockNum);//原库存数
|
|
|
- mngChangeEntity.setValidNum(stockNum + orderGoodsEntity.getNumber());//可用数
|
|
|
- mngChangeEntity.setCreateTime(new Date());
|
|
|
- mngChangeEntity.setModTime(new Date());
|
|
|
- mngChangeEntity.setCreaterSn(user.getUsername());
|
|
|
- mngChangeEntity.setModerSn(user.getUsername());
|
|
|
- mngChangeEntity.setIsValid(0);
|
|
|
- mngChangeEntity.setMerchSn(goodsEntity.getMerchSn());
|
|
|
- mngChangeDao.save(mngChangeEntity);
|
|
|
- }
|
|
|
- }
|
|
|
- if (storeRelaEntity.getIsStockShare().equalsIgnoreCase(Dict.isStockShare.item_0.getItem())) {
|
|
|
- //还原门店库存
|
|
|
- if (null == storeRelaEntity.getStockNum()) {
|
|
|
- stockNum = 0;
|
|
|
- }else{
|
|
|
- stockNum = storeRelaEntity.getStockNum();
|
|
|
- }
|
|
|
- storeRelaEntity.setSellVolume(Integer.parseInt(sellVolume.toString()));
|
|
|
- storeRelaEntity.setStockNum(stockNum + orderGoodsEntity.getNumber());//库存数量
|
|
|
- productStoreRelaDao.update(storeRelaEntity);
|
|
|
-
|
|
|
- StoreMngChangeEntity storeMngChangeEntity = new StoreMngChangeEntity();
|
|
|
- storeMngChangeEntity.setChangeType(Dict.changeType.item_0.getItem());
|
|
|
- storeMngChangeEntity.setChangeReason(changeReason);
|
|
|
- storeMngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(storeRelaEntity.getGoodsId())));
|
|
|
- storeMngChangeEntity.setStoreId(Integer.parseInt(String.valueOf(storeRelaEntity.getStoreId())));
|
|
|
- storeMngChangeEntity.setMerchSn(storeRelaEntity.getMerchSn());
|
|
|
- storeMngChangeEntity.setCreateTime(new Date());
|
|
|
- storeMngChangeEntity.setModTime(new Date());
|
|
|
- storeMngChangeEntity.setStoreChangeNum(orderGoodsEntity.getNumber());
|
|
|
- storeMngChangeEntity.setStoreOriginalNum(stockNum);
|
|
|
- storeMngChangeEntity.setStoreValidNum(stockNum + orderGoodsEntity.getNumber());
|
|
|
- storeMngChangeEntity.setCreaterSn(user.getUsername());
|
|
|
- storeMngChangeEntity.setModerSn(user.getUsername());
|
|
|
- storeMngChangeEntity.setIsValid(0);
|
|
|
- storeMngChangeDao.save(storeMngChangeEntity);
|
|
|
- }
|
|
|
- }else {
|
|
|
+ if (null != storeRelaEntity.getStockNum()) {
|
|
|
+ stockNum = storeRelaEntity.getStockNum();
|
|
|
//还原门店库存
|
|
|
- if (null == storeRelaEntity.getStockNum()) {
|
|
|
- stockNum = 0;
|
|
|
- }else{
|
|
|
- stockNum = storeRelaEntity.getStockNum();
|
|
|
- }
|
|
|
- storeRelaEntity.setSellVolume(Integer.parseInt(sellVolume.toString()));
|
|
|
- storeRelaEntity.setStockNum(stockNum + orderGoodsEntity.getNumber());//库存数量
|
|
|
- productStoreRelaDao.update(storeRelaEntity);
|
|
|
-
|
|
|
- StoreMngChangeEntity storeMngChangeEntity = new StoreMngChangeEntity();
|
|
|
- storeMngChangeEntity.setChangeType(Dict.changeType.item_0.getItem());
|
|
|
- storeMngChangeEntity.setChangeReason(changeReason);
|
|
|
- storeMngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(storeRelaEntity.getGoodsId())));
|
|
|
- storeMngChangeEntity.setStoreId(Integer.parseInt(String.valueOf(storeRelaEntity.getStoreId())));
|
|
|
- storeMngChangeEntity.setMerchSn(storeRelaEntity.getMerchSn());
|
|
|
- storeMngChangeEntity.setStoreChangeNum(orderGoodsEntity.getNumber());
|
|
|
- storeMngChangeEntity.setStoreOriginalNum(stockNum);
|
|
|
- storeMngChangeEntity.setStoreValidNum(stockNum + orderGoodsEntity.getNumber());
|
|
|
- storeMngChangeEntity.setCreateTime(new Date());
|
|
|
- storeMngChangeEntity.setModTime(new Date());
|
|
|
- storeMngChangeEntity.setCreaterSn(user.getUsername());
|
|
|
- storeMngChangeEntity.setModerSn(user.getUsername());
|
|
|
- storeMngChangeEntity.setIsValid(0);
|
|
|
- storeMngChangeDao.save(storeMngChangeEntity);
|
|
|
+ resetStoreGoodsStock(stockNum, storeRelaEntity, orderGoodsEntity, sellVolume, changeReason, user);
|
|
|
+ }
|
|
|
+ GoodsEntity goodsEntity = goodsDao.queryObject(orderGoodsEntity.getGoodsId());
|
|
|
+ if(goodsEntity != null){
|
|
|
+ stockNum = goodsEntity.getGoodsNumber();
|
|
|
+ //还原商户商品库存
|
|
|
+ resetGoodsStock(stockNum, storeRelaEntity, orderGoodsEntity, sellVolume, changeReason, user);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 还原商品总库存
|
|
|
+ * @param stockNum
|
|
|
+ * @param storeRelaEntity
|
|
|
+ * @param orderGoodsEntity
|
|
|
+ * @param sellVolume
|
|
|
+ * @param changeReason
|
|
|
+ * @param user
|
|
|
+ */
|
|
|
+ private void resetGoodsStock(Integer stockNum, ProductStoreRelaEntity storeRelaEntity,
|
|
|
+ OrderGoodsEntity orderGoodsEntity, BigDecimal sellVolume, String changeReason, SysUserEntity user){
|
|
|
+ GoodsEntity goodsEntity = goodsDao.queryObject(storeRelaEntity.getGoodsId());
|
|
|
+ if(goodsEntity!=null){
|
|
|
+ goodsEntity.setGoodsNumber(stockNum + orderGoodsEntity.getNumber());
|
|
|
+// goodsEntity.setSellVolume(Integer.parseInt(goodsSellVolume.toString()));
|
|
|
+ goodsDao.update(goodsEntity);
|
|
|
+
|
|
|
+// storeRelaEntity.setSellVolume(Integer.parseInt(sellVolume.toString()));
|
|
|
+// productStoreRelaDao.update(storeRelaEntity);
|
|
|
+
|
|
|
+ MngChangeEntity mngChangeEntity = new MngChangeEntity();
|
|
|
+ mngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(goodsEntity.getId())));
|
|
|
+ mngChangeEntity.setThirdPartyMerchCode(goodsEntity.getThirdPartyMerchCode());
|
|
|
+ mngChangeEntity.setChangeReason(changeReason);
|
|
|
+ mngChangeEntity.setChangeType(Dict.changeType.item_0.getItem());
|
|
|
+ mngChangeEntity.setChangeNum(orderGoodsEntity.getNumber());//变化数
|
|
|
+ mngChangeEntity.setOriginalNum(stockNum);//原库存数
|
|
|
+ mngChangeEntity.setValidNum(stockNum + orderGoodsEntity.getNumber());//可用数
|
|
|
+ mngChangeEntity.setCreateTime(new Date());
|
|
|
+ mngChangeEntity.setModTime(new Date());
|
|
|
+ mngChangeEntity.setCreaterSn(user.getUsername());
|
|
|
+ mngChangeEntity.setModerSn(user.getUsername());
|
|
|
+ mngChangeEntity.setIsValid(0);
|
|
|
+ mngChangeEntity.setMerchSn(goodsEntity.getMerchSn());
|
|
|
+ mngChangeDao.save(mngChangeEntity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 还原门店商品库存
|
|
|
+ * @param stockNum
|
|
|
+ * @param storeRelaEntity
|
|
|
+ * @param orderGoodsEntity
|
|
|
+ * @param sellVolume
|
|
|
+ * @param changeReason
|
|
|
+ * @param user
|
|
|
+ */
|
|
|
+ private void resetStoreGoodsStock(Integer stockNum, ProductStoreRelaEntity storeRelaEntity,
|
|
|
+ OrderGoodsEntity orderGoodsEntity, BigDecimal sellVolume, String changeReason, SysUserEntity user){
|
|
|
+ storeRelaEntity.setSellVolume(Integer.parseInt(sellVolume.toString()));
|
|
|
+ storeRelaEntity.setStockNum(stockNum + orderGoodsEntity.getNumber());//库存数量
|
|
|
+ productStoreRelaDao.update(storeRelaEntity);
|
|
|
+
|
|
|
+ StoreMngChangeEntity storeMngChangeEntity = new StoreMngChangeEntity();
|
|
|
+ storeMngChangeEntity.setChangeType(Dict.changeType.item_0.getItem());
|
|
|
+ storeMngChangeEntity.setChangeReason(changeReason);
|
|
|
+ storeMngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(storeRelaEntity.getGoodsId())));
|
|
|
+ storeMngChangeEntity.setStoreId(Integer.parseInt(String.valueOf(storeRelaEntity.getStoreId())));
|
|
|
+ storeMngChangeEntity.setMerchSn(storeRelaEntity.getMerchSn());
|
|
|
+ storeMngChangeEntity.setStoreChangeNum(orderGoodsEntity.getNumber());
|
|
|
+ storeMngChangeEntity.setStoreOriginalNum(stockNum);
|
|
|
+ storeMngChangeEntity.setStoreValidNum(stockNum + orderGoodsEntity.getNumber());
|
|
|
+ storeMngChangeEntity.setCreateTime(new Date());
|
|
|
+ storeMngChangeEntity.setModTime(new Date());
|
|
|
+ storeMngChangeEntity.setCreaterSn(user.getUsername());
|
|
|
+ storeMngChangeEntity.setModerSn(user.getUsername());
|
|
|
+ storeMngChangeEntity.setIsValid(0);
|
|
|
+ storeMngChangeDao.save(storeMngChangeEntity);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询该退款订单编号是否是推广渠道订单,是则修改渠道定时扫描状态
|
|
|
+ * @param orderInfo
|
|
|
+ */
|
|
|
+ private void queryStorePromRealUpdateIsScan(OrderEntity orderInfo){
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("orderId", orderInfo.getId());
|
|
|
+ List<MkStorePromOrderRealEntity> list = mkStorePromOrderRealDao.queryPromRealListByMap(map);
|
|
|
+ if(list.size() > 0) {
|
|
|
+ for (MkStorePromOrderRealEntity mkStorePromOrderRealEntity : list) {
|
|
|
+ mkStorePromOrderRealEntity.setIsPromStatScan(Dict.isDistSellScan.item_0.getItem());
|
|
|
+ mkStorePromOrderRealDao.update(mkStorePromOrderRealEntity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 处理用户退款申请
|
|
|
*
|
|
@@ -528,7 +562,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
if (refundEntity.getRefundStatus() == 2) {
|
|
|
orderInfo.setOrderStatus(401);
|
|
|
- UserEntity entity = userDao.queryObject(orderInfo.getUserId());
|
|
|
+// UserEntity entity = userDao.queryObject(orderInfo.getUserId());
|
|
|
} else {
|
|
|
orderInfo.setOrderStatus(201);
|
|
|
}
|
|
@@ -623,21 +657,27 @@ public class OrderServiceImpl implements OrderService {
|
|
|
// SfRouteServiceResponseEntity entity = SFUtil.routeService("254355029325", thirdMerchExpressEntity.getExpressAccount(),
|
|
|
// thirdMerchExpressEntity.getExpressPwd(), SFPropertiesBuilder.instance().getUrl());//444072971585
|
|
|
if(entity.getHead().equalsIgnoreCase("OK")){
|
|
|
- if(entity.getBody() != null && entity.getBody().getRouteResponse() != null){
|
|
|
- RouteResponseEntity routeResponseEntity = entity.getBody().getRouteResponse().get(0);
|
|
|
- if(routeResponseEntity != null){
|
|
|
- List<RouteEntity> entityList = routeResponseEntity.getRouteResponse();
|
|
|
- for (RouteEntity route : entityList) {
|
|
|
- WuliuEntity wuliuEntity = new WuliuEntity();
|
|
|
- wuliuEntity.setAcceptTime(route.getAccept_time());
|
|
|
- wuliuEntity.setAcceptStation(route.getAccept_address() + route.getRemark());
|
|
|
- wuliuEntityList.add(wuliuEntity);
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
+ if(entity.getBody() == null){
|
|
|
WuliuEntity wuliuEntity = new WuliuEntity();
|
|
|
wuliuEntity.setAcceptStation("暂无物流轨迹");
|
|
|
wuliuEntityList.add(wuliuEntity);
|
|
|
+ }else{
|
|
|
+ if(entity.getBody().getRouteResponse() == null){
|
|
|
+ WuliuEntity wuliuEntity = new WuliuEntity();
|
|
|
+ wuliuEntity.setAcceptStation("暂无物流轨迹");
|
|
|
+ wuliuEntityList.add(wuliuEntity);
|
|
|
+ }else{
|
|
|
+ RouteResponseEntity routeResponseEntity = entity.getBody().getRouteResponse().get(0);
|
|
|
+ if(routeResponseEntity != null){
|
|
|
+ List<RouteEntity> entityList = routeResponseEntity.getRouteResponse();
|
|
|
+ for (RouteEntity route : entityList) {
|
|
|
+ WuliuEntity wuliuEntity = new WuliuEntity();
|
|
|
+ wuliuEntity.setAcceptTime(route.getAccept_time());
|
|
|
+ wuliuEntity.setAcceptStation(route.getAccept_address() + route.getRemark());
|
|
|
+ wuliuEntityList.add(wuliuEntity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}else{
|
|
|
throw new RRException("查询顺丰订单异常,"+entity.getErrors());
|
|
@@ -769,7 +809,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
// 检查库存和更新库存
|
|
|
for (OfflineCartEntity cartEntity : offlineCartEntityList) {
|
|
|
- if (goodsDao.queryObject(cartEntity.getGoodsId()) == null) {
|
|
|
+ GoodsEntity goodsEntity = goodsDao.queryObject(cartEntity.getGoodsId());
|
|
|
+ if (goodsEntity == null) {
|
|
|
resultObj.put("errno", 400);
|
|
|
resultObj.put("errmsg", "订单提交失败:商品不存在");
|
|
|
return resultObj;
|
|
@@ -788,6 +829,11 @@ public class OrderServiceImpl implements OrderService {
|
|
|
productInfo.setStoreId(Long.valueOf(storeId));
|
|
|
productInfo.addSellVolume();
|
|
|
productStoreRelaDao.updateStockNum(productInfo);//修改普通商品库存
|
|
|
+
|
|
|
+ if(goodsEntity != null) {
|
|
|
+ goodsEntity.setGoodsNumber(goodsEntity.getGoodsNumber() - cartEntity.getNumber());
|
|
|
+ goodsDao.update(goodsEntity);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1067,4 +1113,56 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<OrderEntity> promOrderList(Map<String, Object> map) {
|
|
|
+ Integer[] statusList = {201};
|
|
|
+ List<OrderEntity> list = orderDao.promOrderList(map);
|
|
|
+ for (OrderEntity orderEntity: list) {
|
|
|
+ Map<String, Object> queryMap = new HashMap<>();
|
|
|
+ queryMap.put("goodsId", orderEntity.getGoodsId());
|
|
|
+ queryMap.put("statusList", statusList);
|
|
|
+ queryMap.put("orderId", orderEntity.getId());
|
|
|
+ Double promActualPrice = orderDao.getActualPriceByOutProm(queryMap);
|
|
|
+ if(promActualPrice == null){
|
|
|
+ promActualPrice = 0d;
|
|
|
+ }
|
|
|
+ orderEntity.setPromActualPrice(BigDecimal.valueOf(promActualPrice));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int queryPromOrderTotal(Map<String, Object> map) {
|
|
|
+ return orderDao.queryPromOrderTotal(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<OrderEntity> promOrderListExport(Map<String, Object> map){
|
|
|
+ Integer[] statusList = {201};
|
|
|
+ List<OrderEntity> list = orderDao.promOrderListExport(map);
|
|
|
+ for (OrderEntity orderEntity: list) {
|
|
|
+ Map<String, Object> queryMap = new HashMap<>();
|
|
|
+ queryMap.put("goodsId", orderEntity.getGoodsId());
|
|
|
+ queryMap.put("orderId", orderEntity.getId());
|
|
|
+ queryMap.put("statusList", statusList);
|
|
|
+ Double promActualPrice = orderDao.getActualPriceByOutProm(queryMap);
|
|
|
+ if(promActualPrice == null){
|
|
|
+ promActualPrice = 0d;
|
|
|
+ }
|
|
|
+ orderEntity.setPromActualPrice(BigDecimal.valueOf(promActualPrice));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<OrderEntity> storeTopicOrderList(Map<String, Object> map) {
|
|
|
+ List<OrderEntity> list = orderDao.storeTopicOrderList(map);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int queryStoreTopicOrderTotal(Map<String, Object> map) {
|
|
|
+ return orderDao.queryStoreTopicOrderTotal(map);
|
|
|
+ }
|
|
|
}
|