|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import cn.hutool.core.lang.TypeReference; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.extra.spring.SpringUtil; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
@@ -31,7 +32,7 @@ import com.hz.pm.api.external.model.dto.MhPurchaseNoticeDTO; |
|
|
|
import com.hz.pm.api.external.model.enumeration.MhUnitStripEnum; |
|
|
|
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; |
|
|
|
import com.hz.pm.api.projectdeclared.chain.ProjectStatusRewriteHandlerContext; |
|
|
|
import com.hz.pm.api.projectdeclared.helper.MhXchxFileHelper; |
|
|
|
import com.hz.pm.api.projectdeclared.helper.MhXcfhxFileHelper; |
|
|
|
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO; |
|
|
|
import com.hz.pm.api.projectdeclared.model.dto.PurchaseSaveDTO; |
|
|
|
import com.hz.pm.api.projectdeclared.model.dto.XcfhxApplyEditDTO; |
|
|
@@ -69,6 +70,7 @@ import com.hz.pm.api.user.security.model.UserInfoDetails; |
|
|
|
import com.hz.pm.api.user.util.LoginUserUtil; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.ApiResponse; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.basic.util.NdDateUtils; |
|
|
@@ -135,7 +137,7 @@ public class PurchaseManage { |
|
|
|
private final IProjectInstService projectInstService; |
|
|
|
private final EnvironmentUtil environmentUtil; |
|
|
|
private final IXinchuangService xinchuangService; |
|
|
|
private final MhXchxFileHelper mhXchxFileHelper; |
|
|
|
private final MhXcfhxFileHelper mhXcfhxFileHelper; |
|
|
|
private final IPurchaseStatusChangeService purchaseStatusChangeService; |
|
|
|
private final MhUnitQueryAuthHelper mhUnitQueryAuthHelper; |
|
|
|
private final IProjectGovSystemReplaceInfosService projectGovSystemReplaceInfosService; |
|
|
@@ -552,6 +554,28 @@ public class PurchaseManage { |
|
|
|
projectGovSystemReplaceInfosService.updateBatchById(projectGovSystemReplaceInfos); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void repairXcfhxReportFiles() { |
|
|
|
List<Purchase> purchases = purchaseService.list(Wrappers.lambdaQuery(Purchase.class) |
|
|
|
.select(Purchase::getId, Purchase::getXcfhxReportFiles) |
|
|
|
.isNotNull(Purchase::getXcfhxReportFiles)); |
|
|
|
for (Purchase purchase : purchases) { |
|
|
|
BizUtils.notBlank(purchase.getXcfhxReportFiles(), w -> { |
|
|
|
try { |
|
|
|
ApiResponse<FileResultVO> response = JSONUtil.toBean(w, new TypeReference<ApiResponse<FileResultVO>>() { |
|
|
|
}, false); |
|
|
|
if (response.getCode() == ApiResponse.SUCCESS_CODE) { |
|
|
|
purchase.setXcfhxReportFiles(JSONUtil.toJsonStr(Collections.singletonList(response.getData()))); |
|
|
|
purchaseService.updateById(purchase); |
|
|
|
} |
|
|
|
log.warn("修复采购信息xcfhxReportFiles成功:{}", w); |
|
|
|
} catch (Exception ex) { |
|
|
|
log.warn("修复采购信息xcfhxReportFiles失败:{}", w); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void pushToMhNotice(Long purchaseId) { |
|
|
|
Purchase purchase = purchaseService.getById(purchaseId); |
|
|
|
if (Boolean.TRUE.equals(mhPurchaseNoticeOpen)) { |
|
|
@@ -1080,7 +1104,7 @@ public class PurchaseManage { |
|
|
|
if (Boolean.TRUE.equals(dto.getMatchXcfhx()) |
|
|
|
&& StrUtils.isNotBlank(dto.getMhXcfhxReportFile())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXcfhxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
xinchuang.setXcfhxReportFiles(mhXcfhxFileHelper.getXcfhxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
|
|
|
|
if (xinchuangService.save(xinchuang)) { |
|
|
@@ -1097,7 +1121,7 @@ public class PurchaseManage { |
|
|
|
&& StrUtils.isNotBlank(dto.getMhXcfhxReportFile()) && |
|
|
|
!dto.getMhXcfhxReportFile().equals(old.getMhXcfhxReportFile())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXcfhxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
xinchuang.setXcfhxReportFiles(mhXcfhxFileHelper.getXcfhxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
if (xinchuangService.updateById(xinchuang)) { |
|
|
|
return xinchuang.getId(); |
|
|
@@ -1106,11 +1130,11 @@ public class PurchaseManage { |
|
|
|
} |
|
|
|
|
|
|
|
public String xcfhxReportFiles(String code) { |
|
|
|
return mhXchxFileHelper.getXcfhxFile(code, null); |
|
|
|
return mhXcfhxFileHelper.getXcfhxFile(code, null); |
|
|
|
} |
|
|
|
|
|
|
|
public void exportXcfhFile(String code, HttpServletResponse response) throws UnsupportedEncodingException { |
|
|
|
mhXchxFileHelper.exportReport(code, response); |
|
|
|
mhXcfhxFileHelper.exportReport(code, response); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|