Bläddra i källkod

项目添加项目定义号功能

user5 6 månader sedan
förälder
incheckning
9b43f0566f

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -324,6 +324,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String reviewerPersonId;//审核人
 	private Integer contractsNum; //盖章数量
 	private String temporaryId; //临时id
+	private String projectDefinitionId; //项目定义号
 
 	public String getPrrId() {
 		return prrId;
@@ -2302,4 +2303,12 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setTemporaryId(String temporaryId) {
 		this.temporaryId = temporaryId;
 	}
+
+	public String getProjectDefinitionId() {
+		return projectDefinitionId;
+	}
+
+	public void setProjectDefinitionId(String projectDefinitionId) {
+		this.projectDefinitionId = projectDefinitionId;
+	}
 }

+ 8 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -776,15 +776,19 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		String master = null;
 		if (isMaster) {
 			master = "1";
-            workProjectUserDao.deleteProjectMasterMembers(map);
+			if(memberIds.size()>0){
+				workProjectUserDao.deleteProjectMasterMembers(map);
+			}
             /*map.put("isMaster", "0");
             workProjectUserDao.batchInsert(map);*/
 		} else {
 			master = "0";
 		}
-		workProjectUserDao.deleteProjectMembers(projectId, master);
-		map.put("isMaster", master);
-		workProjectUserDao.batchInsert(map);
+		if(memberIds.size()>0){
+			workProjectUserDao.deleteProjectMembers(projectId, master);
+			map.put("isMaster", master);
+			workProjectUserDao.batchInsert(map);
+		}
 	}
 
 	/**

+ 18 - 6
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -75,7 +75,8 @@
 		a.reviewer_person as "reviewerPerson",
 		a.reviewer_person_id as "reviewerPersonId",
 		a.company_type as "companyType",
-		a.contracts_num as "contractsNum"
+		a.contracts_num as "contractsNum",
+		a.project_definition_id as "projectDefinitionId"
 
 	</sql>
 
@@ -130,7 +131,8 @@
 		a.reviewer_person as "reviewerPerson",
 		a.reviewer_person_id as "reviewerPersonId",
 		a.company_type as "companyType",
-		a.contracts_num as "contractsNum"
+		a.contracts_num as "contractsNum",
+		a.project_definition_id as "projectDefinitionId"
 	</sql>
 
 	<sql id="projectRecordsJoins">
@@ -411,6 +413,9 @@
 			<if test="projectId != null and projectId != ''">
 				AND a.project_id like concat('%',#{projectId},'%')
 			</if>
+			<if test="projectDefinitionId != null and projectDefinitionId != ''">
+				AND a.project_definition_id like concat('%',#{projectDefinitionId},'%')
+			</if>
 			<if test="projectName != null and projectName != ''">
 				AND a.project_name like concat(concat('%',#{projectName}),'%')
 			</if>
@@ -542,6 +547,9 @@
 			<if test="projectType!=null and projectType!=''">
 				and a.project_type = #{projectType}
 			</if>
+			<if test="projectDefinitionId != null and projectDefinitionId != ''">
+				AND a.project_definition_id like concat('%',#{projectDefinitionId},'%')
+			</if>
             <if test="projectId != null and projectId != ''">
                 AND a.project_id like concat('%',#{projectId},'%')
             </if>
@@ -817,7 +825,8 @@
 			reviewer_person,
 			reviewer_person_id,
 			company_type,
-			contracts_num
+			contracts_num,
+			project_definition_id
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -874,7 +883,8 @@
 		    #{reviewerPerson},
 		    #{reviewerPersonId},
 		    #{companyType},
-		    #{contractsNum}
+		    #{contractsNum},
+		    #{projectDefinitionId}
 		)
 	</insert>
 
@@ -930,7 +940,8 @@
 			emergency_project=#{emergencyProject},
 			reviewer_person = #{reviewerPerson},
 		reviewer_person_id = #{reviewerPersonId},
-		contracts_num = #{contractsNum}
+		contracts_num = #{contractsNum},
+		project_definition_id = #{projectDefinitionId}
 			<choose>
 				<when test="reportedState ==null or reportedState == ''">
 					,reported_state = null
@@ -994,7 +1005,8 @@
 			belonging_department = #{belongingDepartment},
 		reviewer_person = #{reviewerPerson},
 		reviewer_person_id = #{reviewerPersonId},
-		contracts_num = #{contractsNum}
+		contracts_num = #{contractsNum},
+		project_definition_id = #{projectDefinitionId}
 			<if test="engineeringType != null and engineeringType != ''">
 				,engineering_type =#{engineeringType}
 			</if>

+ 31 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsAdminModify.jsp

@@ -716,6 +716,31 @@
         function num(obj){
             obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
         }
+
+        function projectDefinition(obj){
+            // 获取输入的值
+            var value = obj.value;
+
+            // 定义正则表达式
+            var isAlphaNumeric = /^[a-zA-Z0-9]+$/;  // 仅包含字母数字
+            var isWu = /^无$/;                      // 仅包含"无"
+
+            // 去除所有非法字符 (除了字母、数字和"无")
+            value = value.replace(/[^a-zA-Z0-9无]/g, "");
+
+            // 判断当前输入内容
+            if (isAlphaNumeric.test(value)) {
+                // 如果是字母数字,删除"无"
+                obj.value = value.replace(/无/g, "");
+            } else if (isWu.test(value)) {
+                // 如果输入的是"无",删除所有字母数字
+                obj.value = "无";
+            } else {
+                // 如果既包含字母数字又包含“无”,清除所有内容
+                obj.value = "";
+                top.layer.msg("项目定义号仅可输入字母数字或'无',且两者不可同时输入!",{icon:2});
+            }
+        }
     </script>
 </head>
 <body >
@@ -836,6 +861,12 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目定义号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectDefinitionId" id="projectDefinitionId" onchange="projectDefinition(this)" maxlength="64" htmlEscape="false" placeholder="请输入项目定义号" class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">项目编号:</label>
                     <div class="layui-input-block">
                         <div class="input-group">

+ 31 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm.jsp

@@ -858,6 +858,30 @@
         function num(obj){
             obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
         }
+        function projectDefinition(obj){
+            // 获取输入的值
+            var value = obj.value;
+
+            // 定义正则表达式
+            var isAlphaNumeric = /^[a-zA-Z0-9]+$/;  // 仅包含字母数字
+            var isWu = /^无$/;                      // 仅包含"无"
+
+            // 去除所有非法字符 (除了字母、数字和"无")
+            value = value.replace(/[^a-zA-Z0-9无]/g, "");
+
+            // 判断当前输入内容
+            if (isAlphaNumeric.test(value)) {
+                // 如果是字母数字,删除"无"
+                obj.value = value.replace(/无/g, "");
+            } else if (isWu.test(value)) {
+                // 如果输入的是"无",删除所有字母数字
+                obj.value = "无";
+            } else {
+                // 如果既包含字母数字又包含“无”,清除所有内容
+                obj.value = "";
+                top.layer.msg("项目定义号仅可输入字母数字或'无',且两者不可同时输入!",{icon:2});
+            }
+        }
     </script>
 </head>
 <body>
@@ -956,6 +980,13 @@
                         <form:input path="projectName" id="projectName" onchange="reProjectName(this)" maxlength="255" htmlEscape="false" placeholder="请输入项目名称" class="form-control layui-input judgment"/>
                     </div>
                 </div>
+
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目定义号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectDefinitionId" id="projectDefinitionId" onchange="projectDefinition(this)" maxlength="64" htmlEscape="false" placeholder="请输入项目定义号" class="form-control layui-input required"/>
+                    </div>
+                </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">项目编号:</label>
                     <div class="layui-input-block">

+ 8 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp

@@ -452,6 +452,12 @@
 								<form:input path="workContractInfo.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
 						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">项目定义号:</label>
+							<div class="layui-input-block">
+								<form:input path="projectDefinitionId" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
 						<%--<div class="layui-item query athird ">
 							<label class="layui-form-label">委托方:</label>
 							<div class="layui-input-block">
@@ -564,7 +570,6 @@
 							return "<span title='"+ d.projName +"'>" +d.projName+ "</span>";
 						}
                     }}
-				/*,{field:'projId',align:'center', title: '项目编号',  width:150}*/
                 /*,{field:'projId',align:'center', title: '项目编号',minWidth:150,templet:function(d){
                         return "<a class=\"attention-info\" title=\"" + d.projId + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralCostProjectRecords/view?id=" + d.id + "','95%', '95%')\">" + d.projId + "</a>";
                     }}*/
