| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 订单信息记录Service实现 |
| | |
| | | |
| | | @Override |
| | | public Integer create(Orders orders) { |
| | | |
| | | |
| | | ordersMapper.insert(orders); |
| | | return orders.getId(); |
| | | } |
| | | |
| | | |
| | | |
| | | public void initVerification(Orders orders){ |
| | | if(Objects.isNull(orders) |
| | | || Objects.isNull(orders.getType()) |
| | | || Objects.isNull(orders.getStartDate()) |
| | | || Objects.isNull(orders.getEndDate()) |
| | | || StringUtil.isBlank(orders.getLocation()) |
| | | || StringUtil.isBlank(orders.getLocationRemark()) |
| | | || Objects.isNull(orders.getLat()) |
| | | || Objects.isNull(orders.getLgt()) |
| | | || Objects.isNull(orders.getCategoryId()) |
| | | || (Constants.equalsInteger(orders.getType(),Constants.ZERO) && Objects.isNull(orders.getWorkType())) |
| | | || Objects.isNull(orders.getPriceNum1()) |
| | | || (!( Constants.equalsInteger(orders.getType(),Constants.ZERO) |
| | | && Constants.equalsInteger(orders.getWorkType(),Constants.TWO) ) && Objects.isNull(orders.getPrice()) ) |
| | | || ( Constants.equalsInteger(orders.getType(),Constants.ONE) && Objects.isNull(orders.getTransportTypeId()) ) |
| | | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | |
| | | if (pageWrap.getModel().getPayAccount() != null) { |
| | | queryWrapper.lambda().eq(Orders::getPayAccount, pageWrap.getModel().getPayAccount()); |
| | | } |
| | | if (pageWrap.getModel().getReviceAccount() != null) { |
| | | queryWrapper.lambda().eq(Orders::getReviceAccount, pageWrap.getModel().getReviceAccount()); |
| | | } |
| | | if (pageWrap.getModel().getPriceRemark() != null) { |
| | | queryWrapper.lambda().eq(Orders::getPriceRemark, pageWrap.getModel().getPriceRemark()); |
| | | } |
| | |
| | | } |
| | | if (pageWrap.getModel().getIsUpdate() != null) { |
| | | queryWrapper.lambda().eq(Orders::getIsUpdate, pageWrap.getModel().getIsUpdate()); |
| | | } |
| | | if (pageWrap.getModel().getBlackRecive() != null) { |
| | | queryWrapper.lambda().eq(Orders::getBlackRecive, pageWrap.getModel().getBlackRecive()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |