资质修改

dev_test1.0
anthonywj 1 year ago
parent 48c0ce5269
commit 0bb6bfc97a

@ -216,7 +216,7 @@ public class SupCertRemindMsgImpl implements SupCertRemindMsgService {
private void buildNearRemindMsg(QueryWrapper<SupCertEntity> supCertWrapper, Integer type) {
List<SupCertEntity> supCertList = supCertDao.selectList(supCertWrapper);
List<SupCertEntity> list = new CopyOnWriteArrayList<>(supCertList);
list.parallelStream().forEach(supCertEntity -> {
list.forEach(supCertEntity -> {
SupCertRemindMsgEntity msgEntity = getSupCertNearRemindMsg(supCertEntity, type);
if (null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() > new Date().getTime()) {
try {
@ -237,7 +237,7 @@ public class SupCertRemindMsgImpl implements SupCertRemindMsgService {
private void buildRemindMsg(QueryWrapper<SupCertEntity> supCertWrapper, Integer type) {
List<SupCertEntity> supCertList = supCertDao.selectList(supCertWrapper);
List<SupCertEntity> list = new CopyOnWriteArrayList<>(supCertList);
list.parallelStream().forEach(supCertEntity -> {
list.forEach(supCertEntity -> {
//判断证书是否超出失效期
SupCertRemindMsgEntity msgEntity = getSupCertRemindMsg(supCertEntity, type);
if (null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() > new Date().getTime()) {

@ -211,21 +211,29 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
boolean b = supCertDao.updateCompanyCert(supCertEntity);
if (IntUtil.value(supCertEntity.getType()) == ConstantStatus.CERT_COMPANY) {
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supCertEntity.getCustomerId());
supCompanyEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supCompanyEntity.setUpdateTime(new Date());
supCompanyService.modifyCompany(supCompanyEntity);
if (supCompanyEntity != null) {
supCompanyEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supCompanyEntity.setUpdateTime(new Date());
supCompanyService.modifyCompany(supCompanyEntity);
}
} else if (IntUtil.value(supCertEntity.getType()) == ConstantStatus.CERT_MANUFACTURER) {
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supCertEntity.getManufacturerIdFk());
supManufacturerEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supManufacturerEntity.setUpdateTime(new Date());
supManufacturerService.modifyCompany(supManufacturerEntity);
if (supManufacturerEntity != null) {
supManufacturerEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supManufacturerEntity.setUpdateTime(new Date());
supManufacturerService.modifyCompany(supManufacturerEntity);
}
} else if (IntUtil.value(supCertEntity.getType()) == ConstantStatus.CERT_PRODUCT) {
SupProductResponse supProductResponse = supProductService.findByProductId(supCertEntity.getProductIdFk());
SupProductEntity supProductEntity = new SupProductEntity();
supProductEntity.setId(supProductResponse.getId());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supProductService.modifyRegistration(supProductEntity);
if (supProductResponse != null) {
SupProductEntity supProductEntity = new SupProductEntity();
supProductEntity.setId(supProductResponse.getId());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setAuditStatus(ConstantStatus.AUDIT_UN);
supProductService.modifyRegistration(supProductEntity);
}
}
return b;
}

@ -1,5 +1,6 @@
package com.glxp.api.upload;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
@ -15,6 +16,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
@Slf4j
@RestController
@ -27,10 +29,13 @@ public class DownloadController {
, @RequestParam String type
, @RequestParam String name) throws IOException {
// String filePath = new String(name.getBytes("UTF-8"), "UTF-8");
if (name.endsWith("pdf") || name.endsWith("doc")) {
OutputStream os = null;
try {
FileInputStream input = new FileInputStream(new File(filePath + "/register/file/" + type + "/" + name));
File file = new File(filePath + "/register/file/" + type + "/" + name);
FileInputStream input = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] b = new byte[2048];
int len;
@ -39,6 +44,9 @@ public class DownloadController {
}
input.close();
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage());
log.error(new String(ExceptionUtil.getMessage(e).getBytes(StandardCharsets.UTF_8)));
log.error("pdf:" + ExceptionUtils.getStackTrace(e));
} finally {
if (os != null) {
@ -50,8 +58,9 @@ public class DownloadController {
OutputStream os = null;
try {
// 读取图片
File file = new File(filePath + "/register/file/" + type + "/" + name);
BufferedImage image = ImageIO.read(
new FileInputStream(new File(filePath + "/register/file/" + type + "/" + name)));
new FileInputStream(file));
response.setContentType("image/png");
os = response.getOutputStream();
@ -59,6 +68,9 @@ public class DownloadController {
ImageIO.write(image, "png", os);
}
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage());
log.error(new String(ExceptionUtil.getMessage(e).getBytes(StandardCharsets.UTF_8)));
log.error("图片:" + ExceptionUtils.getStackTrace(e));
} finally {
if (os != null) {
@ -85,7 +97,9 @@ public class DownloadController {
}
input.close();
} catch (IOException e) {
log.error(e.getMessage());
log.error(ExceptionUtil.getMessage(e));
log.error("图片:" + ExceptionUtils.getStackTrace(e));
} finally {
if (os != null) {
os.flush();
@ -110,7 +124,9 @@ public class DownloadController {
}
input.close();
} catch (IOException e) {
log.error(e.getMessage());
log.error(ExceptionUtil.getMessage(e));
log.error("图片:" + ExceptionUtils.getStackTrace(e));
} finally {
if (os != null) {
os.flush();

Loading…
Cancel
Save