Browse Source

发票查询
缴费日志导出

wangli 4 years ago
parent
commit
01717e0fd8

+ 27 - 4
smart-city-platform/src/main/java/com/bz/smart_city/advice/LogAdvice.java

@@ -8,6 +8,7 @@ import com.bz.smart_city.entity.User;
 import com.bz.smart_city.service.SysLogsService;
 import io.swagger.annotations.ApiOperation;
 import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.Signature;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.reflect.MethodSignature;
@@ -15,6 +16,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.StringUtils;
 
+import java.lang.reflect.Method;
+import java.time.LocalDateTime;
+
 /**
  * 统一日志处理
  *
@@ -28,11 +32,29 @@ public class LogAdvice {
 
 	@Around(value = "@annotation(com.bz.smart_city.annotation.LogAnnotation)")
 	public Object logSave(ProceedingJoinPoint joinPoint) throws Throwable {
+
+		try{
+			//1.获取到所有的参数值的数组
+			Object[] args = joinPoint.getArgs();
+			Signature signature = joinPoint.getSignature();
+			MethodSignature methodSignature = (MethodSignature) signature;
+			//2.获取到方法的所有参数名称的字符串数组
+			String[] parameterNames = methodSignature.getParameterNames();
+			Method method = methodSignature.getMethod();
+			System.out.println("---------------参数列表开始-------------------------");
+			for (int i =0 ,len=parameterNames.length;i < len ;i++){
+				System.out.println("参数名:"+ parameterNames[i] + " = " +args[i]);
+			}
+			System.out.println("---------------参数列表结束-------------------------");
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+
 		SysLogs sysLogs = new SysLogs();
 		LoginUser user = UserUtil.getCurrentUser();
 		if (user != null) {
 			// 设置当前登录用户
-			sysLogs.setId(user.getId());
+			sysLogs.setUserId(user.getId());
 			MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
 
 			String module = null;
@@ -60,9 +82,10 @@ public class LogAdvice {
 				sysLogs.setRemark(e.getMessage());
 				throw e;
 			} finally {
-				if (sysLogs.getId() != null) {
-					sysLogsService.insertSelective(sysLogs);
-				}
+//				if (sysLogs.getUserId() != null) {
+				sysLogs.setCreateTime(LocalDateTime.now());
+//					sysLogsService.insertSelective(sysLogs);
+//				}
 			}
 		}else {
 			return joinPoint.proceed();

+ 5 - 6
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayFeeController.java

@@ -1,5 +1,6 @@
 package com.bz.smart_city.controller.pay;
 
+import com.bz.smart_city.annotation.LogAnnotation;
 import com.bz.smart_city.commom.model.AjaxMessage;
 import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.dto.pay.PayInvoiceDto;
@@ -38,8 +39,6 @@ public class PayFeeController {
     @Autowired
     PayFeeService payFeeService;
     @Autowired
-    private PayPayReceivedService payPayReceivedService;
-    @Autowired
     PayTransactiondetailsService payTransactiondetailsService;
 
 
@@ -62,7 +61,7 @@ public class PayFeeController {
             arrayList=  Arrays.asList(receivableIds.split(",")).stream().map(BigInteger::new).collect(Collectors.toList());
         }
 
-        return new AjaxMessage<String>(ResultStatus.OK,payFeeService.payFee(accountnumber,
+        return new AjaxMessage<>(ResultStatus.OK,payFeeService.payFee(accountnumber,
                                                                             metercode,
                                                                             BigDecimal.valueOf(Double.parseDouble(transAmount)),
                                                                             Integer.valueOf(paytype),
@@ -85,7 +84,7 @@ public class PayFeeController {
 
     ){
         //暂时先默认柜台支付为现金支付,后期区分
-     return new AjaxMessage(ResultStatus.OK, payFeeService.payFeeCounter(accountId,4,new BigDecimal(transAmount),balancetype));
+     return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFeeCounter(accountId,4,new BigDecimal(transAmount),balancetype));
     }
 
     @GetMapping("/findPayfeeAccountInfo")
@@ -94,14 +93,14 @@ public class PayFeeController {
             @ApiParam(value = "开户id,查询多用户时,再次查询用id查询") @RequestParam(required = false)BigInteger id,
             @ApiParam(value = "查询内容,户编、户名、手机、地址") @RequestParam(required = false)String condition ){
 
-        return new AjaxMessage<List<PayfeeAccountInfoDto>>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id , condition ));
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id , condition ));
     }
 
     @GetMapping("/getPayfeeDetaileBill")
     @ApiOperation(value="查询账单详情")
     public AjaxMessage<PayfeeDetaileBill> getPayfeeDetaileBill(
             @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId){
-        return new AjaxMessage<PayfeeDetaileBill>(ResultStatus.OK,payFeeService.getPayfeeDetaileBill(accountId));
+        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayfeeDetaileBill(accountId));
 
     }
 

+ 48 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayPrintInvoiceController.java

@@ -1,18 +1,28 @@
 package com.bz.smart_city.controller.pay;
 
 import com.bz.smart_city.commom.model.AjaxMessage;
+import com.bz.smart_city.commom.model.Pagination;
 import com.bz.smart_city.commom.model.ResultStatus;
 import com.bz.smart_city.dto.pay.ReturnPrintResultDto;
+import com.bz.smart_city.dto.pay.payfee.PayInvoiceSearchDto;
+import com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto;
 import com.bz.smart_city.service.pay.IssueElectronicInvoiceService;
+import com.bz.smart_city.service.pay.PrintInvoicePrintService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.math.BigInteger;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
 /**
  * @ClassName PayPrintInvoiceController
  * @Description: TODO
@@ -27,6 +37,9 @@ public class PayPrintInvoiceController {
     @Autowired
     private IssueElectronicInvoiceService issueElectronicInvoiceService;
 
+    @Autowired
+    private PrintInvoicePrintService printInvoicePrintService;
+
     @ApiOperation(value = "发票打印")
     @GetMapping(value = "/InvoicePrintRequest")
     public AjaxMessage<ReturnPrintResultDto> InvoicePrintRequest(
@@ -48,5 +61,40 @@ public class PayPrintInvoiceController {
         ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId,customerId,"2", null, null, invoicePrintId);
         return new AjaxMessage<>(ResultStatus.OK, returnPrintResultDto);
     }
+    @ApiOperation(value = "发票列表")
+    @GetMapping(value = "/invoicePrintList")
+    public AjaxMessage<List<PayfeeInvoicePrintDto>> invoicePrintList(
+            @ApiParam(value = "发票id", required = false) @RequestParam(required = false) BigInteger id,
+            @ApiParam(value = "用户编号", required = false) @RequestParam(required = false) BigInteger accountId,
+            @ApiParam(value = "账期年", required = false) @RequestParam(required = false) Integer year) {
+        PayInvoiceSearchDto payInvoiceSearchDto=new PayInvoiceSearchDto();
+        payInvoiceSearchDto.setId(id);
+        payInvoiceSearchDto.setAccountId(accountId);
+        payInvoiceSearchDto.setYear(year);
+        return new AjaxMessage<>(ResultStatus.OK, printInvoicePrintService.findList(payInvoiceSearchDto));
+    }
+
+    @ApiOperation(value = "发票列表分页")
+    @GetMapping(value = "/invoicePrintPageList")
+    public AjaxMessage<Pagination<PayfeeInvoicePrintDto>> invoicePrintPageList(
+            @ApiParam(value = "综合查询(发票号码/客户编号/客户名称)", required = false) @RequestParam(required = false) String condition,
+            @ApiParam(value = "发票状态", required = false) @RequestParam(required = false) Integer state,
+            @ApiParam(value = "开始时间yyyyMMddhhmmss", required = false) @RequestParam(required = false) String startPrintDate,
+            @ApiParam(value = "结束时间yyyyMMddhhmmss", required = false) @RequestParam(required = false) String endPrintDate,
+            @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
+            @ApiParam(value = "条数,非必传,默认10条", required = false, defaultValue = "10") @RequestParam(required = false, defaultValue = "10") int pageSize
+    ) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+        PayInvoiceSearchDto payInvoiceSearchDto=new PayInvoiceSearchDto();
+        payInvoiceSearchDto.setCondition(condition);
+        payInvoiceSearchDto.setState(state);
+        if(StringUtils.isNotBlank(startPrintDate)){
+            payInvoiceSearchDto.setStartPrintDate( LocalDateTime.parse(startPrintDate,df));
+        }
+        if(StringUtils.isNotBlank(endPrintDate)){
+            payInvoiceSearchDto.setEndPrintDate(LocalDateTime.parse(endPrintDate, df));
+        }
 
+        return new AjaxMessage<>(ResultStatus.OK, printInvoicePrintService.findPageList(payInvoiceSearchDto,pageNum,pageSize));
+    }
 }

+ 14 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/system/OperationLogController.java

@@ -69,4 +69,18 @@ public class OperationLogController {
     ) {
         operationLogService.getExcel(username, operationName,content, startDate, endDate, mobilephone, httpServletResponse);
     }
+
+    @GetMapping("/getPayfeeExcel")
+    @ApiOperation(value = "缴费操作日志导出excel")
+    public void getPayfeeExcel(
+            @ApiParam(value = "用户名", required = false) @RequestParam(required = false) String username,
+            @ApiParam(value = "操作名称", required = false) @RequestParam(required = false) String operationName,
+            @ApiParam(value = "操作内容", required = false) @RequestParam(required = false) String content,
+            @ApiParam(value = "手机号码", required = false) @RequestParam(required = false) String mobilephone,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
+            @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate,
+            HttpServletResponse httpServletResponse
+    ) {
+        operationLogService.getPayfeeExcel(username, operationName,content, startDate, endDate, mobilephone, httpServletResponse);
+    }
 }

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/PayInvoicePrintMapper.java

@@ -1,5 +1,7 @@
 package com.bz.smart_city.dao.pay;
 
+import com.bz.smart_city.dto.pay.payfee.PayInvoiceSearchDto;
+import com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto;
 import com.bz.smart_city.entity.pay.PayInvoiceprinted;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -25,4 +27,6 @@ public interface PayInvoicePrintMapper {
     List<PayInvoiceprinted> findListByState();
 
     Integer updateReceivedIsPrint(@Param("isPrint") Boolean isPrint, @Param("payseriesno") String payseriesno, @Param("customerId") BigInteger customerId);
+
+    List<PayfeeInvoicePrintDto> findList(PayInvoiceSearchDto payInvoiceSearchDto);
 }

+ 40 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayInvoiceSearchDto.java

@@ -0,0 +1,40 @@
+package com.bz.smart_city.dto.pay.payfee;
+
+import com.bz.smart_city.entity.ProgramItem;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigInteger;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @description 发票查询条件
+ * @auto wangli
+ * @data 2020-08-18 8:28
+ */
+@Data
+public class PayInvoiceSearchDto {
+    @ApiModelProperty("发票id")
+    private BigInteger id;
+    @ApiModelProperty("客户id")
+    private BigInteger accountId;
+    @ApiModelProperty("账期年")
+    private Integer year;
+    @ApiModelProperty("发票状态")
+    private Integer state;
+    @ApiModelProperty("开票时间")
+    private LocalDateTime startPrintDate;
+    @ApiModelProperty("开票时间")
+    private LocalDateTime endPrintDate;
+    @ApiModelProperty("模糊查询")
+    private String condition;
+
+    @ApiModelProperty("站点id")
+    private BigInteger siteId;
+    @ApiModelProperty("客户id")
+    private BigInteger customerId;
+    @ApiModelProperty("权限")
+    private List<ProgramItem> programItems;
+
+}

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeAccountInfoDto.java

