资质修改

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

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

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

Loading…
Cancel
Save