Browse Source

项目批次归档

user5 4 years ago
parent
commit
2c5f88d1e8

+ 5 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/dao/ProjectFilingbatchRelationDao.java

@@ -24,4 +24,9 @@ public interface ProjectFilingbatchRelationDao extends CrudDao<ProjectFilingbatc
      * @param relation
      */
     void updateStatus(ProjectFilingbatchRelation relation);
+    /**
+     * 修改驳回状态
+     * @param filingBatchId
+     */
+    void updateDelFlagByFilingBatch(String  filingBatchId);
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/projectFilingBatch/entity/ProjectFilingBatch.java

@@ -34,7 +34,7 @@ public class ProjectFilingBatch extends DataEntity<ProjectFilingBatch> {
     private String home;
     private Act act;//工作流对象
     private String information; //归档批次信息
-    private List<ProjectFilingbatchRelation> projectFilingbatchRelations;
+    private List<ProjectFilingbatchRelation> projectFilingbatchRelations =Lists.newArrayList();
     private String relationId;
     private Integer relationdelFlag;
 

+ 20 - 9
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -403,15 +403,6 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 relation.setFilingBatch(projectFilingBatch.getId());
                 projectFilingbatchRelationDao.updateStatus(relation);
             }
-        //如果流程通过
-        }else if(!"modifyApply".equals(taskDefKey)){
-            for (RuralProjectRecords projectRecords:projectFilingBatch.getProject()){
-                ProjectFilingbatchRelation relation=projectFilingbatchRelationDao.getProjectId(projectRecords.getId());
-                //查询已存在项目归档信息,将被驳回(4)的状态的项目的del_status改为1(逻辑删除)
-                if(4 ==relation.getStatus()){
-                    this.updateDelFlag(relation);
-                }
-            }
         }
 
         User createUser = UserUtils.get(projectFilingBatch.getCreateBy().getId());
@@ -561,6 +552,16 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
         List<User> userList = new ArrayList<>();
         if(!state) {
             users.add(projectFilingBatch.getCreateBy());
+            //审批通过,处理归档项目状态
+            List<ProjectFilingbatchRelation> projectFilingbatchRelationList = projectFilingBatch.getProjectFilingbatchRelations();
+            for (ProjectFilingbatchRelation info: projectFilingbatchRelationList) {
+                if(4 == info.getStatus()){
+                    info.setDelFlag("1");
+                    info.setBoxNum("");
+                    info.setReBoxNum("");
+                }
+                this.updateByid(info);
+            }
             //审核完成提示框
             String title = "归档批次号【"+projectFilingBatch.getFilingBatch()+"】归档成功";
             String content = "归档批次号【"+projectFilingBatch.getFilingBatch()+"】归档成功,归档批次编号:"+projectFilingBatch.getId();
@@ -740,4 +741,14 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
         projectFilingbatchRelationDao.updateDelFlag(filingbatchRelation);
     }
 
+    /**
+     * 项目归档表逻辑删除
+     * @param filingBatch
+     */
+    @Transactional(readOnly = false)
+    public void delete(ProjectFilingBatch filingBatch){
+        super.delete(filingBatch);
+        projectFilingbatchRelationDao.updateDelFlagByFilingBatch(filingBatch.getId());
+    }
+
 }