@@ -21,6 +21,8 @@ public class PayfeeAccountInfoDto {
 
     @ApiModelProperty(value = "客户信息id")
     private BigInteger accountId;
+    @ApiModelProperty(value = "水表信息id")
+    private BigInteger watermeterId;
     @ApiModelProperty(value = "开户信息id" )
     private BigInteger custId;
     @ApiModelProperty(value = "客户编码" )

+ 64 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeInvoicePrintDto.java

@@ -0,0 +1,64 @@
+package com.bz.smart_city.dto.pay.payfee;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigInteger;
+import java.time.LocalDateTime;
+
+/**
+ * @description 发票
+ * @auto wangli
+ * @data 2020-08-17 15:25
+ */
+@Data
+@ApiModel("缴费界面——发票信息")
+public class PayfeeInvoicePrintDto {
+    @ApiModelProperty(value = "主键")
+    private BigInteger id;
+    @ApiModelProperty(value = "客户ID")
+    private BigInteger accountId;
+    @ApiModelProperty(value = "发票代码")
+    private String invoiceCode;
+    @ApiModelProperty(value = "发票号码")
+    private String invoiceNo;
+    @ApiModelProperty(value = "客户编号")
+    private String accountnumber;
+    @ApiModelProperty(value = "客户名称")
+    private String accountname;
+    @ApiModelProperty(value = "订单号")
+    private String orderNo;
+    @ApiModelProperty(value = "交易流水号")
+    private String payseriesno;
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    @ApiModelProperty(value = "开票时间")
+    private LocalDateTime printDate;
+    @ApiModelProperty(value = "价税合计")
+    private Double totalPrintAmount;
+    @ApiModelProperty(value = "发票状态 0:待生成 1:正常 2: 开票中(待生成) 3:已冲红 4:开票失败  5:已作废")
+    private Integer state;
+    @ApiModelProperty(value="发票状态")
+    private String stateLabel;
+    @ApiModelProperty(value = "负责人")
+    private String createBy;
+
+    @ApiModelProperty(value = "发票类型 1:蓝票 2:红票")
+    private Integer invoiceType;
+    @ApiModelProperty(value = "发票类型 1:蓝票 2:红票")
+    private String invoiceTypeLabel;
+//    @ApiModelProperty(value = "发票种类")
+//    private String invoiceLine;
+
+    @ApiModelProperty(value = "发票PDF路径")
+    private String pdfUrl;
+    @ApiModelProperty(value = "发票JPG路径")
+    private String jpgUrl;
+
+//    @ApiModelProperty(value = "作废人")
+//    private String canceledBy;
+
+    @ApiModelProperty(value = "被冲红记录ID")
+    private BigInteger cancelInvoiceId;
+}

+ 3 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/OperationLogService.java

@@ -21,5 +21,8 @@ public interface OperationLogService {
     void getExcel(String username, String operationName, String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse);
 
     void addMobileOperationLog(OperationLog operationLog);
+
+    void getPayfeeExcel(String username, String operationName, String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse);
+
 }
 

+ 26 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/OperationLogServiceImpl.java

@@ -121,5 +121,31 @@ public class OperationLogServiceImpl implements OperationLogService {
             throw new ServiceException(-900, "导出异常");
         }
     }
