|
|
@ -4,11 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; |
|
|
|
import com.epmet.dao.evaluationindex.screen.*; |
|
|
|
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|
|
|
import com.epmet.dto.screencoll.form.*; |
|
|
|
import com.epmet.service.evaluationindex.screen.AnScreenCollService; |
|
|
@ -17,10 +13,6 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -56,17 +48,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void communityProjectProfile(ScreenCollFormDTO<AnCommunityProjectProfileFormDTO> formDTO,String customerId) { |
|
|
|
List<AnCommunityProjectProfileFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
public void communityProjectProfile(ScreenCollFormDTO<AnCommunityProjectProfileFormDTO> formDTO) { |
|
|
|
/*List<AnCommunityProjectProfileFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ;*/ |
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
int affectRows = communityProjectProfileDao.deleteBatch(customerId); |
|
|
|
int affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); |
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
affectRows = communityProjectProfileDao.deleteBatch(customerId); |
|
|
|
affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); |
|
|
|
} |
|
|
|
} |
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { |
|
|
|
communityProjectProfileDao.insertBatch(list,customerId); |
|
|
|
communityProjectProfileDao.insertBatch(list,formDTO.getCustomerId()); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
@ -81,17 +73,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void pmRank(ScreenCollFormDTO<AnGrassRootsPmRankFormDTO> formDTO,String customerId) { |
|
|
|
List<AnGrassRootsPmRankFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
public void pmRank(ScreenCollFormDTO<AnGrassRootsPmRankFormDTO> formDTO) { |
|
|
|
/*List<AnGrassRootsPmRankFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ;*/ |
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
int affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
int affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
} |
|
|
|
} |
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { |
|
|
|
pmRankDao.insertBatch(list,customerId); |
|
|
|
pmRankDao.insertBatch(list,formDTO.getCustomerId()); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -105,21 +97,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void pmTotal(ScreenCollFormDTO<AnGrassRootsPmTotalMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
List<AnGrassRootsPmTotalMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
public void pmTotal(ScreenCollFormDTO<AnGrassRootsPmTotalMonthlyFormDTO> formDTO) { |
|
|
|
/*List<AnGrassRootsPmTotalMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ;*/ |
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
int affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
} |
|
|
|
} |
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { |
|
|
|
pmTotalMonthlyDao.insertBatch(list, |
|
|
|
customerId, |
|
|
|
formDTO.getCustomerId(), |
|
|
|
formDTO.getMonthId(), |
|
|
|
quarterId, |
|
|
|
yearId); |
|
|
@ -136,21 +128,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void grassrootsOrg(ScreenCollFormDTO<AnGrassRootsOrgMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
List<AnGrassRootsOrgMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
public void grassrootsOrg(ScreenCollFormDTO<AnGrassRootsOrgMonthlyFormDTO> formDTO) { |
|
|
|
/*List<AnGrassRootsOrgMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ;*/ |
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
int affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
} |
|
|
|
} |
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { |
|
|
|
orgMonthlyDao.insertBatch(list, |
|
|
|
customerId, |
|
|
|
formDTO.getCustomerId(), |
|
|
|
formDTO.getMonthId(), |
|
|
|
quarterId, |
|
|
|
yearId); |
|
|
@ -167,21 +159,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void grassrootsGovern(ScreenCollFormDTO<AnGrassRootsGovernMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
List<AnGrassRootsGovernMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
public void grassrootsGovern(ScreenCollFormDTO<AnGrassRootsGovernMonthlyFormDTO> formDTO) { |
|
|
|
/*List<AnGrassRootsGovernMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ;*/ |
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
int affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); |
|
|
|
} |
|
|
|
} |
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { |
|
|
|
governMonthlyDao.insertBatch(list, |
|
|
|
customerId, |
|
|
|
formDTO.getCustomerId(), |
|
|
|
formDTO.getMonthId(), |
|
|
|
quarterId, |
|
|
|
yearId); |
|
|
|