Browse Source

1修改批量导入

Xiaojh 4 years ago
parent
commit
ee2a619a67
20 changed files with 195 additions and 103 deletions
  1. 3 3
      smart-city-platform/src/main/java/com/bz/smart_city/advice/LogAdvice.java
  2. 4 3
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayPrintInvoiceController.java
  3. 2 18
      smart-city-platform/src/main/java/com/bz/smart_city/controller/system/OperationLogController.java
  4. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/dao/OperationLogMapper.java
  5. 66 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeInvoicePrintDto.java
  6. 4 0
      smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayBaseCustomerandmeterrela.java
  7. 2 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/OperationLogService.java
  8. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/UserService.java
  9. 13 32
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/OperationLogServiceImpl.java
  10. 2 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/UserServiceImpl.java
  11. 23 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/IssueElectronicInvoiceServiceImpl.java
  12. 5 5
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayFeeServiceImp.java
  13. 0 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayInvoicePrintServiceImpl.java
  14. 63 21
      smart-city-platform/src/main/java/com/bz/smart_city/service/importfile/AsyncTaskImportService.java
  15. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/IssueElectronicInvoiceService.java
  16. 0 2
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/PrintInvoicePrintService.java
  17. BIN
      smart-city-platform/src/main/resources/excel/batchOpenAccountTemplate.xlsx
  18. 2 2
      smart-city-platform/src/main/resources/mapper/OperationLogMapper.xml
  19. 2 1
      smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml
  20. 1 0
      smart-city-platform/src/main/resources/mapper/pay/PayInvoicePrintMapper.xml

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

@@ -82,10 +82,10 @@ public class LogAdvice {
 				sysLogs.setRemark(e.getMessage());
 				throw e;
 			} finally {
-//				if (sysLogs.getUserId() != null) {
+				if (sysLogs.getUserId() != null) {
 				sysLogs.setCreateTime(LocalDateTime.now());
-//					sysLogsService.insertSelective(sysLogs);
-//				}
+					sysLogsService.insertSelective(sysLogs);
+				}
 			}
 		}else {
 			return joinPoint.proceed();

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

@@ -46,8 +46,9 @@ public class PayPrintInvoiceController {
             @ApiParam(value = "站点ID", required = false) @RequestParam(required = false) String siteId,
             @ApiParam(value = "水司ID", required = false) @RequestParam(required = false) String customerId,
             @ApiParam(value = "用户编号", required = true) @RequestParam(required = true) String userCode,
-            @ApiParam(value = "缴费流水号", required = true) @RequestParam(required = true) String payseriesno) {
-        ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId,customerId,"1", userCode, payseriesno, null);
+            @ApiParam(value = "缴费流水号", required = true) @RequestParam(required = true) String payseriesno,
+            @ApiParam(value = "email", required = true) @RequestParam(required = true) String email) {
+        ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId,customerId,"1", userCode, payseriesno, null,email);
         return new AjaxMessage<>(ResultStatus.OK, returnPrintResultDto);
     }
 
@@ -58,7 +59,7 @@ public class PayPrintInvoiceController {
             @ApiParam(value = "水司ID", required = false) @RequestParam(required = false) String customerId,
             @ApiParam(value = "用户编号", required = true) @RequestParam(required = true) String userCode,
             @ApiParam(value = "票据ID", required = true) @RequestParam(required = true) String invoicePrintId) {
-        ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId,customerId,"2", null, null, invoicePrintId);
+        ReturnPrintResultDto returnPrintResultDto = issueElectronicInvoiceService.requestPrint(siteId, customerId, "2", null, null, invoicePrintId, null);
         return new AjaxMessage<>(ResultStatus.OK, returnPrintResultDto);
     }
     @ApiOperation(value = "发票列表")

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

