|
@@ -14,6 +14,7 @@ import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
|
import com.jeeplus.modules.projectrecord.entity.AdminProjectReportedImport;
|
|
|
import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
|
|
|
import com.jeeplus.modules.projectrecord.service.AdminProjectReportedImportService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.ReportedConsultant;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
|
|
@@ -27,16 +28,15 @@ 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.ModelAttribute;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+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.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -89,6 +89,7 @@ public class AdminProjectReportedImportController extends BaseController {
|
|
|
Page<AdminProjectReportedImport> page = projectReportedImportService.findPage(new Page<AdminProjectReportedImport>(request, response), projectReportedImport);
|
|
|
|
|
|
model.addAttribute("page", page);
|
|
|
+ model.addAttribute("projectReportedImport", projectReportedImport);
|
|
|
model.addAttribute("moneyAll", projectReportedImportService.getMoneyAll(projectReportedImport));
|
|
|
return "modules/ruralprojectrecords/reported/import/adminProjectReportedImportList";
|
|
|
}
|
|
@@ -238,6 +239,93 @@ public class AdminProjectReportedImportController extends BaseController {
|
|
|
return "redirect:"+Global.getAdminPath()+"/project/adminProjectReportedImport/?repage";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存报告并提交审核
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @param redirectAttributes
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "batchReport")
|
|
|
+ public Map<String, Object> batchReport(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ if(!BaseController.REPORTSWITCH){
|
|
|
+ // 业务逻辑处理
|
|
|
+ result.put("message", "项目上报失败:上报管理员已关闭上报模块");
|
|
|
+ result.put("success",false);
|
|
|
+ }
|
|
|
+
|
|
|
+ String listIds = request.getParameter("listId");
|
|
|
+ List<String> idList = Arrays.asList(listIds.split(","));
|
|
|
+
|
|
|
+ StringBuilder successStr = new StringBuilder("项目上报成功");
|
|
|
+ StringBuilder errorStr = new StringBuilder("造价记录编号为:");
|
|
|
+
|
|
|
+ for (String id : idList) {
|
|
|
+ AdminProjectReportedImport projectReportedImport = null;
|
|
|
+ if (StringUtils.isNotBlank(id)){
|
|
|
+ projectReportedImport = projectReportedImportService.get(id);
|
|
|
+ }
|
|
|
+ if (null != projectReportedImport ){
|
|
|
+ if("5".equals(projectReportedImport.getReportStatus())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ projectReportedImportService.disposeListImport(projectReportedImport);
|
|
|
+
|
|
|
+
|
|
|
+ //根据上报id查询上报咨询员的信息
|
|
|
+ List<RuralReportConsultant> reportedConsultants=ruralProjectMessageS.getReportedConsultantsList(projectReportedImport.getId());
|
|
|
+ //查询报告咨询员的信息
|
|
|
+ //对上报的咨询员进行处理
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageS.disposereportedConsultant(reportedConsultants);
|
|
|
+ if(consultantList.size()>0){
|
|
|
+ List<ReportedConsultant> reportedConsultantList = Lists.newArrayList();
|
|
|
+
|
|
|
+ for (RuralReportConsultant ruralReportConsultant : consultantList) {
|
|
|
+ ReportedConsultant reportedConsultant = new ReportedConsultant();
|
|
|
+ reportedConsultant.setWcyysr(ruralReportConsultant.getWcyysr());
|
|
|
+ reportedConsultant.setZixunyuan(ruralReportConsultant.getZixunyuan());
|
|
|
+ reportedConsultant.setIdCard(ruralReportConsultant.getIdCard());
|
|
|
+ reportedConsultant.setWcyysrbl(ruralReportConsultant.getWcyysrbl());
|
|
|
+ reportedConsultant.setWcyysr(ruralReportConsultant.getWcyysr());
|
|
|
+ reportedConsultant.setRoleFlag(ruralReportConsultant.getRoleFlag());
|
|
|
+ reportedConsultant.setId(ruralReportConsultant.getId());
|
|
|
+ reportedConsultantList.add(reportedConsultant);
|
|
|
+ }
|
|
|
+ projectReportedImport.setReportedConsultantList(reportedConsultantList);
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = "";
|
|
|
+ if(!projectReportedImport.getIsNewRecord()){//编辑表单保存
|
|
|
+ AdminProjectReportedImport t = projectReportedImportService.getRuralProjectRecordsReported(projectReportedImport.getId());;//从数据库取出记录的值
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(projectReportedImport, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ str = projectReportedImportService.saveReportedInfo(t);
|
|
|
+ }else{//新增表单保存
|
|
|
+ str = projectReportedImportService.saveReportedInfo(projectReportedImport);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(str)){
|
|
|
+ errorStr.append(projectReportedImport.getDangABH()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(errorStr.toString()) && errorStr.toString().length()>8){
|
|
|
+ errorStr.deleteCharAt(errorStr.length() - 1);
|
|
|
+ errorStr.append("。 数据存在错误,请单独进行上报");
|
|
|
+ // 业务逻辑处理
|
|
|
+ result.put("message", errorStr.toString());
|
|
|
+ }else{
|
|
|
+
|
|
|
+ // 业务逻辑处理
|
|
|
+ result.put("message", successStr.toString());
|
|
|
+ result.put("success",true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|