From d5fb7403743cd1b42c805853da68a8366e4b50d2 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 17 六月 2024 19:25:50 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml | 3
pipIrr-platform/pipIrr-web/pipIrr-web-sell/pom.xml | 6 ++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateLast.java | 11 +++
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java | 7 ++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportLast.java | 4 +
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/dto/Code2Session.java | 6 ++
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java | 65 +++++++++++++++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportHistory.java | 4 +
pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml | 2
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateHistory.java | 11 +++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandHistory.java | 3 +
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java | 3
12 files changed, 121 insertions(+), 4 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateHistory.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateHistory.java
index 1ec2a27..e15bc35 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateHistory.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateHistory.java
@@ -1,7 +1,12 @@
package com.dy.pipIrrGlobal.pojoRm;
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -28,16 +33,20 @@
/**
* 涓婚敭
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ @TableId(type = IdType.INPUT)
public Long id;
/**
* 鎺у埗鍣ㄥ疄浣揑D锛堝閿級
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
public Long controllerId;
/**
* 鍙栨按鍙D锛堝閿級
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
public Long intakeId;
/**
@@ -48,11 +57,13 @@
/**
* 涓婃姤鏃ユ湡鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date dt;
/**
* 鎺у埗鍣ㄦ椂閽�
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date rtuDt;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateLast.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateLast.java
index 6a5a21d..d2eefc7 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateLast.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmAlarmStateLast.java
@@ -1,7 +1,12 @@
package com.dy.pipIrrGlobal.pojoRm;
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -28,16 +33,20 @@
/**
* 涓婚敭
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ @TableId(type = IdType.INPUT)
public Long id;
/**
* 鎺у埗鍣ㄥ疄浣揑D锛堝閿級
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
public Long controllerId;
/**
* 鍙栨按鍙D锛堝閿級
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
public Long intakeId;
/**
@@ -48,11 +57,13 @@
/**
* 涓婃姤鏃ユ湡鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date dt;
/**
* 鎺у埗鍣ㄦ椂閽�
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date rtuDt;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandHistory.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandHistory.java
index d935b7a..3825187 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandHistory.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandHistory.java
@@ -15,6 +15,7 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
@@ -55,6 +56,7 @@
/**
* 鍙栨按鍙D
*/
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
@NotNull(message = "鍙栨按鍙D涓嶈兘涓虹┖")
private Long intakeId;
@@ -80,6 +82,7 @@
* 鍙戦�佸懡浠ゆ椂闂�
*/
@NotNull(message = "鍙戦�佸懡浠ゆ椂闂翠笉鑳戒负绌�")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sendTime;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportHistory.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportHistory.java
index 3f7c6ef..c897110 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportHistory.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportHistory.java
@@ -9,6 +9,7 @@
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo;
import com.dy.common.po.BaseEntity;
import com.dy.common.util.DateTime;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -61,16 +62,19 @@
/**
* 鏁版嵁鎺ユ敹鏃ユ湡鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date dt;
/**
* 鎺у埗鍣ㄦ椂閽�
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date rtuDt;
/**
* 鏁版嵁鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd")
public Date dataDt;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportLast.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportLast.java
index de43043..4a9469b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportLast.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmTimingReportLast.java
@@ -9,6 +9,7 @@
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo;
import com.dy.common.po.BaseEntity;
import com.dy.common.util.DateTime;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -61,16 +62,19 @@
/**
* 鏁版嵁鎺ユ敹鏃ユ湡鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date dt;
/**
* 鎺у埗鍣ㄦ椂閽�
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date rtuDt;
/**
* 鏁版嵁鏃堕棿
*/
+ @JsonFormat(pattern = "yyyy-MM-dd")
public Date dataDt;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml
index ab2ff92..700142f 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-database-ym.yml
@@ -5,8 +5,8 @@
#name: ym
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
-# url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
+# url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
username: root
password: dysql,;.abc!@#
druid:
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
index dd319b6..6a305ff 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
@@ -21,7 +21,8 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
- <include refid="Base_Column_List" />
+<!-- <include refid="Base_Column_List" />-->
+ *
from se_virtual_card
where id = #{id,jdbcType=BIGINT}
</select>
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/pom.xml
index 2efc9f8..df231c5 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/pom.xml
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/pom.xml
@@ -40,6 +40,12 @@
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.1</version>
+ </dependency>
+
<!--OkHttp-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
index 7d16dba..196f207 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
@@ -513,6 +513,7 @@
String sessionKey = job.getString("session_key");
Long clientId = clientSv.getClientIdByPhone(phoneNumber);
+ String SessionId = "";
if(clientId != null) {
// 娣诲姞寰俊鐢ㄦ埛璐︽埛璁板綍
SeOpenId seOpenId = new SeOpenId();
@@ -520,7 +521,11 @@
seOpenId.setOpenId(openid);
seOpenId.setSessionKey(sessionKey);
seOpenId.setCreateTime(new Date());
- Long SessionId = clientSv.addOpenId(seOpenId);
+ //Long SessionId = clientSv.addOpenId(seOpenId);
+ Long rec = clientSv.addOpenId(seOpenId);
+ if(rec != null) {
+ SessionId = String.valueOf(rec);
+ }
return BaseResponseUtils.buildSuccess(SessionId);
} else {
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
index a816627..1753ae1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
@@ -174,7 +174,8 @@
*/
public Long addOpenId(SeOpenId po) {
seOpenIdMapper.insert(po);
- return po.getClientId();
+ //return po.getClientId();
+ return po.getId();
}
/**
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java
index 2d237fa..4314bed 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/PaymentCtrl.java
@@ -18,6 +18,7 @@
import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM;
import com.dy.pipIrrSell.virtualCard.enums.RefundItemStateENUM;
import com.dy.pipIrrSell.wallet.enums.RefundStatusENUM;
+import com.dy.pipIrrSell.wechatpay.dto.Code2Session;
import com.dy.pipIrrSell.wechatpay.dto.DtoOrder;
import com.dy.pipIrrSell.wechatpay.dto.NotifyResource;
import com.dy.pipIrrSell.wechatpay.dto.OrderNotify;
@@ -73,6 +74,7 @@
private final String privateCertFileName = PayInfo.privateCertFileName;
private final String appid = PayInfo.appid;
+ private final String secret = PayInfo.secret;
private final String mchid = PayInfo.mchid;
private final String schema = PayInfo.schema;
private final String signType = PayInfo.signType;
@@ -83,6 +85,68 @@
// 骞冲彴璇佷功鍏挜
private final Map CERTIFICATE_MAP = new HashMap();
+
+ /**
+ * 鐧诲綍鍑瘉鏍¢獙锛屽啘鎴风粦瀹氳处鍙烽�昏緫鍖呭惈鐧诲綍鍑瘉鏍¢獙锛屾鎺ュ彛浣滃簾
+ * @param code2Session 鐧诲綍鍑瘉鏍¢獙浼犲叆瀵硅薄
+ * @param bindingResult
+ * @return
+ * @throws Exception
+ */
+ @Operation(summary = "鐧诲綍鍑瘉鏍¢獙", description = "鐧诲綍鍑瘉鏍¢獙")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = Boolean.class))}
+ )
+ })
+ @PostMapping(path = "getSessionId")
+ @Transactional(rollbackFor = Exception.class)
+ @SsoAop()
+ public BaseResponse<Boolean> getSessionId(@RequestBody @Valid Code2Session code2Session, BindingResult bindingResult) throws Exception {
+ if(bindingResult != null && bindingResult.hasErrors()){
+ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
+ }
+
+ String phoneNumber = code2Session.getPhoneNumber();
+ String jsCode = code2Session.getJs_code();
+
+ Map<String, Object> queryParams = new HashMap<>();
+ queryParams.put("appid", appid);
+ queryParams.put("secret", secret);
+ queryParams.put("js_code", jsCode);
+ queryParams.put("grant_type", grantType);
+ Map<String, String> headerParams = new HashMap<>();
+ JSONObject job = restTemplateUtil.get(loginUrl, queryParams, headerParams);
+
+ if(job.getLong("errcode") != null && job.getLong("errcode") >= -1) {
+ return BaseResponseUtils.buildFail("鐧诲綍鍑瘉鏍¢獙澶辫触");
+ }
+
+ String openid = job.getString("openid");
+ String sessionKey = job.getString("session_key");
+
+ Long clientId = clientSv.getClientIdByPhone(phoneNumber);
+ String SessionId = "";
+ if(clientId != null) {
+ // 娣诲姞寰俊鐢ㄦ埛璐︽埛璁板綍
+ SeOpenId seOpenId = new SeOpenId();
+ seOpenId.setClientId(clientId);
+ seOpenId.setOpenId(openid);
+ seOpenId.setSessionKey(sessionKey);
+ seOpenId.setCreateTime(new Date());
+ Long rec = clientSv.addOpenId(seOpenId);
+ if(rec != null) {
+ SessionId = String.valueOf(rec);
+ }
+ return BaseResponseUtils.buildSuccess(SessionId);
+
+ } else {
+ return BaseResponseUtils.buildError(SellResultCode.PHONE_NUMBER_IS_ERROR.getMessage());
+ }
+ }
/**
* 涓嬭浇寰俊鏀粯骞冲彴璇佷功 娴嬭瘯瀹屽簾闄�
@@ -221,6 +285,7 @@
if(job_result == null) {
return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_ADD_FAIL.getMessage());
}
+
return BaseResponseUtils.buildSuccess(job_result) ;
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/dto/Code2Session.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/dto/Code2Session.java
index ad86942..cc9804c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/dto/Code2Session.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wechatpay/dto/Code2Session.java
@@ -36,4 +36,10 @@
@Schema(description = "js_code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@NotBlank(message = "js_code涓嶈兘涓虹┖")
private String js_code;
+
+ /**
+ * 鎵嬫満鍙�
+ */
+ @NotBlank(message = "鎵嬫満鍙蜂笉鑳戒负绌�")
+ private String phoneNumber;
}
--
Gitblit v1.8.0