瀏覽代碼

发票报销内容修改

user5 4 年之前
父節點
當前提交
ad8ceabd9a

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

@@ -58,4 +58,18 @@ public interface ProjectRecordsDao extends CrudDao<ProjectRecords> {
      */
     List<ProjectRecords> ruralFindList(ProjectRecords records);
 
+    /**
+     * 查询ruralProjectRecord数量
+     * @param records
+     * @return
+     */
+    Integer workInvoiceCount(ProjectRecords records);
+
+    /**
+     * 查询ruralProjectRecord详情
+     * @param records
+     * @return
+     */
+    List<ProjectRecords> workInvoiceFindList(ProjectRecords records);
+
 }

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

@@ -253,11 +253,11 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 			projectRecords.getSqlMap().put("dsf", dataScopeSql);
 		}
 		//查询数据条数
-		int count = dao.ruralQueryCount(projectRecords);
+		int count = dao.workInvoiceCount(projectRecords);
 		page.setCount(count);
 		page.setCountFlag(false);
 		projectRecords.setPage(page);
-		List<ProjectRecords> recordsList = dao.ruralFindList(projectRecords);
+		List<ProjectRecords> recordsList = dao.workInvoiceFindList(projectRecords);
 		//查询负责人信息
 		for (ProjectRecords records : recordsList) {
 			this.queryContractInfos(records);

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

@@ -63,6 +63,7 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	private String type;
 	private String typeName;
 	private WorkReimbursementTypeInfo workReimbursementTypeInfo;
+	private String taskName;
 	public String getCreateOffice() {
 		return createOffice;
 	}
@@ -523,4 +524,12 @@ public class WorkReimbursement extends ActEntity<WorkReimbursement> {
 	public void setHandleName(String handleName) {
 		this.handleName = handleName;
 	}
+
+	public String getTaskName() {
+		return taskName;
+	}
+
+	public void setTaskName(String taskName) {
+		this.taskName = taskName;
+	}
 }

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

@@ -47,6 +47,7 @@ import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
 import com.jeeplus.modules.workreimbursement.entity.WorkAccount;
 import com.jeeplus.modules.workreimbursement.entity.WorkAccountAudit;
 import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
+import com.jeeplus.modules.workreimbursement.utils.HistoicFlowUtil;
 import com.jeeplus.modules.workreimbursement.utils.VarStr;
 import com.jeeplus.modules.workreimbursementback.dao.WorkReimbursementBackDao;
 import com.jeeplus.modules.workreimbursementback.entity.WorkReimbursementBack;
@@ -123,6 +124,8 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
     private WorkReimbursementBackDao workReimbursementBackDao;
     @Autowired
     private WorkLoanDao workLoanDao;
+    @Autowired
+    private HistoicFlowUtil histoicFlowUtil;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -250,6 +253,10 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     info.setProject(project);
                 }
             }
+            /*if(StringUtils.isNotBlank(info.getProcessInstanceId())){
+                String taskName = histoicFlowUtil.histoicFlow(info.getProcessInstanceId());
+                info.setTaskName(taskName);
+            }*/
         }
         return page;
     }

+ 86 - 0
src/main/java/com/jeeplus/modules/workreimbursement/utils/HistoicFlowUtil.java

@@ -0,0 +1,86 @@
+package com.jeeplus.modules.workreimbursement.utils;
+
+import com.jeeplus.common.utils.Collections3;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.sys.entity.SysRoleActivity;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.SystemService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.ui.Model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author: 大猫
+ * @create: 2020-12-22 08:58
+ **/
+@Service
+public class HistoicFlowUtil {
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private SystemService systemService;
+
+    public String histoicFlow(String processInstanceId){
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(processInstanceId);
+        workActivityProcess.setIsApproval("0");
+        List<WorkActivityProcess> lists = workActivityProcessService.findByProcInsIdAudit(workActivityProcess);
+        if (0 != lists.size()){
+            WorkActivityProcess activityProcess = lists.get(0);
+            Act a = new Act();
+            if (activityProcess.getActivity() ==null) {
+                if("销假申请".equals(activityProcess.getRemarks())||"续假申请".equals(activityProcess.getRemarks())){
+                    a.setTaskName("开始");
+                }else{
+                    a.setTaskName("重申|撤销");
+                }
+            }else if (activityProcess.getActivity().getUser()!=null && StringUtils.isNotBlank(activityProcess.getActivity().getUser().getId())){
+                String id = activityProcess.getActivity().getUser().getId();
+                if ("1".equals(id)){
+                    a.setRoleName("负责人");
+                }else {
+                    a.setAssigneeName(UserUtils.get(activityProcess.getActivity().getUser().getId()).getName());
+                }
+                a.setTaskName(activityProcess.getActivity().getName());
+            }else{
+                SysRoleActivity role = activityProcess.getActivity().getRole();
+                String buffer = UserUtils.getRoleActivityEnname(UserUtils.getSelectCompany().getId(),UserUtils.getUser());
+                if (activityProcess.getProcessUserList()!=null && activityProcess.getProcessUserList().size()!=0){
+                    a.setAssigneeName(Collections3.extractToString(activityProcess.getProcessUserList(), "name", ","));
+                }
+                if("master".equals(role.getEnname())){
+                    a.setRoleName("负责人");
+                }else if("qyr".equals(role.getEnname())){
+                    a.setRoleName("签约人");
+                }else if("sqr".equals(role.getEnname())){
+                    a.setRoleName("申请人");
+                    a.setAssigneeName(UserUtils.get(lists.get(lists.size() - 1).getCreateBy().getId()).getName());
+                }else {
+                    if (role.getEnname().contains(buffer)){
+                        SysRoleActivity r = systemService.getRoleActivityByEnname(role.getEnname());
+                        a.setRoleName(r.getName());
+                    }else {
+                        //如果流程中指定的角色为董事长dsz,而该公司下没有这样角色,则r=null,空指针
+                        SysRoleActivity r = systemService.getRoleActivityByEnname(buffer+role.getEnname());
+                        a.setRoleName(r!=null?r.getName():"");
+                    }
+                }
+                a.setTaskName(activityProcess.getActivity().getName());
+            }
+
+            a.setComment(activityProcess.getRemarks());
+            return a.getTaskName();
+        }
+
+        return "";
+    }
+}

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

