Browse Source

feat(all): 价格体系

1 增加修改人和创建人字段
dev
zhaoqiaobo 1 month ago
parent
commit
ea01c17ba7
  1. 12
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageV2VO.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml
  3. 44
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

12
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageV2VO.java

@ -66,6 +66,18 @@ public class BasicdataPricePageV2VO implements Serializable {
@ApiModelProperty(value = "修改时间")
private String updateTime;
@ApiModelProperty(value = "修改人")
private String updateUser;
@ApiModelProperty(value = "修改人id")
private String updateUserId;
@ApiModelProperty(value = "创建人")
private String createUser;
@ApiModelProperty(value = "创建人id")
private String createUserId;
@ApiModelProperty(value = "配送-上楼费免费楼层")
private String dispatchStairsCarryingCharge;

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml

@ -123,6 +123,7 @@
else ''
end effectiveStatus,
t.update_time,
t.update_user updateUserId,
t.effective_time,
t.expiry_time
from logpm_basicdata_store_brand lbsb
@ -177,6 +178,7 @@
else ''
end effectiveStatus,
t.update_time,
t.create_user createUserId,
t.effective_time,
t.expiry_time
from logpm_basicdata_price t

44
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -108,10 +108,13 @@ import org.springblade.common.enums.BooleanZeroOneEnums;
import org.springblade.common.model.IDict;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDictBizClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.vo.RegionAllVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -158,6 +161,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
private final ISysClient sysClient;
private final IDictBizClient dictBizClient;
private final IBasicCarModelClient carModelClient;
private final IUserClient iUserClient;
@Override
public IPage<BasicdataPricePageVO> selectBasicdataPricePage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice) {
@ -191,7 +195,23 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
public IPage<BasicdataPricePageV2VO> selectBasicdataPricePageV2(IPage<BasicdataPricePageV2VO> page, BasicdataPriceV2Query basicdataPrice) {
List<BasicdataPricePageV2VO> basicdataPriceVOS = baseMapper.selectBasicdataPricePageV2(page, basicdataPrice);
if (CollUtil.isNotEmpty(basicdataPriceVOS)) {
String updateUserIds = basicdataPriceVOS.stream()
.filter(vo -> StrUtil.isNotEmpty(vo.getUpdateUserId()))
.map(BasicdataPricePageV2VO::getUpdateUserId)
.collect(Collectors.joining(","));
R<List<User>> listR = iUserClient.userInfoByIds(AuthUtil.getTenantId(), updateUserIds);
Map<String, String> userMap = new HashMap<>();
if (R.isSuccess(listR)) {
List<User> data = listR.getData();
for (User datum : data) {
userMap.put(Convert.toStr(datum.getId()), datum.getRealName());
}
}
for (BasicdataPricePageV2VO basicdataPriceVO : basicdataPriceVOS) {
String updateUserId = basicdataPriceVO.getUpdateUserId();
if (StrUtil.isNotEmpty(updateUserId)) {
basicdataPriceVO.setUpdateUser(userMap.get(updateUserId));
}
// 服务类型
String serviceType = basicdataPriceVO.getServiceType();
if (StrUtil.isNotEmpty(serviceType)) {
@ -256,7 +276,23 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
List<BasicdataPricePageV2VO> basicdataPriceVOS = baseMapper.hisPageV2(page, basicdataPrice);
if (CollUtil.isNotEmpty(basicdataPriceVOS)) {
String updateUserIds = basicdataPriceVOS.stream()
.filter(vo -> StrUtil.isNotEmpty(vo.getCreateUserId()))
.map(BasicdataPricePageV2VO::getCreateUserId)
.collect(Collectors.joining(","));
R<List<User>> listR = iUserClient.userInfoByIds(AuthUtil.getTenantId(), updateUserIds);
Map<String, String> userMap = new HashMap<>();
if (R.isSuccess(listR)) {
List<User> data = listR.getData();
for (User datum : data) {
userMap.put(Convert.toStr(datum.getId()), datum.getRealName());
}
}
for (BasicdataPricePageV2VO basicdataPriceVO : basicdataPriceVOS) {
String createUserId = basicdataPriceVO.getCreateUserId();
if (StrUtil.isNotEmpty(createUserId)) {
basicdataPriceVO.setCreateUser(userMap.get(createUserId));
}
// 服务类型
String serviceType = basicdataPriceVO.getServiceType();
if (StrUtil.isNotEmpty(serviceType)) {
@ -921,7 +957,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
List<BasicdataPriceCategoryBasicEntity> basicEntities = categoryBasicService.list(Wrappers.<BasicdataPriceCategoryBasicEntity>lambdaQuery().in(BasicdataPriceCategoryBasicEntity::getPriceId, priceIdSet));
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities = categoryWarehouseService.list(Wrappers.<BasicdataPriceCategoryWarehouseEntity>lambdaQuery().in(BasicdataPriceCategoryWarehouseEntity::getPriceId, priceIdSet));
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities = categoryDispatchService.list(Wrappers.<BasicdataPriceCategoryDispatchEntity>lambdaQuery().in(BasicdataPriceCategoryDispatchEntity::getPriceId, priceIdSet));
//价格 + 品类 + 路径
// 价格 + 品类 + 路径
if (CollUtil.isNotEmpty(basicEntities)) {
// 提货干线 有路径 + 有品类
List<BasicdataPriceCategoryBasicEntity> routeCategoryBaseList = basicEntities.stream()
@ -2130,12 +2166,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
// if (CollUtil.isNotEmpty(basicEntities)) {
// // 提货干线 有路径 + 有品类
// List<BasicdataPriceCategoryBasicEntity> routeCategoryBaseList = basicEntities.stream()

Loading…
Cancel
Save