浏览代码

feature 代码提交

xiahan 4 月之前
父节点
当前提交
33399314d6

+ 19 - 2
pom.xml

@@ -8,8 +8,25 @@
         <groupId>com.rongwei</groupId>
         <version>1.1-SNAPSHOT</version>
     </parent>
-
-
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-stdlib</artifactId>
+                <version>2.1.20</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-stdlib-jdk8</artifactId>
+                <version>1.8.21</version>
+            </dependency>
+            <dependency>
+                <groupId>com.squareup.okhttp3</groupId>
+                <artifactId>okhttp</artifactId>
+                <version>4.12.0</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
     <groupId>com.rongwei</groupId>
     <artifactId>zhsw_service</artifactId>
     <version>1.0-SNAPSHOT</version>

+ 11 - 7
zhsw-common/src/main/java/com/rongwei/zhsw/system/importListener/MeterReadingRecordListener.java

@@ -62,14 +62,19 @@ public class MeterReadingRecordListener extends AnalysisEventListener<ImportMete
      */
     @Override
     public void invoke(ImportMeterReadingRecordVo importMeterReadingRecordVo, AnalysisContext analysisContext) {
+        Integer currentRowNum = analysisContext.readRowHolder().getRowIndex();
+        if(StringUtils.isBlank(importMeterReadingRecordVo.getAccountNumber()) && importMeterReadingRecordVo.getReadingDate() == null &&importMeterReadingRecordVo.getConsumption() == null){
+            return;
+        }
+
         if (StringUtils.isBlank(importMeterReadingRecordVo.getAccountNumber())) {
-            throw new CustomException("户号为空");
+            throw new CustomException("第"+currentRowNum+"行户号为空");
         }
         if (importMeterReadingRecordVo.getReadingDate() == null) {
-            throw new CustomException("抄表日期");
+            throw new CustomException("第"+currentRowNum+"行抄表日期");
         }
         if (importMeterReadingRecordVo.getConsumption() == null && importMeterReadingRecordVo.getConsumption().compareTo(BigDecimal.ZERO) <= 0) {
-            throw new CustomException("读数为空,抄表数小于0");
+            throw new CustomException("第"+currentRowNum+"行读数为空,抄表数小于0");
         }
         // 判断数据是否重复
         boolean b = recordList.stream().anyMatch(record -> record.getAccountNumber().equals(importMeterReadingRecordVo.getAccountNumber())
@@ -92,9 +97,6 @@ public class MeterReadingRecordListener extends AnalysisEventListener<ImportMete
 
     @Override
     public void doAfterAllAnalysed(AnalysisContext analysisContext) {
-        if (recordList.isEmpty()) {
-            return;
-        }
         if (!duplicateRecordList.isEmpty()) {
             throw new CustomException(
                     "Excel表中" +
@@ -107,7 +109,9 @@ public class MeterReadingRecordListener extends AnalysisEventListener<ImportMete
                             timeAnomalyList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).collect(Collectors.joining("、"))
                             + "户号存在抄表日期大于当前日期的记录,请检查!");
         }
-
+        if (recordList.isEmpty()) {
+            return;
+        }
 
         // 获取数据中的所有户号
         List<String> accountNumList = recordList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).distinct().collect(Collectors.toList());

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/system/service/impl/BillGenerationServiceImpl.java

@@ -42,7 +42,7 @@ public class BillGenerationServiceImpl {
     @Autowired
     private DataSourceTransactionManager transactionManager;
 
-    private static final SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
+    private static final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
 
     public static String formatDate(Date date) {
         synchronized (formatter) {
@@ -233,7 +233,7 @@ public class BillGenerationServiceImpl {
 
         String dateStr = formatDate(currentreadingdate);
         // 抄表日期+-+户号
-        swBillManagementUnpaidDo.setBillnumber(dateStr + "-" + swWaterUsageEntryDo.getUsernumber());
+        swBillManagementUnpaidDo.setBillnumber(dateStr.replaceAll("-","") + "-" + swWaterUsageEntryDo.getUsernumber());
         swBillManagementUnpaidDo.setYear(Integer.parseInt(dateStr.substring(0, 4)));
         swBillManagementUnpaidDo.setMonth(Integer.parseInt(dateStr.substring(5, 7)));
         swBillManagementUnpaidDo.setVillagename(swUserManagementDo.getVillagename());

+ 19 - 16
zhsw-common/src/main/java/com/rongwei/zhsw/system/utils/WxApi.java

@@ -2,34 +2,37 @@ package com.rongwei.zhsw.system.utils;
 
 import com.wechat.pay.java.core.Config;
 import com.wechat.pay.java.core.RSAAutoCertificateConfig;
-import com.wechat.pay.java.core.exception.HttpException;
-import com.wechat.pay.java.core.exception.MalformedMessageException;
-import com.wechat.pay.java.core.exception.ServiceException;
 import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
-import com.wechat.pay.java.service.payments.jsapi.model.CloseOrderRequest;
 import com.wechat.pay.java.service.payments.jsapi.model.PrepayRequest;
 import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
-import com.wechat.pay.java.service.payments.jsapi.model.QueryOrderByIdRequest;
-import com.wechat.pay.java.service.payments.jsapi.model.QueryOrderByOutTradeNoRequest;
-import com.wechat.pay.java.service.payments.model.Transaction;
+import org.springframework.core.io.ClassPathResource;
 
 
 public class WxApi {
-    /** 商户号 */
+    /**
+     * 商户号
+     */
     public String merchantId = "1711246421";
 
-    /** 商户API私钥路径 */
-    public String privateKeyPath = "D:\\code\\project\\zhsw\\zhsw_service\\zhsw-common\\src\\main\\resources\\cert\\apiclient_key.pem";
+    /**
+     * 商户API私钥路径
+     */
+    public String privateKeyPath = "D:\\PROJECT\\水务\\zhsw_service\\zhsw-server\\src\\main\\resources\\cert\\apiclient_key.pem";
 
-    /** 商户证书序列号 */
+    /**
+     * 商户证书序列号
+     */
     public String merchantSerialNumber = "6F46F471C22D410F9ECEDC8B197979A4CA42BC96";
 
-    /** 商户APIV3密钥 */
-    public String  apiV3Key = "GBA67AVWJESPJ3TFJ3GT3NLQBEOTO1FW";
+    /**
+     * 商户APIV3密钥
+     */
+    public String apiV3Key = "GBA67AVWJESPJ3TFJ3GT3NLQBEOTO1FW";
 
     public JsapiServiceExtension service;
 
     public void initMerchant() {
+        ClassPathResource classPathResource = new ClassPathResource("cert/apiclient_key.pem");
         Config config =
                 new RSAAutoCertificateConfig.Builder()
                         .merchantId(merchantId)
@@ -39,9 +42,9 @@ public class WxApi {
                         .apiV3Key(apiV3Key)
                         .build();
         service = new JsapiServiceExtension.Builder()
-                        .config(config)
-                        .signType("RSA") // 不填默认为RSA
-                        .build();
+                .config(config)
+                .signType("RSA") // 不填默认为RSA
+                .build();
     }
 
     public PrepayWithRequestPaymentResponse prepayWithRequestPayment() {

+ 2 - 2
zhsw-server/src/main/resources/bootstrap-dev.yml

@@ -4,10 +4,10 @@ spring:
       config:
         file-extension: yaml
         server-addr: 127.0.0.1:8848
-        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        namespace: 9caed6dc-3784-4d73-bd4c-a8e8153bc358
         ext-config[0]:
           data-id: common-config.yaml
       discovery:
         server-addr: 127.0.0.1:8848
-        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        namespace: 9caed6dc-3784-4d73-bd4c-a8e8153bc358
         #cd047569-9470-4dfb-8663-b113d01cd30f