From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 23 十一月 2019 18:30:01 +0800 Subject: [PATCH] 配置文件修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java index f49b5ec..15c4e98 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java @@ -13,15 +13,16 @@ import org.springframework.transaction.annotation.Transactional; import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper; +import com.yeshi.fanli.dto.ChartTDO; import com.yeshi.fanli.entity.bus.user.HongBaoV2; import com.yeshi.fanli.entity.bus.user.LostOrder; import com.yeshi.fanli.entity.bus.user.Order; import com.yeshi.fanli.service.inter.config.ConfigService; -import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService; import com.yeshi.fanli.service.inter.order.HongBaoOrderService; import com.yeshi.fanli.service.inter.order.LostOrderService; import com.yeshi.fanli.service.inter.order.OrderService; -import com.yeshi.fanli.util.Constant; +import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService; +import com.yeshi.fanli.service.inter.order.tb.TaoBaoPunishOrderService; import com.yeshi.fanli.util.Utils; @Service @@ -42,6 +43,9 @@ @Resource private UserOrderMsgNotificationService userOrderMsgNotificationService; + @Resource + private TaoBaoPunishOrderService taoBaoPunishOrderService; + @Transactional @Override public int addLostOrder(LostOrder lostOrder) { @@ -52,8 +56,16 @@ type = 1; } + // 鏄惁澶勪簬杩濊璁㈠崟涓� + if (type == 1) { + int count = taoBaoPunishOrderService.countByTradeParentId(orderId); + if (count > 0) { + return -1001; + } + } + // 璁㈠崟鏄惁宸茬敵璇� - List<LostOrder> orderList = lostOrderMapper.selectByOrderId(orderId); + List<LostOrder> orderList = lostOrderMapper.selectByOrderIdAndType(orderId, type); if (orderList != null && orderList.size() > 0) { if (orderList.get(0).getState() == 0 || orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_VERFING) { return -2; @@ -72,7 +84,7 @@ } // 鏄惁涓哄垎浜禋璁㈠崟 - if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0) + if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS, type) > 0) return -5; // 娆℃暟闄愬埗 @@ -105,7 +117,7 @@ lostOrderwriteLock.unlock(); } - Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId()); + Order or = orderService.getSystemOrderByUid(type, lostOrder.getUserInfo().getId()); if (or != null) { boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId()); if (b) { @@ -213,9 +225,9 @@ @Transactional @Override - public void processSuceess(String orderId) { + public void processSuceess(String orderId, int orderType) { // 鏌ヨ璁㈠崟鍙锋槸鍚﹀湪鐢宠瘔鍒楄〃涓� - List<LostOrder> list = lostOrderMapper.selectByOrderId(orderId); + List<LostOrder> list = lostOrderMapper.selectByOrderIdAndType(orderId, orderType); if (list == null || list.size() == 0) return; for (LostOrder lo : list) { @@ -235,8 +247,8 @@ } @Override - public void processFail(String orderId) { - List<LostOrder> list = lostOrderMapper.selectByOrderId(orderId); + public void processFail(String orderId, int orderType) { + List<LostOrder> list = lostOrderMapper.selectByOrderIdAndType(orderId, orderType); if (list != null) for (LostOrder order : list) { LostOrder update = new LostOrder(); @@ -292,23 +304,24 @@ * @return */ @Override - public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType) { - return lostOrderMapper.listQuery(start, count, key, state, handleType); + public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType, + Integer type) { + return lostOrderMapper.listQuery(start, count, key, state, handleType, type); } @Override - public long countQuery(String key, Integer state, Integer handleType) { - return lostOrderMapper.countQuery(key, state, handleType); + public long countQuery(String key, Integer state, Integer handleType, Integer type) { + return lostOrderMapper.countQuery(key, state, handleType, type); } @Override - public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime, + public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime, String endTime) throws Exception { return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime); } @Override - public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime) + public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime) throws Exception { return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime); } @@ -318,4 +331,9 @@ return lostOrderMapper.listByStateAndResultCode(state, resultCode, (page - 1) * pageSize, pageSize); } + @Override + public void saveLostOrder(LostOrder lostOrder) { + lostOrderMapper.insertSelective(lostOrder); + } + } -- Gitblit v1.8.0