+ 26 - 11
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -99,18 +99,33 @@ public class ProjectFilingBatchController extends BaseController {
             //查询归档项目信息
             List<ProjectFilingBatch> projectFilingBatches = projectFilingBatchService.getProjectFilingBatchRelationList(projectFilingBatch.getId());
             for (ProjectFilingBatch filingBatch : projectFilingBatches) {
-                RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(filingBatch.getProjectId());
-                ruralProjectRecords.setProjectReportNumber(filingBatch.getNumber());
-                if(1 == filingBatch.getRelationdelFlag()){
-                    ruralProjectRecords.setBoxNum("——");
-                    ruralProjectRecords.setReBoxNum("——");
-                    ruralProjectRecords.setDelFlag("驳回");
-                }else{
-                    ruralProjectRecords.setBoxNum(filingBatch.getBoxNum());
-                    ruralProjectRecords.setReBoxNum(filingBatch.getReBoxNum());
-                    ruralProjectRecords.setDelFlag("通过");
+                if(StringUtils.isNotBlank(filingBatch.getProjectId())){
+                    RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(filingBatch.getProjectId());
+                    ruralProjectRecords.setProjectReportNumber(filingBatch.getNumber());
+                    if(7 == filingBatch.getFilingStatus()){
+                        ruralProjectRecords.setBoxNum("");
+                        ruralProjectRecords.setReBoxNum("");
+                        ruralProjectRecords.setDelFlag("已作废");
+                    }else{
+                        if(2 == filingBatch.getStatus()){
+                            ruralProjectRecords.setBoxNum("");
+                            ruralProjectRecords.setReBoxNum("");
+                            ruralProjectRecords.setDelFlag("审批中");
+                        }else if(5 == filingBatch.getStatus() || 4 == filingBatch.getStatus()){
+                            if(1 == filingBatch.getRelationdelFlag()){
+                                ruralProjectRecords.setBoxNum("——");
+                                ruralProjectRecords.setReBoxNum("——");
+                                ruralProjectRecords.setDelFlag("驳回");
+                            }else{
+                                ruralProjectRecords.setBoxNum(filingBatch.getBoxNum());
+                                ruralProjectRecords.setReBoxNum(filingBatch.getReBoxNum());
+                                ruralProjectRecords.setDelFlag("通过");
+                            }
+                        }
+                    }
+                    ruralProjectRecordsList.add(ruralProjectRecords);
                 }
-                ruralProjectRecordsList.add(ruralProjectRecords);
+
             }
             //获取归档人
             projectFilingBatch.setCreateBy(UserUtils.get(projectFilingBatch.getCreateBy().getId()));

+ 13 - 3
src/main/resources/mappings/modules/projectGuidang/ProjectFilingbatchRelationDao.xml

@@ -29,13 +29,13 @@
 			<if test="updateBy!=null and updateBy.id!=null and updateBy.id!=''">
 				update_by = #{updateBy.id},
 			</if>
-			<if test="updateDate!=null">
+			<if test="updateDate!=null and updateDate!=''">
 				update_date = #{updateDate},
 			</if>
-			<if test="filingBatch!=null">
+			<if test="filingBatch!=null and filingBatch!=''">
 				filing_batch=#{filingBatch},
 			</if>
-			<if test="status!=null">
+			<if test="status!=null and status!=''">
 				`status`=#{status},
 			</if>
 			<if test="boxNum!=null">
@@ -44,6 +44,9 @@
 			<if test="reBoxNum!=null">
 				re_box_num=#{reBoxNum}
 			</if>
+			<if test="delFlag!=null">
+				,del_flag=#{delFlag}
+			</if>
 		</set>
 		where id=#{id}
 	</update>
@@ -76,4 +79,11 @@
 		set status = #{status}
 		where id = #{id}
 	</update>
+
+	<update id="updateDelFlagByFilingBatch">
+		update project_flingbatch_relation
+		set del_flag = 1
+		,status = 4
+		where filing_batch = #{id}
+	</update>
 </mapper>

+ 99 - 98
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchAudit.jsp

@@ -22,21 +22,33 @@
                 }
                 var flag=true;
                 if($("#flag").val()!="no1"){
-					$("#workClientLinkmanList tr").each(function(){
-						var clientType=$(this).find("td").eq(5).find(".clientType").val();
-						var reboxNum=$(this).find("td").eq(4).find(".reboxNum").val();
-						var boxNum=$(this).find("td").eq(3).find(".boxNum").val();
-						if (boxNum =="" || reboxNum=="" || clientType==""){
-							layer.msg("请输入项目信息", { icon: 2, offset: "error", time:2000 });
-							flag=false;
+					var tdlen = $("#workClientLinkmanList tr").length;
+					for(var i = 0;i < tdlen;i++){
+						var status = $("#projectFilingbatchRelations"+i+"_status").val();
+						var boxNum = $("#projectFilingbatchRelations"+i+"_boxNum").val();
+						var reboxNum = $("#projectFilingbatchRelations"+i+"_reBoxNum").val();
+						var projectName = $("#projectFilingbatchRelations"+i+"_projectName").val();
+						if(undefined != status && null !=status && ''!= status){
+							if(5 == status){
+								if('' != boxNum && undefined!= boxNum && null != boxNum){
+									if(boxNum != reboxNum){
+										layer.msg(projectName +":两次案卷号不相同,请重新填写", { icon: 2, offset: "error", time:1000 });
+										return false;
+									}
+								}else{
+									layer.msg("请输入项目 "+projectName+" 的案卷号", { icon: 2, offset: "error", time:1000 });
+									return false;
+								}
+							}
+						}else{
+							layer.msg("请给项目 "+projectName+" 选择审批状态", { icon: 2, offset: "error", time:1000 });
+							return false;
 						}
-					})
+					}
 				}
                 if (flag==true){
 					$("#inputForm").submit();
 					return true;
-				}else{
-					layer.msg("请输入项目信息", { icon: 2, offset: "error", time:2000 });
 				}
 
 
@@ -151,7 +163,7 @@
 					</div>
 				</div>
 			</div>
-			<div class="form-group layui-row first">
+			<%--<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>项目基础信息</h2></div>
 					<table id="contentTable" class="table table-bordered table-condensed can-edit">
 						<thead>
@@ -162,27 +174,35 @@
 							<th style="text-align: center">报告号</th>
 							<th style="text-align: center" >案卷号</th>
 							<th style="text-align: center" >确认案卷号</th>
-							<th style="text-align: center" >操作</th>
+							<th style="text-align: center" >审批</th>
 						</tr>
 						</thead>
 						<tbody id="workClientLinkmanList">
 						<c:choose>
 							<c:when test="${not empty projectFilingBatch}">
 								<c:forEach items="${projectFilingBatch.project}" var="project" varStatus="index">
-									<tr>
+									<tr id="workAccountList${index.index}">
+										<td class="hide">
+											<input id="workAccountList${index.index}_id" name="workAccountList[${index.index}].id" type="hidden" value="${project.id}"/>
+											<input id="workAccountList${index.index}_delFlag" name="workAccountList[${index.index}].delFlag" type="hidden" value="0"/>
+										</td>
 										<td>
-											<input name="projectId" type="text" readonly value="${project.projectId}" class="form-control"/>
+											<input type="text" readonly value="${project.projectId}" class="form-control"/>
 										</td>
 										<td>
-											<input name="projectName" type="text" readonly value="${project.projectName}" class="form-control"/>
+											<input type="text" readonly value="${project.projectName}" class="form-control"/>
 										</td>
 										<td>
-											<input name="projectReportNumber" type="text" readonly value="${project.projectReportNumber}" class="form-control"/>
+											<input type="text" readonly value="${project.projectReportNumber}" class="form-control"/>
+										</td>
+
+										<td>
+											<input id="workAccountList${index.index}_boxNum"  name="workAccountList[${index.index}].boxNum" maxlength="32" type="text" value="${projectFilingBatch.boxNum}"  class="form-control required layui-input"/>
+										</td>
+										<td>
+											<input id="workAccountList${index.index}_reBoxNum"  name="workAccountList[${index.index}].reBoxNum" maxlength="32" type="text" value="${projectFilingBatch.reBoxNum}"  class="form-control required layui-input"/>
 										</td>
-										<td><input name="boxNum" id="boxNum" type="text" value="${projectFilingBatch.boxNum}" class="form-control boxNum"/></td>
-										<td><input name="reboxNum" id="reboxNum" onchange="upcase(this)" value="${projectFilingBatch.reBoxNum}" type="text" class="form-control reboxNum"/></td>
 										<td style="overflow: visible;">
-											<input type="hidden" id="getProId" value="${project.id}"/>
 											<select name="clientType" id="clientType" lay-filter="cc" lay-verify="ctype" class="form-control simple-select clientType">
 												<option value="" >--是否通过--</option>
 												<option value="5" itemLabel="label">通过</option>
@@ -202,7 +222,63 @@
 						</c:choose>
 						</tbody>
 					</table>
+			</div>--%>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>项目基础信息</h2></div>
+					<table id="contentTable" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th style="text-align: center">归档项目编号</th>
+							<th style="text-align: center" >归档项目名称</th>
+							<th style="text-align: center">报告号</th>
+							<th style="text-align: center" >案卷号</th>
+							<th style="text-align: center" >确认案卷号</th>
+							<th style="text-align: center" >审批</th>
+						</tr>
+						</thead>
+						<tbody id="workClientLinkmanList">
+						<c:if test="${not empty projectFilingBatch}">
+							<c:forEach items="${projectFilingBatch.project}" var="project" varStatus="index">
+								<tr id="projectFilingbatchRelations${index.index}">
+									<td class="hide">
+										<input id="projectFilingbatchRelations${index.index}_id" name="projectFilingbatchRelations[${index.index}].id" type="hidden" value="${project.id}"/>
+										<input id="projectFilingbatchRelations${index.index}_delFlag" name="projectFilingbatchRelations[${index.index}].delFlag" type="hidden" value="0"/>
+									</td>
+									<td class="hide">
+										<input id="projectFilingbatchRelations${index.index}_status" name="projectFilingbatchRelations[${index.index}].status" type="hidden" value=""/>
+									</td>
+									<td>
+										<input type="text" value="${project.projectId}" readonly="readonly"  class="form-control"/>
+									</td>
+									<td>
+										<input id="projectFilingbatchRelations${index.index}_projectName" type="text" value="${project.projectName}" readonly="readonly"  class="form-control"/>
+									</td>
+									<td>
+										<input type="text" value="${project.projectReportNumber}" readonly="readonly"  class="form-control"/>
+									</td>
+									<td>
+										<input id="projectFilingbatchRelations${index.index}_boxNum"  name="projectFilingbatchRelations[${index.index}].boxNum" maxlength="32" type="text" value="${projectFilingBatch.boxNum}"  class="form-control layui-input"/>
+									</td>
+									<td>
+										<input id="projectFilingbatchRelations${index.index}_reBoxNum"  name="projectFilingbatchRelations[${index.index}].reBoxNum" maxlength="32" type="text" value="${projectFilingBatch.reBoxNum}"  class="form-control layui-input"/>
+									</td>
+									<td style="overflow: visible;">
+										<select  id="projectFilingbatchRelations${index.index}_clientType" name="projectFilingbatchRelations${index.index}.clientType" id="clientType" lay-filter="cc" lay-verify="ctype" class="form-control simple-select clientType">
+											<option value="" >--是否通过--</option>
+											<option value="5" itemLabel="label">通过</option>
+											<option value="4" itemLabel="label">驳回</option>
+										</select>
+									</td>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
 			</div>
+
+
+
 	</form:form>
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>审批流程</h2></div>
@@ -218,87 +294,12 @@
 		var form = layui.form;
 		//下拉框监听器
 		layui.form.on('select(cc)', function(data){
-			var tr=$(this).parent().parent().parent().parent()
-			var boxNum=$(tr).find(".boxNum").val();
-			var reboxNum=$(tr).find(".reboxNum").val();
-			var proId=(tr).find("#getProId").val();
-			var status=$(tr).find("#clientType").val();
-			if (status!="" && boxNum!="" && reboxNum !=""){
-				//修改项目状态
-				$.ajax({
-					type : "POST",
-					url : "${ctx}/projectFilingBatch/projectFilingBatchInfo/updateProjectPass",
-					data : {
-						'status':status,
-						'proId':proId,
-						"boxNum":boxNum,
-						"reboxNum":reboxNum
-					},
-					//请求成功
-					success : function(result) {
-						// layer.msg("项目状态修改成功", { icon: 1, offset: "auto", time:2000 });
-					},
-				});
-			}else if (status=="5"){
-				layer.msg("请输入前面信息", { icon: 2, offset: "error", time:2000 });
-				$("#flag").val("no1")
-			}
-
+			console.log(data.value);
+			var dataId = data.elem.id;
+			var a =dataId.substring(0,dataId.indexOf("_")+1);
+			$("#"+a +"status").val(data.value)
 		});
 	});
 </script>