+
+    public void getPayfeeExcel(String username, String operationName, String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse) {
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), username, operationName, content, startDate, endDate,mobilephone);
+        String title = "操作日志";
+        String[] rowsName = new String[]{"序号", "操作时间", "用户名","手机号", "操作内容"};
+        List<Object[]> dataList = newArrayList();
+        Object[] objs = null;
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        for (int i = 0; i < list.size(); i++) {
+            OperationLog operationLog = list.get(i);
+            objs = new Object[rowsName.length];
+            objs[0] = (i + 1);
+            objs[1] = operationLog.getCreateDate().format(df);
+            objs[2] = operationLog.getUsername();
+            objs[3] = operationLog.getMobilePhone();
+            objs[4] = operationLog.getOperationName();
+            dataList.add(objs);
+        }
+        ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
+        try {
+            excelUtil.export(httpServletResponse);
+        } catch (Exception e) {
+            throw new ServiceException(-900, "导出异常");
+        }
+    }
 }
 

+ 41 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayInvoicePrintServiceImpl.java

@@ -1,8 +1,15 @@
 package com.bz.smart_city.service.impl.pay;
 
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.commom.util.UserUtil;
 import com.bz.smart_city.dao.pay.PayInvoicePrintMapper;
+import com.bz.smart_city.dto.LoginUser;
+import com.bz.smart_city.dto.pay.PayTransactiondetails;
+import com.bz.smart_city.dto.pay.payfee.PayInvoiceSearchDto;
+import com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto;
 import com.bz.smart_city.entity.pay.PayInvoiceprinted;
 import com.bz.smart_city.service.pay.PrintInvoicePrintService;
