Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加根据商品生成订单 #877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ public class OmsOrderController {
@Autowired
private OmsOrderService orderService;


@ApiOperation("新增订单")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody OmsOrder omsOrder) {
int count = orderService.create(omsOrder);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}

@ApiOperation("查询订单")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
* Created by macro on 2018/10/11.
*/
public interface OmsOrderService {
/**
* 添加订单
*/
int create(OmsOrder omsOrder);

/**
* 分页查询订单
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public class OmsOrderServiceImpl implements OmsOrderService {
@Autowired
private OmsOrderOperateHistoryMapper orderOperateHistoryMapper;

@Override
public int create(OmsOrder omsOrder) {
omsOrder.setCommentTime(new Date());
return orderMapper.insert(omsOrder);
}

@Override
public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
Expand Down