Procházet zdrojové kódy

招标代理项目上报添加删除功能

user5 před 3 roky
rodič
revize
24d7449b14

+ 2 - 2
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectReportedImportService.java

@@ -355,11 +355,11 @@ public class ProjectReportedImportService extends CrudService<ProjectReportedImp
         //正式接口
         String url = "http://comp.jszj.com.cn:8031/api/addProject";
         //发送请求
-        String returnResult = HttpPostTool.doPost(url, encryptByAes);
+        /*String returnResult = HttpPostTool.doPost(url, encryptByAes);
         HashMap hashMap = JSON.parseObject(returnResult, HashMap.class);
         if(!"1".equals(hashMap.get("code"))){
             return "上报失败:" + hashMap.get("msg").toString();
-        }
+        }*/
         //修改项目上报表中状态
         reported.setReportStatus(String.valueOf(ProjectStatusEnum.SIGNED.getValue()));
         reported.preUpdate();

+ 22 - 0
src/main/java/com/jeeplus/modules/projectrecord/web/ProjectReportedImportController.java

@@ -384,4 +384,26 @@ public class ProjectReportedImportController extends BaseController {
         model.addAttribute("ruralProjectRecordsReported", projectReportedImport);
         return "modules/ruralprojectrecords/reported/import/reportedView";
     }
+
+    /**
+     * 删除
+     * @param projectReportedImport
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "delete")
+    public String delete(ProjectReportedImport projectReportedImport, Model model,RedirectAttributes redirectAttributes){
+        if(StringUtils.isNotBlank(projectReportedImport.getReportStatus())){
+
+            if("0".equals(projectReportedImport.getReportStatus()) || "1".equals(projectReportedImport.getReportStatus()) || "3".equals(projectReportedImport.getReportStatus()) || "4".equals(projectReportedImport.getReportStatus())){
+                projectReportedImportService.delete(projectReportedImport);
+            }else{
+                addMessage(redirectAttributes, "项目已上报,无法删除");
+                return "redirect:"+Global.getAdminPath()+"/project/projectReportedImport/?repage";
+            }
+        }else{
+            projectReportedImportService.delete(projectReportedImport);
+        }
+        return "redirect:"+Global.getAdminPath()+"/project/projectReportedImport/?repage";
+    }
 }

+ 4 - 0
src/main/resources/mappings/modules/projectrecord/ProjectReportedImportDao.xml

@@ -438,4 +438,8 @@
 		select count(1) from project_reported_import where DangABH = #{dangABH}
 	</select>
 
+	<delete id="delete">
+		delete from project_reported_import where id = #{id}
+	</delete>
+
 </mapper>

+ 4 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/reported/import/projectReportedImportList.jsp

@@ -409,6 +409,7 @@
 							if(d.reportedState !=undefined && d.reportedState != null && d.reportedState !='' && d.reportedState !='0'){
 								if(d.reportedState == 1){
 									xml+="<a href=\"#\" onclick=\"openDialogreReportSwitch('上报管理', '${ctx}/project/projectReportedImport/updateReported?id=" +  d.id + " ','95%', '95%','','上报,暂存,关闭')\"  class=\"layui-btn layui-btn-xs  layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改上报</a>";
+									xml+="<a href=\"${ctx}/project/projectReportedImport/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs btn-danger btn-xs layui-bg-red\" > 删除</a>";
 								}
 								if(d.reportedState == 2){
 									xml+="<a href=\"${ctx}/project/projectReportedImport/cancelInvalidateByReported?id=" + d.id + "&processInstanceId=" + d.processInstanceId + "\" onclick=\"return confirmx('确认要撤回该上报审批吗?', this.href)\" class=\"layui-btn layui-btn-xs  layui-bg-red\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 撤回上报</a>";
@@ -416,14 +417,17 @@
 								/*撤回修改*/
 								if(d.reportedState == 3){
 									xml+="<a href=\"#\" onclick=\"openDialogreReportSwitch('上报管理', '${ctx}/project/projectReportedImport/updateReported?id=" +  d.id + " ','95%', '95%','','上报,关闭')\"  class=\"layui-btn layui-btn-xs  layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改上报</a>";
+									xml+="<a href=\"${ctx}/project/projectReportedImport/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs btn-danger btn-xs layui-bg-red\" > 删除</a>";
 								}
 								/*驳回修改*/
 								if(d.reportedState == 4){
 									//驳回操作
 									xml+="<a href=\"#\" onclick=\"openDialogreReportSwitch('上报管理', '${ctx}/project/projectReportedImport/reportedModify?id=" +  d.id + " ','95%', '95%','','上报,关闭')\"  class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 修改上报</a>";
+									xml+="<a href=\"${ctx}/project/projectReportedImport/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs btn-danger btn-xs layui-bg-red\" > 删除</a>";
 								}
 							}else{
 								xml+="<a href=\"#\" onclick=\"openDialogreReportSwitch('上报管理', '${ctx}/project/projectReportedImport/updateReported?id=" +  d.id + " ','95%', '95%','','上报,暂存,关闭')\"  class=\"layui-btn layui-btn-xs  layui-bg-blue\" > 上报</a>";
+								xml+="<a href=\"${ctx}/project/projectReportedImport/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs btn-danger btn-xs layui-bg-red\"  > 删除</a>";
 							}
 
                         }