Pārlūkot izejas kodu

报销申请部分修改

user5 4 gadi atpakaļ
vecāks
revīzija
1caf8e678e

+ 7 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectRecordsDao.java

@@ -32,6 +32,13 @@ public interface ProjectRecordsDao extends CrudDao<ProjectRecords> {
     ProjectRecords findUseableByProjectId(String projectId);
     List<ProjectRecords> findPageByRe(ProjectRecords records);
     List<ProjectRecords> ruralFindPageByRe(ProjectRecords records);
+
+    /**
+     * 报销查询项目
+     * @param records
+     * @return
+     */
+    List<ProjectRecords> ruralFindPageByReimbur(ProjectRecords records);
     int queryCount(ProjectRecords records);
     int queryCountByStatus(ProjectRecords records);
 

+ 15 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java

@@ -321,6 +321,21 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 		page.setList(recordsList);
 		return page;
 	}
+
+	/**
+	 * 报销查询项目
+	 * @param page
+	 * @param projectRecords
+	 * @param userId
+	 * @return
+	 */
+	public Page<ProjectRecords> ruralFindPageByReimbur(Page<ProjectRecords> page, ProjectRecords projectRecords,String userId) {
+		projectRecords.setPage(page);
+		projectRecords.setUserId(UserUtils.getUser().getId());
+		List<ProjectRecords> recordsList = dao.ruralFindPageByReimbur(projectRecords);
+		page.setList(recordsList);
+		return page;
+	}
 	@Transactional(readOnly = false)
 	public void saveProject(ProjectRecords projectRecords,ProjectStatusEnum projectStatus) throws Exception {
 		long t1 = System.currentTimeMillis();

+ 18 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursement.java

@@ -37,6 +37,8 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	private String businessTypeName;		// 业务类型
 	private String officeId;		// 报销人的部门编号   项目登记人的信息
 	private String submitterId;		// 报销人 项目登记人
+	private String handleId;		// 经办人
+	private String handleName;		// 经办人名称
 	private String submitterName;		// 报销人 项目登记人
 	private Date submitterDate;		// 报销日期
 	private ProjectRecords project;		// 报销项目
@@ -505,4 +507,20 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	public void setTypeName(String typeName) {
 		this.typeName = typeName;
 	}
+
+	public String getHandleId() {
+		return handleId;
+	}
+
+	public void setHandleId(String handleId) {
+		this.handleId = handleId;
+	}
+
+	public String getHandleName() {
+		return handleName;
+	}
+
+	public void setHandleName(String handleName) {
+		this.handleName = handleName;
+	}
 }

+ 3 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java

@@ -498,6 +498,9 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                 if(null == workAccount.getId()){
                     continue;
                 }
