| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | import java.math.RoundingMode; |
| | | import java.net.FileNameMap; |
| | | import java.net.URLConnection; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Controller |
| | |
| | | TUser tUser = itUserService.selectById(userId); |
| | | List<TPrice> prices = priceService.selectList(new EntityWrapper<TPrice>().eq("order_id", tOrder.getId())); |
| | | ArrayList<PriceInfo> priceInfos = new ArrayList<>(); |
| | | if(tUser.getGroupId()!=null){ |
| | | if(false){ |
| | | TGroup tGroup = groupService.selectById(tUser.getGroupId()); |
| | | User user = service.selectById(tGroup.getSalesId()); |
| | | |
| | |
| | | }else { |
| | | for (TPrice price : prices) { |
| | | PriceInfo priceInfo = new PriceInfo(); |
| | | priceInfo.setCarrierCost(price.getPrice()); |
| | | priceInfo.setCustomerCost(price.getPrice()); |
| | | priceInfo.setCarrierCost(price.getCarPrice()); |
| | | priceInfo.setCustomerCost(price.getCarPrice()); |
| | | priceInfo.setName(price.getType()); |
| | | priceInfo.setSalesProfit(new BigDecimal(0)); |
| | | priceInfo.setMargin(new BigDecimal(0)); |
| | |
| | | return new ErrorTip(500,"ERROR"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单详情-提货单",notes="订单详情-提货单") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "平台给用户报价/平台给卡车公司价格",notes="平台给用户报价/平台给卡车公司价格") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | |
| | | map.put("pickUpDate",tOrder.getShipmentDate()); |
| | | map.put("returnDate",tOrder.getOrderOkTime()); |
| | | List<TPrice> prices = priceService.selectList(new EntityWrapper<TPrice>().eq("order_id", orderId)); |
| | | prices.forEach(e->e.setPrice(e.getCarPrice())); |
| | | if(type==1){ |
| | | map.put("price",prices); |
| | | }else{ |
| | | map.put("price",prices); |
| | | // 找出订单用户 --> 获取销售--> 获取提成 --> 计算应给卡车公司金额 |
| | | Integer userId = tOrder.getUserId(); |
| | | TUser tUser = itUserService.selectById(userId); |
| | | if(tUser.getGroupId()==null){ |
| | | map.put("price",prices); |
| | | }else { |
| | | TGroup tGroup = groupService.selectById(tUser.getGroupId()); |
| | | User user = service.selectById(tGroup.getSalesId()); |
| | | List<TUserFeeSetting> tUserFeeSettings = feeSettingService.selectList(new EntityWrapper<TUserFeeSetting>().eq("user_id", user.getId())); |
| | | |
| | | for (TPrice price : prices) { |
| | | for (TUserFeeSetting tUserFeeSetting : tUserFeeSettings) { |
| | | if(price.getType().equals(tUserFeeSetting.getName())){ |
| | | if(tUserFeeSetting.getFee()!=null && tUserFeeSetting.getFee()!=0) { |
| | | double v = ((double) tUserFeeSetting.getFee()) / 100; |
| | | BigDecimal multiply = price.getPrice().multiply(new BigDecimal(v)); |
| | | BigDecimal subtract = price.getPrice().subtract(multiply); |
| | | price.setPrice(subtract); |
| | | }else { |
| | | price.setPrice(price.getPrice()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | map.put("price",prices); |
| | | } |
| | | // Integer userId = tOrder.getUserId(); |
| | | // TUser tUser = itUserService.selectById(userId); |
| | | // if(tUser.getGroupId()==null){ |
| | | // map.put("price",prices); |
| | | // }else { |
| | | // prices.for |
| | | // TGroup tGroup = groupService.selectById(tUser.getGroupId()); |
| | | // User user = service.selectById(tGroup.getSalesId()); |
| | | // List<TUserFeeSetting> tUserFeeSettings = feeSettingService.selectList(new EntityWrapper<TUserFeeSetting>().eq("user_id", user.getId())); |
| | | // |
| | | // for (TPrice price : prices) { |
| | | // for (TUserFeeSetting tUserFeeSetting : tUserFeeSettings) { |
| | | // if(price.getType().equals(tUserFeeSetting.getName())){ |
| | | // if(tUserFeeSetting.getFee()!=null && tUserFeeSetting.getFee()!=0) { |
| | | // double v = ((double) tUserFeeSetting.getFee()) / 100; |
| | | // BigDecimal multiply = price.getPrice().multiply(new BigDecimal(v)); |
| | | // BigDecimal subtract = price.getPrice().subtract(multiply); |
| | | // price.setPrice(subtract); |
| | | // }else { |
| | | // price.setPrice(price.getPrice()); |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // map.put("price",prices); |
| | | // } |
| | | } |
| | | return new SuccessTip(map); |
| | | } |