feat: 一些优化

This commit is contained in:
曹鹏飞 2025-10-11 17:36:42 +08:00
parent 9be20e6a35
commit dee8259e81
11 changed files with 57 additions and 40 deletions

View File

@ -93,7 +93,7 @@ public class InventoryController extends BaseController {
@GetMapping("check/getTaskItems")
public ApiResult<List<InventoryCheckTaskItemVO>> getTaskItems(@Valid @RequestParam(required = false) Long id) {
List<WmsInventoryCheckTaskItem> taskItems = Objects.isNull(id) ? Collections.emptyList() : inventoryCheckTaskItemService.lambdaQuery().eq(WmsInventoryCheckTaskItem::getTaskId, id).list();
List<WarehouseVO> warehouseVOS = warehouseService.getEnableList(null);
List<WarehouseSimpleVO> warehouseVOS = warehouseService.getEnableList(null);
List<InventoryCheckTaskItemVO> vos = new ArrayList<>();
warehouseVOS.forEach(warehouseVO -> {
WmsInventoryCheckTaskItem item = taskItems.stream().filter(taskItem -> Objects.equals(taskItem.getWarehouseId(), warehouseVO.getId())).findFirst().orElse(null);
@ -107,8 +107,8 @@ public class InventoryController extends BaseController {
.setChargeUserId(Objects.isNull(item) ? null : item.getChargeUserId())
.setChargeUserName(Objects.isNull(item) ? "" : item.getChargeUserName())
.setAddress(warehouseVO.getAddress())
.setUserName(warehouseVO.getUserName())
.setPhone(warehouseVO.getPhone())
// .setUserName(warehouseVO.getUserName())
// .setPhone(warehouseVO.getPhone())
);
});
return ApiResult.success(vos);

View File

@ -7,6 +7,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
import com.nflg.wms.common.pojo.vo.WarehouseVO;
import com.nflg.wms.repository.entity.DictionaryItem;
import com.nflg.wms.starter.BaseController;
@ -118,7 +119,7 @@ public class WarehouseController extends BaseController {
* @param factoryNo 工厂编号
*/
@GetMapping("getEnableList")
public ApiResult<List<WarehouseVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
public ApiResult<List<WarehouseSimpleVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
return ApiResult.success(warehouseControllerService.getEnableList(factoryNo));
}

View File

@ -16,6 +16,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
import com.nflg.wms.common.pojo.vo.WarehouseVO;
import com.nflg.wms.common.util.DateTimeUtil;
import com.nflg.wms.common.util.EecExcelUtil;
@ -217,7 +218,7 @@ public class WarehouseControllerService {
.writeTo(response.getOutputStream());
}
public List<WarehouseVO> getEnableList(String factoryNo) {
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
return warehouseService.getEnableList(factoryNo);
}

View File

@ -74,13 +74,13 @@ public class InventoryCheckTaskItemVO {
*/
private String address;
/**
* 责任人
*/
private String userName;
// /**
// * 责任人
// */
// private String userName;
/**
* 联系电话
*/
private String phone;
// /**
// * 联系电话
// */
// private String phone;
}

View File

@ -0,0 +1,29 @@
package com.nflg.wms.common.pojo.vo;
import lombok.Data;
@Data
public class WarehouseSimpleVO {
private Long id;
/**
* 仓库编码
*/
private String no;
/**
* 仓库名称
*/
private String name;
/**
* 所属工厂名称
*/
private String factoryName;
/**
* 所在地点
*/
private String address;
}

View File

@ -5,19 +5,7 @@ import lombok.Data;
import java.time.LocalDateTime;
@Data
public class WarehouseVO {
private Long id;
/**
* 仓库编码
*/
private String no;
/**
* 仓库名称
*/
private String name;
public class WarehouseVO extends WarehouseSimpleVO {
/**
* 责任人
@ -34,11 +22,6 @@ public class WarehouseVO {
*/
private String phone;
/**
* 所在地点
*/
private String address;
/**
* 是否启用
*/
@ -83,9 +66,4 @@ public class WarehouseVO {
* 所属工厂
*/
private Long factoryId;
/**
* 所属工厂名称
*/
private String factoryName;
}

View File

@ -1,5 +1,6 @@
package com.nflg.wms.common.pojo.vo;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@ -18,6 +19,10 @@ public class ZWM3A05ItemVO {
*/
private String ebelp;
public String getEbelp() {
return StrUtil.removeAllPrefix(ebelp, "0");
}
/**
* 退货项目
*/

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
import com.nflg.wms.common.pojo.vo.WarehouseVO;
import com.nflg.wms.repository.entity.WmsWarehouse;
import org.apache.ibatis.annotations.Param;
@ -26,7 +27,7 @@ public interface WmsWarehouseMapper extends BaseMapper<WmsWarehouse> {
List<WarehouseVO> searchNonPage(@Param("request") WarehouseSearchQO request);
List<WarehouseVO> getEnableList(String factoryNo);
List<WarehouseSimpleVO> getEnableList(String factoryNo);
List<WarehouseVO> getListByIds(List<Long> list);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nflg.wms.common.pojo.qo.EnableQO;
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
import com.nflg.wms.common.pojo.vo.WarehouseVO;
import com.nflg.wms.repository.entity.WmsWarehouse;
import jakarta.validation.Valid;
@ -37,7 +38,7 @@ public interface IWmsWarehouseService extends IService<WmsWarehouse> {
List<WarehouseVO> searchNonPage(@Valid WarehouseSearchQO request);
List<WarehouseVO> getEnableList(String factoryNo);
List<WarehouseSimpleVO> getEnableList(String factoryNo);
List<WarehouseVO> getListByIds(List<Long> list);
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nflg.wms.common.pojo.qo.EnableQO;
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
import com.nflg.wms.common.pojo.vo.WarehouseVO;
import com.nflg.wms.common.util.UserUtil;
import com.nflg.wms.common.util.VUtil;
@ -106,7 +107,7 @@ public class WmsWarehouseServiceImpl extends ServiceImpl<WmsWarehouseMapper, Wms
}
@Override
public List<WarehouseVO> getEnableList(String factoryNo) {
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
return baseMapper.getEnableList(factoryNo);
}

View File

@ -49,7 +49,7 @@
order by w.id desc
</select>
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseVO">
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseSimpleVO">
select w.*, di.name as factory_name
from wms_warehouse w
left join dictionary_item di on w.factory_id = di.id