3cc2d625 康伟

kangwei:

1 个父辈 4e3dfbf2
package com.skua.modules.ajh.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.io.IOException;
......@@ -21,6 +22,7 @@ import com.skua.modules.ajh.vo.AjhPlanScheduleDataVO;
import com.skua.modules.common.vo.TreeNodeVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -164,31 +166,61 @@ public class AjhPlanScheduleDataController {
QueryWrapper<AjhPlanScheduleData> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("sd.factory_id",factoryId);
queryWrapper.eq("sd.date_time",month);
List<AjhPlanScheduleDataVO> dataList = ajhPlanScheduleDataService.queryByList( queryWrapper);
List<AjhPlanScheduleDataVO> scheduleDataVOList = ajhPlanScheduleDataService.queryByList( queryWrapper);
AjhPlanScheduleDataVO dataVO = null;
if(dataList != null && !dataList.isEmpty() ){
}else{
List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(factoryId);
if(treeNodeVOList != null && !treeNodeVOList.isEmpty()){
for(TreeNodeVO treeNodeVO : treeNodeVOList){
if(treeNodeVO.getChildren() != null && !treeNodeVO.getChildren().isEmpty()){
for(TreeNodeVO childrenVO : treeNodeVO.getChildren()){
//String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1,String configLevel2, String responsibler1, String completeTime2, String responsibler2
dataList.add( new AjhPlanScheduleDataVO(factoryId ,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(),
childrenVO.getId(),childrenVO.getCompleteTime(),childrenVO.getResponsibler()) ) ;
}
}else{
//String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1
dataList.add( new AjhPlanScheduleDataVO(factoryId ,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler())) ;
}
}
}
}
List<AjhPlanScheduleDataVO> dataList = new ArrayList<>();
List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(factoryId);
if(treeNodeVOList != null && !treeNodeVOList.isEmpty()){
for(TreeNodeVO treeNodeVO : treeNodeVOList){
if(treeNodeVO.getChildren() != null && !treeNodeVO.getChildren().isEmpty()){
for(TreeNodeVO childrenVO : treeNodeVO.getChildren()){
//String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1,String configLevel2, String responsibler1, String completeTime2, String responsibler2
dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList,childrenVO.getParentId(), childrenVO.getId());
if(dataVO == null ){
dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(),
childrenVO.getId(),childrenVO.getCompleteTime(),childrenVO.getResponsibler());
}
dataList.add(dataVO );
}
}else{
dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList, treeNodeVO.getId());
if(dataVO == null ){
dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler());
}
//String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1
dataList.add(dataVO );
}
}
}
result.setResult(dataList);
result.setSuccess(true);
return result;
}
private AjhPlanScheduleDataVO queryAjhPlanScheduleDataVO(List<AjhPlanScheduleDataVO> scheduleDataVOList,String configLevel1,String configLevel2){
AjhPlanScheduleDataVO scheduleDataVO = null;
if(scheduleDataVOList != null && !scheduleDataVOList.isEmpty() && StringUtils.isNotEmpty(configLevel1)){
for( AjhPlanScheduleDataVO dataVO: scheduleDataVOList){
if(configLevel1.equals( dataVO.getConfigLevel1() ) && configLevel2.equals( dataVO.getConfigLevel2() )){
scheduleDataVO = dataVO;break;
}
}
}
return scheduleDataVO;
}
private AjhPlanScheduleDataVO queryAjhPlanScheduleDataVO(List<AjhPlanScheduleDataVO> scheduleDataVOList,String configLevel1){
AjhPlanScheduleDataVO scheduleDataVO = null;
if(scheduleDataVOList != null && !scheduleDataVOList.isEmpty() && StringUtils.isNotEmpty(configLevel1)){
for( AjhPlanScheduleDataVO dataVO: scheduleDataVOList){
if(configLevel1.equals( dataVO.getConfigLevel1() )){
scheduleDataVO = dataVO;break;
}
}
}
return scheduleDataVO;
}
/**
* <pre>
* 导出excel
......
......@@ -99,8 +99,9 @@ public class AjhPlanScheduleDataVO {
public AjhPlanScheduleDataVO() {
}
public AjhPlanScheduleDataVO(String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) {
public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) {
this.factoryId = factoryId;
this.dateTime = dateTime;
this.workItermName = workItermName;
this.workContent = workContent;
......@@ -113,7 +114,7 @@ public class AjhPlanScheduleDataVO {
this.responsibler2 = responsibler2;
}
public AjhPlanScheduleDataVO(String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1) {
public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName,String configLevel1, String completeTime1, String responsibler1) {
this.factoryId = factoryId;
this.workItermName = workItermName;
this.workContent = workContent;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!