@@ -898,4 +898,176 @@
 		</where>
 	</select>
 
+
+	<select id="workInvoiceFindList" resultType="ProjectRecords" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,
+		wci.name AS "workContractInfo.name",
+		wct.id AS "workContractInfo.client.id",
+		wct.name AS "workContractInfo.client.name",
+		o.top_company AS "office.name",
+		dsu.name as "projectRegistrant",
+		prd.number as "reportData.number"
+		FROM rural_project_records a
+		<include refid="projectRecordsJoins"/>
+
+
+		LEFT JOIN project_report_data prd on a.id = prd.project_id
+		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 dsu on a.create_by = dsu.id
+		LEFT JOIN work_project_user w1 on a.id = w1.project_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 o ON o.id = a.office_id
+		<where>
+			<if test="projectId != null and projectId != ''">
+				AND a.project_id like concat('%',#{projectId},'%')
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name like concat(concat('%',#{projectName}),'%')
+			</if>
+			<if test="scaleType != null and scaleType != ''">
+				AND a.scale_type = #{scaleType}
+			</if>
+			<if test="scaleUnit != null and scaleUnit != ''">
+				AND a.scale_unit = #{scaleUnit}
+			</if>
+			<if test="scaleQuantity != null and scaleQuantity != ''">
+				AND a.scale_quantity = #{scaleQuantity}
+			</if>
+			<if test="projectSite != null and projectSite != ''">
+				AND a.project_site LIKE concat('%',#{projectSite},'%')
+			</if>
+			<if test="remarks != null and remarks != ''">
+				AND a.remarks LIKE concat('%',#{remarks},'%')
+			</if>
+			<if test="projectDesc != null and projectDesc != ''">
+				AND a.project_desc LIKE concat('%',#{projectDesc},'%')
+			</if>
+			<if test="area != null and area.id != null and area.id != ''">
+				AND a.area_id = #{area.id}
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
+				AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
+				AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
+				AND wci.contract_price = #{workContractInfo.contractPrice}
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
+				AND wci.contract_type = #{workContractInfo.contractType}
+			</if>
+			<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+				AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
+			</if>
+			<if test="leaderNameStr !=null and leaderNameStr !=''">
+				AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
+			</if>
+			<if test="projectStatus !=null">
+				AND a.status = #{projectStatus}
+			</if>
+			<if test="beginDate !=null">
+				AND a.create_date >= #{beginDate}
+			</if>
+			<if test="endDate !=null">
+				AND a.create_date &lt; #{endDate}
+			</if>
+			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
+			and prd.number is not null
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} )${sqlMap.dsf} )
+			</if>
+		</where>
+		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="workInvoiceCount" resultType="int" >
+		SELECT count(DISTINCT a.id)
+		FROM rural_project_records a
+		<if test="leaderNameStr !=null and leaderNameStr !=''">
+			LEFT JOIN work_project_user w on a.id = w.project_id
+			LEFT JOIN sys_user su on w.user_id = su.id
+		</if>
+		LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		<if test="workContractInfo !=null">
+			LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+		</if>
+		LEFT JOIN project_report_data prd on a.id = prd.project_id
+		<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+			LEFT JOIN work_client_info wct on wci.client_id = wct.id
+		</if>
+		<where>
+			<if test="projectId != null and projectId != ''">
+				AND a.project_id like concat('%',#{projectId},'%')
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND a.project_name like concat(concat('%',#{projectName}),'%')
+			</if>
+			<if test="scaleType != null and scaleType != ''">
+				AND a.scale_type = #{scaleType}
+			</if>
+			<if test="scaleUnit != null and scaleUnit != ''">
+				AND a.scale_unit = #{scaleUnit}
+			</if>
+			<if test="scaleQuantity != null and scaleQuantity != ''">
+				AND a.scale_quantity = #{scaleQuantity}
+			</if>
+			<if test="projectSite != null and projectSite != ''">
+				AND a.project_site LIKE concat('%',#{projectSite},'%')
+			</if>
+			<if test="remarks != null and remarks != ''">
+				AND a.remarks LIKE concat('%',#{remarks},'%')
+			</if>
+			<if test="projectDesc != null and projectDesc != ''">
+				AND a.project_desc LIKE concat('%',#{projectDesc},'%')
+			</if>
+			<if test="area != null and area.id != null and area.id != ''">
+				AND a.area_id = #{area.id}
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
+				AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
+				AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
+				AND wci.contract_price = #{workContractInfo.contractPrice}
+			</if>
+			<if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
+				AND wci.contract_type = #{workContractInfo.contractType}
+			</if>
+			<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+				AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
+			</if>
+			<if test="leaderNameStr !=null and leaderNameStr !=''">
+				AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
+			</if>
+			<if test="projectStatus !=null">
+				AND a.status = #{projectStatus}
+			</if>
+			<if test="beginDate !=null">
+				AND a.create_date >= #{beginDate}
+			</if>
+			<if test="endDate !=null">
+				AND a.create_date &lt; #{endDate}
+			</if>
+			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
+			and prd.number is not null
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
+			</if>
+		</where>
+	</select>
 </mapper>

+ 3 - 3
src/main/webapp/webpage/modules/workinvoice/workInvoiceList.jsp

@@ -434,7 +434,7 @@
 				,{field:'officeName', align:'center',title: '经办单位',width:80,templet:function(d){
 						return "<span title='"+ d.officeName +"'>" + d.officeName + "</span>";
 					}}
-				,{field:'money',align:'center', title: '开票金额',  width:90,templet:function(d){
+				,{field:'money',align:'center', title: '开票金额(元)',  width:110,templet:function(d){
 						return "<span title='"+ d.money +"'>" + d.money + "</span>";
 					}}
 				,{field:'billingContent',align:'center', title: '开票内容',  width:90,templet:function(d){
@@ -456,7 +456,7 @@
 				,{field:'receiptMoneyDate',align:'center', sort:true,title: '收款日期',  width:80}
 				,{field:'receiptMoney',align:'center', title: '是否收款',  width:80}
 				,{field:'cancellation',align:'center', title: '是否作废',  width:80}
-                ,{align:'center', title: '状态',  width:70,templet:function(d){
+                ,{align:'center', title: '状态', fixed: 'right', width:70,templet:function(d){
                         <%--var st = getAuditState(d.status);--%>
 
                         <%--var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workinvoice/workInvoice/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";--%>
@@ -468,7 +468,7 @@
                             var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                         return xml;
                     }}
-                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                ,{field:'op',align:'center',title:"操作",fixed: 'right',width:130,templet:function(d){
                         ////对操作进行初始化
                         var xml="";
                         if(d.canedit1 != undefined && d.canedit1 =="1")

+ 3 - 1
src/main/webapp/webpage/modules/workinvoice/workInvoiceReceiptForm.jsp

@@ -19,7 +19,9 @@
 		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
 		  if(validateForm.form()){
 			  var length = $("#workReceiptList tr").length;
-			  var invoiceMoney = $("#invoiceMoney").val();
+			  var invoiceMoneyStr = $("#invoiceMoney").val();
+			  invoiceMoneyStr = invoiceMoneyStr.replace(/\,/g, "");
+			  var invoiceMoney = parseFloat(invoiceMoneyStr);
 			  if(length==0){
 				  parent.layer.msg('请录入收款信息',{icon:5});
 				  return false;

+ 2 - 0
src/main/webapp/webpage/modules/workreimbursement/workReimbursementList.jsp

@@ -174,6 +174,7 @@
                 ,{field:'money',align:'center', title: '报销金额(元)', width:150,templet:function(d){
                         return "<span title='"+ d.money +"'>" + d.money + "</span>";
                     }}
+                /*,{field:'taskName', align:'center',title: '审批状态',width:120}*/
                 ,{ title: '状态', align:'center',width:70,templet:function(d){
                         <%--var st = getAuditState(d.status);--%>
                         <%--var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workreimbursement/workReimbursement/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";--%>
@@ -213,6 +214,7 @@
                     ,"submitterId":"${index.index+1}"
                     ,"realnumber":"${workReimbursement.number}"
                     ,"number":"${workReimbursement.number}"
+                    ,"taskName":"${workReimbursement.taskName}"
                     ,"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}"