@@ -34,7 +34,6 @@ public class OperationLogController {
     @ApiOperation(value = "查询操作日志分页")
     public AjaxMessage<Pagination<OperationLog>> getPage(
             @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,
@@ -42,7 +41,7 @@ public class OperationLogController {
             @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
             @ApiParam(value = "条数,非必传,默认15条", required = false, defaultValue = "15") @RequestParam(required = false, defaultValue = "15") int pageSize
     ){
-        Pagination<OperationLog> pageInfo = operationLogService.getPage(username, operationName,content, startDate, endDate, pageNum, pageSize,mobilephone);
+        Pagination<OperationLog> pageInfo = operationLogService.getPage(username,content, startDate, endDate, pageNum, pageSize,mobilephone);
         return new AjaxMessage<>(ResultStatus.OK, pageInfo);
     }
 
@@ -60,27 +59,12 @@ public class OperationLogController {
     @ApiOperation(value = "操作日志导出excel")
     public void getExcel(
             @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.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);
+        operationLogService.getExcel(username,content, startDate, endDate, mobilephone, httpServletResponse);
     }
 }

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/OperationLogMapper.java

@@ -15,6 +15,6 @@ public interface OperationLogMapper {
     int updateByPrimaryKeySelective(OperationLog record);
 
     List<OperationLog> getList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems,
-                               @Param("username") String username, @Param("operationName") String operationName, @Param("content") String content,
+                               @Param("username") String username,  @Param("content") String content,
                                @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,@Param("mobilephone")String mobilephone);
 }

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

@@ -0,0 +1,66 @@
+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 = "发票JPG路径")
+    private String imgUrl;
+
+//    @ApiModelProperty(value = "作废人")
+//    private String canceledBy;
+
+    @ApiModelProperty(value = "被冲红记录ID")
+    private BigInteger cancelInvoiceId;
+}

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayBaseCustomerandmeterrela.java

@@ -2,6 +2,7 @@ package com.bz.smart_city.entity.pay.archives;
 
 import com.bz.smart_city.entity.ProgramItem;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -84,6 +85,9 @@ public class PayBaseCustomerandmeterrela {
 
     @ApiModelProperty(value = "电话号码", position = 30)
     private String telephone;
+    @JsonIgnore
+    @ApiModelProperty(value = "邮箱地址", position = 33)
+    private String email;
     @ApiModelProperty(value = "用水性质名称", position = 31)
     private String propertyName;
 

+ 2 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/OperationLogService.java

@@ -13,16 +13,13 @@ public interface OperationLogService {
 
     int updateByPrimaryKeySelective(OperationLog record);
 
-    Pagination<OperationLog> getPage(String username, String operationName, String content, LocalDateTime startDate,
+    Pagination<OperationLog> getPage(String username,  String content, LocalDateTime startDate,
                                      LocalDateTime endDate, int pageNum, int pageSize,String mobilephone);
 
     void add(OperationLog operationLog);
 
-    void getExcel(String username, String operationName, String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse);
+    void getExcel(String username,  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);
-
 }
 

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/UserService.java

@@ -116,5 +116,5 @@ public interface UserService {
 
     void bindOpenId(String openId);
 
-    User findUserByName(String name, BigInteger customerId);
+    User findUserByName(String name, BigInteger sitId);
 }

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

@@ -47,12 +47,12 @@ public class OperationLogServiceImpl implements OperationLogService {
     }
 
     @Override
-    public Pagination<OperationLog> getPage(String username, String operationName, String content,
+    public Pagination<OperationLog> getPage(String username,  String content,
                                             LocalDateTime startDate, LocalDateTime endDate, int pageNum, int pageSize,String mobilephone) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         PageHelper.startPage(pageNum, pageSize);
         List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), username,
-                operationName, content, startDate, endDate,mobilephone);
+                 content, startDate, endDate,mobilephone);
         return new Pagination<>(list);
     }
 
@@ -94,39 +94,16 @@ public class OperationLogServiceImpl implements OperationLogService {
     }
 
     @Override
-    public void getExcel(String username, String operationName, String content, LocalDateTime startDate, LocalDateTime endDate,String mobilephone, HttpServletResponse httpServletResponse) {
+    public void getExcel(String username,  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);
+        List<OperationLog> list = operationLogMapper.getList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), username, 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();
-            objs[5] = operationLog.getOldData().replaceAll("&", ",\r\n");
-            objs[6] = operationLog.getNewData().replaceAll("&", ",\r\n");
-            dataList.add(objs);
+        String[] rowsName;
+        if(loginUser.getSiteType() != null && loginUser.getSiteType() == 2){
+            rowsName = new String[]{"序号", "操作时间", "用户名","手机号", "操作内容"};
+        }else{
+            rowsName= new String[]{"序号", "时间", "用户名","手机号", "操作", "操作前", "操作后"};
         }
