|
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.qmth.sop.business.bean.dto.RegionCoordinatorDingTimeDto;
|
|
|
|
|
|
+import com.qmth.sop.business.bean.dto.*;
|
|
import com.qmth.sop.business.bean.result.CrmProjectResult;
|
|
import com.qmth.sop.business.bean.result.CrmProjectResult;
|
|
import com.qmth.sop.business.bean.result.UserArchivesResult;
|
|
import com.qmth.sop.business.bean.result.UserArchivesResult;
|
|
import com.qmth.sop.business.entity.*;
|
|
import com.qmth.sop.business.entity.*;
|
|
@@ -17,6 +17,7 @@ import com.qmth.sop.common.enums.SopRoleTypeEnum;
|
|
import com.qmth.sop.common.util.DateDisposeUtils;
|
|
import com.qmth.sop.common.util.DateDisposeUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -59,6 +60,15 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
@Resource
|
|
@Resource
|
|
private TBDingSubmitService tbDingSubmitService;
|
|
private TBDingSubmitService tbDingSubmitService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private TBServiceService tbServiceService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private SysCustomService sysCustomService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private SysSupplierService sysSupplierService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public TBDingStatistic findBySopNoAndUserArchivesId(Long serviceId, String sopNo, Long userArchivesId) {
|
|
public TBDingStatistic findBySopNoAndUserArchivesId(Long serviceId, String sopNo, Long userArchivesId) {
|
|
QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
@@ -124,11 +134,22 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
- List<String> sopNoList = datasource.stream().map(TBDing::getSopNo).distinct().collect(Collectors.toList());
|
|
|
|
|
|
+ // 工程师考勤统计(sopNo不为空的 按照sopNo统计)
|
|
|
|
+ List<String> sopNoList = datasource.stream().map(TBDing::getSopNo).filter(SystemConstant::strNotNull).distinct()
|
|
|
|
+ .collect(Collectors.toList());
|
|
for (String sopNo : sopNoList) {
|
|
for (String sopNo : sopNoList) {
|
|
- List<TBDing> sopDingInfo = datasource.stream().filter(e -> e.getSopNo().equals(sopNo)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<TBDing> sopDingInfo = datasource.stream().filter(e -> SystemConstant.strNotNull(e.getSopNo()) && e.getSopNo().equals(sopNo))
|
|
|
|
+ .collect(Collectors.toList());
|
|
this.buildDingStatisticBySop(sopNo, sopDingInfo, -1L);
|
|
this.buildDingStatisticBySop(sopNo, sopDingInfo, -1L);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 区协考勤统计 (sopNo为空的 按照服务单元统计)
|
|
|
|
+ List<Long> serviceIdList = datasource.stream().filter(e -> !SystemConstant.strNotNull(e.getSopNo())).map(TBDing::getServiceId).distinct().collect(Collectors.toList());
|
|
|
|
+ for (Long serviceId : serviceIdList) {
|
|
|
|
+ List<TBDing> serviceDingInfo = datasource.stream().filter(e -> e.getServiceId().equals(serviceId) && !SystemConstant.strNotNull(e.getSopNo()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ this.buildDingStatisticByService(serviceId, serviceDingInfo, -1L);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@@ -166,10 +187,6 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(null, null, crmNo);
|
|
CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(null, null, crmNo);
|
|
Long serviceUnitId = tbCrm.getServiceId();
|
|
Long serviceUnitId = tbCrm.getServiceId();
|
|
|
|
|
|
- Long scanStartTime = tbCrmDetail.getScanStartTime();
|
|
|
|
- Long scanEndTime = tbCrmDetail.getScanEndTime();
|
|
|
|
- Long markPaperStartTime = tbCrmDetail.getMarkPaperStartTime();
|
|
|
|
- Long markPaperEndTime = tbCrmDetail.getMarkPaperEndTime();
|
|
|
|
// 该sop计划有效的日期
|
|
// 该sop计划有效的日期
|
|
List<Long> userArchivesIdList = datasource.stream().map(TBDing::getUserArchivesId).distinct().collect(Collectors.toList());
|
|
List<Long> userArchivesIdList = datasource.stream().map(TBDing::getUserArchivesId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
@@ -283,8 +300,10 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
tbDingStatistic.updateInfo(requestUserId);
|
|
tbDingStatistic.updateInfo(requestUserId);
|
|
}
|
|
}
|
|
tbDingStatistic.setServiceId(serviceUnitId);
|
|
tbDingStatistic.setServiceId(serviceUnitId);
|
|
|
|
+ tbDingStatistic.setServiceName(crmProjectResult.getServiceUnitName());
|
|
tbDingStatistic.setSopNo(sopNo);
|
|
tbDingStatistic.setSopNo(sopNo);
|
|
tbDingStatistic.setCrmNo(crmNo);
|
|
tbDingStatistic.setCrmNo(crmNo);
|
|
|
|
+ tbDingStatistic.setCustomId(crmProjectResult.getCustomId());
|
|
tbDingStatistic.setCustomName(crmProjectResult.getCustomName());
|
|
tbDingStatistic.setCustomName(crmProjectResult.getCustomName());
|
|
tbDingStatistic.setProvince(crmProjectResult.getCustomProvince());
|
|
tbDingStatistic.setProvince(crmProjectResult.getCustomProvince());
|
|
tbDingStatistic.setCity(crmProjectResult.getCustomCity());
|
|
tbDingStatistic.setCity(crmProjectResult.getCustomCity());
|
|
@@ -416,6 +435,7 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
tbDingStatistic.updateInfo(requestUserId);
|
|
tbDingStatistic.updateInfo(requestUserId);
|
|
}
|
|
}
|
|
tbDingStatistic.setServiceId(serviceId);
|
|
tbDingStatistic.setServiceId(serviceId);
|
|
|
|
+ tbDingStatistic.setServiceName(tbServiceService.getById(serviceId).getName());
|
|
tbDingStatistic.setUserId(userId);
|
|
tbDingStatistic.setUserId(userId);
|
|
tbDingStatistic.setUserArchivesId(userArchivesId);
|
|
tbDingStatistic.setUserArchivesId(userArchivesId);
|
|
tbDingStatistic.setUserArchivesName(tbUserArchives.getName());
|
|
tbDingStatistic.setUserArchivesName(tbUserArchives.getName());
|
|
@@ -436,4 +456,256 @@ public class TBDingStatisticServiceImpl extends ServiceImpl<TBDingStatisticMappe
|
|
}
|
|
}
|
|
this.saveOrUpdateBatch(tbDingStatisticList);
|
|
this.saveOrUpdateBatch(tbDingStatisticList);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DingStatisticByPersonDto> findStatisticByPerson(Long serviceId) {
|
|
|
|
+ List<DingStatisticByPersonDto> result = new ArrayList<>();
|
|
|
|
+ QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (serviceId != null) {
|
|
|
|
+ queryWrapper.lambda().eq(TBDingStatistic::getServiceId, serviceId);
|
|
|
|
+ }
|
|
|
|
+ List<TBDingStatistic> datasource = this.list(queryWrapper);
|
|
|
|
+ for (TBDingStatistic tbDingStatistic : datasource) {
|
|
|
|
+ DingStatisticByPersonDto dto = new DingStatisticByPersonDto();
|
|
|
|
+ BeanUtils.copyProperties(tbDingStatistic, dto);
|
|
|
|
+ dto.setUserInfo(tbDingStatistic.getUserArchivesName() + "(" + tbDingStatistic.getUserArchivesCode() + ")");
|
|
|
|
+ result.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DingStatisticBySopDto> findStatisticBySop(Long serviceId) {
|
|
|
|
+ List<DingStatisticBySopDto> result = new ArrayList<>();
|
|
|
|
+ QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (serviceId != null) {
|
|
|
|
+ queryWrapper.lambda().eq(TBDingStatistic::getServiceId, serviceId);
|
|
|
|
+ }
|
|
|
|
+ queryWrapper.lambda().isNotNull(TBDingStatistic::getSopNo);
|
|
|
|
+ List<TBDingStatistic> datasource = this.list(queryWrapper);
|
|
|
|
+ List<String> sopNoList = datasource.stream().map(TBDingStatistic::getSopNo).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (String sopNo : sopNoList) {
|
|
|
|
+ TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(sopNo);
|
|
|
|
+ SopPeriodDto sopPeriodDto = this.findSopPeriod(tbCrmDetail);
|
|
|
|
+
|
|
|
|
+ List<TBDingStatistic> tbDingStatisticList = datasource.stream().filter(e -> sopNo.equals(e.getSopNo())).collect(Collectors.toList());
|
|
|
|
+ String serviceName = "";
|
|
|
|
+ int actualDays = 0;
|
|
|
|
+ int weekdays = 0;
|
|
|
|
+ int weekends = 0;
|
|
|
|
+ int legalHolidays = 0;
|
|
|
|
+ BigDecimal workHours = new BigDecimal(0);
|
|
|
|
+ int violationDays = 0;
|
|
|
|
+
|
|
|
|
+ for (TBDingStatistic tbDingStatistic : tbDingStatisticList) {
|
|
|
|
+ serviceName = tbDingStatistic.getServiceName();
|
|
|
|
+ actualDays = actualDays + tbDingStatistic.getActualDays();
|
|
|
|
+ weekdays = weekdays + tbDingStatistic.getWeekdays();
|
|
|
|
+ weekends = weekends + tbDingStatistic.getWeekends();
|
|
|
|
+ legalHolidays = legalHolidays + tbDingStatistic.getLegalHolidays();
|
|
|
|
+ workHours = workHours.add(tbDingStatistic.getWorkHours());
|
|
|
|
+ violationDays = violationDays + tbDingStatistic.getViolationDays();
|
|
|
|
+ }
|
|
|
|
+ DingStatisticBySopDto dto = new DingStatisticBySopDto();
|
|
|
|
+ dto.setServiceName(serviceName);
|
|
|
|
+ dto.setSopNo(sopNo);
|
|
|
|
+ dto.setCourseName(tbCrmDetail.getCourseName());
|
|
|
|
+ dto.setActualDays(actualDays);
|
|
|
|
+ dto.setWeekdays(weekdays);
|
|
|
|
+ dto.setWeekends(weekends);
|
|
|
|
+ dto.setLegalHolidays(legalHolidays);
|
|
|
|
+ dto.setWorkHours(workHours.doubleValue());
|
|
|
|
+ dto.setViolationDays(violationDays);
|
|
|
|
+ dto.setScanPeriod(sopPeriodDto.getScanPeriod());
|
|
|
|
+ dto.setMarkPaperPeriod(sopPeriodDto.getMarkPaperPeriod());
|
|
|
|
+ result.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DingStatisticByCrmDto> findStatisticByCrm(Long serviceId) {
|
|
|
|
+ List<DingStatisticByCrmDto> result = new ArrayList<>();
|
|
|
|
+ QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (serviceId != null) {
|
|
|
|
+ queryWrapper.lambda().eq(TBDingStatistic::getServiceId, serviceId).isNotNull(TBDingStatistic::getSopNo);
|
|
|
|
+ }
|
|
|
|
+ queryWrapper.lambda().isNotNull(TBDingStatistic::getCrmNo);
|
|
|
|
+ List<TBDingStatistic> datasource = this.list(queryWrapper);
|
|
|
|
+ List<String> crmNoList = datasource.stream().map(TBDingStatistic::getCrmNo).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (String crmNo : crmNoList) {
|
|
|
|
+ TBCrm tbCrm = tbCrmService.findByCrmNo(crmNo);
|
|
|
|
+ List<TBCrmDetail> tbCrmDetailList = tbCrmDetailService.list(
|
|
|
|
+ new QueryWrapper<TBCrmDetail>().lambda().eq(TBCrmDetail::getCrmNo, crmNo));
|
|
|
|
+ int scanPeriod = 0;
|
|
|
|
+ int markPaperPeriod = 0;
|
|
|
|
+ for (TBCrmDetail tbCrmDetail : tbCrmDetailList) {
|
|
|
|
+ SopPeriodDto sopPeriodDto = this.findSopPeriod(tbCrmDetail);
|
|
|
|
+ scanPeriod = scanPeriod + sopPeriodDto.getScanPeriod();
|
|
|
|
+ markPaperPeriod = markPaperPeriod + sopPeriodDto.getMarkPaperPeriod();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<TBDingStatistic> tbDingStatisticList = datasource.stream().filter(e -> crmNo.equals(e.getCrmNo())).collect(Collectors.toList());
|
|
|
|
+ String serviceName = "";
|
|
|
|
+ int actualDays = 0;
|
|
|
|
+ int weekdays = 0;
|
|
|
|
+ int weekends = 0;
|
|
|
|
+ int legalHolidays = 0;
|
|
|
|
+ BigDecimal workHours = new BigDecimal(0);
|
|
|
|
+ int violationDays = 0;
|
|
|
|
+
|
|
|
|
+ for (TBDingStatistic tbDingStatistic : tbDingStatisticList) {
|
|
|
|
+ serviceName = tbDingStatistic.getServiceName();
|
|
|
|
+ actualDays = actualDays + tbDingStatistic.getActualDays();
|
|
|
|
+ weekdays = weekdays + tbDingStatistic.getWeekdays();
|
|
|
|
+ weekends = weekends + tbDingStatistic.getWeekends();
|
|
|
|
+ legalHolidays = legalHolidays + tbDingStatistic.getLegalHolidays();
|
|
|
|
+ workHours = workHours.add(tbDingStatistic.getWorkHours());
|
|
|
|
+ violationDays = violationDays + tbDingStatistic.getViolationDays();
|
|
|
|
+ }
|
|
|
|
+ DingStatisticByCrmDto dto = new DingStatisticByCrmDto();
|
|
|
|
+ dto.setServiceName(serviceName);
|
|
|
|
+ dto.setCrmNo(crmNo);
|
|
|
|
+ dto.setCrmName(tbCrm.getName());
|
|
|
|
+ dto.setActualDays(actualDays);
|
|
|
|
+ dto.setWeekdays(weekdays);
|
|
|
|
+ dto.setWeekends(weekends);
|
|
|
|
+ dto.setLegalHolidays(legalHolidays);
|
|
|
|
+ dto.setWorkHours(workHours.doubleValue());
|
|
|
|
+ dto.setViolationDays(violationDays);
|
|
|
|
+ dto.setScanPeriod(scanPeriod);
|
|
|
|
+ dto.setMarkPaperPeriod(markPaperPeriod);
|
|
|
|
+ result.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DingStatisticByCustomDto> findStatisticByCustom(Long serviceId) {
|
|
|
|
+ List<DingStatisticByCustomDto> result = new ArrayList<>();
|
|
|
|
+ QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (serviceId != null) {
|
|
|
|
+ queryWrapper.lambda().eq(TBDingStatistic::getServiceId, serviceId);
|
|
|
|
+ }
|
|
|
|
+ queryWrapper.lambda().isNotNull(TBDingStatistic::getSopNo);
|
|
|
|
+ List<TBDingStatistic> datasource = this.list(queryWrapper);
|
|
|
|
+ List<Long> customIdList = datasource.stream().map(TBDingStatistic::getCustomId).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (Long customId : customIdList) {
|
|
|
|
+ List<TBCrmDetail> tbCrmDetailList = tbCrmDetailService.findByServiceIdAndCustomId(serviceId, customId);
|
|
|
|
+ int scanPeriod = 0;
|
|
|
|
+ int markPaperPeriod = 0;
|
|
|
|
+ for (TBCrmDetail tbCrmDetail : tbCrmDetailList) {
|
|
|
|
+ SopPeriodDto sopPeriodDto = this.findSopPeriod(tbCrmDetail);
|
|
|
|
+ scanPeriod = scanPeriod + sopPeriodDto.getScanPeriod();
|
|
|
|
+ markPaperPeriod = markPaperPeriod + sopPeriodDto.getMarkPaperPeriod();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<TBDingStatistic> tbDingStatisticList = datasource.stream().filter(e -> customId.equals(e.getCustomId())).collect(Collectors.toList());
|
|
|
|
+ String serviceName = "";
|
|
|
|
+ String customName = sysCustomService.getById(customId).getName();
|
|
|
|
+ int actualDays = 0;
|
|
|
|
+ int weekdays = 0;
|
|
|
|
+ int weekends = 0;
|
|
|
|
+ int legalHolidays = 0;
|
|
|
|
+ BigDecimal workHours = new BigDecimal(0);
|
|
|
|
+ int violationDays = 0;
|
|
|
|
+
|
|
|
|
+ for (TBDingStatistic tbDingStatistic : tbDingStatisticList) {
|
|
|
|
+ serviceName = tbDingStatistic.getServiceName();
|
|
|
|
+ actualDays = actualDays + tbDingStatistic.getActualDays();
|
|
|
|
+ weekdays = weekdays + tbDingStatistic.getWeekdays();
|
|
|
|
+ weekends = weekends + tbDingStatistic.getWeekends();
|
|
|
|
+ legalHolidays = legalHolidays + tbDingStatistic.getLegalHolidays();
|
|
|
|
+ workHours = workHours.add(tbDingStatistic.getWorkHours());
|
|
|
|
+ violationDays = violationDays + tbDingStatistic.getViolationDays();
|
|
|
|
+ }
|
|
|
|
+ DingStatisticByCustomDto dto = new DingStatisticByCustomDto();
|
|
|
|
+ dto.setServiceName(serviceName);
|
|
|
|
+ dto.setCustomName(customName);
|
|
|
|
+ dto.setActualDays(actualDays);
|
|
|
|
+ dto.setWeekdays(weekdays);
|
|
|
|
+ dto.setWeekends(weekends);
|
|
|
|
+ dto.setLegalHolidays(legalHolidays);
|
|
|
|
+ dto.setWorkHours(workHours.doubleValue());
|
|
|
|
+ dto.setViolationDays(violationDays);
|
|
|
|
+ dto.setScanPeriod(scanPeriod);
|
|
|
|
+ dto.setMarkPaperPeriod(markPaperPeriod);
|
|
|
|
+ result.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DingStatisticBySupplierDto> findStatisticBySupplier(Long serviceId) {
|
|
|
|
+ List<DingStatisticBySupplierDto> result = new ArrayList<>();
|
|
|
|
+ QueryWrapper<TBDingStatistic> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (serviceId != null) {
|
|
|
|
+ queryWrapper.lambda().eq(TBDingStatistic::getServiceId, serviceId);
|
|
|
|
+ }
|
|
|
|
+ List<TBDingStatistic> datasource = this.list(queryWrapper);
|
|
|
|
+ List<Long> supplierIdList = datasource.stream().map(TBDingStatistic::getSupplierId).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (Long supplierId : supplierIdList) {
|
|
|
|
+ List<TBDingStatistic> tbDingStatisticList = datasource.stream().filter(e -> supplierId.equals(e.getSupplierId())).collect(Collectors.toList());
|
|
|
|
+ String serviceName = "";
|
|
|
|
+ String supplierName = sysSupplierService.getById(supplierId).getName();
|
|
|
|
+ int actualDays = 0;
|
|
|
|
+ int weekdays = 0;
|
|
|
|
+ int weekends = 0;
|
|
|
|
+ int legalHolidays = 0;
|
|
|
|
+ BigDecimal workHours = new BigDecimal(0);
|
|
|
|
+ int violationDays = 0;
|
|
|
|
+
|
|
|
|
+ for (TBDingStatistic tbDingStatistic : tbDingStatisticList) {
|
|
|
|
+ serviceName = tbDingStatistic.getServiceName();
|
|
|
|
+ actualDays = actualDays + tbDingStatistic.getActualDays();
|
|
|
|
+ weekdays = weekdays + tbDingStatistic.getWeekdays();
|
|
|
|
+ weekends = weekends + tbDingStatistic.getWeekends();
|
|
|
|
+ legalHolidays = legalHolidays + tbDingStatistic.getLegalHolidays();
|
|
|
|
+ workHours = workHours.add(tbDingStatistic.getWorkHours());
|
|
|
|
+ violationDays = violationDays + tbDingStatistic.getViolationDays();
|
|
|
|
+ }
|
|
|
|
+ DingStatisticBySupplierDto dto = new DingStatisticBySupplierDto();
|
|
|
|
+ dto.setServiceName(serviceName);
|
|
|
|
+ dto.setSupplierName(supplierName);
|
|
|
|
+ dto.setActualDays(actualDays);
|
|
|
|
+ dto.setWeekdays(weekdays);
|
|
|
|
+ dto.setWeekends(weekends);
|
|
|
|
+ dto.setLegalHolidays(legalHolidays);
|
|
|
|
+ dto.setWorkHours(workHours.doubleValue());
|
|
|
|
+ dto.setViolationDays(violationDays);
|
|
|
|
+ result.add(dto);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询sop周期
|
|
|
|
+ *
|
|
|
|
+ * @param tbCrmDetail 派单详情
|
|
|
|
+ * @return 结果
|
|
|
|
+ */
|
|
|
|
+ private SopPeriodDto findSopPeriod(TBCrmDetail tbCrmDetail) {
|
|
|
|
+ Long scanActualStartTime = tbCrmDetail.getScanActualStartTime();
|
|
|
|
+ Long scanActualEndTime = tbCrmDetail.getScanActualEndTime();
|
|
|
|
+ Long markPaperActualStartTime = tbCrmDetail.getMarkPaperActualStartTime();
|
|
|
|
+ Long markPaperActualEndTime = tbCrmDetail.getMarkPaperActualEndTime();
|
|
|
|
+ int scanPeriod = 0;
|
|
|
|
+ int markPaperPeriod = 0;
|
|
|
|
+ if (SystemConstant.longNotNull(scanActualStartTime) && SystemConstant.longNotNull(scanActualEndTime)) {
|
|
|
|
+ scanPeriod = DateDisposeUtils.getDaysBetween(scanActualStartTime, scanActualEndTime, SystemConstant.DEFAULT_DATE_YMD_S_PATTERN).size();
|
|
|
|
+ }
|
|
|
|
+ if (SystemConstant.longNotNull(markPaperActualStartTime) && SystemConstant.longNotNull(
|
|
|
|
+ markPaperActualEndTime)) {
|
|
|
|
+ markPaperPeriod = DateDisposeUtils.getDaysBetween(markPaperActualStartTime, markPaperActualEndTime,
|
|
|
|
+ SystemConstant.DEFAULT_DATE_YMD_S_PATTERN).size();
|
|
|
|
+ }
|
|
|
|
+ SopPeriodDto sopPeriodDto = new SopPeriodDto();
|
|
|
|
+ sopPeriodDto.setScanPeriod(scanPeriod);
|
|
|
|
+ sopPeriodDto.setMarkPaperPeriod(markPaperPeriod);
|
|
|
|
+ return sopPeriodDto;
|
|
|
|
+ }
|
|
}
|
|
}
|