|
|
|
@ -18,9 +18,11 @@ import com.xujie.sys.modules.erf.mapper.ErfExpApplyMapper; |
|
|
|
import com.xujie.sys.modules.erf.mapper.ErfFlowInstanceMapper; |
|
|
|
import com.xujie.sys.modules.erf.mapper.ErfFlowNodeInstanceMapper; |
|
|
|
import com.xujie.sys.modules.erf.service.ErfExpApplyService; |
|
|
|
import com.xujie.sys.modules.erf.service.ErfExpRawMaterialService; |
|
|
|
import com.xujie.sys.modules.erf.service.ErfFlowEngineService; |
|
|
|
import com.xujie.sys.modules.erf.entity.ErfFlowApproveLog; |
|
|
|
import com.xujie.sys.modules.erf.mapper.ErfFlowApproveLogMapper; |
|
|
|
import com.xujie.sys.modules.erf.service.ErfTriConfirmService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -66,7 +68,10 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
private ErfFlowApproveLogMapper erfFlowApproveLogMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private com.xujie.sys.modules.erf.service.ErfTriConfirmService erfTriConfirmService; |
|
|
|
private ErfTriConfirmService erfTriConfirmService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ErfExpRawMaterialService erfExpRawMaterialService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private JdbcTemplate jdbcTemplate; |
|
|
|
@ -418,7 +423,7 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
|
|
|
|
// 9. 最后删除申请单主表 |
|
|
|
this.removeById(applyNo); |
|
|
|
|
|
|
|
|
|
|
|
log.info("=== 删除申请单完成 === 申请单号: {}", applyNo); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1231,7 +1236,7 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String copyExpApply(String sourceApplyNo, Boolean copyTriConfirm, Boolean copyAttachment, Long currentUserId) { |
|
|
|
public String copyExpApply(String sourceApplyNo, Boolean copyTriConfirm, Boolean copyAttachment,Boolean copyRawMaterialList, Long currentUserId) { |
|
|
|
log.info("=== 开始复制申请单 === 源申请单号: {}, 复制三方确认: {}, 复制附件: {}", |
|
|
|
sourceApplyNo, copyTriConfirm, copyAttachment); |
|
|
|
|
|
|
|
@ -1295,6 +1300,16 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
// 不抛出异常,继续执行 |
|
|
|
} |
|
|
|
} |
|
|
|
// 9. 复制原材料清单 |
|
|
|
if (Boolean.TRUE.equals(copyRawMaterialList)) { |
|
|
|
try { |
|
|
|
erfExpRawMaterialService.copyRawMaterialList(sourceApplyNo, newApplyNo); |
|
|
|
log.info("原材料清单复制成功"); |
|
|
|
} catch (Exception e) { |
|
|
|
log.warn("复制原材料清单失败: {}", e.getMessage()); |
|
|
|
// 不抛出异常,继续执行 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.info("=== 复制申请单完成 === 新申请单号: {}", newApplyNo); |
|
|
|
return newApplyNo; |
|
|
|
@ -1303,7 +1318,7 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
/** |
|
|
|
* 复制附件 |
|
|
|
* 使用OSS系统(sys_oss表) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param sourceApplyNo 源申请单号 |
|
|
|
* @param targetApplyNo 目标申请单号 |
|
|
|
*/ |
|
|
|
@ -1316,9 +1331,9 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
" order_reftype, conclusion, c_additional_info, project_ispush " + |
|
|
|
"FROM sys_oss " + |
|
|
|
"WHERE order_ref1 = ? AND order_ref2 = ? AND order_ref6 = ?"; |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> attachments = jdbcTemplate.queryForList(sql, "ERF", sourceApplyNo, "EXP_APPLY"); |
|
|
|
|
|
|
|
|
|
|
|
if (attachments.isEmpty()) { |
|
|
|
log.info("源申请单没有附件,跳过复制"); |
|
|
|
return; |
|
|
|
@ -1330,7 +1345,7 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
" order_ref1, order_ref2, order_ref3, order_ref4, order_ref5, order_ref6, " + |
|
|
|
" file_suffix, file_type_code, order_reftype, conclusion, c_additional_info, project_ispush) " + |
|
|
|
"VALUES (?, GETDATE(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; |
|
|
|
|
|
|
|
|
|
|
|
for (Map<String, Object> attachment : attachments) { |
|
|
|
jdbcTemplate.update(insertSql, |
|
|
|
attachment.get("url"), |
|
|
|
|