-        ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-        try {
-            excelUtil.export(httpServletResponse);
-        } catch (Exception e) {
-            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");
@@ -138,6 +115,10 @@ public class OperationLogServiceImpl implements OperationLogService {
             objs[2] = operationLog.getUsername();
             objs[3] = operationLog.getMobilePhone();
             objs[4] = operationLog.getOperationName();
+            if(loginUser.getSiteType() == null || loginUser.getSiteType() != 2) {
+                objs[5] = operationLog.getOldData().replaceAll("&", ",\r\n");
+                objs[6] = operationLog.getNewData().replaceAll("&", ",\r\n");
+            }
             dataList.add(objs);
         }
         ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/UserServiceImpl.java

@@ -615,7 +615,7 @@ public class UserServiceImpl implements UserService {
     }
 
     @Override
-    public User findUserByName(String name, BigInteger customerId) {
-        return userMapper.findUserByName(name,customerId);
+    public User findUserByName(String name, BigInteger sitId) {
+        return userMapper.findUserByName(name,sitId);
     }
 }

+ 23 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/IssueElectronicInvoiceServiceImpl.java

@@ -109,16 +109,27 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
      * @Author:
      * @Date: 2020/7/28
      */
-    public ReturnPrintResultDto requestPrint(String siteId, String customerId, String kpType, String userCode, String payseriesno, String invoicePrintId) {
+    public ReturnPrintResultDto requestPrint(String siteId, String customerId, String kpType, String userCode, String payseriesno, String invoicePrintId,String email) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         ReturnPrintResultDto returnPrintResultDto = new ReturnPrintResultDto();//开票返回结果信息
-        String name = loginUser.getName();//操作员姓名
+
         if(loginUser==null) {
-            // User user = userService.findUserByName("系统操作", BigInteger.valueOf(Long.parseLong(siteId)));
-            //loginUser = new LoginUser();
+             User user = userService.findUserByName("系统操作", BigInteger.valueOf(Long.parseLong(siteId)));
+             loginUser = new LoginUser();
+             if(user!=null)
+             {
+                 loginUser.setName("系统操作");
+                 loginUser.setId(user.getId());
+             }else
+             {
+                 returnPrintResultDto.setResult("1");//开票失败
+                 returnPrintResultDto.setMsg("开票失败,失败原因:系统未配置操作员");
+                 return returnPrintResultDto;
+             }
             loginUser.setCustomerId(Integer.valueOf(customerId));
             loginUser.setSiteId(Integer.valueOf(siteId));
         }
+        String name = loginUser.getName();//操作员姓名
         BaseClosingAccountInfo baseClosingAccountInfo = baseClosingAccountInfoService.getCurrentCloseInfo(loginUser.getSiteId(),loginUser.getCustomerId());
         if(baseClosingAccountInfo==null)
         {
@@ -250,7 +261,14 @@ public class IssueElectronicInvoiceServiceImpl implements IssueElectronicInvoice
             return returnPrintResultDto;
         }
         payInvoiceOrderDto.setDetail(orderDetailDtos);
-        payInvoiceOrderDto.setEmail(invoiceParam.get("saleEmail"));
+        if(email!=null&& email.length()>0)
+            payInvoiceOrderDto.setEmail(email);
+        else {
+            if (payBaseAccount.getEmail() != null)
+                payInvoiceOrderDto.setEmail(payBaseAccount.getEmail());
+            else
+                payInvoiceOrderDto.setEmail(invoiceParam.get("saleEmail"));
+        }
         payEleInvoiceDto.setOrder(payInvoiceOrderDto);
         //发送开票请求
         String jsonsString = DESDZFP.encrypt(JSON.toJSONString(payEleInvoiceDto));

+ 5 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayFeeServiceImp.java

@@ -58,7 +58,7 @@ public class PayFeeServiceImp implements PayFeeService {
             throw new ServiceException(ResultStatus.PAYFEE_TRANSAMOUNT_BELOW_ZERO);
         }
 //        String result="";   //执行结果描述
-        String result="<br>实收金额:"+String.format("%.2f",transAmount)+"元";
+        String result="实收金额:"+String.format("%.2f",transAmount)+"元";
         BigDecimal fees=BigDecimal.ZERO;    //抵扣金额
         LoginUser loginUser = UserUtil.getCurrentUser();
 
@@ -220,10 +220,10 @@ public class PayFeeServiceImp implements PayFeeService {
                 }
             }
         }
