| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
|
| | | import com.yeshi.fanli.dao.order.LostOrderDao;
|
| | | import com.yeshi.fanli.dao.order.PidOrderDao;
|
| | | 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.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private LostOrderDao lostOrderDao;
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private PidOrderDao pidOrderDao;
|
| | | private LostOrderDao lostOrderDao;
|
| | |
|
| | | @Resource
|
| | | private LostOrderMapper lostOrderMapper;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public int addLostOrder(LostOrder lostOrder) {
|
| | | String orderId = lostOrder.getOrderId();
|
| | |
| | | }
|
| | |
|
| | | // 查询是否为分享赚订单
|
| | | if (pidOrderDao.list("from PidOrder p where p.orderId=?", new Serializable[] { orderId }).size() > 0)
|
| | | if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0)
|
| | | return -5;
|
| | |
|
| | | WriteLock lostOrderwriteLock = lostOrderLock.writeLock();
|
| | |
| | | }
|
| | | lostOrder.setHandleTime(System.currentTimeMillis());
|
| | | lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING);
|
| | | lostOrderDao.update(lostOrder);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(lostOrder);
|
| | | }
|
| | |
|
| | | public void reject(LostOrder lostOrder) {
|
| | | lostOrder.setHandleTime(System.currentTimeMillis());
|
| | | lostOrder.setState(2);
|
| | | lostOrderDao.update(lostOrder);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(lostOrder);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Override
|
| | | public LostOrder getOne(long id) {
|
| | | return lostOrderDao.find(LostOrder.class, id);
|
| | | return lostOrderMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Override
|
| | | public void processFail(String orderId) {
|
| | | lostOrderDao.update("update LostOrder lo set lo.resultCode=? where lo.orderId=?",
|
| | | new Serializable[] { LostOrder.RESULT_CODE_FAIL, orderId });
|
| | | List<LostOrder> list = lostOrderMapper.selectByOrderId(orderId);
|
| | | if (list != null)
|
| | | for (LostOrder order : list) {
|
| | | LostOrder update = new LostOrder();
|
| | | update.setId(order.getId());
|
| | | update.setResultCode(LostOrder.RESULT_CODE_FAIL);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Override
|
| | | public void deleteLostOrder(long id) {
|
| | |
|
| | | LostOrder lostOrder = new LostOrder();
|
| | | lostOrder.setId(id);
|
| | | lostOrderDao.delete(lostOrder);
|
| | |
| | | public long countQuery(String key, Integer state, Integer handleType) {
|
| | | return lostOrderMapper.countQuery(key, state, handleType);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countLostNum( Integer dateType, Integer resultCode, |
| | | String year, String startTime, String endTime) throws Exception {
|
| | | public List<Map<String, Object>> 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) throws Exception {
|
| | | |
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception {
|
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | | |
| | |
|
| | | }
|