Browse Source

开票工程一部数据以及金额汇总调整

user5 1 year atrás
parent
commit
7f06ee38b6

+ 19 - 0
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java

@@ -114,6 +114,9 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 
 	private Integer electronicInvoiceFlag ;	//是否已经上传电子发票信息(0:未上传;1:已上传)
 
+	private Date auditPassDate;
+	private Date cancellationAuditPassDate;
+
 	@Override
 	@ExcelField(title="经办人", fieldType=User.class, value="createBy.name", align=2, sort=7)
 	public User getCreateBy() {
@@ -800,4 +803,20 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	public void setAccountCheckingArea(String accountCheckingArea) {
 		this.accountCheckingArea = accountCheckingArea;
 	}
+
+	public Date getAuditPassDate() {
+		return auditPassDate;
+	}
+
+	public void setAuditPassDate(Date auditPassDate) {
+		this.auditPassDate = auditPassDate;
+	}
+
+	public Date getCancellationAuditPassDate() {
+		return cancellationAuditPassDate;
+	}
+
+	public void setCancellationAuditPassDate(Date cancellationAuditPassDate) {
+		this.cancellationAuditPassDate = cancellationAuditPassDate;
+	}
 }

+ 24 - 4
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java

@@ -210,10 +210,17 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 //		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			//查询该选择节点下所有的部门Id
-			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-			officeIdList.add(workInvoice.getOfficeId());
-			workInvoice.setOfficeIdList(officeIdList);
+			if("一部本部".equals(workInvoice.getOfficeId())){
+				List<String> officeIdList = Lists.newArrayList();
+				Office office = officeService.getByName("工程一部");
+				officeIdList.add(office.getId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}else{
+				//查询该选择节点下所有的部门Id
+				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+				officeIdList.add(workInvoice.getOfficeId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}
 		}
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
@@ -263,6 +270,19 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	 */
 	public String getSumMoney(WorkInvoice workInvoice){
 		//workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			if("一部本部".equals(workInvoice.getOfficeId())){
+				List<String> officeIdList = Lists.newArrayList();
+				Office office = officeService.getByName("工程一部");
+				officeIdList.add(office.getId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}else{
+				//查询该选择节点下所有的部门Id
+				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+				officeIdList.add(workInvoice.getOfficeId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}
+		}
 		workInvoice.setPage(new Page<WorkInvoice>());
 		String getSumMoney = dao.getSumMoney(workInvoice);
 		if(StringUtils.isBlank(getSumMoney)){

+ 28 - 4
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -245,11 +245,19 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 		workInvoice.getSqlMap().put("dsf", invoiceDataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
-			//查询该选择节点下所有的部门Id
-			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
-			officeIdList.add(workInvoice.getOfficeId());
-			workInvoice.setOfficeIdList(officeIdList);
+			if("一部本部".equals(workInvoice.getOfficeId())){
+				List<String> officeIdList = Lists.newArrayList();
+				Office office = officeService.getByName("工程一部");
+				officeIdList.add(office.getId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}else{
+				//查询该选择节点下所有的部门Id
+				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+				officeIdList.add(workInvoice.getOfficeId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}
 		}
+
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
 		page.setCountFlag(false);
@@ -394,6 +402,19 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	 */
 	public String getSumMoney(WorkInvoice workInvoice){
 		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			if("一部本部".equals(workInvoice.getOfficeId())){
+				List<String> officeIdList = Lists.newArrayList();
+				Office office = officeService.getByName("工程一部");
+				officeIdList.add(office.getId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}else{
+				//查询该选择节点下所有的部门Id
+				List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+				officeIdList.add(workInvoice.getOfficeId());
+				workInvoice.setOfficeIdList(officeIdList);
+			}
+		}
 		workInvoice.setPage(new Page<WorkInvoice>());
 		String getSumMoney = dao.getSumMoney(workInvoice);
 		if(StringUtils.isBlank(getSumMoney)){
@@ -1469,6 +1490,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			users.add(workInvoice.getCreateBy());
 			if ("yes".equals(workInvoice.getAct().getFlag())) {
 				workInvoice.setInvoiceState("5");
+				workInvoice.setAuditPassDate(new Date());
 				WorkProjectNotify notify = new WorkProjectNotify();
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);
@@ -1830,6 +1852,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					title = "项目【"+ projectNameStr +"】发票申请通过";
 					str = "发票金额:" + workInvoice.getMoney() + "(元)。项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
 					workInvoice.setInvoiceState("5");
+					workInvoice.setAuditPassDate(new Date());
 					WorkProjectNotify notify = new WorkProjectNotify();
 					notify.setNotifyId(workInvoice.getId());
 					userList = workProjectNotifyService.readByNotifyId(notify);
@@ -3296,6 +3319,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			users.add(workInvoice.getCreateBy());
 			if ("yes".equals(workInvoice.getAct().getFlag())) {
 				workInvoice.setInvoiceState("7");
+				workInvoice.setCancellationAuditPassDate(new Date());
 				WorkProjectNotify notify = new WorkProjectNotify();
 				notify.setNotifyId(workInvoice.getId());
 				userList = workProjectNotifyService.readByNotifyId(notify);

+ 2 - 2
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java

@@ -156,7 +156,7 @@ public class WorkInvoiceAllTwoController extends BaseController {
 		//查询已通过的所有发票的开票金额总和
 		String getSumMoney = workInvoiceService.getSumMoney(workInvoice);
 		List<WorkInvoice> workInvoiceList = page.getList();
-		for (WorkInvoice invoice: workInvoiceList) {
+		/*for (WorkInvoice invoice: workInvoiceList) {
 			invoice.setWorkInvoiceProjectRelationList(invoiceService.getProjectRelation(invoice));
 			List<String> projectNameList = invoiceService.getProjectNameList(invoice);
 			String projectNameStr = String.join(",", projectNameList);
@@ -168,7 +168,7 @@ public class WorkInvoiceAllTwoController extends BaseController {
 			}
 			String reportNumberStr = String.join(",", reportNumber);
 			invoice.setReportNumber(reportNumberStr);
-		}
+		}*/
 		model.addAttribute("page", page);
 		model.addAttribute("sumMoney", getSumMoney);
 		model.addAttribute("workInvoiceShow", workInvoice);

+ 75 - 19
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -1119,12 +1119,15 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
-			<if test="officeId != null and officeId != ''">
+			<!--<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
-			</if>
+			</if>-->
 			<if test="money != null and money != ''">
 				AND a.money = #{money}
 			</if>
+			<!--<if test="submitterId != null and submitterId != ''">
+				AND a.create_by = #{submitterId}
+			</if>-->
 			<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
 				AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
 			</if>
@@ -1146,14 +1149,20 @@
 			<if test="companyId != null and companyId != ''">
 				AND a.company_id = #{companyId}
 			</if>
-			<if test="office != null and office.id != null and office.id != ''">
+			<!--<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="invoiceNumber != null and invoiceNumber != ''">
 				AND a.invoice_number LIKE
-					<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
+				<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
 			</if>
 			<if test="invoiceDate != null and invoiceDate != ''">
 				AND a.invoice_date = #{invoiceDate}
@@ -1179,7 +1188,7 @@
 				)
 			</if>
 			<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
-				AND (a.account_checking_user_id = #{accountCheckingUserId} or acu.name like concat('%',#{accountCheckingUserName},'%'))
+				AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
 			</if>
 			<if test="widNumber != null and widNumber != ''">
 				AND wid.number LIKE
@@ -1187,6 +1196,35 @@
 				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
 			</if>
+			<if test="newDrawerId != null and newDrawerId != ''">
+				and new_drawer_id like
+				<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
+			</if>
+			<if test="newDrawer != null and newDrawer != ''">
+				and new_drawer like
+				<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
+			</if>
+			<if test="projectName != null and projectName != ''">
+				and (wipr.details like
+				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+				or rpr.project_name like
+				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+				)
+			</if>
+			<if test="reportNumber != null and reportNumber != ''">
+				and prds.number like
+				<if test="dbName == 'oracle'">'%'||#{reportNumber}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{reportNumber}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{reportNumber},'%')</if>
+			</if>
 			${sqlMap.dsf}
 		</where>
 	) as x
@@ -1270,11 +1308,8 @@
 			<!--<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
 			</if>-->
-			<if test="officeIdList!=null and officeIdList.size!=0">
-				and a.office_id in
-				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
-					#{officeId}
-				</foreach>
+			<if test="money != null and money != ''">
+				AND a.money = #{money}
 			</if>
 			<!--<if test="submitterId != null and submitterId != ''">
 				AND a.create_by = #{submitterId}
@@ -1285,9 +1320,6 @@
 			<if test="receiptMoney != null and receiptMoney != ''">
 				AND a.receipt_money = #{receiptMoney}
 			</if>
-			<if test="money != null and money != ''">
-				AND a.money = #{money}
-			</if>
 			<if test="invoiceType != null and invoiceType != ''">
 				AND a.invoice_type = #{invoiceType}
 			</if>
@@ -1303,11 +1335,14 @@
 			<if test="companyId != null and companyId != ''">
 				AND a.company_id = #{companyId}
 			</if>
-			<if test="office != null and office.id != null and office.id != ''">
+			<!--<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
-			</if>
-			<if test="billingContent != null and billingContent != ''">
-				AND a.billing_content = #{billingContent}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="invoiceNumber != null and invoiceNumber != ''">
 				AND a.invoice_number LIKE
@@ -1327,6 +1362,9 @@
 			<if test="isInvalid != null and isInvalid != ''">
 				AND a.is_invalid = #{isInvalid}
 			</if>
+			<if test="billingContent != null and billingContent != ''">
+				AND a.billing_content = #{billingContent}
+			</if>
 			<if test="area != null and area.id != null and area.id != ''">
 				AND (a.area_parent_id LIKE
 				<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
@@ -1344,6 +1382,18 @@
 				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
 			</if>
+			<if test="newDrawerId != null and newDrawerId != ''">
+				and new_drawer_id like
+				<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
+			</if>
+			<if test="newDrawer != null and newDrawer != ''">
+				and new_drawer like
+				<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
+			</if>
 			<if test="projectName != null and projectName != ''">
 				and (wipr.details like
 				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
@@ -1690,6 +1740,12 @@
 			actual_drawer_email_address = #{actualDrawerEmailAddress},
 			new_drawer = #{newDrawer},
 			actual_drawer_id = #{actualDrawerId}
+			<if test="null != auditPassDate">
+				,audit_pass_date = #{auditPassDate}
+			</if>
+			<if test="null != cancellationAuditPassDate">
+				,cancellation_audit_pass_date = #{cancellationAuditPassDate}
+			</if>
 		WHERE id = #{id}
 	</update>
 	<update id="updateDate">

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

@@ -588,7 +588,7 @@
 									<label class="layui-form-label">经办人部门:</label>
 									<div class="layui-input-block with-icon">
 										<sys:treeselect id="officeId" name="officeId" value="${workInvoice.officeId}" labelName="officeName" labelValue="${workInvoice.officeName}" cssStyle="background-color: #fff"
-														title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+														title="部门" url="/sys/office/treeDataAll?type=6" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
 									</div>
 								</div>
 								<div class="layui-item query athird">

+ 2 - 2
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

@@ -630,7 +630,7 @@
 								<label class="layui-form-label">经办人部门:</label>
 								<div class="layui-input-block with-icon">
 									<sys:treeselect id="officeId" name="officeId" value="${workInvoice.officeId}" labelName="officeName" labelValue="${workInvoice.officeName}" cssStyle="background-color: #fff"
-													title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+													title="部门" url="/sys/office/treeDataAll?type=6" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
 								</div>
 							</div>
 							<div class="layui-item query athird">
@@ -873,7 +873,7 @@
 						if(d.cancellationFlag != undefined && d.cancellationFlag =="1")
 						{
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openElectronicInvoiceDialogreplay('上传电子发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/electronicInvoiceForm?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 上传电子发票</a>";
-							//xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 作废</a>";
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 作废</a>";
 						}
 						if(d.conditionCanedit != undefined && d.conditionCanedit =="1")
 						{