3cc2d625 康伟

kangwei:

1 个父辈 4e3dfbf2
1 package com.skua.modules.ajh.controller; 1 package com.skua.modules.ajh.controller;
2 2
3 import java.util.ArrayList;
3 import java.util.List; 4 import java.util.List;
4 import java.util.Map; 5 import java.util.Map;
5 import java.io.IOException; 6 import java.io.IOException;
...@@ -21,6 +22,7 @@ import com.skua.modules.ajh.vo.AjhPlanScheduleDataVO; ...@@ -21,6 +22,7 @@ import com.skua.modules.ajh.vo.AjhPlanScheduleDataVO;
21 import com.skua.modules.common.vo.TreeNodeVO; 22 import com.skua.modules.common.vo.TreeNodeVO;
22 import lombok.extern.slf4j.Slf4j; 23 import lombok.extern.slf4j.Slf4j;
23 24
25 import org.apache.commons.lang3.StringUtils;
24 import org.jeecgframework.poi.excel.ExcelImportUtil; 26 import org.jeecgframework.poi.excel.ExcelImportUtil;
25 import org.jeecgframework.poi.excel.def.NormalExcelConstants; 27 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
26 import org.jeecgframework.poi.excel.entity.ExportParams; 28 import org.jeecgframework.poi.excel.entity.ExportParams;
...@@ -164,24 +166,31 @@ public class AjhPlanScheduleDataController { ...@@ -164,24 +166,31 @@ public class AjhPlanScheduleDataController {
164 QueryWrapper<AjhPlanScheduleData> queryWrapper = new QueryWrapper<>(); 166 QueryWrapper<AjhPlanScheduleData> queryWrapper = new QueryWrapper<>();
165 queryWrapper.eq("sd.factory_id",factoryId); 167 queryWrapper.eq("sd.factory_id",factoryId);
166 queryWrapper.eq("sd.date_time",month); 168 queryWrapper.eq("sd.date_time",month);
167 List<AjhPlanScheduleDataVO> dataList = ajhPlanScheduleDataService.queryByList( queryWrapper); 169 List<AjhPlanScheduleDataVO> scheduleDataVOList = ajhPlanScheduleDataService.queryByList( queryWrapper);
168 AjhPlanScheduleDataVO dataVO = null; 170 AjhPlanScheduleDataVO dataVO = null;
169 if(dataList != null && !dataList.isEmpty() ){ 171 List<AjhPlanScheduleDataVO> dataList = new ArrayList<>();
170 }else{
171 List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(factoryId); 172 List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(factoryId);
172 if(treeNodeVOList != null && !treeNodeVOList.isEmpty()){ 173 if(treeNodeVOList != null && !treeNodeVOList.isEmpty()){
173 for(TreeNodeVO treeNodeVO : treeNodeVOList){ 174 for(TreeNodeVO treeNodeVO : treeNodeVOList){
174 if(treeNodeVO.getChildren() != null && !treeNodeVO.getChildren().isEmpty()){ 175 if(treeNodeVO.getChildren() != null && !treeNodeVO.getChildren().isEmpty()){
175 for(TreeNodeVO childrenVO : treeNodeVO.getChildren()){ 176 for(TreeNodeVO childrenVO : treeNodeVO.getChildren()){
176 //String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1,String configLevel2, String responsibler1, String completeTime2, String responsibler2 177 //String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1,String configLevel2, String responsibler1, String completeTime2, String responsibler2
177 dataList.add( new AjhPlanScheduleDataVO(factoryId ,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(), 178 dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList,childrenVO.getParentId(), childrenVO.getId());
178 childrenVO.getId(),childrenVO.getCompleteTime(),childrenVO.getResponsibler()) ) ; 179 if(dataVO == null ){
180 dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(),
181 childrenVO.getId(),childrenVO.getCompleteTime(),childrenVO.getResponsibler());
182 }
183 dataList.add(dataVO );
179 } 184 }
180 }else{ 185 }else{
181 //String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1 186 dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList, treeNodeVO.getId());
182 dataList.add( new AjhPlanScheduleDataVO(factoryId ,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler())) ; 187 if(dataVO == null ){
188 dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler());
183 } 189 }
190 //String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1
191 dataList.add(dataVO );
184 } 192 }
193
185 } 194 }
186 } 195 }
187 result.setResult(dataList); 196 result.setResult(dataList);
...@@ -189,6 +198,29 @@ public class AjhPlanScheduleDataController { ...@@ -189,6 +198,29 @@ public class AjhPlanScheduleDataController {
189 return result; 198 return result;
190 } 199 }
191 200
201 private AjhPlanScheduleDataVO queryAjhPlanScheduleDataVO(List<AjhPlanScheduleDataVO> scheduleDataVOList,String configLevel1,String configLevel2){
202 AjhPlanScheduleDataVO scheduleDataVO = null;
203 if(scheduleDataVOList != null && !scheduleDataVOList.isEmpty() && StringUtils.isNotEmpty(configLevel1)){
204 for( AjhPlanScheduleDataVO dataVO: scheduleDataVOList){
205 if(configLevel1.equals( dataVO.getConfigLevel1() ) && configLevel2.equals( dataVO.getConfigLevel2() )){
206 scheduleDataVO = dataVO;break;
207 }
208 }
209 }
210 return scheduleDataVO;
211 }
212 private AjhPlanScheduleDataVO queryAjhPlanScheduleDataVO(List<AjhPlanScheduleDataVO> scheduleDataVOList,String configLevel1){
213 AjhPlanScheduleDataVO scheduleDataVO = null;
214 if(scheduleDataVOList != null && !scheduleDataVOList.isEmpty() && StringUtils.isNotEmpty(configLevel1)){
215 for( AjhPlanScheduleDataVO dataVO: scheduleDataVOList){
216 if(configLevel1.equals( dataVO.getConfigLevel1() )){
217 scheduleDataVO = dataVO;break;
218 }
219 }
220 }
221 return scheduleDataVO;
222 }
223
192 /** 224 /**
193 * <pre> 225 * <pre>
194 * 导出excel 226 * 导出excel
......
...@@ -99,8 +99,9 @@ public class AjhPlanScheduleDataVO { ...@@ -99,8 +99,9 @@ public class AjhPlanScheduleDataVO {
99 public AjhPlanScheduleDataVO() { 99 public AjhPlanScheduleDataVO() {
100 } 100 }
101 101
102 public AjhPlanScheduleDataVO(String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) { 102 public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) {
103 this.factoryId = factoryId; 103 this.factoryId = factoryId;
104 this.dateTime = dateTime;
104 this.workItermName = workItermName; 105 this.workItermName = workItermName;
105 this.workContent = workContent; 106 this.workContent = workContent;
106 107
...@@ -113,7 +114,7 @@ public class AjhPlanScheduleDataVO { ...@@ -113,7 +114,7 @@ public class AjhPlanScheduleDataVO {
113 this.responsibler2 = responsibler2; 114 this.responsibler2 = responsibler2;
114 } 115 }
115 116
116 public AjhPlanScheduleDataVO(String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1) { 117 public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName,String configLevel1, String completeTime1, String responsibler1) {
117 this.factoryId = factoryId; 118 this.factoryId = factoryId;
118 this.workItermName = workItermName; 119 this.workItermName = workItermName;
119 this.workContent = workContent; 120 this.workContent = workContent;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!