| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="order") |
| | | @RequestMapping(path = "order") |
| | | public class OrderCtrl { |
| | | private OrderSv sv; |
| | | |
| | | @Autowired |
| | | public void setAssemblySv(OrderSv orderSv) { |
| | | this.sv = orderSv; |
| | | } |
| | | @PostMapping(path="save") |
| | | |
| | | @PostMapping(path = "save") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("保存订单信息") |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PrOrder order){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PrOrder order) { |
| | | int count = sv.save(order); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | |
| | | |
| | | /** |
| | | * 更新 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @PostMapping(path = "update") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("修改订单信息") |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PrOrder order){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PrOrder order) { |
| | | int count = sv.update(order); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | |
| | | |
| | | /** |
| | | * 删除订单信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @GetMapping(path = "delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @Log("删除订单信息") |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id) { |
| | | int count = sv.delete(Long.parseLong(id)); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @GetMapping(path = "one") |
| | | @SsoPowerAop(power = "10200000") |
| | | @Log("根据ID查询订单信息") |
| | | public BaseResponse<PrOrder> one(String id){ |
| | | PrOrder plan=sv.selectById(id); |
| | | public BaseResponse<PrOrder> one(String id) { |
| | | PrOrder plan = sv.selectById(id); |
| | | return BaseResponseUtils.buildSuccess(plan); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @PostMapping(path = "some") |
| | | @SsoPowerAop(power = "10200000") |
| | | @Log("分页查询订单信息") |
| | | public BaseResponse<QueryResultVo<List<PrOrder>>> some(@RequestBody QueryVo vo){ |
| | | QueryResultVo<List<PrOrder>> list = sv.selectSome(vo) ; |
| | | public BaseResponse<QueryResultVo<List<PrOrder>>> some(@RequestBody QueryVo vo) { |
| | | QueryResultVo<List<PrOrder>> list = sv.selectSome(vo); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有订单 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping(path="all") |
| | | @GetMapping(path = "all") |
| | | @SsoPowerAop(power = "10300000") |
| | | @Log("查询所有产品") |
| | | public BaseResponse<List<PrOrder>> all(){ |
| | | public BaseResponse<List<PrOrder>> all() { |
| | | QueryVo vo = new QueryVo(); |
| | | return BaseResponseUtils.buildSuccess(sv.selectAll(vo)); |
| | | } |
| | | |
| | | @PostMapping(path="updateStatus") |
| | | @PostMapping(path = "updateStatus") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("更新任务计划状态") |
| | | public BaseResponse<Boolean> updateStatus(@RequestBody PrAssemblyPlan plan){ |
| | | int count = 0;//sv.updateStatus(plan); |
| | | @Log("更新订单状态") |
| | | public BaseResponse<Boolean> updateStatus(@RequestBody PrOrder order) { |
| | | int count = 0; //sv.updateStatus(plan); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |