Browse Source

1.返回字典

dev-warehouse
0.0 2 years ago
parent
commit
b5922f6654
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java
  3. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java
  4. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java
  5. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -47,6 +47,8 @@ public class DictBizConstant {
public static final String DISTRIBUTION_DELIVERY_KiIND = "distribution_deliverylist_kind";//配送种类 public static final String DISTRIBUTION_DELIVERY_KiIND = "distribution_deliverylist_kind";//配送种类
public static final String AREA_TYPE = "area_type";//货区类型

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataGoodsAreaVO.java

@ -46,6 +46,14 @@ public class BasicdataGoodsAreaVO extends BasicdataGoodsAreaEntity {
private String name; private String name;
private Boolean leaf; private Boolean leaf;
/**
* 创建人
*/
private String createUserName;
/**
* 货区类型
*/
private String areaTypeName;

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java

@ -22,6 +22,7 @@ import com.logpm.basicdata.service.IBasicdataGoodsAreaService;
import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; import com.logpm.basicdata.vo.BasicdataGoodsAreaVO;
import com.logpm.basicdata.vo.BasicdataNodeVO; import com.logpm.basicdata.vo.BasicdataNodeVO;
import com.logpm.basicdata.vo.BasicdataWarehouseVO; import com.logpm.basicdata.vo.BasicdataWarehouseVO;
import com.logpm.basicdata.wrapper.WarehouseGoodsAreaWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -80,7 +81,7 @@ public class BasicdataGoodsAreaController extends BladeController {
IPage<Object> page = Condition.getPage(query); IPage<Object> page = Condition.getPage(query);
IPage<BasicdataGoodsAreaVO> list = basicdataGoodsAreaService.getBasicdataGoodsAreaList(basicdataGoodsArea,page); IPage<BasicdataGoodsAreaVO> list = basicdataGoodsAreaService.getBasicdataGoodsAreaList(basicdataGoodsArea,page);
// IPage<BasicdataGoodsAreaVO> pages = basicdataGoodsAreaService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataGoodsArea, BasicdataGoodsAreaEntity.class)); // IPage<BasicdataGoodsAreaVO> pages = basicdataGoodsAreaService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataGoodsArea, BasicdataGoodsAreaEntity.class));
return R.data(list); return R.data(WarehouseGoodsAreaWrapper.build().pageVO(list));
} }

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java

@ -16,7 +16,9 @@
*/ */
package com.logpm.basicdata.feign; package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -39,6 +41,7 @@ import springfox.documentation.annotations.ApiIgnore;
public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient { public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient {
private final IBasicdataDriverArteryService basicdataDriverArteryService; private final IBasicdataDriverArteryService basicdataDriverArteryService;
private final BasicdataDriverArteryMapper basicdataDriverArteryMapper;
@Override @Override
@GetMapping(TOP) @GetMapping(TOP)
@ -50,4 +53,13 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient
return BladePage.of(page); return BladePage.of(page);
} }
@Override
@GetMapping(GETENTITY)
public BasicdataDriverArteryEntity getDriverArtery(Long id) {
BasicdataDriverArteryEntity basicdataDriverArteryEntity = basicdataDriverArteryMapper.selectOne(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
.eq(BasicdataDriverArteryEntity::getUserId,id)
);
return basicdataDriverArteryEntity;
}
} }

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java

@ -0,0 +1,54 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.wrapper;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.vo.BasicdataGoodsAreaVO;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.feign.IUserClient;
import java.util.Objects;
/**
* 货区 包装类,返回视图层所需的字段
*
* @author lmy
* @since 2023-08-08
*/
public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper<BasicdataGoodsAreaVO, BasicdataGoodsAreaVO> {
IUserClient userCliient = SpringUtil.getBean(IUserClient.class);
public static WarehouseGoodsAreaWrapper build() {
return new WarehouseGoodsAreaWrapper();
}
@Override
public BasicdataGoodsAreaVO entityVO(BasicdataGoodsAreaVO warehouseWaybill) {
BasicdataGoodsAreaVO basicdataGoodsAreaVO = Objects.requireNonNull(BeanUtil.copy(warehouseWaybill, BasicdataGoodsAreaVO.class));
basicdataGoodsAreaVO.setCreateUserName(userCliient.userInfoById(basicdataGoodsAreaVO.getCreateUser()).getData().getName());
basicdataGoodsAreaVO.setAreaTypeName(DictBizCache.getValue(DictBizConstant.AREA_TYPE,basicdataGoodsAreaVO.getAreaType()));
return basicdataGoodsAreaVO;
}
}
Loading…
Cancel
Save