+import com.github.pagehelper.PageHelper;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -45,4 +52,38 @@ public class PayInvoicePrintServiceImpl implements PrintInvoicePrintService {
     public Integer updateReceivedIsPrint(Boolean isPrint, String payseriesno, BigInteger customerId) {
         return payInvoicePrintMapper.updateReceivedIsPrint(isPrint,payseriesno,customerId);
     }
+
+    public List<PayfeeInvoicePrintDto> findList(PayInvoiceSearchDto payInvoiceSearchDto){
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        //站点为空则加入用户站点查询
+        if( loginUser !=null){
+            //站点权限
+            payInvoiceSearchDto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
+            //客户权限
+            payInvoiceSearchDto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
+            //数据权限
+            payInvoiceSearchDto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
+        }
+
+        return payInvoicePrintMapper.findList(payInvoiceSearchDto);
+    }
+
+    public Pagination<PayfeeInvoicePrintDto> findPageList(PayInvoiceSearchDto payInvoiceSearchDto, int pageNum, int pageSize) {
+
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        //分页
+        PageHelper.startPage(pageNum,pageSize);
+        //站点为空则加入用户站点查询
+        if( loginUser !=null){
+            //站点权限
+            payInvoiceSearchDto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
+            //客户权限
+            payInvoiceSearchDto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
+            //数据权限
+            payInvoiceSearchDto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
+        }
+
+        return new Pagination<>(payInvoicePrintMapper.findList(payInvoiceSearchDto));
+    }
+
 }

