|
|
@@ -80,6 +80,7 @@ import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.time.LocalDateTime; |
|
|
@@ -724,32 +725,30 @@ public class PurchaseManage { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Long addSystem(XcfhxApplySaveDTO dto) { |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
|
|
|
|
Xinchuang xinchuang = BeanUtil.copyProperties(dto, Xinchuang.class); |
|
|
|
xinchuang.setSourceType(PurchaseSourceTypeEnum.MANUAL_ADDITION.getCode()); |
|
|
|
xinchuang.setBuildOrgCode(userFullInfo.getMhUnitIdStr()); |
|
|
|
xinchuang.setBuildOrgName(userFullInfo.getMhUnitName()); |
|
|
|
if(xinchuangService.save(xinchuang)){ |
|
|
|
if (Boolean.TRUE.equals(dto.getMatchXcfhx())) { |
|
|
|
if (StrUtils.isNotBlank(dto.getMhXcfhxReportFile())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
if (Boolean.TRUE.equals(dto.getMatchXcfhx())) { |
|
|
|
if (StrUtils.isNotBlank(dto.getMhXcfhxReportFile())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
} |
|
|
|
if(xinchuangService.save(xinchuang)){ |
|
|
|
return xinchuang.getId(); |
|
|
|
} |
|
|
|
throw BizException.wrap("新增失败"); |
|
|
|
} |
|
|
|
|
|
|
|
public Long updateSystem(XcfhxApplyEditDTO dto) { |
|
|
|
Xinchuang old = xinchuangService.getById(dto.getId()); |
|
|
|
VUtils.isTrue(Objects.isNull(old)).throwMessage("数据不存在"); |
|
|
|
Xinchuang xinchuang = BeanUtil.copyProperties(dto, Xinchuang.class); |
|
|
|
if (Boolean.TRUE.equals(dto.getMatchXcfhx()) && StrUtils.isNotBlank(dto.getMhXcfhxReportFile()) && |
|
|
|
!dto.getMhXcfhxReportFile().equals(old.getMhXcfhxReportFile())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
if(xinchuangService.updateById(xinchuang)){ |
|
|
|
if (Boolean.TRUE.equals(dto.getMatchXcfhx()) && StrUtils.isNotBlank(dto.getMhXcfhxReportFile()) && |
|
|
|
!dto.getMatchXcfhx().equals(xinchuang.getMatchXcfhx())) { |
|
|
|
String fileName = xinchuang.getBidName() + "-信创符合性测评报告."; |
|
|
|
xinchuang.setXcfhxReportFiles(mhXchxFileHelper.getXchxFile(dto.getMhXcfhxReportFile(), fileName)); |
|
|
|
} |
|
|
|
return xinchuang.getId(); |
|
|
|
} |
|
|
|
throw BizException.wrap("编辑失败"); |
|
|
@@ -759,7 +758,7 @@ public class PurchaseManage { |
|
|
|
return mhXchxFileHelper.getXchxFile(code, null); |
|
|
|
} |
|
|
|
|
|
|
|
public void exportXcfhFile(String code,HttpServletResponse response) { |
|
|
|
public void exportXcfhFile(String code,HttpServletResponse response) throws UnsupportedEncodingException { |
|
|
|
mhXchxFileHelper.exportReport(code, response); |
|
|
|
} |
|
|
|
} |