| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.chinaztt.mes.basic.dto.LocationDTO; |
| | | import com.chinaztt.mes.basic.dto.LocationIfsMoveDTO; |
| | | import com.chinaztt.mes.basic.entity.Location; |
| | | import com.chinaztt.mes.basic.entity.Warehouse; |
| | | import com.chinaztt.mes.basic.excel.LocationData; |
| | | import com.chinaztt.mes.basic.mapper.LocationMapper; |
| | | import com.chinaztt.mes.basic.mapper.WarehouseMapper; |
| | | import com.chinaztt.mes.basic.service.LocationService; |
| | | import com.chinaztt.mes.basic.service.WarehouseService; |
| | | import com.chinaztt.mes.basic.util.DictUtils; |
| | | import com.chinaztt.ztt.admin.api.entity.SysDictItem; |
| | | import com.chinaztt.ztt.admin.api.feign.RemoteParamService; |
| | | import com.chinaztt.ztt.common.core.constant.SecurityConstants; |
| | | import com.chinaztt.ztt.common.core.util.R; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collector; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 库位基础数据 |
| | |
| | | public static final String CONTRACT = "IFS_DOMAIN"; |
| | | private RemoteParamService remoteParamService; |
| | | private IfsFeignClient ifsFeignClient; |
| | | |
| | | private DictUtils dictUtils; |
| | | @Override |
| | | public IPage<List<Location>> getLoc(Page page, QueryWrapper<LocationDTO> ew) { |
| | | return baseMapper.getLoc(page, ew); |
| | |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | return; |
| | | } |
| | | List<SysDictItem> dict = dictUtils.getDict("warehouse_type"); |
| | | for (LocationData data : list) { |
| | | Location newLocation = new Location(); |
| | | dict.forEach(a->{ |
| | | if (a.getLabel().equals(data.getLocType())){ |
| | | newLocation.setLocType(a.getValue()); |
| | | } |
| | | }); |
| | | if("启用".equals(data.getLocState())){ |
| | | newLocation.setLocStatus(1); |
| | | }else{ |
| | | newLocation.setLocStatus(0); |
| | | } |
| | | newLocation.setFactoryId(data.getFactoryId()); |
| | | newLocation.setLocGroup(data.getLocGroup()); |
| | | newLocation.setLocGroup(data.getWarehouseId()); |
| | | newLocation.setLocName(data.getLocName()); |
| | | newLocation.setLocNo(data.getLocNo()); |
| | | newLocation.setIfsLocation(data.getIfsLocation()); |
| | | baseMapper.insert(newLocation); |
| | | } |
| | | } |