|
|
@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -288,10 +289,22 @@ public class BaseReportServiceImpl implements BaseReportService { |
|
|
|
@Override |
|
|
|
public void agencyProject(AgencyProjectFormDTO formDTO) { |
|
|
|
if (formDTO.getIsFirst()) { |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = baseReportDao.delAgencyProject(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); |
|
|
|
} while (deleteNum > NumConstant.ZERO); |
|
|
|
// 20220711修改逻辑
|
|
|
|
// int deleteNum;
|
|
|
|
// do {
|
|
|
|
// deleteNum = baseReportDao.delAgencyProject(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId());
|
|
|
|
// } while (deleteNum > NumConstant.ZERO);
|
|
|
|
|
|
|
|
List<AgencyProjectFormDTO.DataList> dataList = formDTO.getDataList(); |
|
|
|
List<String> dateIdList = new ArrayList<String>(); |
|
|
|
String customerId = dataList.get(NumConstant.ZERO).getCustomerId(); |
|
|
|
for(AgencyProjectFormDTO.DataList d : dataList){ |
|
|
|
if(!dateIdList.contains(d.getDateId())){ |
|
|
|
dateIdList.add(d.getDateId()); |
|
|
|
} |
|
|
|
} |
|
|
|
baseReportDao.delAgencyProjectDaily(customerId,dateIdList); |
|
|
|
|
|
|
|
} |
|
|
|
List<List<AgencyProjectFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); |
|
|
|
partition.forEach(p -> { |
|
|
|