+                //添加人员部门id
+                User user = UserUtils.get(workAccount.getReimbursementName());
+                workAccount.setOfficeId(user.getOffice().getId());
                 if (WorkAccount.DEL_FLAG_NORMAL.equals(workAccount.getDelFlag())) {
                     List<WorkAccountAudit> workAccountAudits = workAccount.getWorkAccountAuditList();
                     List<WorkAccountAudit> workAccountAuditList = new ArrayList<>();

+ 1 - 1
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java

@@ -738,7 +738,7 @@ public class WorkReimbursementController extends BaseController {
 	@RequestMapping(value = "selectReproject")
 	public String selectReproject(String userId,ProjectRecords projectId, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, HttpServletRequest request, HttpServletResponse response, Model model) {
 		projectId.setCompany(UserUtils.getSelectCompany());
-		Page<ProjectRecords> page = projectRecordsService.ruralFindPageByRe(new Page<ProjectRecords>(request, response), projectId,userId);
+		Page<ProjectRecords> page = projectRecordsService.ruralFindPageByReimbur(new Page<ProjectRecords>(request, response), projectId,userId);
 		try {
 			searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
 			fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");

+ 38 - 0
src/main/resources/mappings/modules/projectrecord/ProjectRecordsDao.xml

@@ -686,6 +686,44 @@
 		</choose>
 	</select>
 
+	<!-- 报销查询项目 -->
+	<select id="ruralFindPageByReimbur" resultType="ProjectRecords" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,
+		wci.name AS "workContractInfo.name",
+		wci.contract_num AS "workContractInfo.contractNum",
+		wct.id AS "workContractInfo.client.id",
+		wct.name AS "workContractInfo.client.name",
+		o.name AS "office.name"
+		,prd.number as "reportData.number"
+		FROM rural_project_records a
+		<include refid="projectRecordsJoins"/>
+		LEFT JOIN work_project_user w on a.id = w.project_id
+		LEFT JOIN sys_user su on w.user_id = su.id
+		LEFT JOIN sys_user u on a.create_by = u.id
+		LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+		LEFT JOIN work_client_info wct on wci.client_id = wct.id
+		LEFT JOIN sys_office s ON s.id = a.company_id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		LEFT JOIN project_report_data prd ON a.id = prd.project_id
+		where a.status='5'  and a.del_flag='0' and w.del_flag='0'
+		and prd.number is not null
+		and wci.del_flag='0' and (wci.completion_status!='5' or wci.completion_status is null)
+		<if test="projectName != null and projectName != ''">
+			AND a.project_name like concat(concat('%',#{projectName}),'%')
+		</if>
+		GROUP BY a.id
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
 	<select id="getProjectType" resultType="com.jeeplus.modules.projectType.entity.ProjectType">
 		select type_id as typeId,type_name as typeName from project_type where parent_id = #{projectTypeId}
 	</select>

+ 7 - 2
src/main/resources/mappings/modules/workreimbursement/WorkAccountDao.xml

@@ -121,7 +121,8 @@
 			project_id,
 			reimbursement_name,
 			bills,
-			evection_number
+			evection_number,
+			office_id
 		) VALUES (
 			#{id},
 			#{type},
@@ -140,7 +141,8 @@
 			#{project.id},
 			#{reimbursementName},
 			#{bills},
-			#{evectionNumber}
+			#{evectionNumber},
+			#{officeId}
 		)
 	</insert>
 
@@ -191,6 +193,9 @@
 		<if test="evectionNumber != null and evectionNumber != ''">
 			evection_number = #{evectionNumber},
 		</if>
+		<if test="officeId != null and officeId != ''">
+			office_id = #{officeId},
+		</if>
 			update_by = #{updateBy.id},
 			update_date = #{updateDate}
 		WHERE id = #{id}

+ 11 - 5
src/main/resources/mappings/modules/workreimbursement/WorkReimbursementDao.xml

@@ -7,7 +7,7 @@
 		a.process_instance_id AS "processInstanceId",
 		a.number AS "number",
 		a.business_type AS "businessType",
-		a.submitter_id AS "submitterId",
+		a.submitter_id AS "handleId",
 		a.submitter AS "submitter",
 		a.submitter_date AS "submitterDate",
 		a.project_id AS "project.id",
@@ -28,7 +28,6 @@
 		a.bank AS "bank",
 		a.bank_no AS "bankNo",
 		a.company_id AS "companyId",
-		a.office_id AS "officeId",
 		p.project_name AS "project.projectName",
 		a.project_name AS "projectName",
 		a.bank_card AS "bankCard",
@@ -56,6 +55,7 @@
 			<include refid="workReimbursementColumns"/>
 		,wa.reimbursement_name AS "submitterId"
 		,wa.money as "money"
+		,(select office_id from sys_user where id = wa.reimbursement_name) AS "officeId"
 		FROM work_reimbursement a
 		left join work_account wa on wa.work_reimbursement_id =a.id
 		left join rural_project_records p on p.id = wa.project_id
@@ -71,7 +71,7 @@
 				AND a.status = #{status}
 			</if>
 			<if test="officeId != '' and officeId != null">
-				AND a.office_id = #{officeId}
+				AND wa.office_id = #{officeId}
 			</if>
 			<if test="submitterDate != '' and submitterDate != null">
 				AND a.submitter_date = #{submitterDate}
@@ -82,8 +82,11 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.submitter_date &lt;= #{endDate}
 			</if>
+			<if test="handleId != null and handleId != ''">
+				AND a.submitter_id = #{handleId}
+			</if>
 			<if test="submitterId != null and submitterId != ''">
-				AND a.submitter_id = #{submitterId}
+				AND wa.reimbursement_name = #{submitterId}
 			</if>
 			${sqlMap.dsf}
 		</where>
@@ -125,8 +128,11 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.submitter_date &lt;= #{endDate}
 			</if>
+			<if test="handleId != null and handleId != ''">
+				AND a.submitter_id = #{handleId}
+			</if>
 			<if test="submitterId != null and submitterId != ''">
-				AND a.submitter_id = #{submitterId}
+				AND wa.reimbursement_name = #{submitterId}
 			</if>
 			${sqlMap.dsf}
 		</where>

+ 17 - 0
src/main/webapp/webpage/modules/sys/gridselectcallproject.jsp

@@ -64,6 +64,23 @@
 					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+
+
+					<div class="commonQuery">
+						<div class="layui-item query athird">
+							<span class="layui-form-label">项目名称:</span>
+							<div class="layui-input-block">
+								<form:input path="${searchKey}" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item athird fr">
+							<div class="input-group">
+								<button id="searchReset" class="fixed-btn searchReset fr" style="margin-right: 0px;" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
 				</form:form>
 			</div>
 		</div>

+ 4 - 4
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -509,7 +509,7 @@
         <div class="form-group layui-row first">
             <div class="form-group-label"><h2>基础信息</h2></div>
             <div class="layui-item layui-col-sm6">
-                <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">
                     <div class="input-group">
                         <sys:gridSelectUser id="submitterId" name="submitterId" value="${workReimbursement.submitterId}" labelName="submitterName" labelValue="${workReimbursement.submitterName}"
@@ -556,7 +556,7 @@
                 <label class="layui-form-label"><span class="require-item">*</span>报销项目:</label>
                 <div class="layui-input-block with-icon">
                     <sys:gridselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="project" name="project.id"  value="${workReimbursement.project.id}"  title="选择报销项目" labelName="project.projectName"
-                                               labelValue="${workReimbursement.project.projectName}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:gridselectReproject>
+                                               labelValue="${workReimbursement.project.projectName}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:gridselectReproject>
                 </div>
             </div>
             <div class="layui-item layui-col-sm6">
@@ -683,7 +683,7 @@
                                 <td>
                                     <div class="not_project_reimbursement_div"  style="width: 200px">
                                         <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList${index.index}_project" name="workAccountList[${index.index}].project.id"  value="${workAccount.project.id}"  title="选择报销项目" labelName="workAccountList[${index.index}].project.projectName"
-                                                                    labelValue="${workAccount.project.projectName}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
+                                                                    labelValue="${workAccount.project.projectName}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
                                     </div>
                                 </td>
                                 <td>
@@ -750,7 +750,7 @@
                         <td>
                             <div class="not_project_reimbursement_div"  style="width: 200px">
                                 <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList{{idx}}_project" name="workAccountList[{{idx}}].project.id"  value="${workReimbursement.project.id}"  title="选择报销项目" labelName="workAccountList[{{idx}}].project.projectName"
-                                               labelValue="{{row.projectName}}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
+                                               labelValue="{{row.projectName}}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
                             </div>
                         </td>
                         <td>

+ 12 - 1
src/main/webapp/webpage/modules/workreimbursement/workReimbursementList.jsp

@@ -85,6 +85,13 @@
                     </div>
                     <div id="moresees" style="clear:both;display:none;">
                         <div class="layui-item query athird">
+                            <label class="layui-form-label">经办人:</label>
+                            <div class="layui-input-block with-icon">
+                                <sys:treeselect id="handleId" name="handleId" value="${workReimbursement.handleId}" labelName="handleName" labelValue="${workReimbursement.handleName}"
+                                                title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                            </div>
+                        </div>
+                        <div class="layui-item query athird">
                             <label class="layui-form-label">报销人:</label>
                             <div class="layui-input-block with-icon">
                                 <sys:treeselect id="submitterId" name="submitterId" value="${workReimbursement.submitterId}" labelName="submitterName" labelValue="${workReimbursement.submitterName}"
@@ -148,10 +155,13 @@
                             "<span title=" + d.realnumber + ">" + d.number + "</span></a>";
                         return xml;
                     }}
+                ,{field:'handleName',align:'center', title: '经办人', width:80,templet:function(d){
+                        return "<span title='"+ d.handleName +"'>" + d.handleName + "</span>";
+                    }}
                 ,{field:'submitterName',align:'center', title: '报销人', width:80,templet:function(d){
                         return "<span title='"+ d.submitterName +"'>" + d.submitterName + "</span>";
                     }}
-                ,{field:'officeId',align:'center', title: '报销公司/部门', minWidth:110,templet:function(d){
+                ,{field:'officeId',align:'center', title: '报销部门', minWidth:110,templet:function(d){
                         return "<span title='"+ d.officeId +"'>" + d.officeId + "</span>";
                     }}
                 ,{field:'projectId', align:'center',title: '报销项目', minWidth:150,templet:function(d){
@@ -204,6 +214,7 @@
                     ,"realnumber":"${workReimbursement.number}"
                     ,"number":"${workReimbursement.number}"
                     ,"submitterName":"<c:out value="${fns:getUserById(workReimbursement.submitterId).name}" escapeXml="true"/>"
+                    ,"handleName":"<c:out value="${fns:getUserById(workReimbursement.handleId).name}" escapeXml="true"/>"
                     ,"officeId":"${fns:getOfficeById(workReimbursement.officeId).name}"
                     ,"projectId":
                         <c:if test="${workReimbursement.ext == 1}">