|
|
@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter; |
|
|
|
import com.alibaba.excel.converters.longconverter.LongStringConverter; |
|
|
|
import com.alibaba.excel.converters.longconverter.LongStringConverter; |
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; |
|
|
|
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -22,6 +23,7 @@ import com.hnac.hzims.spare.vo.SpWarehouseInVO; |
|
|
|
import com.hnac.hzims.spare.vo.WtSpBasicVO; |
|
|
|
import com.hnac.hzims.spare.vo.WtSpBasicVO; |
|
|
|
import com.hnac.hzims.spare.vo.WtSpManagementVO; |
|
|
|
import com.hnac.hzims.spare.vo.WtSpManagementVO; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
@ -29,9 +31,11 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.feign.IDictBizClient; |
|
|
|
import org.springblade.system.feign.IDictBizClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
@ -44,10 +48,7 @@ import java.io.IOException; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 服务实现类 |
|
|
|
* 服务实现类 |
|
|
@ -56,6 +57,7 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, SpWarehouseInEntity> implements ISpWarehouseInService { |
|
|
|
public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, SpWarehouseInEntity> implements ISpWarehouseInService { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(SpWarehouseInServiceImpl.class); |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(SpWarehouseInServiceImpl.class); |
|
|
@ -300,14 +302,12 @@ public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, S |
|
|
|
params.put("warehouseId",warehouseInVO.getStorageRoom()); |
|
|
|
params.put("warehouseId",warehouseInVO.getStorageRoom()); |
|
|
|
} |
|
|
|
} |
|
|
|
params.put("tenantId", AuthUtil.getTenantId()); |
|
|
|
params.put("tenantId", AuthUtil.getTenantId()); |
|
|
|
IPage<SpWarehouseInVO> page = new Page<>(); |
|
|
|
List<SpWarehouseInVO> warehouseInPage = baseMapper.selectPageList(null, params); |
|
|
|
List<SpWarehouseInVO> warehouseInPage = baseMapper.selectPageList(page, params); |
|
|
|
|
|
|
|
// 导入列表
|
|
|
|
// 导入列表
|
|
|
|
List<SpWarehouseInExportVO> warehouseInExportList = new ArrayList<>(); |
|
|
|
List<SpWarehouseInExportVO> warehouseInExportList = new ArrayList<>(); |
|
|
|
// 数据处理
|
|
|
|
// 数据处理
|
|
|
|
warehouseInPage.forEach(warehouse -> { |
|
|
|
warehouseInPage.forEach(warehouse -> { |
|
|
|
SpWarehouseInExportVO exportVO = new SpWarehouseInExportVO(); |
|
|
|
new SpWarehouseInExportVO(); |
|
|
|
BeanUtils.copyProperties(warehouse, exportVO); |
|
|
|
|
|
|
|
int type = warehouse.getType().intValue(); |
|
|
|
int type = warehouse.getType().intValue(); |
|
|
|
// 入库类型
|
|
|
|
// 入库类型
|
|
|
|
String typeName; |
|
|
|
String typeName; |
|
|
@ -321,9 +321,11 @@ public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, S |
|
|
|
typeName = WarehouseInType.OLD.getName(); |
|
|
|
typeName = WarehouseInType.OLD.getName(); |
|
|
|
} |
|
|
|
} |
|
|
|
warehouse.setTypeName(typeName); |
|
|
|
warehouse.setTypeName(typeName); |
|
|
|
// 时间格式
|
|
|
|
String userName = Optional.ofNullable(warehouse.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null); |
|
|
|
// warehouse.setStartTime(DateUtil.format(plan.getScheduledStartTime(), DateUtil.PATTERN_DATE));
|
|
|
|
warehouse.setUserName(userName); |
|
|
|
// warehouse.setEndTime(DateUtil.format(plan.getScheduledEndTime(), DateUtil.PATTERN_DATE));
|
|
|
|
log.info("入库数据为:{}", JSON.toJSONString(warehouse)); |
|
|
|
|
|
|
|
SpWarehouseInExportVO exportVO = BeanUtil.copy(warehouse,SpWarehouseInExportVO.class); |
|
|
|
|
|
|
|
warehouseInExportList.add(exportVO); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 设置响应头
|
|
|
|
// 设置响应头
|
|
|
|
// URLEncoder.encode防止中文乱码
|
|
|
|
// URLEncoder.encode防止中文乱码
|
|
|
|