Browse Source

值班日志导出bug修改

zhongwei
ty 9 months ago
parent
commit
c98ddbd28f
  1. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyLogServiceImpl.java

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyLogServiceImpl.java

@ -14,6 +14,7 @@ import org.apache.commons.io.IOUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
@ -30,6 +31,8 @@ import java.util.*;
@Service @Service
public class ImsDutyLogServiceImpl extends BaseServiceImpl<ImsDutyLogMapper, ImsDutyLogEntity> implements IImsDutyLogService { public class ImsDutyLogServiceImpl extends BaseServiceImpl<ImsDutyLogMapper, ImsDutyLogEntity> implements IImsDutyLogService {
@Value("${hzims.duty.file-path}")
private String savePath;
@Override @Override
public void exportDutyLog(String dutyId, HashMap<String, Object> map) { public void exportDutyLog(String dutyId, HashMap<String, Object> map) {
ImsDutyLogEntity res = this.baseMapper.selectOne(new LambdaQueryWrapper<ImsDutyLogEntity>() {{ ImsDutyLogEntity res = this.baseMapper.selectOne(new LambdaQueryWrapper<ImsDutyLogEntity>() {{
@ -107,12 +110,14 @@ public class ImsDutyLogServiceImpl extends BaseServiceImpl<ImsDutyLogMapper, Ims
if (StringUtils.isNotBlank(res.getDutyPic())) { if (StringUtils.isNotBlank(res.getDutyPic())) {
String[] dutyPicSplit = res.getDutyPic().split(","); String[] dutyPicSplit = res.getDutyPic().split(",");
for (String string : dutyPicSplit) { for (String string : dutyPicSplit) {
ImageEntity imageEntity = new ImageEntity(imgToByte("/template/img" + downloadFileByUrl(string, "/template/img")), 225, 163); ImageEntity imageEntity = new ImageEntity(imgToByte(savePath + downloadFileByUrl(string, savePath)), 225, 163);
imageEntity.setUrl(string); imageEntity.setUrl(string);
imageEntityList.add(imageEntity); imageEntityList.add(imageEntity);
} }
map.put("dutyPic",imageEntityList); }else {
imageEntityList.add(new ImageEntity());
} }
map.put("dutyPic",imageEntityList);
} }
} }

Loading…
Cancel
Save