Ver código fonte

iaw 确认收货

master
chenchaod 1 mês atrás
pai
commit
75c582598c

+ 6
- 6
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/issue/OrderController.java Ver arquivo

@@ -138,12 +138,12 @@ public class OrderController extends MyValidController {
return ApiResponse.of(msg);
}

// @ApiOperation(value = "17.发行确认收货")
// @PostMapping(value = "/returnApply")
// public ApiResponse<String> returnApply(@Valid @RequestBody returnApplyReqDTO reqDto) throws ManagerException {
// String msg = issueOrderManage.returnApply(reqDto);
// return ApiResponse.of(msg);
// }
@ApiOperation(value = "17.订单收货")
@PostMapping(value = "/orderReceiveGoods")
public ApiResponse<?> processReceiveGoods(@Valid @RequestBody OrderDetailReqDto reqDto) throws ManagerException {
issueOrderManage.orderReceiveGoods(reqDto);
return ApiResponse.success().setMessage("收货成功");
}
@ApiOperation(value = "18.订单详情")
@PostMapping(value = "/orderDetailQuery")
public ApiResponse<OrderDetailResDto> orderDetailQuery(@Valid @RequestBody OrderDetailReqDto reqDto) throws ManagerException {

+ 2
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueOrderManage.java Ver arquivo

@@ -50,4 +50,6 @@ public interface IssueOrderManage {
void agreeProtocol(AgreeProtocolReqDTO reqDto) throws ManagerException;

OrderDetailResDto orderDetailQuery(OrderDetailReqDto reqDto) throws ManagerException;

void orderReceiveGoods(OrderDetailReqDto reqDto) throws ManagerException;
}

+ 26
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueOrderManageImpl.java Ver arquivo

@@ -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);

Carregando…
Cancelar
Salvar