|
@@ -1,18 +1,29 @@
|
|
package com.warewms.hailiang.service.impl;
|
|
package com.warewms.hailiang.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.warewms.common.core.domain.base.page.PageDomain;
|
|
import com.warewms.common.core.domain.base.page.PageDomain;
|
|
import com.warewms.common.core.domain.base.page.TableDataInfo;
|
|
import com.warewms.common.core.domain.base.page.TableDataInfo;
|
|
|
|
+import com.warewms.common.core.domain.entity.SysDictData;
|
|
import com.warewms.common.utils.StringUtils;
|
|
import com.warewms.common.utils.StringUtils;
|
|
|
|
+import com.warewms.hailiang.domain.DTO.RetroactiveHistoryDTO;
|
|
|
|
+import com.warewms.hailiang.domain.Device;
|
|
import com.warewms.hailiang.domain.RetroactiveHistory;
|
|
import com.warewms.hailiang.domain.RetroactiveHistory;
|
|
import com.warewms.hailiang.domain.RetroactiveNow;
|
|
import com.warewms.hailiang.domain.RetroactiveNow;
|
|
|
|
+import com.warewms.hailiang.service.DeviceService;
|
|
import com.warewms.hailiang.service.RetroactiveHistoryService;
|
|
import com.warewms.hailiang.service.RetroactiveHistoryService;
|
|
import com.warewms.hailiang.mapper.RetroactiveHistoryMapper;
|
|
import com.warewms.hailiang.mapper.RetroactiveHistoryMapper;
|
|
|
|
+import com.warewms.system.service.impl.SysDictTypeServiceImpl;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.sql.Wrapper;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author AD
|
|
* @author AD
|
|
@@ -26,6 +37,12 @@ public class RetroactiveHistoryServiceImpl extends ServiceImpl<RetroactiveHistor
|
|
@Autowired
|
|
@Autowired
|
|
RetroactiveHistoryMapper retroactiveHistoryMapper;
|
|
RetroactiveHistoryMapper retroactiveHistoryMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ DeviceService deviceService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ SysDictTypeServiceImpl dictTypeService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public TableDataInfo<RetroactiveHistory> getListByPage(RetroactiveHistory retroactiveHistory, PageDomain pageDomain) {
|
|
public TableDataInfo<RetroactiveHistory> getListByPage(RetroactiveHistory retroactiveHistory, PageDomain pageDomain) {
|
|
return TableDataInfo.build(retroactiveHistoryMapper.selectPage(pageDomain.build(),new LambdaQueryWrapper<RetroactiveHistory>()
|
|
return TableDataInfo.build(retroactiveHistoryMapper.selectPage(pageDomain.build(),new LambdaQueryWrapper<RetroactiveHistory>()
|
|
@@ -46,6 +63,42 @@ public class RetroactiveHistoryServiceImpl extends ServiceImpl<RetroactiveHistor
|
|
.eq(StringUtils.isNotEmpty(retroactiveHistory.getStatus()),RetroactiveHistory::getStatus,retroactiveHistory.getStatus())
|
|
.eq(StringUtils.isNotEmpty(retroactiveHistory.getStatus()),RetroactiveHistory::getStatus,retroactiveHistory.getStatus())
|
|
.orderByAsc(RetroactiveHistory::getCreateTime));
|
|
.orderByAsc(RetroactiveHistory::getCreateTime));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<RetroactiveHistoryDTO> export(RetroactiveHistory retroactiveHistory, String ids) {
|
|
|
|
+ LambdaQueryWrapper<RetroactiveHistory> retroactiveHistoryLambdaQueryWrapper = Wrappers.lambdaQuery(RetroactiveHistory.class);
|
|
|
|
+ List<String> longs = new ArrayList<>();
|
|
|
|
+ if (StringUtils.isNotEmpty(ids)){
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
+ if (split.length==1){
|
|
|
|
+ longs.add(ids);
|
|
|
|
+ }else{
|
|
|
|
+ longs = Arrays.asList(split);
|
|
|
|
+ System.out.println(longs);
|
|
|
|
+ retroactiveHistoryLambdaQueryWrapper.in(RetroactiveHistory::getHistoryId,longs)
|
|
|
|
+ .orderByAsc(RetroactiveHistory::getCreateTime);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ retroactiveHistoryLambdaQueryWrapper
|
|
|
|
+ .like(StringUtils.isNotEmpty(retroactiveHistory.getRetroactiveId()),RetroactiveHistory::getRetroactiveId,retroactiveHistory.getRetroactiveId())
|
|
|
|
+ .eq(StringUtils.isNotEmpty(retroactiveHistory.getStatus()),RetroactiveHistory::getStatus,retroactiveHistory.getStatus())
|
|
|
|
+ .orderByAsc(RetroactiveHistory::getCreateTime);
|
|
|
|
+ }
|
|
|
|
+ return retroactiveHistoryMapper.selectList(retroactiveHistoryLambdaQueryWrapper).stream().map(itme->{
|
|
|
|
+ RetroactiveHistoryDTO retroactiveHistoryDTO = BeanUtil.copyProperties(itme, RetroactiveHistoryDTO.class);
|
|
|
|
+ for (Device device : deviceService.getList()) {
|
|
|
|
+ if(device.getDeviceId().equals(retroactiveHistoryDTO.getDeviceId())){
|
|
|
|
+ retroactiveHistoryDTO.setDeviceId(device.getAbbreviation());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (SysDictData process : dictTypeService.selectDictDataByType("process")) {
|
|
|
|
+ if (process.getDictValue().equals(retroactiveHistoryDTO.getStatus())){
|
|
|
|
+ retroactiveHistoryDTO.setStatus(process.getDictLabel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return retroactiveHistoryDTO;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|