Ver código fonte

新增项目添加项目负责人 和项目责任人

user5 4 anos atrás
pai
commit
c74b5c64f8

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

@@ -175,6 +175,10 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String checkNotifyId; //选查代办判定条件
 	private String actType; //流程节点
 
+	private String projectMasterName;	//项目负责人名称
+	private String projectMasterId;		//项目负责人id
+	private List<User> projectMasterIds; //项目负责人list
+
 	private List<String> civilProjectList = Lists.newArrayList();
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
 
@@ -1221,4 +1225,28 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setActType(String actType) {
 		this.actType = actType;
 	}
+
+	public String getProjectMasterName() {
+		return projectMasterName;
+	}
+
+	public void setProjectMasterName(String projectMasterName) {
+		this.projectMasterName = projectMasterName;
+	}
+
+	public String getProjectMasterId() {
+		return projectMasterId;
+	}
+
+	public void setProjectMasterId(String projectMasterId) {
+		this.projectMasterId = projectMasterId;
+	}
+
+	public List<User> getProjectMasterIds() {
+		return projectMasterIds;
+	}
+
+	public void setProjectMasterIds(List<User> projectMasterIds) {
+		this.projectMasterIds = projectMasterIds;
+	}
 }

+ 20 - 5
src/main/java/com/jeeplus/modules/sys/web/OfficeController.java

@@ -28,7 +28,9 @@ import com.jeeplus.modules.wexinpackage.access.util.access.AddressDepartment;
 import com.jeeplus.modules.wexinpackage.access.util.access.WeChatParamsUtil;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -500,6 +502,8 @@ public class OfficeController extends BaseController {
             //存放部门搜索添加
             office.setOldName(selectName);
         }
