| | |
| | | throw new ServiceException(Constants.Code_500,Constants.Code_msg); |
| | | } |
| | | } |
| | | @ApiOperation("其他系统传输订单保存") |
| | | @PostMapping("/saveOtherSystemOrder") |
| | | public Result saveOtherSystemOrder(@RequestBody Map<String, Object> orderMap) throws Exception { |
| | | if(orderService.saveOrder(orderMap)) { |
| | | return Result.seccess(true); |
| | | }else{ |
| | | throw new ServiceException(Constants.Code_500,Constants.Code_msg); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("订单表头保存") |
| | | @PostMapping("/saveOrderTitle") |
| | |
| | | public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){ |
| | | return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product)); |
| | | } |
| | | @ApiOperation("其他系统获取产品查询接口") |
| | | @PostMapping("/otherSysGetProduct") |
| | | public Result otherSysGetProduct(){ |
| | | return Result.seccess(productService.otherSysGetProduct()); |
| | | } |
| | | |
| | | @ApiOperation("产品保存接口") |
| | | @SaCheckPermission("createProduct.add") |
| | | @PostMapping("/saveProduct") |
| | |
| | | //插入其他副表数据,被其他方法引用 |
| | | public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { |
| | | //先把其他金额副表的金额与数量置0 |
| | | if(orderOtherMoneyList!=null){ |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | orderOtherMoney.setQuantity(0.0); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //循环给订单明细表字段添加序号和周长 |
| | | for (int i = 0; i < OrderDetails.size(); i++) { |
| | |
| | | orderDetailMapper.insertBatch(OrderDetails); |
| | | //往小片表传入产品数据 |
| | | orderGlassDetailMapper.insertOrderGlassDetail(orderId); |
| | | if(orderOtherMoneyList!=null){ |
| | | orderOtherMoneyList.forEach(orderOtherMoney ->{ |
| | | orderOtherMoney.setId(null); |
| | | orderOtherMoney.setOrderId(orderId); |
| | |
| | | } |
| | | orderOtherMoneyMapper.insert(orderOtherMoney); |
| | | }); |
| | | } |
| | | |
| | | //修改订单主表面积与周长以及重量 |
| | | orderMapper.updateOrderParameter(orderId); |
| | | |
| | |
| | | map.put("detail",productDetailList); |
| | | return map; |
| | | } |
| | | |
| | | public List<Product> otherSysGetProduct() { |
| | | return productMapper.selectList(new QueryWrapper<Product>().eq("state",1) |
| | | .orderByDesc("id")); |
| | | } |
| | | } |
| | |
| | | `order` as a |
| | | where |
| | | year(a.create_time) = year(now()) |
| | | and a.id>400 |
| | | </select> |
| | | |
| | | <select id="selectOrderIdMin"> |