@@ -23,6 +23,7 @@ import com.deepoove.poi.data.Pictures;
import com.deepoove.poi.plugin.table.MultipleRowTableRenderPolicy ;
import digital.laboratory.platform.common.core.constant.CommonConstants ;
import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants ;
import digital.laboratory.platform.common.core.exception.CheckedException ;
import digital.laboratory.platform.common.core.exception.ValidateCodeException ;
import digital.laboratory.platform.common.core.util.ClassUtils ;
import digital.laboratory.platform.common.core.util.R ;
@@ -497,7 +498,12 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
dm . put ( " caseBrief " , caseEvent . getCaseBrief ( ) ) ;
//构造委托部分需要的数据
dm . put ( " clientOrgName " , entrustment . getClientOrgName ( ) ) ; //委托单位
dm . put ( " identificationNo " , entrustment . getAcceptNo ( ) ) ; //受理编 号
// 如果受理编号不为空,则生成[xxxx]x号, 比如2025-8 -》 [2025]8 号
if ( StrUtil . isNotBlank ( entrustment . getAcceptNo ( ) ) ) {
List < String > split = StrUtil . split ( entrustment . getAcceptNo ( ) , " - " ) ;
dm . put ( " identificationNo " , String . format ( " [%s]%s号 " , split . get ( 0 ) , split . get ( 1 ) ) ) ; //受理编号
}
// dm.put("identificationNo", entrustment.getAcceptNo());//受理编号
dm . put ( " year " , entrustment . getEntrustmentTime ( ) ! = null ? entrustment . getEntrustmentTime ( ) . getYear ( ) : LocalDate . now ( ) . getYear ( ) ) ;
dm . put ( " materialDes " , buildMaterialDes ( materialList ) ) ; //检材描述
@@ -799,11 +805,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
EntrustmentIdentificationMaterial material = materialList . get ( 0 ) ;
retSb . append ( " 对检材中是否含有 " )
. append (
DrugLiteConvert . convertDirtyLiteByJSON (
material . getCandidateDrugs ( )
) . stream ( )
. map ( DrugLite : : getName )
. collect ( Collectors . joining ( " 、 " ) )
DrugLiteConvert . joiningDrugListNameToStr ( material . getCandidateDrugs ( ) , " 、 " )
)
. append ( " 成分进行 " )
. append ( AnalysisOptionEnums . fromCode ( material . getAnalysisOption ( ) ) . getChineseName ( ) )
@@ -815,10 +817,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
Collectors . groupingBy ( item - >
item . getAnalysisOption ( ) +
" _ " +
DrugLiteConvert . convertDirtyLiteByJSON ( item . getCandidateDrugs ( ) )
. stream ( )
. map ( DrugLite : : getName )
. collect ( Collectors . joining ( " " ) ) ,
DrugLiteConvert . joiningDrugListNameToStr ( item . getCandidateDrugs ( ) , " " ) ,
LinkedHashMap : : new , // 返回有序map
Collectors . toList ( ) )
) ;
@@ -827,11 +826,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
retSb . append ( " 对1号至 " )
. append ( materialList . size ( ) )
. append ( " 号检材中是否含有 " )
. append ( DrugLiteConvert . convertDirtyLiteByJSON (
material . getCandidateDrugs ( )
) . stream ( )
. map ( DrugLite : : getName )
. collect ( Collectors . joining ( " 、 " ) ) ) ;
. append ( DrugLiteConvert . joiningDrugListNameToStr ( material . getCandidateDrugs ( ) , " 、 " ) ) ;
retSb . append ( " 成分进行 " )
. append ( AnalysisOptionEnums . fromCode ( material . getAnalysisOption ( ) ) . getChineseName ( ) )
. append ( " 检测 " ) ;
@@ -992,7 +987,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
break ;
}
try {
if ( ! ossFile . objectExist ( retBookName ) ) {
if ( ! ossFile . objectExist ( retBookName ) | | entrustment . getStatus ( ) < = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_WAITING_ACCEPT . getStatus ( ) ) {
//不存在就生成一个
if ( ( whatBook . equals ( " identItemBook " ) | | whatBook . equals ( " identfyBook " ) ) & & this . generateIdentifyItemsBook ( entrustId ) ) {
return retBookName ;
@@ -1059,24 +1054,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
return remoteGenerateWordService . genDeliverCertPhoto ( entrustId , acceptNo , caseName , deliverer1Name , deliverer2Name ) ;
}
// @Override
// public String getMaterialMergePhoto(String entrustId, Integer groupCount) {
// //String path=OSSDirectoryConstants.DOCUMENT_ACCEPT_DIRECTORY+"/"+entrustId+"/"+OSSDirectoryConstants.DOCUMENT_ACCEPT_DIRECTORY_DELIVER;
// //先判断如果没有生成,我们就生成,如果生成了,我们就直接取
// Entrustment entrustment = this.getById(entrustId);
// CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId());
// List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService
// .list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
// .eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId()));
// List<String> materialIds = new ArrayList<>();
// materialList.forEach(item -> {
// materialIds.add(item.getId());
// });
// String path = remoteGenerateWordService.genMaterialPhoto(entrustId, materialIds, caseEvent.getCaseName(), entrustment.getAcceptNo(), groupCount);
//
// return path;
// }
//
@Override
public Boolean historyDataToTransSys ( String status , List < String > entrustIds ) {
@@ -1231,21 +1208,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException ( " 委托已经提交, 不能再进行修改 " ) ;
}
// List<UpdateInfo> pis = entrustment.getProcessInfo();
// if (pis == null) {
// pis = new ArrayList<UpdateInfo>();
// }
// if (pis.size() == 0) {
// UpdateInfo pi = new UpdateInfo(dlpUser.getId(),
// dlpUser.getName(),
// dlpUser.getOrgId(),
// dlpUser.getOrgName(),
// "已创建",
// 1, entrustment.getStatus());
// pis.add(pi);
// }
// entrustment.setProcessInfo(pis);
System . out . println ( String . format ( " 保存委托, entrust.getCandidateDrugs()=%s " , entrust . getCandidateDrugs ( ) ) ) ;
@@ -1273,13 +1235,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
UpdateWrapper < Entrustment > updateWrapper = new UpdateWrapper < Entrustment > ( ) ;
updateWrapper . eq ( " id " , entrust . getId ( ) ) ; // 查询条件是 id 相等
// updateWrapper.set("case_id", entrust.getCaseId()); // CaseId 不能修改
// updateWrapper.set("entrustment_no", entrust.getEntrustmentNo()); // EntrustmentNo 不能修改
// updateWrapper.set("process_instance_id", entrust.getProcessInstanceId()); // 不能修改
// updateWrapper.set("entrustment_time", entrust.getEntrustmentTime()); // 不能修改
// updateWrapper.set("client_org_id", entrust.getClientOrgId());
// updateWrapper.set("submitter", entrust.getSubmitter());
// updateWrapper.set("submit_time", entrust.getsubmitTime());
updateWrapper . set ( " client_org_id " , entrust . getClientOrgId ( ) ) ;
updateWrapper . set ( " client_org_name " , entrust . getClientOrgName ( ) ) ;
updateWrapper . set ( " client_address " , entrust . getClientAddress ( ) ) ;
@@ -1364,17 +1319,17 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 检查委托原来的状态
Entrustment entrustment = this . getById ( entrust . getId ( ) ) ;
if ( entrustment = = null ) {
throw new Runtime Exception( String . format ( " 没有找到 id 为 %s 的委托 " , entrust . getId ( ) ) ) ;
throw new Checked Exception( String . format ( " 没有找到 id 为 %s 的委托 " , entrust . getId ( ) ) ) ;
}
if ( entrustment . getStatus ( ) ! = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_CREATED . getStatus ( ) ) {
throw new Runtime Exception( " 委托已经提交, 无须再次提交 " ) ;
throw new Checked Exception( " 委托已经提交, 无须再次提交 " ) ;
}
if ( dlpUser . isStaff ( ) & & dlpUser . HasPermission ( " EntrustmentAidInput " ) ) {
// 是代录员, clientOrgId 由用户提供
if ( StrUtil . isEmpty ( entrust . getClientOrgId ( ) ) ) {
throw new Runtime Exception( " 代录委托必须录入委托单位数据 " ) ;
throw new Checked Exception( " 代录委托必须录入委托单位数据 " ) ;
}
}
@@ -1396,7 +1351,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
entrustment . setCheckCandidateUser ( candidateUser ) ; // 不使用用户提交的候选人名单
} else {
if ( StrUtil . isBlank ( entrust . getCheckCandidateUser ( ) ) ) {
throw new Runtime Exception( " 必须提供审批候选人名单 " ) ;
throw new Checked Exception( " 必须提供审批候选人名单 " ) ;
}
entrustment . setCheckCandidateUser ( entrust . getCheckCandidateUser ( ) ) ; // 使用用户提交的候选人名单
@@ -1419,14 +1374,18 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
pis . add ( pi ) ;
entrustment . setProcessInfo ( pis ) ;
//-- 更新送检员表的信息
if ( org . apache . commons . lang3 . StringUtils. isNotBlank ( entrust . getDeliverer1Name ( ) ) ) {
if ( StringUtils . isNotBlank ( entrust . getDeliverer1Name ( ) ) ) {
Deliverer deliverer1 = getDeliverer1 ( entrust , dlpUser ) ;
remoteDeliverService . renew ( deliverer1 ) ;
} else {
throw new CheckedException ( " 送检人信息不能为空! " ) ;
}
if ( org . apache . commons . lang3 . StringUtils. isNotBlank ( entrust . getDeliverer2Name ( ) ) ) {
if ( StringUtils . isNotBlank ( entrust . getDeliverer2Name ( ) ) ) {
Deliverer deliverer2 = getDeliverer2 ( entrust , dlpUser ) ;
remoteDeliverService . renew ( deliverer2 ) ;
} //-------------------
} else {
throw new CheckedException ( " 送检人信息不能为空! " ) ;
}
entrustment . setDeliverer1Id ( entrust . getDeliverer1Id ( ) ) ;
entrustment . setDeliverer1Cert ( entrust . getDeliverer1Cert ( ) ) ;
entrustment . setDeliverer1Name ( entrust . getDeliverer1Name ( ) ) ;
@@ -1447,7 +1406,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
. eq ( " entrustment_id " , entrustment . getId ( ) )
. orderByAsc ( " create_time " ) ) ;
if ( materialList = = null | | materialList . size ( ) = = 0 ) {
throw new Runtime Exception( " 请至少添加一个检材后再提交! " ) ;
throw new Checked Exception( " 请至少添加一个检材后再提交! " ) ;
}
if ( StrUtil . isBlank ( entrust . getEntrustRequirement ( ) ) ) {
entrustment . setEntrustRequirement ( this . buildEntrustReq ( materialList ) ) ;
@@ -1586,23 +1545,27 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 审核任务已经提交了, 转到新的环节
int newStatus = - 1 ; // 新的状态(环节)
{
newStatus = ProcessFlowMapper . getNextStatus ( entrustment . getStatus ( ) , opCode ) ;
String currentAcceptNo = " " ;
if ( opCode = = 1 ) {
}
if ( newStatus = = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_CREATED . getStatus ( ) ) {
EntrustmentIdentificationMaterial im = new EntrustmentIdentificationMaterial ( ) ;
im . setCheckPassed ( 0 ) ;
im . setApprovePassed ( 0 ) ;
im . setAcceptPassed ( 0 ) ;
im . setAcceptNo ( null ) ;
entrustmentIdentificationMaterialService . setEntrustmentIdentificationMaterialStatusByEntrustment ( im , entrustment . getId ( ) ) ;
}
newStatus = ProcessFlowMapper . getNextStatus ( entrustment . getStatus ( ) , opCode ) ;
if ( opCode = = 1 & & StrUtil . isBlank ( entrustment . getAcceptNo ( ) ) ) {
// 20250114 贵阳需求,审核通过后就生成受理编号
String yearStr = String . valueOf ( LocalDateTime . now ( ) . getYear ( ) ) ;
String maxEntrustAcceptNo = baseMapper . getMaxEntrustAcceptNo ( yearStr ) ;
currentAcceptNo = yearStr + " - " + ( StrUtil . isBlank ( maxEntrustAcceptNo ) ? " 1 " : ( Integer . parseInt ( maxEntrustAcceptNo ) + 1 ) ) ;
}
if ( newStatus = = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_CREATED . getStatus ( ) ) {
EntrustmentIdentificationMaterial im = new EntrustmentIdentificationMaterial ( ) ;
im . setCheckPassed ( 0 ) ;
im . setApprovePassed ( 0 ) ;
im . setAcceptPassed ( 0 ) ;
im . setAcceptNo ( null ) ;
entrustmentIdentificationMaterialService . setEntrustmentIdentificationMaterialStatusByEntrustment ( im , entrustment . getId ( ) ) ;
}
//退回后需标记
if ( opCode = = - 1 ) {
entrustment . setReturnOrNot ( - 1 ) ;
@@ -1611,18 +1574,18 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//-------------------
// 更新数据库表数据
//-------------------
entrustment. setDestructiveAnalysis( entrust. getDestructiveAnalysis( ) ) ;
entrustment. setOtherIdentificationNotes( entrust. getOtherIdentificationNotes( ) ) ;
// entrustment. setDestructiveAnalysis( entrust. getDestructiveAnalysis()) ;
// entrustment. setOtherIdentificationNotes( entrust. getOtherIdentificationNotes()) ;
//entrustment.setOtherAgreement(entrust.getOtherAgreement());
entrustment. setAvoidIdentifier( entrust. getAvoidIdentifier( ) ) ;
entrustment. setComments( entrust. getComments( ) ) ;
// entrustment. setAvoidIdentifier( entrust. getAvoidIdentifier()) ;
// entrustment. setComments( entrust. getComments()) ;
entrustment. setCheckUser( dlpUser. getId ( ) ) ;
entrustment. setCheckTime( LocalDateTime. now ( ) ) ;
entrustment. setCheckComments( entrust. getCheckComments( ) ) ;
entrustment. setCheckTimes( entrustment. getCheckTimes( ) + 1 ) ; // 审核次数加 1
entrustment. setPreviousStatus( entrustment. getStatus( ) ) ; // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
entrustment. setStatus( newStatus) ; // 新的状态(环节), 可能会是审批或提交前
// entrustment. setCheckUser( dlpUser.getId()) ;
// entrustment. setCheckTime( LocalDateTime.now()) ;
// entrustment. setCheckComments( entrust. getCheckComments()) ;
// entrustment. setCheckTimes( entrustment. getCheckTimes() + 1); // 审核次数加 1
// entrustment. setPreviousStatus( entrustment. getStatus()); // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
// entrustment. setStatus( newStatus); // 新的状态(环节), 可能会是审批或提交前
List < UpdateInfo > pis = entrustment . getProcessInfo ( ) ;
if ( pis = = null ) {
@@ -1647,28 +1610,28 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
pis . add ( pi ) ;
}
entrustment. setProcessInfo( pis ) ;
// entrustment. setProcessInfo(pis) ;
UpdateWrapper < Entrustment > updateWrapper = new UpdateWrapper < Entrustment > ( ) ;
updateWrapper . eq ( " id " , entrustment . getId ( ) ) ; // 查询条件是 id 相等
updateWrapper . set ( " destructive_analysis " , entrustment . getDestructiveAnalysis ( ) ) ;
updateWrapper . set ( " other_identification_notes " , entrustment . getOtherIdentificationNotes ( ) ) ;
updateWrapper . set ( " destructive_analysis " , entrust . getDestructiveAnalysis ( ) ) ;
updateWrapper . set ( " other_identification_notes " , entrust . getOtherIdentificationNotes ( ) ) ;
updateWrapper . set ( " other_agreement " , entrustment . getOtherAgreement ( ) ) ;
updateWrapper . set ( " avoid_identifier " , entrustment . getAvoidIdentifier ( ) , " typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( " comments " , entrustment . getComments ( ) ) ;
updateWrapper . set ( " avoid_identifier " , entrust . getAvoidIdentifier ( ) , " typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( " comments " , entrust . getComments ( ) ) ;
updateWrapper . set ( " return_or_not " , entrustment . getReturnOrNot ( ) ) ;
updateWrapper . set ( " check_user " , entrustment . getCheckUser ( ) ) ;
updateWrapper . set ( " check_time " , entrustment . getCheckTime ( ) ) ;
updateWrapper . set ( " check_comments " , entrustment . getCheckComments ( ) ) ;
updateWrapper . set ( " check_times " , entrustment . getCheckTimes ( ) ) ;
updateWrapper . set ( " check_user " , dlpUser . getId ( ) ) ;
updateWrapper . set ( " check_time " , LocalDateTime . now ( ) ) ;
updateWrapper . set ( " check_comments " , entrust . getCheckComments ( ) ) ;
updateWrapper . set ( " check_times " , entrustment . getCheckTimes ( ) + 1 ) ; // 审核次数加 1
updateWrapper . set ( " approve_candidate_user " , entrustment . getApproveCandidateUser ( ) ) ;
updateWrapper . set ( " status " , entrustment . getStatus ( ) ) ;
updateWrapper . set ( " previous_status " , entrustment . getPrevious Status ( ) ) ;
updateWrapper . set ( " status " , newStatus ) ; // 新的状态(环节), 可能会是审批或提交前
updateWrapper . set ( " previous_status " , entrustment . getStatus ( ) ) ; // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
// updateWrapper.set("process_info", entrustment.getProcessInfo(), "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler");
updateWrapper . set ( " process_info " , entrustment . getProcessInfo ( ) , " javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( " process_info " , pis , " javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( StrUtil . isNotBlank ( currentAcceptNo ) , " accept_no " , currentAcceptNo ) ;
if ( ! this . update ( null , updateWrapper ) ) {
throw new RuntimeException ( " 保存委托信息失败 " ) ;
}
@@ -2120,8 +2083,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 转换临时目录中的 word 文档为 PDF
String pdfFilePath = OSSDirectoryConstants . DOCUMENT_ENTRUSTMENT_DIRECTORY + " / " + ev . getId ( ) + " / " + entrustmentLetterFileName + " .docx " ;
try {
//这里加一下判断条件,由于贵阳市局这里的情况是审核的时候就需要查看委托书,所以为了保证每一次提交过来的委托都是最新的,所以在审核 通过以前应该每次查看都是重新生成
if ( ! ossFile . objectExist ( pdfFilePath ) | | ev . getStatus ( ) < EntrustmentStatusConstants . ENTRUSTMENT_STATUS_WAITING_CONFIRM . getStatus ( ) ) {
//这里加一下判断条件,由于贵阳市局这里的情况是审核的时候就需要查看委托书,所以为了保证每一次提交过来的委托都是最新的,所以在受理 通过以前应该每次查看都是重新生成
if ( ! ossFile . objectExist ( pdfFilePath ) | | ev . getStatus ( ) < = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_WAITING_ACCEPT . getStatus ( ) ) {
GenerateEntrustmentLetterPDF ( ev ) ;
return pdfFilePath ;
}
@@ -2184,6 +2147,11 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException ( " 保存委托日期失败 " ) ;
}
}
// 如果受理编号不为空,则生成[xxxx]x号, 比如2025-8 -》 [2025]8号
if ( StrUtil . isNotBlank ( ev . getAcceptNo ( ) ) ) {
List < String > split = StrUtil . split ( ev . getAcceptNo ( ) , " - " ) ;
dm . put ( " acceptNo " , String . format ( " [%s]%s号 " , split . get ( 0 ) , split . get ( 1 ) ) ) ;
}
String oldIdentificationResult = ev . getOldIdentificationResult ( ) ;
String oldIdentification = " " ;
switch ( oldIdentificationResult ) {
@@ -2328,28 +2296,19 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//-------------------
// 更新数据库表数据
//-------------------
entrustment . setDestructiveAnalysis ( entrust . getDestructiveAnalysis ( ) ) ;
entrustment . setOtherIdentificationNotes ( entrust . getOtherIdentificationNotes ( ) ) ;
entrustment . setAvoidIdentifier ( entrust . getAvoidIdentifier ( ) ) ;
entrustment . setOtherAgreement ( entrust . getOtherAgreement ( ) ) ;
entrustment . setComments ( entrust . getComments ( ) ) ;
entrustment . setAcceptUser ( null ) ; // 之前可能受理过, 现在后悔了, 置 null
entrustment . setAcceptTime ( null ) ; // 之前可能受理过, 现在后悔了, 置 null
entrustment . setAcceptComments ( entrust . getAcceptComments ( ) ) ;
UpdateWrapper < Entrustment > updateWrapper = new UpdateWrapper < Entrustment > ( ) ;
updateWrapper . eq ( " id " , entrustment . getId ( ) ) ; // 查询条件是 id 相等
updateWrapper . set ( " destructive_analysis " , entrustment . getDestructiveAnalysis ( ) ) ;
updateWrapper . set ( " other_identification_notes " , entrustment . getOtherIdentificationNotes ( ) ) ;
updateWrapper . set ( " avoid_identifier " , entrustment . getAvoidIdentifier ( ) , " typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( " other_agreement " , entrustment . getOtherAgreement ( ) ) ;
updateWrapper . set ( " comments " , entrustment . getComments ( ) ) ;
updateWrapper . set ( " destructive_analysis " , entrust . getDestructiveAnalysis ( ) ) ;
updateWrapper . set ( " other_identification_notes " , entrust . getOtherIdentificationNotes ( ) ) ;
updateWrapper . set ( " avoid_identifier " , entrust . getAvoidIdentifier ( ) , " typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler " ) ;
updateWrapper . set ( " other_agreement " , entrust . getOtherAgreement ( ) ) ;
updateWrapper . set ( " comments " , entrust . getComments ( ) ) ;
updateWrapper . set ( " accept_user " , entrustment . getAcceptUser ( ) ) ;
updateWrapper . set ( " accept_time " , entrustment . getAcceptTime ( ) ) ;
updateWrapper . set ( " accept_comments " , entrustment . getAcceptComments ( ) ) ;
updateWrapper . set ( " accept_user " , null ) ; // 之前可能受理过, 现在后悔了, 置 null
updateWrapper . set ( " accept_time " , null ) ;
updateWrapper . set ( " accept_comments " , entrust . getAcceptComments ( ) ) ;
if ( ! this . update ( null , updateWrapper ) ) {
@@ -2367,7 +2326,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
@Override
@GlobalTransactional
public Entrustment bizAccept_Apply ( Entrustment entrust , Integer opCode , DLPUser dlpUser ) {
String newEntrustAcceptNo = " " ;
// 20250114 贵阳禁毒需求,受理编号在提交审核时就生成
// String newEntrustAcceptNo = "";
if ( opCode = = null ) {
throw new RuntimeException ( String . format ( " 受理必须提供 opCode " ) ) ;
}
@@ -2436,15 +2396,15 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
}
}
//从检材中取出委托的受理号
String materialAcceptNo = imList . get ( 0 ) . getAcceptNo ( ) ;
// 3-26 如果是大数据平台同步的委托,那么我们在受理完成的时候先生成一个空的受理编号,最后在同步大数据平台信息的时候会把这个编号赋值过去
// newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
entrustmentIdentificationMaterialService. getNewIdentificationMaterialNo( newEntrustAcceptNo) ;
if ( entrustment. getDataSources( ) ! = 1 ) {
newEntrustAcceptNo = materialAcceptNo. substring( 0 , materialAcceptNo. lastIndexOf( " - " ) ) ;
} else {
newEntrustAcceptNo = " acceptNo" ;
}
// String materialAcceptNo = imList.get(0).getAcceptNo(); 20250114
// // 3-26 如果是大数据平台同步的委托,那么我们在受理完成的时候先生成一个空的受理编号,最后在同步大数据平台信息的时候会把这个编号赋值过去
//// newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
// entrustmentIdentificationMaterialService. getNewIdentificationMaterialNo( newEntrustAcceptNo) ;
// if ( entrustment. getDataSources() != 1) {
// newEntrustAcceptNo = materialAcceptNo. substring(0, materialAcceptNo. lastIndexOf("-")) ;
// } else {
// newEntrustAcceptNo = " acceptNo" ;
// }
}
int newStatus = ProcessFlowMapper . getNextStatus ( entrustment . getStatus ( ) , opCode ) ;
@@ -2513,12 +2473,12 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
entrustment . setProcessInfo ( pis ) ;
//上面注释的代码前面已经设置过,不需要再设置一次,直接更新
if ( StringUtils. isNotBlank( newEntrustAcceptNo) ) {
entrustment. setAcceptNo( newEntrustAcceptNo) ; //设置受理编号
}
if ( ! StringUtils. isNotBlank( newEntrustAcceptNo) & & opCode = = 1 ) {
throw new RuntimeException( " 受理编号不能为空 " ) ;
}
// if ( StringUtils. isNotBlank( newEntrustAcceptNo)) { 20250114
// entrustment. setAcceptNo( newEntrustAcceptNo); //设置受理编号
// }
// if (! StringUtils. isNotBlank( newEntrustAcceptNo) && opCode == 1) {
// throw new RuntimeException("受理编号不能为空") ;
// }
entrustment . setIsTrans ( 1 ) ; //如果是通过我们系统进行受理,就让他不能再手动流转了
if ( ! this . updateById ( entrustment ) ) {
throw new RuntimeException ( " 保存委托信息失败 " ) ;
@@ -2660,7 +2620,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//如果文件不存在, 则生成, 否则直接从OSS中获取
//if (!ossFile.objectExist(pdfFilePath)) {
//这里加一个判断,由于贵阳市局的确认书需要在审核的时候就能打印出来,为了保证每一次生成的确认书都是委托单位提交过来的最新版,所以我们在审核通过之前,每一次生成委托书都应该重新生成,审核成功以后就不用再重新生成了
if ( ! ossFile . objectExist ( downFile ) | | ev . getStatus ( ) < EntrustmentStatusConstants . ENTRUSTMENT_STATUS_WAITING_CONFIRM . getStatus ( ) ) {
if ( ! ossFile . objectExist ( downFile ) | | ev . getStatus ( ) < = EntrustmentStatusConstants . ENTRUSTMENT_STATUS_WAITING_ACCEPT . getStatus ( ) ) {
if ( this . generateIdentifyItemsBook ( ev . getId ( ) ) ) {
ossFile . fileGet ( downFile , httpServletResponse . getOutputStream ( ) ) ;