+        HashSet<Map<String, Object>> mapSet = new HashSet<>();
+        //查询所有有关部门
         List<Office> list = officeService.findByParentIdsLike(office);
         for (int i = 0; i < list.size(); i++) {
             Office e = list.get(i);
@@ -513,16 +517,28 @@ public class OfficeController extends BaseController {
                 map.put("pIds", e.getParentIds());
                 map.put("name", e.getTopCompany());
                 map.put("selectName", selectName);
-                if (type != null && "3".equals(type)) {
+                if (type != null && ("3".equals(type) || "4".equals(type))) {
                     map.put("isParent", true);
                 }
+                if("4".equals(type)){
+                    //根据参数获取信息
+                    List<User> listUser = systemService.treeDataByNameOnReported(e.getId(),selectName);
+                    if(listUser.size()>0) {
+                        mapSet.add(map);
+                    }
+                }
                 mapList.add(map);
             }
         }
+
+        if("4".equals(type)){
+            List<Map<String,Object>> mapList1=new ArrayList<>(mapSet);
+            return mapList1;
+        }
         if(!"2".equals(type)){
             List<User> userList= new ArrayList<>();
-            HashSet<Map<String, Object>> mapSet = new HashSet<>();
-            if (null != selectName && "" != selectName){
+            //判定参数必须存在
+            if (StringUtils.isNotBlank(selectName)){
                 userList = systemService.findUserByName(selectName);
                 if (0 != userList.size()){
                     Iterator it = mapList.iterator();
@@ -548,8 +564,7 @@ public class OfficeController extends BaseController {
                     List<Map<String,Object>> mapList1=new ArrayList<>(mapSet);
                     return mapList1;
                 }
-        }
-
+            }
         }
         return mapList;
     }

+ 9 - 5
src/main/java/com/jeeplus/modules/sys/web/UserController.java

@@ -18,15 +18,13 @@ import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.sys.dao.UserDao;
-import com.jeeplus.modules.sys.entity.Office;
-import com.jeeplus.modules.sys.entity.Role;
-import com.jeeplus.modules.sys.entity.SystemConfig;
-import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.*;
 import com.jeeplus.modules.sys.security.SystemAuthorizingRealm;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.service.SystemConfigService;
 import com.jeeplus.modules.sys.service.SystemService;
 import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.sysimportinfo.entity.SysImportInfo;
 import com.jeeplus.modules.sysimportinfo.service.SysImportInfoService;
@@ -1015,6 +1013,10 @@ public class UserController extends BaseController {
     public List<Map<String, Object>> treeDataByNameOnReported(@RequestParam(required=false) String projectId,@RequestParam(required=false) String officeId,@RequestParam(required = false) String selectName, HttpServletResponse response) {
         List<Map<String, Object>> mapList = Lists.newArrayList();
         if(StringUtils.isBlank(projectId)){
+            if(StringUtils.isBlank(officeId)){
+                return mapList;
+            }
+            //根据部门查询人员信息
             List<User> list = systemService.treeDataByNameOnReported(officeId,selectName);
             for (int i=0; i<list.size(); i++){
                 Map<String, Object> map = Maps.newHashMap();
@@ -1026,9 +1028,11 @@ public class UserController extends BaseController {
                 map.put("name", name);
                 WorkStaffBasicInfo info = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(e.getId());
                 workStaffBasicInfoService.queryDetails(info);
+                //查询用户执业资格证书信息
                 List<WorkStaffCertificate> certificateList = info.getCertificateList();
                 for (WorkStaffCertificate certificate:certificateList) {
-                    if("注册/资格证".equals(certificate.getName())){
+                    //判定是否为一级造价师
+                    if("161".equals(certificate.getName())){
                         map.put("officeId", certificate.getNum());
                         break;
                     }

+ 10 - 2
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -65,9 +65,12 @@
         ,o.top_company AS "office.name"
 		,prd.number AS "projectReportNumber"
 		,prr.id As "prrid"
+		,a.project_master_id as "projectMasterId"
+		,supmi.name as "projectMasterName"
         FROM rural_project_records a
         <include refid="projectRecordsJoins"/>
         LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
 		left join project_report_data prd on prd.project_id = a.id
 		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
 		LEFT JOIN sys_office o ON o.id = a.office_id
@@ -424,7 +427,8 @@
 		    estimate_total_fees,
 			construction_unit,
 			construction_linkman,
-			attachment_project_sort
+			attachment_project_sort,
+			project_master_id
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -469,7 +473,8 @@
 			#{estimateTotalFees},
 			#{constructionUnit},
 			#{constructionLinkman},
-			#{attachmentProjectSort}
+			#{attachmentProjectSort},
+			#{projectMasterId}
 		)
 	</insert>
 	
@@ -514,6 +519,9 @@
 			construction_unit = #{constructionUnit},
 			construction_linkman = #{constructionLinkman},
 			attachment_project_sort = #{attachmentProjectSort}
+			<if test="projectMasterId != null and projectMasterId != ''">
+				,project_master_id = #{projectMasterId}
+			</if>
 		WHERE id = #{id}
 	</update>
 	<update id="updateDate">

+ 9 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsAudit.jsp

@@ -250,10 +250,10 @@
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6 lw6">
-					<label class="layui-form-label">项目责人:</label>
+					<label class="layui-form-label double-line"><span class="require-item">*</span>项目责人:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:inquireselectUser id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}" cssStyle="background-color: #fff"
-											   title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+											   title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6 lw6">
@@ -263,6 +263,13 @@
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目负责人:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:reportedtreeselectUser id="projectMaster" name="projectMasterId" value="${projectRecords.projectMasterId}" labelName="projectMasterName" labelValue="${projectRecords.projectMasterName}" cssStyle="background-color: #fff"
+											   title="项目负责人" url="/sys/office/treeDataAll?type=4" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
 					<label class="layui-form-label double-line">工作开始日期:</label>
 					<div class="layui-input-block">
 						<input class=" form-control layui-input " readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${projectRecords.startDate}" pattern="yyyy-MM-dd"/>">

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

@@ -870,7 +870,7 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
-                    <label class="layui-form-label"><span class="require-item">*</span>项目责人:</label>
+                    <label class="layui-form-label"><span class="require-item">*</span>项目责人:</label>
                     <div class="layui-input-block  with-icon">
                         <sys:inquireselectUser id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"
                                        cssStyle="background-color:#fff"  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
@@ -883,6 +883,13 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目负责人:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:reportedtreeselectUser id="projectMaster" name="projectMasterId" value="${ruralProjectRecords.projectMasterId}" labelName="projectMasterName" labelValue="${ruralProjectRecords.projectMasterName}"
+                                                    cssStyle="background-color:#fff" title="项目负责人" url="/sys/office/treeDataAll?type=4" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label double-line">工作开始日期:</label>
                     <div class="layui-input-block">
                         <input placeholder="请选择开始日期" style="background-color: #fff" class="laydate-icondate form-control layui-input layer-date laydate-icon" readonly="readonly" id="startDate" name="startDate" value="<fmt:formatDate value="${ruralProjectRecords.startDate}" pattern="yyyy-MM-dd"/>">

+ 9 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsModify.jsp

@@ -862,7 +862,7 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
-                    <label class="layui-form-label"><span class="require-item">*</span>项目责人:</label>
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>项目责人:</label>
                     <div class="layui-input-block  with-icon">
                         <sys:inquireselectUser id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}"
                                         cssStyle="background-color:#fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
@@ -874,6 +874,14 @@
                         <form:input path="officeName" htmlEscape="false" id="officeName" class="form-control layui-input" readonly="true"/>
                     </div>
                 </div>
+
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label">项目负责人:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:reportedtreeselectUser id="projectMaster" name="projectMasterId" value="${projectRecords.projectMasterId}" labelName="projectMasterName" labelValue="${projectRecords.projectMasterName}" cssStyle="background-color: #fff"
+                                               title="项目负责人" url="/sys/office/treeDataAll?type=4" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
                 <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label double-line">工作开始日期:</label>
                     <div class="layui-input-block">

+ 7 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsView.jsp

@@ -201,7 +201,7 @@
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6 lw6">
-					<label class="layui-form-label">项目责人:</label>
+					<label class="layui-form-label">项目责人:</label>
 					<div class="layui-input-block">
 						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
 					</div>
@@ -213,6 +213,12 @@
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目负责人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.projectMasterName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
 					<label class="layui-form-label double-line">工作开始日期:</label>
 					<div class="layui-input-block">
 						<input class="laydate-icondate form-control layui-input layer-date ash"  style="background-color: #f1f1f1" readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${ruralProjectRecords.startDate}" pattern="yyyy-MM-dd"/>">

+ 1 - 1
src/main/webapp/webpage/modules/sys/tagTreeselectReported.jsp

@@ -8,7 +8,7 @@
 	<script type="text/javascript">
 		var key, lastValue = "", nodeList = [], type = getQueryString("type", "${url}");
 		var tree, setting = {view:{selectedMulti:false,dblClickExpand:false},check:{enable:"${checked}",nocheckInherit:true},
-				async:{enable:(type==3),url:"${ctx}/sys/user/treeDataByNameOnReported",autoParam:["id=officeId","projectId=projectId","selectName=selectName"]},
+				async:{enable:(type==4),url:"${ctx}/sys/user/treeDataByNameOnReported",autoParam:["id=officeId","projectId=projectId","selectName=selectName"]},
 				data:{simpleData:{enable:true}},callback:{<%--
 					beforeClick: function(treeId, treeNode){
 						if("${checked}" == "true"){