-<script type="text/javascript">
-	function upcase(obj) {
-		var tr=obj.parentNode.parentNode;
-		var boxNum=jQuery(tr).find("#boxNum").val()
-		var reboxNum=jQuery(tr).find("#reboxNum").val()
-		if (boxNum!=""){
-			if (reboxNum!=""){
-				if(boxNum!=reboxNum){
-					jQuery(tr).find("#reboxNum").val("");
-					layer.msg("确认案卷号与案卷号不匹配", { icon: 2, offset: "error", time:2000 });
-				}
-			}else{
-				layer.msg("请输入再次确认案卷号", { icon: 2, offset: "error", time:2000 });
-			}
-		}else{
-			layer.msg("请输入案卷号", { icon: 2, offset: "error", time:2000 });
-		}
-	}
-	function proType(obj) {
-		var tr=obj.parentNode.parentNode;
-		var boxNum=jQuery(tr).find("#boxNum").val()
-		var reboxNum=jQuery(tr).find("#reboxNum").val()
-		var pass=jQuery(tr).find("#clientType").val();
-		var proId=jQuery(tr).find("#getProId").val();
-		if (boxNum!=""){
-			if (reboxNum!=""){
-				if(boxNum!=reboxNum){
-				}else{
-
-					<%--//修改项目状态--%>
-					<%--$.ajax({--%>
-					<%--	type : "POST",--%>
-					<%--	url : "${ctx}/projectFilingBatch/projectFilingBatchInfo/updateProjectPass",--%>
-					<%--	data : {--%>
-					<%--		'status':pass,--%>
-					<%--		'proId':proId,--%>
-					<%--		"boxNum":boxNum,--%>
-					<%--		"reboxNum":reboxNum--%>
-					<%--	},--%>
-					<%--	//请求成功--%>
-					<%--	success : function(result) {--%>
-					<%--		layer.msg("项目状态修改成功", { icon: 1, offset: "auto", time:2000 });--%>
-					<%--	},--%>
-
-					<%--});--%>
-				}
-			}else{
-				layer.msg("请输入再次确认案卷号", { icon: 2, offset: "error", time:2000 });
-			}
-		}
-	}
-
-</script>
 </body>
 </html>