| 
						
						
							
								
							
						
						
					 | 
					@ -34,6 +34,7 @@ import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.screencoll.ScreenCollFormDTO; | 
					 | 
					 | 
					import com.epmet.dto.screencoll.ScreenCollFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; | 
					 | 
					 | 
					import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.apache.commons.collections4.ListUtils; | 
					 | 
					 | 
					import org.apache.commons.collections4.ListUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -42,9 +43,12 @@ import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.util.CollectionUtils; | 
					 | 
					 | 
					import org.springframework.util.CollectionUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import javax.annotation.Resource; | 
					 | 
					 | 
					import javax.annotation.Resource; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.ArrayList; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.Arrays; | 
					 | 
					 | 
					import java.util.Arrays; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.List; | 
					 | 
					 | 
					import java.util.List; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.Map; | 
					 | 
					 | 
					import java.util.Map; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.concurrent.atomic.AtomicInteger; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 * 中央区-项目数据项目处理进展表 | 
					 | 
					 | 
					 * 中央区-项目数据项目处理进展表 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -58,6 +62,8 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Resource | 
					 | 
					 | 
					    @Resource | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    private ScreenProjectProcessAttachmentDao screenProjectProcessAttachmentDao; | 
					 | 
					 | 
					    private ScreenProjectProcessAttachmentDao screenProjectProcessAttachmentDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    @Resource | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    private ScreenProjectProcessAttachmentService screenProjectProcessAttachmentService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public PageData<ScreenProjectProcessDTO> page(Map<String, Object> params) { | 
					 | 
					 | 
					    public PageData<ScreenProjectProcessDTO> page(Map<String, Object> params) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IPage<ScreenProjectProcessEntity> page = baseDao.selectPage( | 
					 | 
					 | 
					        IPage<ScreenProjectProcessEntity> page = baseDao.selectPage( | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -120,39 +126,35 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); | 
					 | 
					 | 
					                affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        param.getDataList().forEach(item -> { | 
					 | 
					 | 
					        List<String> processIdList = | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            //先删除旧数据
 | 
					 | 
					 | 
					                param.getDataList().stream().map(ScreenProjectProcessFormDTO :: getProcessId).collect(Collectors.toList()).stream().distinct() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            QueryWrapper<ScreenProjectProcessEntity> screenProjectProcessEntityQueryWrapper = new QueryWrapper<>(); | 
					 | 
					 | 
					                        .collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            screenProjectProcessEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) | 
					 | 
					 | 
					        //删除旧数据
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) | 
					 | 
					 | 
					        baseDao.deleteByProcessIds(param.getCustomerId(), processIdList); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); | 
					 | 
					 | 
					        screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), processIdList); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            baseDao.delete(screenProjectProcessEntityQueryWrapper); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					        List<ScreenProjectProcessAttachmentEntity> attachmentList = new ArrayList<>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            QueryWrapper<ScreenProjectProcessAttachmentEntity> screenProjectProcessAttachmentEntityQueryWrapper = new QueryWrapper<>(); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            screenProjectProcessAttachmentEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) | 
					 | 
					 | 
					        List<ScreenProjectProcessEntity> processList = param.getDataList().stream().map(item -> { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) | 
					 | 
					 | 
					            ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); | 
					 | 
					 | 
					            entity.setCustomerId(param.getCustomerId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); | 
					 | 
					 | 
					            entity.setDataEndTime(param.getDateId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            //插入
 | 
					 | 
					 | 
					            AtomicInteger i = new AtomicInteger(0); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); | 
					 | 
					 | 
					            List<ScreenProjectProcessAttachmentEntity> attachments = item.getAttachments().stream().map(attachment -> { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            screenProjectProcessEntity.setCustomerId(param.getCustomerId()); | 
					 | 
					 | 
					                ScreenProjectProcessAttachmentEntity attachmentEntity = ConvertUtils.sourceToTarget(attachment, ScreenProjectProcessAttachmentEntity.class); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            screenProjectProcessEntity.setDataEndTime(param.getDateId()); | 
					 | 
					 | 
					                attachmentEntity.setCustomerId(param.getCustomerId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            baseDao.insert(screenProjectProcessEntity); | 
					 | 
					 | 
					                attachmentEntity.setProcessId(item.getProcessId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					                attachmentEntity.setProjectId(item.getProjectId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            List<ScreenProjectProcessAttachmentDTO> attachments = item.getAttachments(); | 
					 | 
					 | 
					                if (attachmentEntity.getSort() == null) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(attachments)){ | 
					 | 
					 | 
					                    attachmentEntity.setSort(i.getAndIncrement()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                for (int i = 0; i < attachments.size(); i++) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    ScreenProjectProcessAttachmentEntity attachmentEntity = ConvertUtils.sourceToTarget(attachments.get(i), ScreenProjectProcessAttachmentEntity.class); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    attachmentEntity.setCustomerId(param.getCustomerId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    attachmentEntity.setProcessId(item.getProcessId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    attachmentEntity.setProjectId(item.getProjectId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (attachmentEntity.getSort() == null) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        attachmentEntity.setSort(i); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    screenProjectProcessAttachmentDao.insert(attachmentEntity); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            } | 
					 | 
					 | 
					                return attachmentEntity; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        }); | 
					 | 
					 | 
					            }).collect(Collectors.toList()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            attachmentList.addAll(attachments); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            return entity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }).collect(Collectors.toList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.insertBatch(processList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        screenProjectProcessAttachmentService.insertBatch(attachmentList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |