@ -28,12 +28,15 @@ import org.springblade.desk.basic.constant.BaseValue;
import org.springblade.desk.basic.mapper.OemMapper ;
import org.springblade.desk.basic.pojo.entity.CenterTeam ;
import org.springblade.desk.basic.pojo.entity.Oem ;
import org.springblade.desk.basic.pojo.entity.TeamSet ;
import org.springblade.desk.basic.service.ICenterTeamService ;
import org.springblade.desk.basic.service.IPlatingService ;
import org.springblade.desk.basic.service.ITeamSetService ;
import org.springblade.desk.basic.util.IdUtil ;
import org.springblade.desk.basic.util.StatusCountMap ;
import org.springblade.desk.dashboard.pojo.entity.* ;
import org.springblade.desk.dashboard.service.IBsProcessSetService ;
import org.springblade.desk.dashboard.service.IBsTeamSetService ;
import org.springblade.desk.dashboard.service.IDsPartService ;
import org.springblade.desk.dashboard.service.IDsPartVersionService ;
import org.springblade.desk.device.pojo.entity.EquipmentEntity ;
@ -50,6 +53,7 @@ import org.springblade.desk.produce.mapper.WorkPlanMapper;
import org.springblade.desk.produce.pojo.dto.* ;
import org.springblade.desk.produce.pojo.entity.* ;
import org.springblade.desk.produce.pojo.vo.MakeRecExpandVO ;
import org.springblade.desk.produce.pojo.vo.ProduceMonitorFileSlotVO ;
import org.springblade.desk.produce.pojo.vo.ProduceMonitorSlotListVO ;
import org.springblade.desk.produce.pojo.vo.WorkPlanExpandVO ;
import org.springblade.desk.produce.service.* ;
@ -57,6 +61,7 @@ import org.springblade.desk.quality.constant.InspectionItemConst;
import org.springblade.desk.quality.constant.InspectionTaskConst ;
import org.springblade.desk.quality.constant.ReviewSheetConst ;
import org.springblade.desk.quality.excel.InspectionTaskExcel ;
import org.springblade.desk.quality.mapper.AuditFileMapper ;
import org.springblade.desk.quality.mapper.InspectionTaskMapper ;
import org.springblade.desk.quality.pojo.entity.* ;
import org.springblade.desk.quality.pojo.request.InspectionTaskSearch ;
@ -64,7 +69,7 @@ import org.springblade.desk.quality.pojo.request.InspectionTaskStartNew;
import org.springblade.desk.quality.pojo.vo.* ;
import org.springblade.desk.quality.service.* ;
import org.springblade.desk.quality.wrapper.InspectionTaskListWrapper ;
import org.springblade.scheduling.pojo.entity.WorkPlanEntity ;
import org.springblade.erpdata.feign.IErpDataCheckerSealClient ;
import org.springblade.system.feign.IDictClient ;
import org.springblade.system.feign.IUserClient ;
import org.springblade.system.pojo.entity.User ;
@ -74,6 +79,8 @@ import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service ;
import org.springframework.transaction.annotation.Transactional ;
import java.math.BigDecimal ;
import java.math.RoundingMode ;
import java.time.LocalDateTime ;
import java.time.format.DateTimeFormatter ;
import java.util.* ;
@ -147,6 +154,22 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
private IWorkPlanItemService workPlanItemService ;
@Resource
private IMakeRecService makeRecService ;
@Resource
private AuditFileMapper auditFileMapper ;
@Resource
private ITeamSetService teamSetService ;
@Resource
private IWorkPlanItemDetailService workPlanItemDetailService ;
@Resource
private final IErpDataCheckerSealClient erpDataCheckerSealClient ;
@Resource
private final IBsTeamSetService bsTeamSetService ;
@Resource
private final IMacToolUseService macToolUseService ;
@Resource
private final IMesQcProduceRunService qcProduceRunService ;
@Resource
private final IBsProcessSetService bsProcessSetService ;
@Override
@ -654,20 +677,20 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
}
if ( moduleList . get ( 0 ) ) {
// 头记录
JSONObject modelJson = buildModelOne ( wo , yo , dsPart ) ;
jsonObj . put ( "modelOne" , modelJson ) ;
JSONObject modelOne = buildModelOne ( wo , yo , dsPart ) ;
jsonObj . put ( "modelOne" , modelOne ) ;
}
// 检验记录
if ( moduleList . get ( 1 ) ) {
JSONObject modelJson1 = new JSONObject ( ) ;
JSONObject modelThree = new JSONObject ( ) ;
List < JSONObject > checkList = this . getCheckListNotNG ( woId , wpList , true ) ;
modelJson1 . put ( "checkList" , checkList ) ;
jsonObj . put ( "modelThree" , modelJson1 ) ;
modelThree . put ( "checkList" , checkList ) ;
jsonObj . put ( "modelThree" , modelThree ) ;
}
List < JSONObject > modelTwoList = this . buildModelTwo ( wpList , planList ) ;
jsonObj . put ( "modelTwo" , modelTwoList ) ;
List < JSONObject > modelTwo = this . buildModelTwo ( wo , yo , dsPart , wpList , planList ) ;
jsonObj . put ( "modelTwo" , modelTwo ) ;
if ( moduleList . get ( 2 ) ) {
// 镀后入库记录
@ -682,6 +705,7 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
/ * *
* 构建modelOne
*
* @param wo
* @param yo
* @param dsPart
@ -692,7 +716,7 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
JSONObject yoJson = new JSONObject ( ) ;
JSONObject partJson = new JSONObject ( ) ;
JSONObject modelJson = new JSONObject ( ) ;
if ( dsPart ! = null ) {
if ( dsPart ! = null ) {
partJson . put ( "partCode" , dsPart . getPartCode ( ) ) ;
partJson . put ( "partName" , dsPart . getPartName ( ) ) ;
partJson . put ( "hardness" , dsPart . getHardness ( ) ) ;
@ -700,15 +724,22 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
partJson . put ( "material" , dsPart . getMaterial ( ) ) ;
partJson . put ( "cruxMemo" , dsPart . getKeyInfo ( ) ) ;
partJson . put ( "memo" , dsPart . getRemarks ( ) ) ;
partJson . put ( "area" , dsPart . getArea ( ) ) ;
if ( dsPart . getArea ( ) ! = null ) {
partJson . put ( "area" , roundToSixDecimalPlaces ( dsPart . getArea ( ) ) ) ;
}
}
if ( yo ! = null ) {
if ( yo ! = null ) {
yoJson . put ( "productType" , yo . getProductType ( ) ) ;
yoJson . put ( "prodIdent" , yo . getProductIdent ( ) ) ;
yoJson . put ( "poQty" , yo . getYpQty ( ) ) ;
yoJson . put ( "poArea" , yo . getYpArea ( ) ) ;
if ( yo . getYpArea ( ) ! = null ) {
yoJson . put ( "poArea" , roundToSixDecimalPlaces ( yo . getYpArea ( ) ) ) ;
}
yoJson . put ( "primaryCraft" , yo . getPrimaryCraft ( ) ) ;
}
if ( wo ! = null ) {
if ( wo ! = null ) {
woJson . put ( "batchNo" , wo . getBatchNo ( ) ) ;
}
woJson . put ( "pjYieldOrder" , yoJson ) ;
@ -717,13 +748,28 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
return modelJson ;
}
/ * *
* double保留6为小数 , 四舍五入
*
* @param num
* @return
* /
private double roundToSixDecimalPlaces ( Double num ) {
// 防止double精度问题,先转为BigDecimal
BigDecimal bigDecimal = new BigDecimal ( Double . toString ( num ) ) ;
// 设置保留6位小数,四舍五入模式
bigDecimal = bigDecimal . setScale ( 6 , RoundingMode . HALF_UP ) ;
return bigDecimal . doubleValue ( ) ;
}
/ * *
* 构建modelTwo
*
* @param wpList
* @param modelFlag
* @return
* /
private List < JSONObject > buildModelTwo ( List < WorkPlanExpandVO > wpList , List < Boolean > modelFlag ) {
private List < JSONObject > buildModelTwo ( WorkOrder wo , YieldOrder yo , DsPartEntity dsPart , List < WorkPlanExpandVO > wpList , List < Boolean > modelFlag ) {
if ( wpList = = null | | wpList . size ( ) = = 0 ) {
return null ;
}
@ -740,36 +786,27 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
tankInfo . put ( "pdjArea" , null ) ;
tankInfo . put ( "gjArea" , null ) ;
modelTwo . put ( "orders" , prWorkPlan . getOrders ( ) ) ;
modelTwo . put ( "papers" , prWorkPlan . getPapers ( ) ) ;
modelTwo . put ( "createMan" , prWorkPlan . getCreateMan ( ) ) ;
modelTwo . put ( "factEndTime" , prWorkPlan . getFactEndTime ( ) ) ;
modelTwo . put ( "papers" , prWorkPlan . getPapers ( ) ) ;
modelTwo . put ( "referenceFile" , prWorkPlan . getReferenceFile ( ) ) ;
modelTwo . put ( "procedureSet" , procedureSet ) ;
modelTwo . put ( "slotList" , slotList ) ;
modelTwo . put ( "tankInfo" , tankInfo ) ;
List < MesRbFilePreserveSlotEntity > dsRbFilePreserveSlotList = new ArrayList < > ( ) ;
List < ProduceMonitorFileSlotVO > dsRbFilePreserveSlotList = new ArrayList < > ( ) ;
if ( WorkPlan . PRINT_TYPE_PROCESS . equals ( prWorkPlan . getPrintType ( ) ) ) {
// 同槽信息(从设备,工装使用记录获取)
List < ProduceMonitorSlotListVO > slotVOList = null ;
//zxh 20250626 增加固溶工序同炉数据
if ( "固溶" . equals ( prWorkPlan . getPpsName ( ) ) ) {
slotVOList = workPlanMapper . listSlotInfoGr ( prWorkPlan . getId ( ) , Boolean . FALSE ) ;
} else {
slotVOList = workPlanMapper . listSlotInfoList ( prWorkPlan . getId ( ) , Boolean . TRUE ) ;
if ( slotVOList = = null | | slotVOList . size ( ) = = 0 ) {
slotVOList = workPlanMapper . listSlotInfoList ( prWorkPlan . getId ( ) , Boolean . FALSE ) ;
}
}
List < ProduceMonitorSlotListVO > slotVOList = macToolUseService . listSlotInfo ( prWorkPlan ) ;
if ( CollectionUtils . isNotEmpty ( slotVOList ) ) {
for ( ProduceMonitorSlotListVO slot : slotVOList ) {
JSONObject slotJson = new JSONObject ( ) ;
slotJson . put ( "mtuCode" , slot . getMtu Code ( ) ) ;
slotJson . put ( "mtuCode" , slot . getMtnCode ( ) ) ;
slotJson . put ( "partCode" , slot . getPartCode ( ) ) ;
slotJson . put ( "batchNo" , slot . getBatchNo ( ) ) ;
slotJson . put ( "workQty" , slot . getWorkQty ( ) ) ;
slotJson . put ( "prodIdent" , slot . getProdIdent ( ) ) ;
slotJson . put ( "area" , slot . getArea ( ) ) ;
slotJson . put ( "totalArea" , slot . getTotal Area ( ) ) ;
slotJson . put ( "totalArea" , slot . getSum Area ( ) ) ;
slotList . add ( slotJson ) ;
}
}
@ -786,8 +823,8 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
List < FeiBaSetEntity > basList = feiBaSetService . listByIds ( bas ) ;
List < EquipmentEntity > cardList = mesEquipmentCardService . listByIds ( cards ) ;
// 设备编号
String gj = StringUtils . join ( rackList . stream ( ) . filter ( j - > j . getRsTyp e ( ) ! = null ) . map ( j - > j . getRsTyp e ( ) ) . collect ( Collectors . toList ( ) ) , "'、'" ) ;
String fb = StringUtils . join ( basList . stream ( ) . filter ( j - > j . getFsTyp e ( ) ! = null ) . map ( j - > j . getFsTyp e ( ) ) . collect ( Collectors . toList ( ) ) , "、" ) ;
String gj = StringUtils . join ( rackList . stream ( ) . filter ( j - > j . getRsCod e ( ) ! = null ) . map ( j - > j . getRsCod e ( ) ) . collect ( Collectors . toList ( ) ) , "'、'" ) ;
String fb = StringUtils . join ( basList . stream ( ) . filter ( j - > j . getFsCod e ( ) ! = null ) . map ( j - > j . getFsCod e ( ) ) . collect ( Collectors . toList ( ) ) , "、" ) ;
String eq = StringUtils . join ( cardList . stream ( ) . filter ( j - > j . getDeviceCode ( ) ! = null ) . map ( j - > j . getDeviceCode ( ) ) . collect ( Collectors . toList ( ) ) , "、" ) ;
modelTwo . put ( "gjCode" , gj ) ;
modelTwo . put ( "fbCode" , fb ) ;
@ -823,10 +860,37 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
// 如果是荧光检测工序,需要返回报工人签章图片
if ( "荧光检测" . equals ( prWorkPlan . getPpsName ( ) ) ) {
if ( makeRec ! = null ) {
String checkManByNewErpMes = workPlanMapper . getCheckManByNewErpMes ( makeRec . getWorkerAccount ( ) ) ;
String checkManByNewErpMes = erpDataCheckerSealClient . getCheckManByNewErpMes ( makeRec . getWorkerName ( ) ) ;
modelTwo . put ( "workerImgUrl" , checkManByNewErpMes ) ;
}
}
if ( StringUtils . isEmpty ( prWorkPlan . getPapers ( ) ) | | StringUtils . isEmpty ( prWorkPlan . getReferenceFile ( ) ) ) {
AuditFile auditFile = null ;
if ( "涂色标" . equals ( prWorkPlan . getPpsName ( ) ) | | "喷砂" . equals ( prWorkPlan . getPpsName ( ) ) ) {
auditFile = auditFileMapper . getByPpsId ( prWorkPlan . getPpsId ( ) ) ;
} else {
if ( wo . getTsId ( ) ! = null ) {
TeamSet teamSet = teamSetService . getById ( wo . getTsId ( ) ) ;
String productApplicationArea = null ;
if ( teamSet ! = null ) {
if ( dsPart ! = null ) {
productApplicationArea = dsPart . getProductApplicationArea ( ) ;
}
String productIdent = yo . getProductIdent ( ) ;
if ( StringUtils . isNotEmpty ( productApplicationArea ) & & StringUtils . isNotEmpty ( productIdent ) ) {
auditFile = auditFileMapper . getDataByPpsIdAndApplyArea ( prWorkPlan . getPpsId ( ) , teamSet . getWcId ( ) , productApplicationArea , productIdent , prWorkPlan . getCaId ( ) ) ;
}
if ( StringUtils . isNotEmpty ( productIdent ) & & auditFile = = null ) {
auditFile = auditFileMapper . getDataByPpsIdAndPqName ( prWorkPlan . getPpsId ( ) , teamSet . getWcId ( ) , productIdent , prWorkPlan . getCaId ( ) ) ;
}
}
}
}
if ( auditFile ! = null ) {
modelTwo . put ( "papers" , auditFile . getPapers ( ) ) ;
modelTwo . put ( "referenceFile" , auditFile . getReferenceFile ( ) ) ;
}
}
modelTwoList . add ( modelTwo ) ;
}
}
@ -835,110 +899,91 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
/ * *
* 构建dsRbFilePreserveSlotList
*
* @param workPlan
* @return
* /
private List < MesRbFilePreserveSlotEntity > buildDsRbFilePreserveSlotList ( WorkPlanExpandVO workPlan ) {
List < MesRbFilePreserveSlotEntity > dsRbFilePreserveSlotList = new ArrayList < > ( ) ;
QueryWrapper < CenterTeam > qwteam = new QueryWrapper < > ( ) ;
qwteam . eq ( "TS_ID" , workPlan . getMakeTeam ( ) ) ;
List < CenterTeam > teamList = centerTeamService . list ( qwteam ) ;
CenterTeam bsCenterTeam = null ;
if ( teamList ! = null & & teamList . size ( ) > 0 ) {
bsCenterTeam = teamList . get ( 0 ) ;
}
if ( bsCenterTeam ! = null & & bsCenterTeam . getWcId ( ) ! = null ) {
private List < ProduceMonitorFileSlotVO > buildDsRbFilePreserveSlotList ( WorkPlanExpandVO workPlan ) {
List < MesQcProduceRunEntity > qcProduceRunsList ;
List < ProduceMonitorFileSlotVO > dsRbFilePreserveSlotList = new ArrayList < > ( ) ;
BsTeamSetEntity bsTeamSet = bsTeamSetService . getById ( workPlan . getMakeTeam ( ) ) ;
if ( bsTeamSet ! = null ) {
MacToolUse prMacToolUse ;
List < MesRbFilePreserveSlotEntity > preserveSlotList ;
List < MesQcProduceRunEntity > qcProduceRunsList ;
MesQcProduceRunEntity boxInfo = new MesQcProduceRunEntity ( ) ;
MesQcProduceRunEntity boxInfo ;
// 根据电子档案维护组装数据(上线前) 分槽
List < MacToolUse > dataByWpIdAndIndexList = workPlanMapper . getDataByWpIdAndIndexList ( workPlan . getId ( ) , "1" ) ;
if ( dataByWpIdAndIndexList ! = null & & dataByWpIdAndIndexList . size ( ) > 0 ) {
List < MacToolUse > dataByWpIdAndIndexList = macToolUseService . getDataByWpIdAndIndexList ( workPlan . getId ( ) , "1" ) ;
if ( com . baomidou . mybatisplus . core . toolkit . CollectionUtils . isNotEmpty ( dataByWpIdAndIndexList ) ) {
for ( MacToolUse prMacToolUseItem : dataByWpIdAndIndexList ) {
if ( prMacToolUseItem ! = null & & prMacToolUseItem . getId ( ) ! = null ) {
// 获取模板数据
preserveSlotList = mesRbFilePreserveSlotService . getByRfpId ( Long . valueOf ( prMacToolUseItem . getRfpId ( ) ) ) ;
qcProduceRunsList = workPlanMapper . listPrByWpIdIndexAndMtnCode ( workPlan . getId ( ) , 1 , prMacToolUseItem . getMtnCode ( ) ) ;
qcProduceRunsList = qcProduceRunService . listPrByWpIdIndexAndMtnCode ( dataByWpIdAndIndexList . stream ( ) . map ( MacToolUse : : getMtnCode ) . toList ( ) , prMacToolUseItem . getMtnCode ( ) ) ;
// 烘箱信息(从设备,工装使用记录获取)
List < MesQcProduceRunEntity > runs = workPlanMapper . getBoxInfoByWpIdMtnCodeList ( workPlan . getId ( ) ) ;
if ( runs ! = null & & runs . size ( ) > 0 ) {
boxInfo = runs . get ( 0 ) ;
}
if ( StringUtils . isNotBlank ( boxInfo . getInDate ( ) ) ) {
boxInfo = macToolUseService . getBoxInfoByWpIdMtnCode ( workPlan . getId ( ) ) ;
if ( boxInfo . getInDate ( ) ! = null ) {
qcProduceRunsList . add ( boxInfo ) ;
}
if ( qcProduceRunsList ! = null & & qcProduceRunsList . size ( ) > 0 ) {
if ( qcProduceRunsList ! = null & & ! qcProduceRunsList . isEmpty ( ) ) {
// 2025-07-23 线上迁移修改删除了日志打印
// cdl 20250218 修改分槽同一槽号连续出现
this . setRbFilePreserveData ( preserveSlotList , qcProduceRunsList , workPlan ,
dsRbFilePreserveSlotList , prMacToolUseItem ) ;
this . setRbFilePreserveDateNew ( preserveSlotList , qcProduceRunsList , workPlan , dsRbFilePreserveSlotList , prMacToolUseItem ) ;
}
}
}
}
// 根据电子档案维护组装数据(自动)
prMacToolUse = workPlanMapper . getDataByWpIdAndIndex ( workPlan . getId ( ) , "2" ) ;
prMacToolUse = macToolUseService . getDataByWpIdAndIndex ( workPlan . getId ( ) , "2" ) ;
if ( prMacToolUse ! = null & & prMacToolUse . getId ( ) ! = null ) {
List < ProReTemplate > dsRbFilePreserveList = null ;
if ( workPlan . getPpsId ( ) ! = null ) {
BsProcessSetEntity process = processSetService . getById ( workPlan . getPpsId ( ) ) ;
if ( "喷砂" . equals ( process . getName ( ) ) | | "涂色标" . equals ( process . getName ( ) ) ) {
dsRbFilePreserveList = workPlanMapper . getDataByWcIdAndPpsId ( null ,
workPlan . getPpsId ( ) , Boolean . TRUE ) ;
} else {
dsRbFilePreserveList = workPlanMapper . getDataByWcIdAndPpsId ( bsCenterTeam . getWcId ( ) ,
workPlan . getPpsId ( ) , Boolean . TRUE ) ;
}
// 获取模板数据
List < ProReTemplate > dsRbFilePreserveList ;
BsProcessSetEntity processSet = bsProcessSetService . getById ( workPlan . getPpsId ( ) ) ;
if ( workPlan . getPpsId ( ) ! = null & & ( "喷砂" . equals ( processSet . getName ( ) ) | | "涂色标" . equals ( processSet . getName ( ) ) ) ) {
dsRbFilePreserveList = proReTemplateService . getDataByWcIdAndPpsId ( null , workPlan . getPpsId ( ) , Boolean . TRUE ) ;
} else {
dsRbFilePreserveList = proReTemplateService . getDataByWcIdAndPpsId ( bsTeamSet . getWcId ( ) , workPlan . getPpsId ( ) , Boolean . TRUE ) ;
}
if ( dsRbFilePreserveList ! = null & & ! dsRbFilePreserveList . isEmpty ( ) ) {
preserveSlotList = mesRbFilePreserveSlotService . getByRfpId ( dsRbFilePreserveList . get ( 0 ) . getId ( ) ) ;
qcProduceRunsList = qcProduceRunService . listPrByWpIdIndex ( workPlan . getId ( ) , 2 , Boolean . TRUE ) ;
//sql不对
if ( dsRbFilePreserveList ! = null & & dsRbFilePreserveList . size ( ) > 0 ) {
//00000000000000
preserveSlotList = workPlanMapper . getByRfpId ( dsRbFilePreserveList . get ( 0 ) . getId ( ) ) ;
qcProduceRunsList = workPlanMapper . listPrByWpIdIndex ( workPlan . getId ( ) , 2 , Boolean . TRUE ) ;
List < MesQcProduceRunEntity > runs = workPlanMapper . getBoxInfoByWpIdMtnCodeList ( workPlan . getId ( ) ) ;
if ( runs ! = null & & runs . size ( ) > 0 ) {
boxInfo = runs . get ( 0 ) ;
}
// 烘箱信息(从设备,工装使用记录获取)
if ( qcProduceRunsList ! = null & & qcProduceRunsList . size ( ) > 0 & & StringUtils . isNotBlank ( boxInfo . getInDate ( ) ) ) {
boxInfo = macToolUseService . getBoxInfoByWpIdMtnCode ( workPlan . getId ( ) ) ;
if ( qcProduceRunsList ! = null & & ! qcProduceRunsList . isEmpty ( ) & & boxInfo . getInDate ( ) ! = null ) {
qcProduceRunsList . add ( boxInfo ) ;
}
if ( qcProduceRunsList ! = null & & qcProduceRunsList . size ( ) > 0 ) {
if ( qcProduceRunsList ! = null & & ! qcProduceRunsList . isEmpty ( ) ) {
// cdl 20250218 修改分槽同一槽号连续出现
this . setRbFilePreserveData ( preserveSlotList , qcProduceRunsList , workPlan ,
dsRbFilePreserveSlotList , prMacToolUse ) ;
this . setRbFilePreserveDateNew ( preserveSlotList , qcProduceRunsList , workPlan , dsRbFilePreserveSlotList , prMacToolUse ) ;
}
}
// 获取额外面积数据
// BsAdditionalMess dataByMtuCode = bsAdditionalMessDao.getDataByOneData(prMacToolUse.getMtnCode(), BsAdditionalMess.TYPE_ONE);
// workPlan.setBsAdditionalMess(dataByMtuCode);
}
// 根据电子档案维护组装数据(线下)
//zxh 20250117 解决单工序绑定两个手动记录只显示一个问题
List < MacToolUse > prMacToolUseList = workPlanMapper . getDataByWpIdAndIndexList ( workPlan . getId ( ) , "3" ) ;
if ( prMacToolUseList ! = null & & prMacToolUseList . size ( ) > 0 ) {
List < MacToolUse > prMacToolUseList = macToolUseService . getDataByWpIdAndIndexList ( workPlan . getId ( ) , "3" ) ;
if ( prMacToolUseList ! = null & & ! prMacToolUseList . isEmpty ( ) ) {
for ( MacToolUse prMacToolUseSd : prMacToolUseList ) {
if ( prMacToolUseSd ! = null & & prMacToolUseSd . getId ( ) ! = null ) {
// 获取模板数据
preserveSlotList = workPlanMapper . getByRfpId ( Long . valueOf ( prMacToolUseSd . getRfpId ( ) ) ) ;
qcProduceRunsList = workPlanMapper . listPrByWpIdIndexAndMtnCode ( workPlan . getId ( ) , 3 , prMacToolUseSd . getMtnCode ( ) ) ;
preserveSlotList = mesRbFilePreserveSlotService . getByRfpId ( Long . valueOf ( prMacToolUseSd . getRfpId ( ) ) ) ;
qcProduceRunsList = qcProduceRunService . listPrByWpIdIndexAndMtnCode ( prMacToolUseList . stream ( ) . map ( MacToolUse : : getMtnCode ) . toList ( ) , prMacToolUseSd . getMtnCode ( ) ) ;
// 烘箱信息(从设备,工装使用记录获取)
List < MesQcProduceRunEntity > runs = workPlanMapper . getBoxInfoByWpIdMtnCodeList ( workPlan . getId ( ) ) ;
if ( runs ! = null & & runs . size ( ) > 0 ) {
boxInfo = runs . get ( 0 ) ;
}
if ( StringUtils . isNotBlank ( boxInfo . getInDate ( ) ) ) {
boxInfo = macToolUseService . getBoxInfoByWpIdMtnCode ( workPlan . getId ( ) ) ;
if ( boxInfo . getInDate ( ) ! = null ) {
qcProduceRunsList . add ( boxInfo ) ;
}
if ( qcProduceRunsList ! = null & & qcProduceRunsList . size ( ) > 0 ) {
if ( qcProduceRunsList ! = null & & ! qcProduceRunsList . isEmpty ( ) ) {
// cdl 20250218 修改分槽同一槽号连续出现
this . setRbFilePreserveData ( preserveSlotList , qcProduceRunsList , workPlan ,
dsRbFilePreserveSlotList , prMacToolUseSd ) ;
this . setRbFilePreserveDateNew ( preserveSlotList , qcProduceRunsList , workPlan , dsRbFilePreserveSlotList , prMacToolUseSd ) ;
}
}
}
@ -947,39 +992,499 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
return dsRbFilePreserveSlotList ;
}
private void setRbFilePreserveDateNew ( List < MesRbFilePreserveSlotEntity > preserveSlotList , List < MesQcProduceRunEntity > qcProduceRunsList , WorkPlan workPlan , List < ProduceMonitorFileSlotVO > dsRbFilePreserveSlotList , MacToolUse prMacToolUse ) {
List < MesRbFilePreserveDetailEntity > dsRbFilePreserveDetailList = null ;
ProduceMonitorFileSlotVO newDsRbFilePreserveSlot = null ;
MesRbFilePreserveDetailEntity newDsRbFilePreserveDetail = null ;
Map < String , MesRbFilePreserveSlotEntity > preserveSlotMap = preserveSlotList . stream ( ) . collect ( Collectors . toMap ( MesRbFilePreserveSlotEntity : : getSlotName , java . util . function . Function . identity ( ) ) ) ;
List < ProduceMonitorFileSlotVO > temporaryList = new ArrayList < > ( ) ;
for ( MesQcProduceRunEntity qcProduceRun : qcProduceRunsList ) {
// 根据维护的电子档案的槽号找寻对应生产追溯的的数据
if ( StringUtils . isBlank ( qcProduceRun . getWorkSlot ( ) ) ) {
continue ;
}
MesRbFilePreserveSlotEntity dsRbFilePreserveSlot = preserveSlotMap . get ( qcProduceRun . getWorkSlot ( ) . trim ( ) ) ;
if ( "水膜连续性检查" . equals ( qcProduceRun . getWorkSlot ( ) . trim ( ) ) ) {
qcProduceRun . setQualified ( "1" ) ;
}
// cdl 20250218 修改分槽同一槽号连续出现
this . setTemplateData ( dsRbFilePreserveSlot , qcProduceRun , newDsRbFilePreserveSlot , dsRbFilePreserveDetailList , newDsRbFilePreserveDetail , workPlan , temporaryList , prMacToolUse ) ;
}
// 判断是不是自动线并且有水墨连续性
MacToolUse macToolUse = macToolUseService . getHangNumIsNull ( workPlan . getId ( ) ) ;
if ( macToolUse ! = null & & macToolUse . getId ( ) ! = null ) {
List < MesRbFilePreserveSlotEntity > smSlotList = preserveSlotList . stream ( ) . filter ( i - > i . getSlotName ( ) . contains ( "水膜连续性" ) ) . toList ( ) ;
for ( MesRbFilePreserveSlotEntity dsRbFilePreserveSlot : smSlotList ) {
if ( dsRbFilePreserveSlot . getSlotName ( ) . contains ( "水膜连续性" ) ) {
MesQcProduceRunEntity qcProduceRun = new MesQcProduceRunEntity ( ) ;
qcProduceRun . setQualified ( "1" ) ;
// cdl 20250218 修改分槽同一槽号连续出现
this . setTemplateData ( dsRbFilePreserveSlot , qcProduceRun , newDsRbFilePreserveSlot , dsRbFilePreserveDetailList , newDsRbFilePreserveDetail , workPlan , temporaryList , prMacToolUse ) ;
}
}
}
dsRbFilePreserveSlotList . addAll ( temporaryList . stream ( ) . sorted ( Comparator . comparing ( ProduceMonitorFileSlotVO : : getSlotIndex ) ) . toList ( ) ) ;
}
private void setTemplateData ( MesRbFilePreserveSlotEntity dsRbFilePreserveSlot , MesQcProduceRunEntity qcProduceRun , ProduceMonitorFileSlotVO newDsRbFilePreserveSlot , List < MesRbFilePreserveDetailEntity > dsRbFilePreserveDetailList , MesRbFilePreserveDetailEntity newDsRbFilePreserveDetail , WorkPlan workPlan , List < ProduceMonitorFileSlotVO > temporaryList , MacToolUse prMacToolUse ) {
if ( dsRbFilePreserveSlot ! = null & & dsRbFilePreserveSlot . getId ( ) ! = null ) {
// Date转String
// 装入槽子对应的信息
newDsRbFilePreserveSlot = new ProduceMonitorFileSlotVO ( ) ;
newDsRbFilePreserveSlot . setRfpsType ( dsRbFilePreserveSlot . getRfpsType ( ) ) ;
newDsRbFilePreserveSlot . setInsertIndex ( dsRbFilePreserveSlot . getInsertIndex ( ) ) ;
newDsRbFilePreserveSlot . setSlotName ( dsRbFilePreserveSlot . getSlotName ( ) ) ;
newDsRbFilePreserveSlot . setSlotIndex ( dsRbFilePreserveSlot . getSlotIndex ( ) ) ;
List < MesRbFilePreserveDetailEntity > preserveDetailList = mesRbFilePreserveDetailService . getByRfpsId ( dsRbFilePreserveSlot . getId ( ) ) ;
if ( ! preserveDetailList . isEmpty ( ) ) {
dsRbFilePreserveDetailList = new ArrayList < > ( ) ;
for ( int i = 0 ; i < preserveDetailList . size ( ) ; i + + ) {
MesRbFilePreserveDetailEntity dsRbFilePreserveDetail = preserveDetailList . get ( i ) ;
Short rfpsType = 0 ;
if ( dsRbFilePreserveDetail ! = null & & dsRbFilePreserveDetail . getRfpsId ( ) ! = null ) {
rfpsType = mesRbFilePreserveSlotService . getById ( dsRbFilePreserveDetail . getRfpsId ( ) ) . getRfpsType ( ) ;
}
newDsRbFilePreserveDetail = new MesRbFilePreserveDetailEntity ( ) ;
newDsRbFilePreserveDetail . setDetailName ( dsRbFilePreserveDetail . getDetailName ( ) ) ;
newDsRbFilePreserveDetail . setDetailIndex ( dsRbFilePreserveDetail . getDetailIndex ( ) ) ;
// 工艺要求
newDsRbFilePreserveDetail . setAsk ( dsRbFilePreserveDetail . getAsk ( ) ) ;
newDsRbFilePreserveDetail . setParamName ( dsRbFilePreserveDetail . getParamName ( ) ) ;
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getInDate ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getOutDate ( ) ) ;
}
if ( rfpsType = = 1 ) { // 模板一
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
}
} else if ( rfpsType = = 2 ) { // 模板二
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
}
} else if ( rfpsType = = 3 ) { // 模板三
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
}
} else if ( rfpsType = = 4 ) { // 模板四
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
}
} else if ( rfpsType = = 5 | | rfpsType = = 22 ) { // 模板五
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
}
} else if ( rfpsType = = 6 ) { // 模板六
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
}
} else if ( rfpsType = = 7 ) { // 模板七
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
}
} else if ( rfpsType = = 8 ) { // 模板八
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
}
} else if ( rfpsType = = 9 ) { // 模板九
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
}
} else if ( rfpsType = = 10 ) { // 模板十
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setQualified ( qcProduceRun . getQualified ( ) ) ;
}
} else if ( rfpsType = = 11 ) { // 模板十一
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
}
} else if ( rfpsType = = 12 ) { // 模板十二
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataThree ( ) ) ;
}
} else if ( rfpsType = = 13 ) { // 模板十三
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
} else if ( i = = 9 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTen ( ) ) ;
}
} else if ( rfpsType = = 14 ) { // 模板十四
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 9 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 10 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
} else if ( i = = 11 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTen ( ) ) ;
}
} else if ( rfpsType = = 15 ) { // 模板十五
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 9 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 10 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
} else if ( i = = 11 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTen ( ) ) ;
} else if ( i = = 12 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEleven ( ) ) ;
} else if ( i = = 13 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwelve ( ) ) ;
}
} else if ( rfpsType = = 16 ) { // 模板十六
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 9 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 10 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
} else if ( i = = 11 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTen ( ) ) ;
} else if ( i = = 12 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEleven ( ) ) ;
} else if ( i = = 13 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwelve ( ) ) ;
} else if ( i = = 14 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThirteen ( ) ) ;
} else if ( i = = 15 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFourteen ( ) ) ;
}
} else if ( rfpsType = = 17 ) { // 模板十七
if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
}
} else if ( rfpsType = = 18 ) { // 模板十八
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
}
} else if ( rfpsType = = 19 ) { // 模板十九 //zxh 20250519 新增模板19和模板20
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
} else if ( i = = 9 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTen ( ) ) ;
} else if ( i = = 10 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEleven ( ) ) ;
} else if ( i = = 11 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getDataTwelve ( ) ) ;
}
} else if ( rfpsType = = 20 ) { // 模板二十
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getInDate ( ) ) ;
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getInDate ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getInDate ( ) ) ;
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getInDate ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getOutDate ( ) ) ;
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getOutDate ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setRfpdTime ( qcProduceRun . getOutDate ( ) ) ;
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getOutDate ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
}
} else if ( rfpsType = = 21 ) { // 模板十三
if ( i = = 0 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataOne ( ) ) ;
} else if ( i = = 1 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataTwo ( ) ) ;
} else if ( i = = 2 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataThree ( ) ) ;
} else if ( i = = 3 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFour ( ) ) ;
} else if ( i = = 4 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataFive ( ) ) ;
} else if ( i = = 5 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSix ( ) ) ;
} else if ( i = = 6 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataSeven ( ) ) ;
} else if ( i = = 7 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataEight ( ) ) ;
} else if ( i = = 8 ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getDataNine ( ) ) ;
}
}
String detailName = dsRbFilePreserveDetail . getDetailName ( ) ;
if ( detailName ! = null ) {
if ( detailName . contains ( "温度" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getTempSlot ( ) ) ;
} else if ( detailName . contains ( "电导率" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getEleRate ( ) ) ;
} else if ( detailName . contains ( "电流" ) & & ! ( detailName . contains ( "壳体" ) | | detailName . contains ( "插针" ) ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getEleStream ( ) ) ;
} else if ( detailName . contains ( "链速" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getVSpeed ( ) ) ;
} else if ( detailName . contains ( "镍离子" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getNiValue ( ) ) ;
} else if ( detailName . contains ( "pH值" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getPhValue ( ) ) ;
}
//zxh 20250604 新增软起时间和工作电压
else if ( detailName . contains ( "软起时间" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getSoftWorkTime ( ) ) ;
} else if ( detailName . contains ( "工作电压" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getVoltage ( ) ) ;
} else if ( detailName . contains ( "初始电压" ) ) {
newDsRbFilePreserveDetail . setParamValue ( qcProduceRun . getStartVol ( ) ) ;
}
}
dsRbFilePreserveDetailList . add ( newDsRbFilePreserveDetail ) ;
}
newDsRbFilePreserveSlot . setChildrenList ( dsRbFilePreserveDetailList ) ;
}
temporaryList . add ( newDsRbFilePreserveSlot ) ;
}
}
private List < JSONObject > getCheckListNotNG ( Long woId , List < WorkPlanExpandVO > wpList , Boolean eleOrPrint ) {
List < JSONObject > checkList = new ArrayList < > ( ) ;
//组装检测项集合
Map < String , JSONObject > ccMap = new LinkedHashMap < > ( ) ;
JSONObject cc ;
List < WorkPlanItemVO > piLst = workPlanItemService . listByWoIdNotNG ( woId ) ;
Map < Long , WorkPlanExpandVO > workPlanMap = wpList . stream ( )
. collect ( Collectors . toMap (
WorkPlanExpandVO : : getId ,
Function . identity ( )
) ) ;
Map < String , List < JSONObject > > piMap = new LinkedHashMap < > ( ) ;
List < JSONObject > lst ;
if ( CollectionUtils . isNotEmpty ( piLst ) ) {
for ( WorkPlanItemVO pi : piLst ) {
lst = piMap . get ( pi . getItemCode ( ) ) ;
WorkPlanExpandVO workPlan = workPlanMap . get ( pi . getWpId ( ) ) ;
String testOrder = workPlan . getOrders ( ) + "-" + pi . getItemCode ( ) ;
JSONObject checkDetail = new JSONObject ( ) ;
checkDetail . put ( "testOrders" , testOrder ) ;
checkDetail . put ( "checkName" , pi . getCheckUserRealName ( ) ) ;
if ( StringUtils . isNotEmpty ( pi . getCheckUserAccount ( ) ) ) {
String checkManByNewErp = workPlanMapper . getCheckManByNewErpMes ( pi . getCheckUserAccount ( ) ) ;
if ( eleOrPrint ) {
checkDetail . put ( "imgUrl" , checkManByNewErp ) ;
if ( CollectionUtils . isEmpty ( lst ) ) {
lst = new ArrayList < > ( ) ;
piMap . put ( testOrder , lst ) ;
cc = new JSONObject ( ) ;
cc . put ( "testOrders" , testOrder ) ;
if ( pi . getCheckQty ( ) ! = null & & pi . getCheckQty ( ) > 0 ) {
cc . put ( "checkQty" , pi . getCheckQty ( ) ) ;
}
if ( pi . getTestQty ( ) ! = null & & pi . getTestQty ( ) > 0 ) {
cc . put ( "testQty" , pi . getTestQty ( ) ) ;
} else {
if ( checkManByNewErp ! = null & & checkManByNewErp . indexOf ( "base64," ) > 0 ) {
String checkManByNewErpSubString = checkManByNewErp . substring ( checkManByNewErp . indexOf ( "base64," ) + 7 ) ;
checkDetail . put ( "imgUrl" , checkManByNewErpSubString ) ;
cc . put ( "testQty" , "" ) ;
}
cc . put ( "checkResult" , WorkPlanItem . checkResultMap . get ( pi . getCheckResult ( ) ) ) ;
if ( StringUtils . isNotEmpty ( pi . getCheckUserRealName ( ) ) ) {
String checkManByNewErp = null ;
try {
checkManByNewErp = erpDataCheckerSealClient . getCheckManByNewErpMes ( pi . getCheckUserRealName ( ) ) ;
} catch ( Exception e ) {
// DB Link 等异常降级,避免阻塞 PDF 生成
}
cc . put ( "checkName" , pi . getCheckUserRealName ( ) ) ;
if ( eleOrPrint ) {
cc . put ( "imgUrl" , checkManByNewErp ) ;
} else {
if ( checkManByNewErp ! = null & & checkManByNewErp . indexOf ( "base64," ) > 0 ) {
String checkManByNewErpSubString = checkManByNewErp . substring ( checkManByNewErp . indexOf ( "base64," ) + 7 ) ;
cc . put ( "imgUrl" , checkManByNewErpSubString ) ;
}
}
if ( pi . getCheckDate ( ) ! = null ) {
cc . put ( "checkDate" , pi . getCheckDate ( ) . toLocalDate ( ) . toString ( ) ) ;
} else {
cc . put ( "checkDate" , "" ) ;
}
}
ccMap . put ( testOrder , cc ) ;
}
if ( "厚度检测" . equals ( pi . getItemName ( ) ) ) {
for ( int i = 0 ; i < 3 ; i + + ) {
lst . add ( this . buildCCC ( pi . getItemName ( ) , pi . getStandardName ( ) , pi . getCheckValue ( ) , pi . getId ( ) , null , pi . getCreateTime ( ) ) ) ;
}
}
lst . add ( this . buildCCC ( pi . getItemName ( ) , pi . getStandardName ( ) , pi . getCheckValue ( ) , pi . getId ( ) , null , pi . getCreateTime ( ) ) ) ;
List < WorkPlanItemDetailVO > idLst ;
for ( Map . Entry < String , JSONObject > entry : ccMap . entrySet ( ) ) {
cc = ccMap . get ( entry . getKey ( ) ) ;
if ( cc ! = null ) {
lst = piMap . get ( cc . get ( "testOrders" ) ) ;
lst = lst . stream ( ) . collect ( Collectors . collectingAndThen ( Collectors . toCollection ( ( )
- > new TreeSet < > ( Comparator . comparing ( i - > ( Date ) i . get ( "createTime" ) ) ) ) , ArrayList : : new ) ) ;
if ( lst ! = null & & lst . size ( ) > 0 ) {
for ( JSONObject ccc : lst ) {
idLst = workPlanItemDetailService . listVOByWorkPlanItemId ( ( Long ) ccc . get ( "wpiId" ) ) ;
if ( idLst ! = null & & idLst . size ( ) > 0 ) {
lst = new ArrayList < > ( ) ;
for ( WorkPlanItemDetailVO itemDetail : idLst ) {
if ( "厚度检测" . equals ( ccc . get ( "testName" ) ) ) {
cc . put ( "deviceCode" , itemDetail . getGaugeValue8 ( ) ) ;
lst . add ( this . buildCCC ( ( String ) ccc . get ( "testName" ) , ( String ) ccc . get ( "trialStandard" ) , itemDetail . getGaugeValueNotNUll ( ) , null , itemDetail . getGaugeValue8 ( ) , ( Date ) ccc . get ( "createTime" ) ) ) ;
} else if ( itemDetail . getMtId ( ) ! = null ) {
lst . add ( this . buildCCC ( ( String ) ccc . get ( "testName" ) , itemDetail . getRuleSize ( ) ,
itemDetail . getGaugeValue1 ( ) , ( Long ) ccc . get ( "wpiId" ) , itemDetail . getTools ( ) , ( Date ) ccc . get ( "createTime" ) ) ) ;
cc . put ( "deviceCode" , itemDetail . getTools ( ) ) ;
if ( cc . get ( "trialStandard" ) ! = null ) {
cc . put ( "trialStandard" , ( String ) cc . get ( "trialStandard" ) + ';' + itemDetail . getRuleSize ( ) ) ;
} else {
cc . put ( "trialStandard" , itemDetail . getRuleSize ( ) ) ;
}
if ( cc . get ( "checkResult" ) ! = null ) {
cc . put ( "checkResult" , cc . get ( "checkResult" ) ) ;
} else {
cc . put ( "checkResult" , itemDetail . getGaugeValue1 ( ) ) ;
}
}
}
}
cc . put ( "cccList" , lst ) ;
checkList . add ( cc ) ;
break ;
}
}
}
}
checkList . add ( checkDetail ) ;
}
}
return checkList ;
}
private JSONObject buildCCC ( String testName , String trialStandard , String checkValue , Long wpiId , String tools , Date createTime ) {
JSONObject ccc = new JSONObject ( ) ;
ccc . put ( "testName" , testName ) ;
ccc . put ( "trialStandard" , trialStandard ) ;
ccc . put ( "checkValue" , checkValue ) ;
ccc . put ( "wpiId" , wpiId ) ;
ccc . put ( "emTools" , tools ) ;
ccc . put ( "createTime" , createTime ) ;
return ccc ;
}
public void getNewProcess ( List < WorkPlan > wpList , JSONObject jsonObj , List < Boolean > modelFlag ) {
if ( wpList = = null | | wpList . size ( ) = = 0 ) {
return ;
@ -1209,10 +1714,10 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
BsProcessSetEntity process = processSetService . getById ( workPlan . getPpsId ( ) ) ;
if ( "喷砂" . equals ( process . getName ( ) ) | | "涂色标" . equals ( process . getName ( ) ) ) {
dsRbFilePreserveList = workPlanMapper . getDataByWcIdAndPpsId ( null ,
workPlan . getPpsId ( ) , Boolean . TRUE ) ;
workPlan . getPpsId ( ) , "0" ) ;
} else {
dsRbFilePreserveList = workPlanMapper . getDataByWcIdAndPpsId ( bsCenterTeam . getWcId ( ) ,
workPlan . getPpsId ( ) , Boolean . TRUE ) ;
workPlan . getPpsId ( ) , "0" ) ;
}
}
@ -2088,12 +2593,12 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
if ( pi . getCheckUserId ( ) ! = null ) {
R < User > user = userClient . userInfoById ( pi . getCheckUserId ( ) ) ;
String userName = user . getData ( ) . getAccount ( ) ;
String userName = user . getData ( ) . getRealName ( ) ;
if ( null ! = user & & user . getData ( ) ! = null ) {
cc . setCheckName ( user . getData ( ) . getRealName ( ) ) ;
}
//zxh 20250212 从nerp获取检验员印章
String checkManByNewErp = workPlanMapper . getCheckManByNewErpMes ( userName ) ;
String checkManByNewErp = erpDataCheckerSealClient . getCheckManByNewErpMes ( userName ) ;
if ( eleOrPrint ) {