Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fix-sign
pref_mail@163.com 4 months ago
parent
commit
970c7bcf66
  1. 8
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceServiceEntity.java
  2. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  3. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvaluePackageServiceImpl.java
  4. 48
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java

8
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceServiceEntity.java

@ -16,6 +16,8 @@
*/
package com.logpm.statistics.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -23,6 +25,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.List;
/**
* 成本配送服务商配置价格 实体类
*
@ -60,4 +64,8 @@ public class ExpenseDispatchPriceServiceEntity extends TenantEntity {
*/
@ApiModelProperty(value = "价格模版id")
private Long templateId;
@ApiModelProperty(value = "司机")
@TableField(exist = false)
private List<JSONObject> drivers;
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -213,8 +213,8 @@ public class DeliverFinishReportListener implements ReportService {
for (QualityDeliverEntity entity : value) {
Long id = entity.getId();
QualityDeliverEntity entity1 = valueMap.get(id);
if (ObjectUtil.isNotEmpty(entity.getCostCategoryId()) && priceMap.containsKey(entity.getCostCategoryId())) {
ExpenseDispatchPriceCategoryVO expenseDispatchPriceCategoryVO = priceMap.get(entity.getCostCategoryId());
if (ObjectUtil.isNotEmpty(entity1.getCostCategoryId()) && priceMap.containsKey(entity1.getCostCategoryId())) {
ExpenseDispatchPriceCategoryVO expenseDispatchPriceCategoryVO = priceMap.get(entity1.getCostCategoryId());
String cost = expenseDispatchPriceCategoryVO.getCost();
Integer unit = expenseDispatchPriceCategoryVO.getUnit();
if (StrUtil.isNotEmpty(cost)) {
@ -283,7 +283,7 @@ public class DeliverFinishReportListener implements ReportService {
// 装卸费单价
String loadingUnloadingFee = expenseDispatchPriceCategoryVO.getLoadingUnloadingFee();
// 上楼层数
// 查询出上楼层数
//
Integer stairsNumber = 0;
if (addvaluePackageMap.containsKey(entity.getOrderPackageCode())) {
stairsNumber = Convert.toInt(addvaluePackageMap.get(entity.getOrderPackageCode()));

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvaluePackageServiceImpl.java

@ -28,6 +28,7 @@ import com.logpm.distribution.service.IDistributionAddvalueDetailService;
import com.logpm.distribution.service.IDistributionAddvaluePackageService;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -72,7 +73,13 @@ public class DistributionAddvaluePackageServiceImpl extends BaseServiceImpl<Dist
.in(DistributionAddvaluePackageEntity::getOrderPackageCode, collect1));
if (CollUtil.isNotEmpty(list)) {
// 转map
Map<Long, String> map = list.stream().collect(Collectors.toMap(DistributionAddvaluePackageEntity::getAddvalueDetailId, DistributionAddvaluePackageEntity::getOrderPackageCode));
Map<Long, String> map = list.stream()
.filter(it -> ObjectUtil.isNotEmpty(it.getAddvalueDetailId()))
.collect(Collectors.toMap(
DistributionAddvaluePackageEntity::getAddvalueDetailId,
DistributionAddvaluePackageEntity::getOrderPackageCode,
(existingValue, newValue) -> existingValue // 处理键冲突
));
List<DistributionAddvalueDetailEntity> list1 = addvalueDetailService.list(
Wrappers.<DistributionAddvalueDetailEntity>lambdaQuery()
.select(DistributionAddvalueDetailEntity::getFloolNum, DistributionAddvalueDetailEntity::getId)

48
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java

@ -16,6 +16,8 @@
*/
package com.logpm.statistics.controller;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -30,13 +32,16 @@ import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -47,8 +52,11 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 成本配送服务商配置价格 控制器
@ -74,6 +82,7 @@ public class ExpenseDispatchPriceServiceController extends BladeController {
ExpenseDispatchPriceServiceEntity detail = expenseDispatchPriceServiceService.getOne(Condition.getQueryWrapper(expenseDispatchPriceService));
return R.data(ExpenseDispatchPriceServiceWrapper.build().entityVO(detail));
}
/**
* 成本配送服务商配置价格 分页
*/
@ -103,8 +112,28 @@ public class ExpenseDispatchPriceServiceController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入expenseDispatchPriceService")
public R save(@Valid @RequestBody ExpenseDispatchPriceServiceEntity expenseDispatchPriceService) {
expenseDispatchPriceServiceService.save(expenseDispatchPriceService);
return R.data(expenseDispatchPriceService.getId());
List<JSONObject> drivers = expenseDispatchPriceService.getDrivers();
if (CollUtil.isEmpty(drivers)) {
throw new ServiceException("司机必传");
}
List<ExpenseDispatchPriceServiceEntity> list = expenseDispatchPriceServiceService.list();
Set<Long> collect = new HashSet<>();
if (CollUtil.isNotEmpty(list)) {
collect = list.stream().map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet());
}
for (JSONObject driver : drivers) {
Long driverId = driver.getLong("driverId");
if (collect.contains(driverId)) {
throw new ServiceException("司机已存在,请检查。");
}
String driverName = driver.getString("driverName");
ExpenseDispatchPriceServiceEntity expenseDispatchPriceServiceEntity = new ExpenseDispatchPriceServiceEntity();
BeanUtil.copyProperties(expenseDispatchPriceService, expenseDispatchPriceServiceEntity);
expenseDispatchPriceServiceEntity.setDriverId(driverId);
expenseDispatchPriceServiceEntity.setDriverName(driverName);
expenseDispatchPriceServiceService.save(expenseDispatchPriceServiceEntity);
}
return R.data(Boolean.TRUE);
}
/**
@ -114,6 +143,19 @@ public class ExpenseDispatchPriceServiceController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入expenseDispatchPriceService")
public R update(@Valid @RequestBody ExpenseDispatchPriceServiceEntity expenseDispatchPriceService) {
ExpenseDispatchPriceServiceEntity byId = expenseDispatchPriceServiceService.getById(expenseDispatchPriceService.getId());
if (ObjectUtil.isEmpty(byId)) {
throw new ServiceException("单据不存在,请联系管理员。");
}
List<ExpenseDispatchPriceServiceEntity> list = expenseDispatchPriceServiceService.list();
if (CollUtil.isNotEmpty(list)) {
Set<Long> collect = list.stream()
.filter(item -> !item.getDriverId().equals(byId.getDriverId()))
.map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet());
if (collect.contains(expenseDispatchPriceService.getDriverId())) {
throw new ServiceException("司机已存在,请检查。");
}
}
return R.status(expenseDispatchPriceServiceService.updateById(expenseDispatchPriceService));
}
@ -146,7 +188,7 @@ public class ExpenseDispatchPriceServiceController extends BladeController {
@ApiOperation(value = "导出数据", notes = "传入expenseDispatchPriceService")
public void exportExpenseDispatchPriceService(@ApiIgnore @RequestParam Map<String, Object> expenseDispatchPriceService, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<ExpenseDispatchPriceServiceEntity> queryWrapper = Condition.getQueryWrapper(expenseDispatchPriceService, ExpenseDispatchPriceServiceEntity.class);
//if (!AuthUtil.isAdministrator()) {
// if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(ExpenseDispatchPriceService::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(ExpenseDispatchPriceServiceEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);

Loading…
Cancel
Save