|
|
@ -19,6 +19,7 @@ import com.ccsens.util.exception.BaseException; |
|
|
|
import com.ctc.wstx.util.DataUtil; |
|
|
|
import lombok.Data; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.time.DateUtils; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -32,6 +33,7 @@ import java.io.OutputStream; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.GregorianCalendar; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Slf4j |
|
|
@ -1065,7 +1067,49 @@ public class ExcelService implements IExcelService { |
|
|
|
return competeJoinList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public TableVo.SchedulePlan schedulePlanning(CompeteDto.CompeteTime params) { |
|
|
|
List<TableVo.SchedulePlanDetailAllIn> schedulePlanDetailListUp = new ArrayList<>(); |
|
|
|
List<TableVo.SchedulePlanDetailAllIn> schedulePlanDetailListDown = new ArrayList<>(); |
|
|
|
//关联查询项目名,该项目在config和project中都存在
|
|
|
|
List <TableVo.SchedulePlanDetail> schedulePlanDetailList = competeProjectConfigDao.selectDetail(); |
|
|
|
for (TableVo.SchedulePlanDetail schedulePlanDetail : schedulePlanDetailList){ |
|
|
|
//项目名
|
|
|
|
String projectName = schedulePlanDetail.getProjectName(); |
|
|
|
//开始时间yyyy-MM-dd HH:mm:ss
|
|
|
|
long startTime = schedulePlanDetail.getStartTime(); |
|
|
|
Date date = new Date(startTime); |
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm"); |
|
|
|
String sm = simpleDateFormat.format(date); |
|
|
|
//结束时间
|
|
|
|
long endTime = schedulePlanDetail.getEndTime(); |
|
|
|
Date date1 = new Date(endTime); |
|
|
|
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm"); |
|
|
|
String em = simpleDateFormat1.format(date1); |
|
|
|
//拼接
|
|
|
|
String string = projectName + "("+ sm +"-"+ em + ")"; |
|
|
|
//项目开始日期
|
|
|
|
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("MM-dd"); |
|
|
|
String md = simpleDateFormat2.format(date); |
|
|
|
//上午项目
|
|
|
|
if (Integer.parseInt(sm.substring(0,2)) >= 6 && Integer.parseInt(sm.substring(0,2)) <= 12){ |
|
|
|
TableVo.SchedulePlanDetailAllIn schedulePlanDetailAllIn = new TableVo.SchedulePlanDetailAllIn(); |
|
|
|
schedulePlanDetailAllIn.setData(md); |
|
|
|
schedulePlanDetailAllIn.setString(string); |
|
|
|
schedulePlanDetailListUp.add(schedulePlanDetailAllIn); |
|
|
|
}//下午项目
|
|
|
|
else if (Integer.parseInt(sm.substring(0,2)) > 12 && Integer.parseInt(sm.substring(0,2)) <= 18){ |
|
|
|
TableVo.SchedulePlanDetailAllIn schedulePlanDetailAllIn1 = new TableVo.SchedulePlanDetailAllIn(); |
|
|
|
schedulePlanDetailAllIn1.setData(md); |
|
|
|
schedulePlanDetailAllIn1.setString(string); |
|
|
|
schedulePlanDetailListDown.add(schedulePlanDetailAllIn1); |
|
|
|
} |
|
|
|
} |
|
|
|
TableVo.SchedulePlan schedulePlan = new TableVo.SchedulePlan(); |
|
|
|
schedulePlan.setSchedulePlanDetailListDown(schedulePlanDetailListDown); |
|
|
|
schedulePlan.setSchedulePlanDetailListUp(schedulePlanDetailListUp); |
|
|
|
return schedulePlan; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|