|
@@ -11,15 +11,18 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.control.dto.*;
|
|
|
import org.springblade.control.entity.*;
|
|
|
import org.springblade.control.mapper.TaskProcessMapper;
|
|
|
import org.springblade.control.service.TaskProcessService;
|
|
|
+import org.springblade.control.utils.PDFConverter;
|
|
|
import org.springblade.control.vo.*;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -27,6 +30,8 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springblade.resource.feign.IOSSClient;
|
|
|
+import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.entity.Dept;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
@@ -37,6 +42,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Duration;
|
|
@@ -58,6 +64,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
private final ProjectCostBudgetServiceImpl projectCostBudgetService;
|
|
|
private final ProjectInfoServiceImpl projectInfoServiceImpl;
|
|
|
private final ProjectCostBudgetStatsServiceImpl projectCostBudgetStatsService;
|
|
|
+ private final NewIOSSClient newIOSSClient;
|
|
|
|
|
|
@Override
|
|
|
public IPage<TaskProcessInfoVO> taskPage(IPage<TaskProcessInfo> page, TaskProcessInfoDTO dto) {
|
|
@@ -91,7 +98,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd"), 1), "yyyy-MM-dd");
|
|
|
queryWrapper.lambda().between(TaskProcessInfo::getReportDate, dto.getStartTime(), endTime);
|
|
|
}
|
|
|
- IPage<TaskProcessInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, true, TaskProcessInfo::getReportDate));
|
|
|
+ IPage<TaskProcessInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, false, TaskProcessInfo::getReportDate));
|
|
|
|
|
|
List<DictInfo> dictInfoList = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'report_type'", new BeanPropertyRowMapper<>(DictInfo.class));
|
|
|
|
|
@@ -143,7 +150,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TaskProcessInfoDetailVO taskDetail(String id) {
|
|
|
+ public TaskProcessInfoDetailVO taskDetail(String id) throws Exception {
|
|
|
TaskProcessInfoDetailVO vo = new TaskProcessInfoDetailVO();
|
|
|
TaskProcessInfo taskProcessInfo = baseMapper.selectById(id);
|
|
|
if (taskProcessInfo != null) {
|
|
@@ -193,6 +200,30 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
|
|
|
data = jdbcTemplate.query("select * from c_expense_financial_reimbursement_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMFinancialReimbursementInfo.class)).stream().findAny().orElse(null);
|
|
|
EMFinancialReimbursementInfoVO voCW = BeanUtil.copyProperties(data, EMFinancialReimbursementInfoVO.class);
|
|
|
if (voCW != null) {
|
|
|
+ //pdf转png
|
|
|
+ /*if (ObjectUtil.isNotEmpty(voCW.getFrAttachmentUrl()) && ObjectUtil.isEmpty(voCW.getFrAttachmentUrlPng())) {
|
|
|
+ InputStream ossInputStream = CommonUtil.getOSSInputStream(voCW.getFrAttachmentUrl());
|
|
|
+ byte[] bytes = PDFConverter.convertToPNG(ossInputStream);
|
|
|
+ if (bytes != null) {
|
|
|
+ BladeFile bladeFile = newIOSSClient.updateFile(bytes, SnowFlakeUtil.get() + ".png");
|
|
|
+ if (ObjectUtil.isNotEmpty(bladeFile)) {
|
|
|
+ jdbcTemplate.execute("update c_expense_financial_reimbursement_info set fr_electronic_invoice_url_png = '" + bladeFile.getLink() + "' where id = " + voCW.getId());
|
|
|
+ voCW.setFrAttachmentUrl(bladeFile.getLink());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(voCW.getFrElectronicInvoiceUrl()) && ObjectUtil.isEmpty(voCW.getFrElectronicInvoiceUrlPng())) {
|
|
|
+ InputStream ossInputStream = CommonUtil.getOSSInputStream(voCW.getFrElectronicInvoiceUrl());
|
|
|
+ byte[] bytes = PDFConverter.convertToPNG(ossInputStream);
|
|
|
+ if (bytes != null) {
|
|
|
+ BladeFile bladeFile = newIOSSClient.updateFile(bytes, SnowFlakeUtil.get() + ".png");
|
|
|
+ if (ObjectUtil.isNotEmpty(bladeFile)) {
|
|
|
+ jdbcTemplate.execute("update c_expense_financial_reimbursement_info set fr_attachment_url_png = '" + bladeFile.getLink() + "' where id = " + voCW.getId());
|
|
|
+ voCW.setFrElectronicInvoiceUrl(bladeFile.getLink());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
if (ObjectUtil.isNotEmpty(voCW.getProjectId()) && ObjectUtil.isNotEmpty(voCW.getBudgetPlanIds())) { //如果预算ids不为空,那么证明有关联计划任务(单关联)
|
|
|
TaskPlanInfoVO planTaskInfoList2 = this.getPlanTaskInfoList(voCW.getBudgetPlanIds(), controlProjectInfos);
|
|
|
if (planTaskInfoList2 != null) {
|