@@ -576,6 +581,7 @@
 							return "<span title='暂无报告'  style='color: #009688'>暂无报告</span>";
 						}
 					}}
+				,{field:'projectDefinitionId',align:'center', title: '项目定义号',  width:150}
                 ,{field:'contract', align:'center',title: '合同名称',minWidth:200,templet:function(d){
 						if(""!= d.contract){
 							return "<a class=\"attention-info\" title=\""+d.contract+"\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同管理', '${ctx}/workcontractinfo/workContractInfo/lookForm?id=" + d.conId + "','95%', '95%')\">" + d.contract + "</a>";
@@ -664,6 +670,7 @@
                 {
                     "index":"${index.index+1}"
                     ,"id":"${projectRecords.id}"
+                    ,"projectDefinitionId":"${projectRecords.projectDefinitionId}"
                     ,"projId":"${projectRecords.projectId}"
                     ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
 					,"projMaster":"${projectRecords.leaderNameStr}"

+ 31 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsAdminModify.jsp

@@ -670,6 +670,31 @@
         function num(obj){
             obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
         }
+
+        function projectDefinition(obj){
+            // 获取输入的值
+            var value = obj.value;
+
+            // 定义正则表达式
+            var isAlphaNumeric = /^[a-zA-Z0-9]+$/;  // 仅包含字母数字
+            var isWu = /^无$/;                      // 仅包含"无"
+
+            // 去除所有非法字符 (除了字母、数字和"无")
+            value = value.replace(/[^a-zA-Z0-9无]/g, "");
+
+            // 判断当前输入内容
+            if (isAlphaNumeric.test(value)) {
+                // 如果是字母数字,删除"无"
+                obj.value = value.replace(/无/g, "");
+            } else if (isWu.test(value)) {
+                // 如果输入的是"无",删除所有字母数字
+                obj.value = "无";
+            } else {
+                // 如果既包含字母数字又包含“无”,清除所有内容
+                obj.value = "";
+                top.layer.msg("项目定义号仅可输入字母数字或'无',且两者不可同时输入!",{icon:2});
+            }
+        }
 	</script>
 </head>
 <body >
@@ -777,6 +802,12 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目定义号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectDefinitionId" id="projectDefinitionId" onchange="projectDefinition(this)" maxlength="64" htmlEscape="false" placeholder="请输入项目定义号" class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">项目编号:</label>
                     <div class="layui-input-block">
                         <div class="input-group">

+ 31 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsForm.jsp

@@ -912,6 +912,31 @@
         function num(obj){
             obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
         }
+
+        function projectDefinition(obj){
+            // 获取输入的值
+            var value = obj.value;
+
+            // 定义正则表达式
+            var isAlphaNumeric = /^[a-zA-Z0-9]+$/;  // 仅包含字母数字
+            var isWu = /^无$/;                      // 仅包含"无"
+
+            // 去除所有非法字符 (除了字母、数字和"无")
+            value = value.replace(/[^a-zA-Z0-9无]/g, "");
+
+            // 判断当前输入内容
+            if (isAlphaNumeric.test(value)) {
+                // 如果是字母数字,删除"无"
+                obj.value = value.replace(/无/g, "");
+            } else if (isWu.test(value)) {
+                // 如果输入的是"无",删除所有字母数字
+                obj.value = "无";
+            } else {
+                // 如果既包含字母数字又包含“无”,清除所有内容
+                obj.value = "";
+                top.layer.msg("项目定义号仅可输入字母数字或'无',且两者不可同时输入!",{icon:2});
+            }
+        }
     </script>
 </head>
 <body>
@@ -1002,6 +1027,12 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目定义号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectDefinitionId" id="projectDefinitionId" onchange="projectDefinition(this)" maxlength="64" htmlEscape="false" placeholder="请输入项目定义号" class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label">项目编号:</label>
                     <div class="layui-input-block">
                         <div class="input-group">

+ 8 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsList.jsp

@@ -394,6 +394,12 @@
 								<form:input path="workContractInfo.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
 						</div>
+							<div class="layui-item query athird ">
+								<label class="layui-form-label">项目定义号:</label>
+								<div class="layui-input-block">
+									<form:input path="projectDefinitionId" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+								</div>
+							</div>
 						<%--<div class="layui-item query athird ">
 							<label class="layui-form-label">委托方:</label>
 							<div class="layui-input-block">
@@ -508,6 +514,7 @@
 							return "<span title='暂无报告'  style='color: #009688'>暂无报告</span>";
 						}
 					}}
+				,{field:'projectDefinitionId',align:'center', title: '项目定义号',  width:150}
                 ,{field:'contract', align:'center',title: '合同名称',minWidth:200,templet:function(d){
                 		if(""!= d.contract){
 							return "<a class=\"attention-info\" title=\""+d.contract+"\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同管理', '${ctx}/workcontractinfo/workContractInfo/lookForm?companyType=${companyType}&id=" + d.conId + "','95%', '95%')\">" + d.contract + "</a>";
@@ -600,6 +607,7 @@
                 {
                     "index":"${index.index+1}"
                     ,"id":"${projectRecords.id}"
+					,"projectDefinitionId":"${projectRecords.projectDefinitionId}"
                     ,"projId":"${projectRecords.projectId}"
                     ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
 					,"projMaster":"${projectRecords.leaderNameStr}"