north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java
@@ -42,6 +42,15 @@ 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") north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -30,6 +30,12 @@ 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") north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -217,9 +217,12 @@ //插入其他副表数据,被其他方法引用 public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { //先把其他金额副表的金额与数量置0 orderOtherMoneyList.forEach(orderOtherMoney -> { orderOtherMoney.setQuantity(0.0); }); if(orderOtherMoneyList!=null){ orderOtherMoneyList.forEach(orderOtherMoney -> { orderOtherMoney.setQuantity(0.0); }); } //循环给订单明细表字段添加序号和周长 for (int i = 0; i < OrderDetails.size(); i++) { @@ -271,14 +274,17 @@ orderDetailMapper.insertBatch(OrderDetails); //往小片表传入产品数据 orderGlassDetailMapper.insertOrderGlassDetail(orderId); orderOtherMoneyList.forEach(orderOtherMoney ->{ orderOtherMoney.setId(null); orderOtherMoney.setOrderId(orderId); if(orderOtherMoney.getQuantity()!=null && orderOtherMoney.getPrice()!=null){ orderOtherMoney.setMoney((orderOtherMoney.getQuantity()*orderOtherMoney.getPrice())); } orderOtherMoneyMapper.insert(orderOtherMoney); }); if(orderOtherMoneyList!=null){ orderOtherMoneyList.forEach(orderOtherMoney ->{ orderOtherMoney.setId(null); orderOtherMoney.setOrderId(orderId); if(orderOtherMoney.getQuantity()!=null && orderOtherMoney.getPrice()!=null){ orderOtherMoney.setMoney((orderOtherMoney.getQuantity()*orderOtherMoney.getPrice())); } orderOtherMoneyMapper.insert(orderOtherMoney); }); } //修改订单主表面积与周长以及重量 orderMapper.updateOrderParameter(orderId); north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -174,4 +174,9 @@ map.put("detail",productDetailList); return map; } public List<Product> otherSysGetProduct() { return productMapper.selectList(new QueryWrapper<Product>().eq("state",1) .orderByDesc("id")); } } north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -39,6 +39,7 @@ `order` as a where year(a.create_time) = year(now()) and a.id>400 </select> <select id="selectOrderIdMin">