| | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.dto.sd.OrderDTO; |
| | | import com.example.erp.dto.sd.OrderDetailProductDTO; |
| | | import com.example.erp.dto.sd.OrderSearchDTO; |
| | | import com.example.erp.entity.sd.*; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | |
| | | |
| | | |
| | | //修改订单数据,并且重新生成多个副表数据 |
| | | public void updateOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) { |
| | | |
| | | public void updateOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) throws Exception { |
| | | Order oldOrder = orderMapper.selectOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderId,order.getOrderId())); |
| | | if(oldOrder.getProcessReview()==2){ |
| | | throw new ServiceException(Constants.Code_600,"该订单已经审核,无法修改"); |
| | | } |
| | | if(!Objects.equals(oldOrder.getVersion(), order.getVersion())){ |
| | | throw new ServiceException(Constants.Code_600,"该订单已经修改,请刷新页面"); |
| | | } |
| | | order.setCreateTime(null); |
| | | order.setVersion(order.getVersion()+1); |
| | | LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Order::getOrderId, order.getOrderId()); |
| | | orderMapper.update(order,updateWrapper); |
| | |
| | | } |
| | | } |
| | | JSONObject orderJson = new JSONObject(config); |
| | | Order order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("filter")), Order.class); |
| | | OrderSearchDTO order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("filter")), OrderSearchDTO.class); |
| | | Map<String,String> sortDate = (Map<String, String>) config.get("sort"); |
| | | String field = sortDate.get("field").replaceAll("(?<!^)([A-Z])", "_$1").toLowerCase(); |
| | | String orderBy = sortDate.get("order"); |
| | |
| | | } |
| | | //订单审核 |
| | | public boolean reviewOrderById(String id, Integer status, String userId, String userName) { |
| | | Log log = new Log(); |
| | | log.setOperator(userName); |
| | | log.setOperatorId(userId); |
| | | log.setContent(status.toString()); |
| | | log.setFunction("reviewOrderById:"+id); |
| | | logService.saveLog(log); |
| | | Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id)); |
| | | if(order.getProcessReview()!=2){ |
| | | throw new ServiceException(Constants.Code_600,"该订单还未审核"); |
| | |
| | | } |
| | | //工艺审核界面审核更新数据 |
| | | public boolean reviewProcessById(String id, Integer status,List<OrderGlassDetail> orderGlassDetails) { |
| | | Log log = new Log(); |
| | | log.setContent(orderGlassDetails.toString()); |
| | | log.setFunction("reviewProcessById:"+id); |
| | | if(!orderGlassDetails.isEmpty() && status==2){ |
| | | orderGlassDetails.forEach(orderGlassDetail ->{ |
| | | double area = Math.round((orderGlassDetail.getChildWidth()*orderGlassDetail.getChildHeight()/1000000) * 100) * 0.01d; |
| | |
| | | // //赋值订单工艺表 |
| | | // orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | | } |
| | | |
| | | logService.saveLog(log); |
| | | return orderMapper.reviewProcessById(id,status); |
| | | } |
| | | //工艺审核界面数据查询 |