|
|
@ -21,14 +21,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessDao; |
|
|
|
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; |
|
|
|
import com.epmet.dto.screen.ScreenProjectProcessDTO; |
|
|
|
import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; |
|
|
|
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|
|
@ -36,11 +35,11 @@ import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEnt |
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; |
|
|
|
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; |
|
|
|
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
@ -120,6 +119,9 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
|
public void collect(ScreenCollFormDTO<ScreenProjectProcessFormDTO> param) { |
|
|
|
if (CollectionUtils.isEmpty(param.getDataList())){ |
|
|
|
return; |
|
|
|
} |
|
|
|
if (param.getIsFirst()) { |
|
|
|
int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); |
|
|
|
while (affectedRows > 0) { |
|
|
@ -129,6 +131,9 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje |
|
|
|
List<String> processIdList = |
|
|
|
param.getDataList().stream().map(ScreenProjectProcessFormDTO :: getProcessId).collect(Collectors.toList()).stream().distinct() |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isEmpty(processIdList)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
//删除旧数据
|
|
|
|
baseDao.deleteByProcessIds(param.getCustomerId(), processIdList); |
|
|
|
screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), processIdList); |
|
|
|