| | |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.sd.*; |
| | | import com.example.erp.service.userInfo.SysErrorService; |
| | | import com.sun.org.apache.regexp.internal.RE; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | return map; |
| | | } |
| | | //订单审核 |
| | | public boolean reviewOrderById(String id,Integer status) { |
| | | public boolean reviewOrderById(String id, Integer status, String userId, String userName) { |
| | | Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id)); |
| | | if(order.getProcessReview()!=2){ |
| | | throw new ServiceException(Constants.Code_600,"该订单还未审核"); |
| | | } |
| | | return orderMapper.reviewOrderById(id,status); |
| | | return orderMapper.reviewOrderById(id,status,userId,userName); |
| | | } |
| | | //工艺审核界面审核更新数据 |
| | | public boolean reviewProcessById(String id, Integer status,List<OrderGlassDetail> orderGlassDetails) { |
| | |
| | | public List<OrderGlassDetail> getOrderCraftDetailById(String id) { |
| | | return orderGlassDetailMapper.selectOrderGlassDetailByOrderId(id); |
| | | } |
| | | |
| | | public Object printOrderProductDetail(String orderId) { |
| | | List<Map<String,Object>> orderProductDistinct = orderDetailMapper.getOrderProductDistinctById(orderId); |
| | | |
| | | List<Map<String,Object>> orderProductDetail = new ArrayList<>(); |
| | | orderProductDistinct.forEach(map->{ |
| | | Map<String,Object> orderProductDetailMap = new HashMap<>(); |
| | | 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", |
| | | orderDetail.getWidth()*orderDetail.getHeight()/1000000) |
| | | ) * orderDetail.getQuantity() |
| | | ); |
| | | }); |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | | orderProductDetail.add(orderProductDetailMap); |
| | | }); |
| | | |
| | | Map<String,Object> returns = new HashMap<>(); |
| | | |
| | | returns.put("orderProductDetail",orderProductDetail); |
| | | returns.put("order",orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",orderId))); |
| | | return returns; |
| | | } |
| | | |
| | | public Object printOrderProductGlassDetail(String orderId) { |
| | | Map<String,Object> returns = new HashMap<>(); |
| | | returns.put("order",orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",orderId))); |
| | | |
| | | List<Map<String,Object>> orderProductDistinct = orderDetailMapper.getOrderProductDistinctById(orderId); |
| | | List<Map<String,Object>> orderProductDetail = new ArrayList<>(); |
| | | orderProductDistinct.forEach(map->{ |
| | | Map<String,Object> orderProductDetailMap = new HashMap<>(); |
| | | 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", |
| | | orderDetail.getWidth()*orderDetail.getHeight()/1000000) |
| | | ) * orderDetail.getQuantity() |
| | | ); |
| | | |
| | | List<OrderGlassDetail> orderGlassDetails = |
| | | orderGlassDetailMapper.selectList( |
| | | new QueryWrapper<OrderGlassDetail>(). |
| | | eq("order_id",orderId). |
| | | eq("order_number",orderDetail.getOrderNumber()) |
| | | ); |
| | | orderDetail.setOrderGlassDetails(orderGlassDetails); |
| | | }); |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | | orderProductDetail.add(orderProductDetailMap); |
| | | }); |
| | | returns.put("orderDetail",orderProductDetail); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return returns; |
| | | |
| | | |
| | | |
| | | } |
| | | } |