|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Orders findById(Integer id) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ordersMapper.selectById(id); | 
|---|
|  |  |  | Orders orders = ordersMapper.selectJoinOne(Orders.class,new MPJLambdaWrapper<Orders>() | 
|---|
|  |  |  | .selectAll(Orders.class) | 
|---|
|  |  |  | .select(" m1.name " , Orders::getReleaseName) | 
|---|
|  |  |  | .select(" m1.telephone " , Orders::getReleasePhone) | 
|---|
|  |  |  | .select(" case when i.AUTH_TYPE = 0 then i.LINK_NAME else i.COMPANY_NAME end " , Orders::getAcceptName) | 
|---|
|  |  |  | .select(" i.TELEPHONE " , Orders::getAcceptPhone) | 
|---|
|  |  |  | .select("c1.name",Orders::getCategoryName) | 
|---|
|  |  |  | .select("c2.name",Orders::getTransportTypeName) | 
|---|
|  |  |  | .leftJoin(" category c1 on t.category_id = c1.id  ") | 
|---|
|  |  |  | .leftJoin(" category c2 on t.TRANSPORT_TYPE_ID = c2.id  ") | 
|---|
|  |  |  | .leftJoin("member m1 on t.RELEASE_MEMBER_ID = m1.id ") | 
|---|
|  |  |  | .leftJoin("member m2 on t.ACCEPT_MEMBER_ID = m2.id ") | 
|---|
|  |  |  | .leftJoin("identity_info i on m2.id = i.MEMBER_ID and i.TYPE = t.type and i.AUDIT_STATUS = 2  ") | 
|---|
|  |  |  | .eq(Orders::getDeleted,Constants.ZERO) | 
|---|
|  |  |  | .eq(Orders::getId,id) | 
|---|
|  |  |  | .orderByDesc(Orders::getId)); | 
|---|
|  |  |  | if(Objects.isNull(orders)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //附件信息 | 
|---|
|  |  |  | List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjId,orders.getId()) | 
|---|
|  |  |  | .eq(Multifile::getIsdeleted,Constants.ZERO).eq(Multifile::getObjType,Constants.ONE).orderByAsc(Multifile::getId)); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ | 
|---|
|  |  |  | String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() | 
|---|
|  |  |  | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ORDERS_FILES).getCode(); | 
|---|
|  |  |  | for (Multifile multifile:multifileList) { | 
|---|
|  |  |  | multifile.setFileurlFull(path + multifile.getFileurl()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orders.setMultifileList(multifileList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //订单流转记录 | 
|---|
|  |  |  | List<OrderLog> orderLogList = orderLogMapper.selectList(new QueryWrapper<OrderLog>().lambda() | 
|---|
|  |  |  | .eq(OrderLog::getDeleted,Constants.ZERO) | 
|---|
|  |  |  | .eq(OrderLog::getOrderId,orders.getId()) | 
|---|
|  |  |  | .orderByAsc(OrderLog::getCreateTime) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(orderLogList)){ | 
|---|
|  |  |  | for (OrderLog orderLog:orderLogList) { | 
|---|
|  |  |  | if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ZERO)){ | 
|---|
|  |  |  | orderLog.setLogInfo(orderLog.getLogInfo().replace("{userName}",orders.getReleaseName())); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ONE)){ | 
|---|
|  |  |  | orderLog.setLogInfo(orderLog.getLogInfo().replace("{userName}",orders.getAcceptName())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orders.setOrderLogList(orderLogList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return orders; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public PageData<Orders> findPage(PageWrap<Orders> pageWrap) { | 
|---|
|  |  |  | IPage<Orders> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); | 
|---|
|  |  |  | MPJLambdaWrapper<Orders> queryWrapper = new MPJLambdaWrapper<>(); | 
|---|
|  |  |  | MPJLambdaWrapper<Orders> queryWrapper = new MPJLambdaWrapper<Orders>(); | 
|---|
|  |  |  | Utils.MP.blankToNull(pageWrap.getModel()); | 
|---|
|  |  |  | Orders model  = pageWrap.getModel(); | 
|---|
|  |  |  | queryWrapper.selectAll(Orders.class) | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper.apply(org.apache.commons.lang3.StringUtils.isNotBlank(model.getAcceptName())," i.LINK_NAME like '%"+model.getAcceptName()+"%' or i.company_name like '%"+model.getAcceptName()+"%' "); | 
|---|
|  |  |  | IPage<Orders> iPage = ordersMapper.selectJoinPage(page,Orders.class,queryWrapper); | 
|---|
|  |  |  | for (Orders orders:iPage.getRecords()) { | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | orders.setOrderContent(Constants.workType.getName(orders.getWorkType()) +" | " + orders.getCategoryName()); | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getWorkType(),Constants.ZERO)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum1()+"斤"); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(orders.getWorkType(),Constants.ONE)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum1()+"人"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.getOrderContent(orders); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return PageData.from(iPage); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void getOrderContent(Orders orders){ | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ | 
|---|
|  |  |  | orders.setOrderContent(Constants.workType.getName(orders.getWorkType()) +" | " + orders.getCategoryName()); | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getWorkType(),Constants.ZERO)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum1()+"斤"); | 
|---|
|  |  |  | }else if(Constants.equalsInteger(orders.getWorkType(),Constants.ONE)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum2()+"人"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getCarType(),Constants.ZERO)||Constants.equalsInteger(orders.getCarType(),Constants.ONE)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum2()+"人"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | " +orders.getPriceNum1()+"斤"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ | 
|---|
|  |  |  | orders.setOrderContent(  orders.getCategoryName() + " | " + orders.getTransportTypeName() +" | " + orders.getTransportNum() +"斤"); | 
|---|
|  |  |  | if(Constants.equalsInteger(orders.getCarType(),Constants.ZERO)){ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | 用车" +orders.getPriceNum2()+"天"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | 用车" +orders.getPriceNum2()+"次"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if(org.apache.commons.lang3.StringUtils.isNotBlank(orders.getWayInfo())){ | 
|---|
|  |  |  | List<CateringDTO> cateringDTOList = JSONArray.parseArray(orders.getWayInfo(),CateringDTO.class); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(cateringDTOList)){ | 
|---|
|  |  |  | for (CateringDTO cateringDTO:cateringDTOList) { | 
|---|
|  |  |  | if(StringUtils.isEmpty(orders.getOrderContent())){ | 
|---|
|  |  |  | orders.setOrderContent(cateringDTO.getName()+cateringDTO.getPrice()+" 需"+cateringDTO.getNum()+"份"); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | orders.setOrderContent(orders.getOrderContent()+" | "+cateringDTO.getName()+cateringDTO.getPrice()+" 需"+cateringDTO.getNum()+"份"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public long count(Orders orders) { | 
|---|
|  |  |  | QueryWrapper<Orders> wrapper = new QueryWrapper<>(orders); | 
|---|