+ 8 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/PrintInvoicePrintService.java

@@ -1,5 +1,8 @@
 package com.bz.smart_city.service.pay;
 
+import com.bz.smart_city.commom.model.Pagination;
+import com.bz.smart_city.dto.pay.payfee.PayInvoiceSearchDto;
+import com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto;
 import com.bz.smart_city.entity.pay.PayInvoice;
 import com.bz.smart_city.entity.pay.PayInvoiceprinted;
 import org.apache.ibatis.annotations.Param;
@@ -25,4 +28,9 @@ public interface PrintInvoicePrintService {
     List<PayInvoiceprinted> findListByState();
 
     Integer updateReceivedIsPrint(Boolean isPrint, String payseriesno, BigInteger customerId);
+
+    List<PayfeeInvoicePrintDto> findList(PayInvoiceSearchDto payInvoiceSearchDto);
+
+     Pagination<PayfeeInvoicePrintDto> findPageList(PayInvoiceSearchDto payInvoiceSearchDto, int pageNum, int pageSize);
+
 }

+ 58 - 0
smart-city-platform/src/main/resources/mapper/pay/PayInvoicePrintMapper.xml

@@ -124,4 +124,62 @@
 		where payseriesno=#{payseriesno} and customer_id=#{customerId}
 	</update>
 
+	<select id="findList" resultType="com.bz.smart_city.dto.pay.payfee.PayfeeInvoicePrintDto">
+		select
+		p.id,
+		p.account_id,
+		p.invoice_code as "invoiceCode",
+		p.invoice_no as "invoiceNo",
+		a.accountnumber,
+		a.name as "accountname",
+		p.order_no as "orderNo",
+		p.payseriesno,
+		p.print_date as "printDate",
+		p.total_print_amount as "totalPrintAmount",
+		p.state,
+		(case when p.state=0 then '待生成'
+		when p.state=1 then '正常'
+		when p.state=2 then '开票中(待生成)'
+		when p.state=3 then '已冲红'
+		when p.state=4 then '开票失败'
+		when p.state=5 then '已作废' end)
+		as "stateLabel",
+		p.invoice_type as "invoiceType",
+		(case when p.invoice_type=1 then "蓝票"
+		when p.invoice_type=2 then "红票" end) as "invoiceTypeLabel",
+		p.pdf_url as "pdfUrl",
+		p.jpg_url as "jpgUrl",
+		(select name from sc_user where id=p.create_by) as "createBy",
+		p.cancelinvoice_id as "cancelInvoiceId"
+		from pay_invoice_printed p
+		left join pay_base_account a on a.id=p.account_id
+		where p.customer_id=#{customerId} and p.site_id=#{siteId}
+		<if test="id != null">
+			and p.id=#{id}
+		</if>
+		<if test="accountId != null">
+			and p.account_id=#{accountId}
+		</if>
+		<if test="year != null">
+			and p.year=#{year}
+		</if>
+		<if test="state != null">
+			and p.state=#{state}
+		</if>
+		<if test="startPrintDate != null ">
+			and p.print_date >= #{startPrintDate}
+		</if>
+		<if test="endPrintDate != null ">
+			and p.print_date &lt;=#{endPrintDate}
+		</if>
+		<if test="condition != null and condition != ''">
+			and(
+			p.invoice_no like concat('%',#{condition},'%')
+			or a.accountnumber like concat('%',#{condition},'%')
+			or a.`name` like concat('%',#{condition},'%')
+			)
+		</if>
+
+	</select>
+
 </mapper>

+ 1 - 0
smart-city-platform/src/main/resources/mapper/pay/payFeeMapper.xml

@@ -105,6 +105,7 @@
             a.email,
             c.opendate,
             c.metercode,
+            c.watermeter_id as "watermeterId",
             (select label from pay_sys_dict where type='住房类型' and `value`=c.housetype and site_id=#{siteId}
             and customer_id=#{customerId}) as "housetype",
             (select label from pay_sys_dict where type='结算方式' and `value`=c.calculateway and  site_id=#{siteId}