-        result+="&emsp;&emsp;支付金额抵扣:"+String.format("%.2f",fees)+"元";
+        result+="; 支付金额抵扣:"+String.format("%.2f",fees)+"元";
         //余额充值或划扣有余额
         if(balancetype == 1 && transAmount.compareTo(BigDecimal.ZERO) == 1){
-            result+="&emsp;&emsp;余额转预存:"+String.format("%.2f",transAmount)+"元";
+            result+="; 余额转预存:"+String.format("%.2f",transAmount)+"元";
             //修改余额
             remaining=remaining.add(transAmount);
             //生成交易明细
@@ -233,7 +233,7 @@ public class PayFeeServiceImp implements PayFeeService {
             payTransactiondetails.setTranstypeLabel("账户转预存");
             transactiondetailsDtoList.add(payTransactiondetails);
         }else{
-            result+="&emsp;&emsp;余额找零:"+String.format("%.2f", transAmount)+"元";
+            result+="; 余额找零:"+String.format("%.2f", transAmount)+"元";
         }
 
         //修改预存账户
@@ -562,7 +562,7 @@ public class PayFeeServiceImp implements PayFeeService {
         payfeeResult.setPayseriesno(payseriesno);
         payfeeResult.setTransType(1);
         payfeeResult.setPayway(payway);
-        payfeeResult.setMsg("<br>充值金额:"+String.format("%.2f", transAmount)+"元");
+        payfeeResult.setMsg("充值金额:"+String.format("%.2f", transAmount)+"元");
         return payfeeResult;
     }
 

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

@@ -4,7 +4,6 @@ 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;

+ 63 - 21
smart-city-platform/src/main/java/com/bz/smart_city/service/importfile/AsyncTaskImportService.java

@@ -42,6 +42,8 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import static com.google.common.collect.Lists.newArrayList;
 
@@ -1008,6 +1010,44 @@ public class AsyncTaskImportService {
                             String housetype = housetypeCell.getStringCellValue().trim();
                             String customerGroup = customergroupCell.getStringCellValue().trim();
 
+                            //校验手机号是否正确
+                            if(StringUtils.isNotBlank(telephone)){
+                                String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
+                                if(telephone.length() != 11){
+                                    failTime++ ;
+                                    msg +="客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,";
+                                    log.info("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
+                                    c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
+                                    continue;
+                                }else{
+                                    Pattern p = Pattern.compile(regex);
+                                    Matcher m = p.matcher(telephone);
+                                    boolean isMatch = m.matches();
+                                    if(!isMatch){
+                                        failTime++ ;
+                                        msg +="客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,";
+                                        log.info("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
+                                        c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
+                                        continue;
+                                    }
+                                }
+                            }
+
+                            //校验邮箱是否正确
+                            if(StringUtils.isNotBlank(email)){
+                                String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
+                                Pattern p = Pattern.compile(check);
+                                Matcher m = p.matcher(email);
+                                boolean isMatch = m.matches();
+                                if(!isMatch){
+                                    failTime++ ;
+                                    msg +="客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,";
+                                    log.info("客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,");
+                                    c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,");
+                                    continue;
+                                }
+                            }
+
                             PayBaseCustomerandmeterrela customer =  new PayBaseCustomerandmeterrela();//实例化开户实体
                             //根据客户编码寻找客户id
                             PayBaseAccount accounts = payBaseCustomerandmeterrelaMapper.getAccountId(loginUser.getSiteId(),loginUser.getCustomerId(),accountnumber);
@@ -1029,14 +1069,14 @@ public class AsyncTaskImportService {
                                 failTime++ ;
                                 msg +="客户编码【"+accountnumber+"】用水性质不能为空,";
                                 log.info("客户编码【"+accountnumber+"】用水性质不能为空,");
-                                //c_remark.setCellValue("客户编码【"+accountnumber+"】住房类型不能为空,");
+                                c_remark.setCellValue("客户编码【"+accountnumber+"】用水性质不能为空,");
                                 continue;
                             }
                             if(office == null){
                                 failTime++ ;
                                 msg+="客户编码【"+accountnumber+"】机构信息有误,";
                                 log.info("客户编码【"+accountnumber+"】机构信息有误,");
-                                //c_remark.setCellValue("客户编码【"+accountnumber+"】机构信息有误,");
+                                c_remark.setCellValue("客户编码【"+accountnumber+"】机构信息有误,");
                                 continue;
                             }
 
@@ -1045,7 +1085,7 @@ public class AsyncTaskImportService {
                                 failTime++ ;
                                 msg +="【"+accountnumber+"】添加开户失败,客户信息有误,";
                                 log.info("【"+accountnumber+"】添加开户失败,客户信息有误,");
-                                //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,客户信息有误,");
+                                c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,客户信息有误,");
                                 continue;
                                 //throw new ServiceException(ResultStatus.PAY_ADD_CUSTOMER_GETACCOUNT);
                             }
@@ -1053,7 +1093,7 @@ public class AsyncTaskImportService {
                                 failTime++ ;
                                 msg += "【"+accountnumber+"】添加开户失败,水表信息有误,";
                                 log.info("【"+accountnumber+"】添加开户失败,水表信息有误,");
-                                //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,水表信息有误,");
+                                c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,水表信息有误,");
                                 continue;
                             }
 
@@ -1064,11 +1104,26 @@ public class AsyncTaskImportService {
                                 failTime++ ;
                                 msg +="【"+accountnumber+"】添加开户失败,该客户未验收,";
                                 log.info("【"+accountnumber+"】添加开户失败,该客户未验收,");
-                                //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户未验收,");
+                                c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户未验收,");
                                 continue;
                             }
                             Integer value = 0;
                             customer.setVatno(vatno);
+
+                            PayBaseAccount saveAccount  = payBaseAccountMapper.get(accounts.getId());
+                            if(idtype != null && idtype != ""){
+                                value = paySysDictService.getDictValue("证件类型",idtype,siteId,customerId);
+                                saveAccount.setIdtype(value);
+                                if(value != null && StringUtils.isBlank(idcardno)){
+                                    failTime++ ;
+                                    msg += "【"+accountnumber+"】添加开户失败,证件号码不能为空,";
+                                    log.info("【"+accountnumber+"】添加开户失败,证件号码不能为空,");
+                                    c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,证件号码不能为空,");
+                                    continue;
+                                }
+                                saveAccount.setIdcardno(idcardno);
+                            }
+
                             //判断客户是否销户后在开户
                             PayBaseCustomerandmeterrela baseCustomer = payBaseCustomerandmeterrelaMapper.queryCancelInfo(loginUser.getSiteId(),loginUser.getCustomerId(),accountnumber,metercode);
                             if(baseCustomer != null && baseCustomer.getBusinessstate() != 1){
@@ -1085,7 +1140,7 @@ public class AsyncTaskImportService {
                                         failTime++ ;
                                         msg += "【"+accountnumber+"】添加开户失败,结算水量不能为空,";
                                         log.info("【"+accountnumber+"】添加开户失败,结算水量不能为空,");
-                                        //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
+                                        c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,结算水量不能为空,");
                                         continue;
                                     }
                                     customer.setFixedamount(BigDecimal.valueOf(Double.valueOf(fixedamount)));//固定量
@@ -1111,7 +1166,7 @@ public class AsyncTaskImportService {
                                     failTime++ ;
                                     msg += "【"+accountnumber+"】添加开户失败,该客户已存在,";
                                     log.info("【"+accountnumber+"】添加开户失败,该客户已存在,");
-                                    //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
+                                    c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
                                     continue;
                                 }
 
@@ -1126,7 +1181,7 @@ public class AsyncTaskImportService {
                                         failTime++ ;
                                         msg += "【"+accountnumber+"】添加开户失败,结算水量不能为空,";
                                         log.info("【"+accountnumber+"】添加开户失败,结算水量不能为空,");
-                                        //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
+                                        c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,结算水量不能为空,");
                                         continue;
                                     }
                                     customer.setFixedamount(BigDecimal.valueOf(Double.valueOf(fixedamount)));//固定量
@@ -1160,20 +1215,7 @@ public class AsyncTaskImportService {
                             }
 
                             //修改客户信息
-                            PayBaseAccount saveAccount  = payBaseAccountMapper.get(accounts.getId());
                             saveAccount.setName(accountnameCell.getStringCellValue());
-                            if(idtype != null && idtype != ""){
-                                value = paySysDictService.getDictValue("证件类型",idtype,siteId,customerId);
-                                saveAccount.setIdtype(value);
-                                if(value != null && StringUtils.isBlank(idcardno)){
-                                    failTime++ ;
-                                    msg += "【"+accountnumber+"】添加开户失败,证件号码不能为空,";
-                                    log.info("【"+accountnumber+"】添加开户失败,证件号码不能为空,");
-                                    //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
-                                    continue;
-                                }
-                                saveAccount.setIdcardno(idcardno);
-                            }
                             saveAccount.setTelephone(telephone);
                             saveAccount.setMobilephone(telephone);
                             saveAccount.setId(accounts.getId());

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/IssueElectronicInvoiceService.java

@@ -10,5 +10,5 @@ import com.bz.smart_city.dto.pay.ReturnPrintResultDto;
  * @Version V1.0
  **/
 public interface IssueElectronicInvoiceService {
-    ReturnPrintResultDto requestPrint(String siteId, String customerId,String kpType, String userCode, String payseriesno, String invoicePrintId);
+    ReturnPrintResultDto requestPrint(String siteId, String customerId,String kpType, String userCode, String payseriesno, String invoicePrintId,String email);
 }

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

@@ -3,9 +3,7 @@ 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;
 
 import java.math.BigInteger;
 import java.util.List;

BIN
smart-city-platform/src/main/resources/excel/batchOpenAccountTemplate.xlsx


+ 2 - 2
smart-city-platform/src/main/resources/mapper/OperationLogMapper.xml

@@ -156,8 +156,8 @@
           </foreach>
         </if>
         <if test="username != null and username != ''"> AND sol.username LIKE concat('%',#{username},'%')</if>
-        <if test="operationName != null and operationName != ''"> AND sol.operation_name LIKE concat('%',#{operationName},'%')</if>
-        <if test="content != null and content != ''"> AND (sol.old_data LIKE concat('%',#{content},'%') or sol.new_data LIKE concat('%',#{content},'%'))</if>
+        <if test="content != null and content != ''"> AND (sol.operation_name LIKE concat('%',#{content},'%')
+         or (sol.old_data LIKE concat('%',#{content},'%') or sol.new_data LIKE concat('%',#{content},'%')))</if>
         <if test="startDate != null"> and sol.create_date <![CDATA[ >= ]]> #{startDate}</if>
         <if test="endDate != null"> and sol.create_date <![CDATA[ <= ]]> #{endDate}</if>
          <if test="mobilephone != null and mobilephone != ''">AND sol.mobilephone LIKE concat('%',#{mobilephone},'%')</if>

+ 2 - 1
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -617,7 +617,8 @@
         account.telephone as "telephone",
         account.address as "address",
         customer.vatno as "vatno",
-        customer.bankaccount as "bankaccount"
+        customer.bankaccount as "bankaccount",
+        account.email as "email"
         from pay_base_customerandmeterrela customer
         left join pay_base_account account on customer.account_id = account.id
         <where>

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

@@ -150,6 +150,7 @@
 		when p.invoice_type=2 then "红票" end) as "invoiceTypeLabel",
 		p.pdf_url as "pdfUrl",
 		p.jpg_url as "jpgUrl",
+		p.img_url as "imgUrl",
 		(select name from sc_user where id=p.create_by) as "createBy",
 		p.cancelinvoice_id as "cancelInvoiceId"
 		from pay_invoice_printed p