|
|
@@ -9,7 +9,9 @@ import cn.com.taiji.core.entity.dict.EnableStatus; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.IdType; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.SourceType; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.UserType; |
|
|
|
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep; |
|
|
|
import cn.com.taiji.core.entity.dict.issue.OrderType; |
|
|
|
import cn.com.taiji.core.entity.dict.issue.ShippingStatus; |
|
|
|
import cn.com.taiji.core.entity.dict.log.OperateType; |
|
|
|
import cn.com.taiji.core.entity.issue.*; |
|
|
|
import cn.com.taiji.core.entity.user.AccountInfo; |
|
|
@@ -28,6 +30,7 @@ import cn.com.taiji.iaw.repo.jpa.request.issue.IssueOrderaPageRequest; |
|
|
|
import cn.com.taiji.iaw.repo.jpa.request.issue.IssueOrdermPageRequest; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.HashMap; |
|
|
@@ -297,6 +300,29 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd |
|
|
|
return resDto; |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void orderReceiveGoods(OrderDetailReqDto reqDto) throws ManagerException { |
|
|
|
IssueOrderinfo orderinfo = checkOrder(reqDto.getOrderNo()); |
|
|
|
if (!IssueOrderStep.WAITING_RECEIVE.equals(orderinfo.getOrderStep()) || |
|
|
|
!ShippingStatus.WAIT_RECEIVING.equals(orderinfo.getShippingStatus())){ |
|
|
|
throw new ManagerException("当前订单阶段{"+orderinfo.getOrderStep().getStep()+"}不可收货"); |
|
|
|
} |
|
|
|
List<IssueOrderPost> postList = issueOrderinfoPostRepo.findByOrderNoList(reqDto.getOrderNo(), OrderType.ISSUE); |
|
|
|
if (isEmpty(postList)) { |
|
|
|
throw new ManagerException("当前订单没有发货,无法进行收货"); |
|
|
|
} |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
orderinfo.setOrderStep(IssueOrderStep.WAITING_ACTIVE); |
|
|
|
orderinfo.setUpdateTime(now); |
|
|
|
issueOrderinfoRepo.merge(orderinfo); |
|
|
|
|
|
|
|
IssueOrderPost issueOrderPost = postList.get(0); |
|
|
|
issueOrderPost.setReceivingTime(now); |
|
|
|
issueOrderPost.setReceiveOpId(findOpenIdByToken(reqDto.getAccessToken())); |
|
|
|
issueOrderinfoPostRepo.merge(issueOrderPost); |
|
|
|
} |
|
|
|
|
|
|
|
//校验发行订单是否存在 |
|
|
|
private IssueOrderinfo checkOrder(String orderNo) throws ManagerException { |
|
|
|
IssueOrderinfo order = issueOrderinfoRepo.findByOrderNo(orderNo); |