| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.dto.sd.OrderDTO; |
| | | import com.example.erp.dto.sd.OrderDetailProductDTO; |
| | | import com.example.erp.entity.sd.*; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.exception.ServiceException; |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e.toString()); |
| | | sysError.setError(Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("saveOrder"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = false; |
| | |
| | | for (int i = 0; i < OrderDetails.size(); i++) { |
| | | OrderDetails.get(i).setOrderNumber(i+1); |
| | | OrderDetails.get(i).setOrderId(orderId); |
| | | OrderDetails.get(i).setPerimeter(Double.valueOf(String.format("%.3f",(OrderDetails.get(i).getWidth()+OrderDetails.get(i).getHeight())*2/1000))); |
| | | OrderDetails.get(i).setPerimeter(Double.valueOf(String.format("%.3f",(OrderDetails.get(i).getWidth()+OrderDetails.get(i).getHeight())*2/1000*OrderDetails.get(i).getQuantity()))); |
| | | OrderDetails.get(i).setWeight(1.0); |
| | | if(OrderDetails.get(i).getBendRadius()!=null && OrderDetails.get(i).getBendRadius()!=0){ |
| | | //获取弯钢弧度 |
| | |
| | | return orderDetailMapper.exportOrderProductSummary(dates); |
| | | } |
| | | |
| | | |
| | | public Map<String,String> getOrderProductDetailTag(String orderId) { |
| | | return orderDetailMapper.getOrderProductDetailTag(orderId); |
| | | } |
| | |
| | | orderProductDetailMap.put("productId",map.get("productId")); |
| | | orderProductDetailMap.put("productName",map.get("productName")); |
| | | List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId); |
| | | orderDetails.forEach(orderDetail->{ |
| | | |
| | | orderDetail.setGrossArea( |
| | | Double.parseDouble(String.format("%.3f",Double.parseDouble( |
| | | String.format("%.3f", |
| | | orderDetail.getWidth()*orderDetail.getHeight()/1000000) |
| | | ) * orderDetail.getQuantity())) |
| | | ); |
| | | }); |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | | orderProductDetail.add(orderProductDetailMap); |