|
@@ -3,43 +3,20 @@
|
|
|
*/
|
|
|
package com.jeeplus.modules.projectAccessory.web;
|
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
-import com.jeeplus.common.json.AjaxJson;
|
|
|
-import com.jeeplus.common.persistence.Page;
|
|
|
-import com.jeeplus.common.utils.DateUtils;
|
|
|
-import com.jeeplus.common.utils.MyBeanUtils;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
-import com.jeeplus.common.utils.excel.ExportExcel;
|
|
|
-import com.jeeplus.common.utils.excel.ImportExcel;
|
|
|
import com.jeeplus.common.web.BaseController;
|
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
|
|
|
-import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationTree;
|
|
|
-import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
|
|
|
import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
|
|
|
import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
|
|
|
-import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
|
|
|
-import com.jeeplus.modules.projectVisa.entity.VisaTreeData;
|
|
|
-import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
|
|
|
-import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
|
|
|
-import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
|
|
|
-import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
|
-import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
|
-import com.jeeplus.modules.sys.entity.User;
|
|
|
-import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
-import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import javax.validation.ConstraintViolationException;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -84,7 +61,19 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
@RequestMapping(value = "getAccessoryRelationList")
|
|
|
@ResponseBody
|
|
|
public Map<String,List> getAccessoryRelationList(ProjectAccessoryRelationInfo projectAccessoryRelationInfo){
|
|
|
- return projectAccessoryRelationService.findListTree(projectAccessoryRelationInfo);
|
|
|
+ Map map = new HashMap();
|
|
|
+ if(StringUtils.isBlank(projectAccessoryRelationInfo.getAttachmentProjectType()) || StringUtils.isBlank(projectAccessoryRelationInfo.getAttachmentProjectSort())){
|
|
|
+ map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectSort())){
|
|
|
+ Integer decide = projectAccessoryRelationService.decideAttachmentProjectSort(projectAccessoryRelationInfo.getAttachmentProjectSort());
|
|
|
+ if(1 == decide || StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectApprovalMoney())){
|
|
|
+ return projectAccessoryRelationService.findListTree(projectAccessoryRelationInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -108,10 +97,9 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
if (StringUtils.isNotBlank(projectAccessoryRelationInfo.getParentIds())) {
|
|
|
String[] parentIds = projectAccessoryRelationInfo.getParentIds().split(",");
|
|
|
List<String> parentIdList = Arrays.asList(parentIds);
|
|
|
- projectAccessoryRelationInfo.setProjectType(parentIdList.get(0));
|
|
|
- projectAccessoryRelationInfo.setAttachType(parentIdList.get(1));
|
|
|
+ projectAccessoryRelationInfo.setAttachType(parentIdList.get(0));
|
|
|
}
|
|
|
- projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateList(projectAccessoryRelationInfo.getAttachType(), projectAccessoryRelationInfo.getProjectType()));
|
|
|
+ projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateListByForm(projectAccessoryRelationInfo));
|
|
|
//获取项目阶段 并进行处理展示数据信息
|
|
|
/*List<MainDictDetail> mainDictDetails = projectAccessoryRelationService.attachmentProjectList();
|
|
|
if (mainDictDetails.size() > 0) {
|
|
@@ -164,7 +152,7 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
projectAccessoryRelationService.save(projectAccessoryInfo);//保存
|
|
|
}
|
|
|
addMessage(redirectAttributes, "保存项目类型附件设置成功");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage&attachmentProjectType="+projectAccessoryInfo.getAttachmentProjectType()+"&attachmentProjectSort="+projectAccessoryInfo.getAttachmentProjectSort()+"&attachmentProjectApprovalMoney="+projectAccessoryInfo.getAttachmentProjectApprovalMoney();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -178,7 +166,7 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
public String delete(ProjectAccessoryRelationInfo projectAccessoryInfo, RedirectAttributes redirectAttributes) {
|
|
|
projectAccessoryRelationService.delete(projectAccessoryInfo);
|
|
|
addMessage(redirectAttributes, "删除项目类型附件设置成功");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage&attachmentProjectType="+projectAccessoryInfo.getAttachmentProjectType()+"&attachmentProjectSort="+projectAccessoryInfo.getAttachmentProjectSort()+"&attachmentProjectApprovalMoney="+projectAccessoryInfo.getAttachmentProjectApprovalMoney();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -189,13 +177,13 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
*/
|
|
|
@RequiresPermissions("projectAccessoryRelation:projectAccessoryRelation:del")
|
|
|
@RequestMapping(value = "deleteAll")
|
|
|
- public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
|
|
|
+ public String deleteAll(String ids,ProjectAccessoryRelationInfo projectAccessoryInfo, RedirectAttributes redirectAttributes) {
|
|
|
String idArray[] =ids.split(",");
|
|
|
for(String id : idArray){
|
|
|
projectAccessoryRelationService.delete(projectAccessoryRelationService.get(id));
|
|
|
}
|
|
|
addMessage(redirectAttributes, "删除项目类型附件设置成功");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage&attachmentProjectType="+projectAccessoryInfo.getAttachmentProjectType()+"&attachmentProjectSort="+projectAccessoryInfo.getAttachmentProjectSort()+"&attachmentProjectApprovalMoney="+projectAccessoryInfo.getAttachmentProjectApprovalMoney();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -204,9 +192,9 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "formAttachment")
|
|
|
- public String formAttachment(Model model,String parentId,String projectType,String projectId) {
|
|
|
+ public String formAttachment(Model model,String parentId,String projectType,String projectId,Double reviewFee) {
|
|
|
ProjectAccessoryRelationInfo projectAccessoryRelationInfo = new ProjectAccessoryRelationInfo();
|
|
|
- projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateAndOtherList(parentId, projectType,projectId));
|
|
|
+ projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateAndOtherList(parentId, projectType,projectId,reviewFee));
|
|
|
model.addAttribute("projectAccessoryRelationInfo", projectAccessoryRelationInfo);
|
|
|
return "modules/projectAccessory/projectAccessoryRelation/fileAttachForm";
|
|
|
}
|
|
@@ -217,4 +205,18 @@ public class ProjectAccessoryRelationController extends BaseController {
|
|
|
return projectTemplateService.getAttachmentCount(attachmentId,projectId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 项目类别是否为打包项目判定
|
|
|
+ * @param attachmentProjectSort
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("decideAttachmentProjectSort")
|
|
|
+ @ResponseBody
|
|
|
+ public Map<String,Integer> decideAttachmentProjectSort(@RequestParam("attachmentProjectSort") String attachmentProjectSort){
|
|
|
+ Map map = new HashMap();
|
|
|
+ Integer result = projectAccessoryRelationService.decideAttachmentProjectSort(attachmentProjectSort);
|
|
|
+ map.put("result",result);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
}
|