From 23f8f5155749bbe0d2494c52d8adc3e6476b9cac Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 20 十二月 2023 17:23:55 +0800
Subject: [PATCH] 2023-12-20 朱宝民 IC卡15个接口重构,角色授权,获取用户信息
---
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java | 36
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml | 83 +--
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java | 23 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml | 24
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java | 10
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml | 85 +--
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java | 10
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java | 9
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java | 8
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java | 36
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java | 34
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java | 9
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java | 8
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java | 30 +
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java | 27
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml | 93 ++--
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java | 4
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java | 62 ++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java | 4
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java | 4
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java | 29 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml | 18
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java | 62 +++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java | 9
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java | 64 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml | 19
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java | 33 +
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java | 31 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml | 86 ++++
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java | 10
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java | 10
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java | 16
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java | 38 -
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java | 11
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java | 6
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml | 90 +--
44 files changed, 764 insertions(+), 407 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java
new file mode 100644
index 0000000..0e3781b
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java
@@ -0,0 +1,30 @@
+package com.dy.pipIrrGlobal.daoBa;
+
+import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023/12/19 16:48
+ * @LastEditTime 2023/12/19 16:48
+ * @Description
+ */
+public interface BaRolePermissionsMapper {
+ int deleteByPrimaryKey(Long id);
+
+ int insert(BaRolePermissions record);
+
+ int insertSelective(BaRolePermissions record);
+
+ BaRolePermissions selectByPrimaryKey(Long id);
+
+ int updateByPrimaryKeySelective(BaRolePermissions record);
+
+ int updateByPrimaryKey(BaRolePermissions record);
+
+ /**
+ * 渚濇嵁瑙掕壊缂栧彿鍒犻櫎瑙掕壊鎺堟潈
+ * @return
+ */
+ int delPermissionsByRoleId(@Param("roleId") Long roleId);
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
index cef278f..e0ebca4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
+import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -85,4 +86,11 @@
* @return update count
*/
int deleteLogicById(Long id);
+
+ /**
+ * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鐢ㄦ埛淇℃伅
+ * @param userId 鐢ㄦ埛缂栧彿
+ * @return 鐢ㄦ埛淇℃伅鍒楄〃
+ */
+ List<VoUserInfo> getUserInfos(@Param("userId") Long userId);
}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java
index b6a0fc8..342c842 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java
@@ -8,8 +8,8 @@
/**
* @author ZhuBaoMin
- * @date 2023/12/9 10:14
- * @LastEditTime 2023/12/9 10:14
+ * @date 2023/12/20 14:48
+ * @LastEditTime 2023/12/20 14:48
* @Description
*/
public interface SeCancelMapper {
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java
index 7ea6e04..cfde906 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java
@@ -8,8 +8,8 @@
/**
* @author ZhuBaoMin
- * @date 2023/12/9 8:55
- * @LastEditTime 2023/12/9 8:55
+ * @date 2023/12/19 15:08
+ * @LastEditTime 2023/12/19 15:08
* @Description
*/
public interface SeLossMapper {
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java
index 6ccbf70..f310ec2 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java
@@ -8,8 +8,8 @@
/**
* @author ZhuBaoMin
- * @date 2023/12/11 9:17
- * @LastEditTime 2023/12/11 9:17
+ * @date 2023/12/20 16:52
+ * @LastEditTime 2023/12/20 16:52
* @Description
*/
public interface SeReversalMapper {
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java
index c011843..1369db0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java
@@ -8,8 +8,8 @@
/**
* @author ZhuBaoMin
- * @date 2023/12/11 9:11
- * @LastEditTime 2023/12/11 9:11
+ * @date 2023/12/20 16:05
+ * @LastEditTime 2023/12/20 16:05
* @Description
*/
public interface SeUnlockMapper {
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java
new file mode 100644
index 0000000..3bff3ae
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java
@@ -0,0 +1,64 @@
+package com.dy.pipIrrGlobal.pojoBa;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023/12/19 16:48
+ * @LastEditTime 2023/12/19 16:48
+ * @Description
+ */
+
+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 io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Positive;
+import jakarta.validation.constraints.Size;
+import lombok.*;
+
+/**
+ * 瑙掕壊鏉冮檺鍏宠仈琛�
+ */
+
+@TableName(value="ba_role_permissions", autoResultMap = true)
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+@Schema(name = "瑙掕壊鏉冮檺瀹炰綋")
+public class BaRolePermissions implements BaseEntity {
+ public static final long serialVersionUID = 1L;
+
+ /**
+ * 涓婚敭
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ @TableId(type = IdType.INPUT)
+ @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ private Long id;
+
+ /**
+ * 瑙掕壊缂栧彿
+ */
+ @Schema(description = "瑙掕壊缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @Positive(message = "瑙掕壊缂栧彿蹇呴』涓哄ぇ浜�0鐨勬暣鏁�")
+ private Long roleid;
+
+ /**
+ * 瑙掕壊鍚嶇О
+ */
+ @Schema(description = "瑙掕壊鍚嶇О", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @Size(max = 20)
+ private String roleName;
+
+ /**
+ * 鏉冮檺鍒楄〃
+ */
+ @Schema(description = "鏉冮檺鍒楄〃", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @NotBlank(message = "鏉冮檺鍒楄〃涓嶈兘涓虹┖")
+ private String permissions;
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java
index 3a900b1..f96a0f0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -46,15 +47,15 @@
* 姘村崱缂栧彿
*/
@Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Positive(message = "姘村崱缂栧彿蹇呴』涓哄ぇ浜�0鐨勬暣鏁�")
- private Long cardid;
+ @NotBlank(message = "姘村崱缂栧彿涓嶈兘涓虹┖")
+ private String cardnum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Length(message = "鍐滄埛缂栧彿涓嶅皬浜巤min}", min = 1)
- private Long clientid;
+ @NotBlank(message = "鍐滄埛缂栧彿涓嶈兘涓虹┖")
+ private String clientnum;
/**
* 閫�娆鹃噾棰�
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java
index c5d1a82..7938329 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -16,7 +17,7 @@
/**
* @author ZhuBaoMin
* @date 2023/12/9 8:55
- * @LastEditTime 2023/12/9 8:55
+ * @LastEditTime 2023/12/19 15:14
* @Description
*/
@@ -46,15 +47,15 @@
* 姘村崱缂栧彿
*/
@Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Length(message = "姘村崱缂栧彿涓嶅皬浜巤min}", min = 1)
- private Long cardid;
+ @NotBlank(message = "姘村崱缂栧彿涓嶈兘涓虹┖")
+ private String cardnum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Length(message = "鍐滄埛缂栧彿涓嶅皬浜巤min}", min = 1)
- private Long clientid;
+ @NotBlank(message = "鍐滄埛缂栧彿涓嶈兘涓虹┖")
+ private String clientnum;
/**
* 浣欓
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java
index 843327c..4c6d281 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -47,15 +48,15 @@
* 姘村崱缂栧彿
*/
@Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Positive(message = "姘村崱缂栧彿蹇呴』涓哄ぇ浜�0鐨勬暣鏁�")
- private Long cardid;
+ @NotBlank(message = "姘村崱缂栧彿涓嶈兘涓虹┖")
+ private String cardnum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Length(message = "鍐滄埛缂栧彿涓嶅皬浜巤min}", min = 1)
- private Long clientid;
+ @NotBlank(message = "鍐滄埛缂栧彿涓嶈兘涓虹┖")
+ private String clientnum;
/**
* 鍗$墖浣欓
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java
index a5c0464..c2428f1 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -47,15 +48,15 @@
* 姘村崱缂栧彿
*/
@Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Positive(message = "姘村崱缂栧彿蹇呴』涓哄ぇ浜�0鐨勬暣鏁�")
- private Long cardid;
+ @NotBlank(message = "姘村崱缂栧彿涓嶈兘涓虹┖")
+ private String cardnum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @Length(message = "鍐滄埛缂栧彿涓嶅皬浜巤min}", min = 1)
- private Long clientid;
+ @NotBlank(message = "鍐滄埛缂栧彿涓嶈兘涓虹┖")
+ private String clientnum;
/**
* 鍓╀綑閲戦
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java
new file mode 100644
index 0000000..e750264
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java
@@ -0,0 +1,33 @@
+package com.dy.pipIrrGlobal.voBa;
+
+import com.dy.common.po.BaseEntity;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023/12/20 10:19
+ * @LastEditTime 2023/12/20 10:19
+ * @Description 鐢ㄦ埛淇℃伅瑙嗗浘瀵硅薄
+ */
+
+@Data
+@Schema(title = "鐢ㄦ埛淇℃伅瑙嗗浘瀵硅薄")
+public class VoUserInfo implements BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ @Schema(title = "鐢ㄦ埛ID")
+ private Long userId;
+
+ @Schema(title = "鐢ㄦ埛濮撳悕")
+ private String userName;
+
+ @Schema(title = "瑙掕壊ID")
+ private Long roleId;
+
+ @Schema(title = "瑙掕壊鍚嶇О")
+ private String roleName;
+
+ @Schema(title = "鎺堟潈鍒楄〃")
+ private String permissions;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java
index cad9d4a..17f3535 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java
@@ -27,10 +27,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
- @Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ @Schema(title = "姘村崱缂栧彿")
+ private String cardNum;
@Schema(title = "姘村崱鐘舵��")
private Byte state;
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java
index d324c92..4a3dc4b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java
@@ -27,10 +27,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
@Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ private String cardNum;
@Schema(title = "閫�鍥為噾棰�")
private Float refund;
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java
index 93c2dd0..6c21326 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java
@@ -29,10 +29,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
- @Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ @Schema(title = "姘村崱缂栧彿")
+ private String cardNum;
@Schema(title = "鍗$墖浣欓")
@JsonSerialize(using = Double2Serializer.class)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
index 1994e6a..e423945 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
@@ -27,10 +27,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
- @Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ @Schema(title = "姘村崱缂栧彿")
+ private String cardNum;
@Schema(title = "鍏呭�奸噾棰�")
private Float amount;
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java
index af5bc58..e454a58 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java
@@ -26,10 +26,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
- @Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ @Schema(title = "姘村崱缂栧彿")
+ private String cardNum;
@Schema(title = "鍓╀綑閲戦")
private Float cardBalance;
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java
index 9101f4c..1967e73 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java
@@ -27,10 +27,10 @@
private String clientName;
@Schema(title = "鍐滄埛缂栧彿")
- private Long clientId;
+ private String clientNum;
- @Schema(title = "姘村崱鍦板潃")
- private String cardAddr;
+ @Schema(title = "姘村崱缂栧彿")
+ private String cardNum;
@Schema(title = "鍓╀綑閲戦")
private Float money;
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml
new file mode 100644
index 0000000..f91308f
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaRolePermissionsMapper">
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
+ <!--@mbg.generated-->
+ <!--@Table ba_role_permissions-->
+ <id column="id" jdbcType="BIGINT" property="id" />
+ <result column="roleId" jdbcType="BIGINT" property="roleid" />
+ <result column="permissions" jdbcType="VARCHAR" property="permissions" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
+ id, roleId, permissions
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from ba_role_permissions
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete from ba_role_permissions
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+
+ <!--渚濇嵁瑙掕壊缂栧彿鍒犻櫎瑙掕壊鎺堟潈-->
+ <delete id="delPermissionsByRoleId" parameterType="java.lang.Long">
+ delete from ba_role_permissions where roleId = ${roleId}
+ </delete>
+
+ <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
+ <!--@mbg.generated-->
+ insert into ba_role_permissions (id, roleId, permissions
+ )
+ values (#{id,jdbcType=BIGINT}, #{roleid,jdbcType=BIGINT}, #{permissions,jdbcType=VARCHAR}
+ )
+ </insert>
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
+ <!--@mbg.generated-->
+ insert into ba_role_permissions
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="roleid != null">
+ roleId,
+ </if>
+ <if test="permissions != null">
+ permissions,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="roleid != null">
+ #{roleid,jdbcType=BIGINT},
+ </if>
+ <if test="permissions != null">
+ #{permissions,jdbcType=VARCHAR},
+ </if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
+ <!--@mbg.generated-->
+ update ba_role_permissions
+ <set>
+ <if test="roleid != null">
+ roleId = #{roleid,jdbcType=BIGINT},
+ </if>
+ <if test="permissions != null">
+ permissions = #{permissions,jdbcType=VARCHAR},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
+ <!--@mbg.generated-->
+ update ba_role_permissions
+ set roleId = #{roleid,jdbcType=BIGINT},
+ permissions = #{permissions,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
index c80eb58..0383d9c 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -221,4 +221,23 @@
update ba_user set deleted = 1
where id = #{id,jdbcType=BIGINT}
</delete>
+
+ <!--鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鐢ㄦ埛淇℃伅-->
+ <select id="getUserInfos" resultType="com.dy.pipIrrGlobal.voBa.VoUserInfo">
+ SELECT
+ user.id AS userId,
+ user.`name` AS userName,
+ rol.id AS roleId,
+ rol.`name` AS roleName,
+ per.permissions
+ FROM ba_user user
+ INNER JOIN ba_user_role use_rol ON user.id = use_rol.userId
+ INNER JOIN ba_role rol ON rol.id = use_rol.roleId
+ INNER JOIN ba_role_permissions per ON per.roleId = rol.id
+ <where>
+ <if test = "userId != null and userId > 0">
+ AND user.id = ${userId}
+ </if>
+ </where>
+ </select>
</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
index f84a50d..941c01e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
@@ -164,9 +164,9 @@
SELECT
COUNT(*) AS recordCount
FROM se_active_card act
- INNER JOIN ba_client cli ON act.clientNum = cli.num
- INNER JOIN se_client_card card ON act.cardNum = card.cardNum
- , (SELECT @i:=0) AS itable
+ INNER JOIN ba_client cli ON act.clientNum = cli.num
+ INNER JOIN se_client_card card ON act.cardNum = card.cardNum
+ , (SELECT @i:=0) AS itable
<where>
<if test = "operateType != null and operateType > 0">
AND act.operateType = ${operateType}
@@ -175,10 +175,6 @@
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
-
- <!-- <if test = "cardAddr != null and cardAddr !=''">-->
- <!-- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
- <!-- </if>-->
<if test = "cardNum != null and cardNum !=''">
AND card.cardNum like CONCAT('%',#{cardNum},'%')
@@ -199,13 +195,13 @@
SELECT
(@i:=@i+1) AS id,
cli.`name` AS clientName,
- cli.id AS clientId,
- card.cardAddr,
+ cli.num AS clientNum,
+ card.cardNum,
card.state,
(CASE
- WHEN card.state = 1 THEN "姝e父"
- WHEN card.state = 2 THEN "宸叉敞閿�"
- ELSE "宸叉寕澶�"
+ WHEN card.state = 1 THEN "姝e父"
+ WHEN card.state = 2 THEN "宸叉敞閿�"
+ ELSE "宸叉寕澶�"
END) AS stateName,
act.reissueAmount,
act.cardCost,
@@ -224,10 +220,6 @@
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
-
-<!-- <if test = "cardAddr != null and cardAddr !=''">-->
-<!-- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
-<!-- </if>-->
<if test = "cardNum != null and cardNum !=''">
AND card.cardNum like CONCAT('%',#{cardNum},'%')
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml
index 0aee3e7..2bbefd7 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml
@@ -5,8 +5,8 @@
<!--@mbg.generated-->
<!--@Table se_cancel-->
<id column="id" jdbcType="BIGINT" property="id" />
- <result column="cardId" jdbcType="BIGINT" property="cardid" />
- <result column="clientId" jdbcType="BIGINT" property="clientid" />
+ <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
+ <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
<result column="refund" jdbcType="FLOAT" property="refund" />
<result column="refundType" jdbcType="TINYINT" property="refundtype" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, cardId, clientId, refund, refundType, remarks, `operator`, operateDt
+ id, cardNum, clientNum, refund, refundType, remarks, `operator`, operateDt
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -30,39 +30,25 @@
where id = #{id,jdbcType=BIGINT}
</delete>
- <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
<!--@mbg.generated-->
- insert into se_cancel (id, cardId, clientId, refund, refundType, remarks, `operator`, operateDt)
- values (#{id,jdbcType=BIGINT},
- #{cardid,jdbcType=BIGINT},
- #{clientid,jdbcType=BIGINT},
- #{refund,jdbcType=FLOAT},
- #{refundtype,jdbcType=TINYINT},
- #{remarks,jdbcType=VARCHAR},
- #{operator,jdbcType=BIGINT},
- #{operatedt,jdbcType=TIMESTAMP})
+ insert into se_cancel (id, cardNum, clientNum, refund,
+ refundType, remarks, `operator`,
+ operateDt)
+ values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{refund,jdbcType=FLOAT},
+ #{refundtype,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
+ #{operatedt,jdbcType=TIMESTAMP})
</insert>
-
-<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel" useGeneratedKeys="true">-->
-<!-- <!–@mbg.generated–>-->
-<!-- insert into se_cancel (cardId, clientId, refund, -->
-<!-- refundType, remarks, `operator`, -->
-<!-- operateDt)-->
-<!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{refund,jdbcType=FLOAT}, -->
-<!-- #{refundtype,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
-<!-- #{operatedt,jdbcType=TIMESTAMP})-->
-<!-- </insert>-->
-
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into se_cancel
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- cardId,
+ <if test="cardnum != null">
+ cardNum,
</if>
- <if test="clientid != null">
- clientId,
+ <if test="clientnum != null">
+ clientNum,
</if>
<if test="refund != null">
refund,
@@ -81,11 +67,11 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ #{clientnum,jdbcType=VARCHAR},
</if>
<if test="refund != null">
#{refund,jdbcType=FLOAT},
@@ -108,11 +94,11 @@
<!--@mbg.generated-->
update se_cancel
<set>
- <if test="cardid != null">
- cardId = #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ cardNum = #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- clientId = #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ clientNum = #{clientnum,jdbcType=VARCHAR},
</if>
<if test="refund != null">
refund = #{refund,jdbcType=FLOAT},
@@ -135,8 +121,8 @@
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
<!--@mbg.generated-->
update se_cancel
- set cardId = #{cardid,jdbcType=BIGINT},
- clientId = #{clientid,jdbcType=BIGINT},
+ set cardNum = #{cardnum,jdbcType=VARCHAR},
+ clientNum = #{clientnum,jdbcType=VARCHAR},
refund = #{refund,jdbcType=FLOAT},
refundType = #{refundtype,jdbcType=TINYINT},
remarks = #{remarks,jdbcType=VARCHAR},
@@ -150,16 +136,16 @@
SELECT
COUNT(*) AS recordCount
FROM se_cancel can
- INNER JOIN se_client_card card ON can.cardId = card.id
- INNER JOIN ba_client cli ON can.clientId = cli.id
- , (SELECT @i:=0) AS itable
+ INNER JOIN se_client_card card ON can.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON can.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "cancelTimeStart != null and cancelTimeStop != null">
@@ -173,33 +159,33 @@
SELECT
(@i:=@i+1) AS id,
cli.`name` AS clientName,
- cli.id AS clientId,
- card.cardAddr,
+ cli.num AS clientNum,
+ card.cardNum,
can.refund,
(CASE
- WHEN can.refundType = 1 THEN "鐜伴噾"
+ WHEN can.refundType = 1 THEN "鐜伴噾"
END) AS refundTypeName,
can.refundType,
(SELECT `name` FROM ba_user WHERE id = can.operator) AS operator,
can.operateDt
FROM se_cancel can
- INNER JOIN se_client_card card ON can.cardId = card.id
- INNER JOIN ba_client cli ON can.clientId = cli.id
- , (SELECT @i:=0) AS itable
+ INNER JOIN se_client_card card ON can.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON can.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "cancelTimeStart != null and cancelTimeStop != null">
AND can.operateDt BETWEEN #{cancelTimeStart} AND #{cancelTimeStop}
</if>
</where>
-
+ ORDER BY can.operateDt DESC
<if test="pageCurr != null and pageSize != null">
LIMIT ${pageCurr}, ${pageSize}
</if>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml
index c52b5ea..15d62b2 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml
@@ -5,8 +5,8 @@
<!--@mbg.generated-->
<!--@Table se_loss-->
<id column="id" jdbcType="BIGINT" property="id" />
- <result column="cardId" jdbcType="BIGINT" property="cardid" />
- <result column="clientId" jdbcType="BIGINT" property="clientid" />
+ <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
+ <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
<result column="money" jdbcType="FLOAT" property="money" />
<result column="refund" jdbcType="FLOAT" property="refund" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, cardId, clientId, money, refund, remarks, `operator`, operateDt
+ id, cardNum, clientNum, money, refund, remarks, `operator`, operateDt
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -30,38 +30,25 @@
where id = #{id,jdbcType=BIGINT}
</delete>
- <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
<!--@mbg.generated-->
- insert into se_loss (id, cardId, clientId, money, refund, remarks, `operator`, operateDt)
- values (#{id,jdbcType=BIGINT},
- #{cardid,jdbcType=BIGINT},
- #{clientid,jdbcType=BIGINT},
- #{money,jdbcType=FLOAT},
- #{refund,jdbcType=FLOAT},
- #{remarks,jdbcType=VARCHAR},
- #{operator,jdbcType=BIGINT},
- #{operatedt,jdbcType=TIMESTAMP})
+ insert into se_loss (id, cardNum, clientNum, money,
+ refund, remarks, `operator`,
+ operateDt)
+ values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
+ #{refund,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
+ #{operatedt,jdbcType=TIMESTAMP})
</insert>
-
-<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss" useGeneratedKeys="true">-->
-<!-- <!–@mbg.generated–>-->
-<!-- insert into se_loss (cardId, clientId, money, -->
-<!-- refund, remarks, `operator`, -->
-<!-- operateDt)-->
-<!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
-<!-- #{refund,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
-<!-- #{operatedt,jdbcType=TIMESTAMP})-->
-<!-- </insert>-->
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into se_loss
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- cardId,
+ <if test="cardnum != null">
+ cardNum,
</if>
- <if test="clientid != null">
- clientId,
+ <if test="clientnum != null">
+ clientNum,
</if>
<if test="money != null">
money,
@@ -80,11 +67,11 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ #{clientnum,jdbcType=VARCHAR},
</if>
<if test="money != null">
#{money,jdbcType=FLOAT},
@@ -107,11 +94,11 @@
<!--@mbg.generated-->
update se_loss
<set>
- <if test="cardid != null">
- cardId = #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ cardNum = #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- clientId = #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ clientNum = #{clientnum,jdbcType=VARCHAR},
</if>
<if test="money != null">
money = #{money,jdbcType=FLOAT},
@@ -134,8 +121,8 @@
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
<!--@mbg.generated-->
update se_loss
- set cardId = #{cardid,jdbcType=BIGINT},
- clientId = #{clientid,jdbcType=BIGINT},
+ set cardNum = #{cardnum,jdbcType=VARCHAR},
+ clientNum = #{clientnum,jdbcType=VARCHAR},
money = #{money,jdbcType=FLOAT},
refund = #{refund,jdbcType=FLOAT},
remarks = #{remarks,jdbcType=VARCHAR},
@@ -149,16 +136,16 @@
SELECT
COUNT(*) AS recordCount
FROM se_loss loss
- INNER JOIN se_client_card card ON loss.cardId = card.id
- INNER JOIN ba_client cli ON loss.clientId = cli.id
+ INNER JOIN se_client_card card ON loss.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON loss.clientNum = cli.num
, (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "lossTimeStart != null and lossTimeStop != null">
@@ -172,29 +159,29 @@
SELECT
(@i:=@i+1) AS id,
cli.`name` AS clientName,
- cli.id AS clientId,
- card.cardAddr,
+ cli.num AS clientNum,
+ card.cardNum,
loss.money,
(SELECT `name` FROM ba_user WHERE id = loss.operator) AS operator,
loss.operateDt
FROM se_loss loss
- INNER JOIN se_client_card card ON loss.cardId = card.id
- INNER JOIN ba_client cli ON loss.clientId = cli.id
+ INNER JOIN se_client_card card ON loss.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON loss.clientNum = cli.num
, (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "lossTimeStart != null and lossTimeStop != null">
AND loss.operateDt BETWEEN #{lossTimeStart} AND #{lossTimeStop}
</if>
</where>
-
+ ORDER BY loss.operateDt DESC
<if test="pageCurr != null and pageSize != null">
LIMIT ${pageCurr}, ${pageSize}
</if>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
index 00fe845..74c067d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
@@ -190,24 +190,18 @@
select
COUNT(*) AS recordCount
FROM se_recharge_history rec
- INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
- INNER JOIN ba_client cli ON rec.clientNum = cli.num
- , (SELECT @i:=0) AS itable
+ INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON rec.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <!-- <if test = "clientId != null and clientId > 0">-->
- <!-- AND rec.clientId like CONCAT('%',#{clientId},'%')-->
- <!-- </if>-->
<if test = "clientNum != null and clientNum > 0">
AND rec.clientNum like CONCAT('%',#{clientNum},'%')
</if>
- <!-- <if test = "cardAddr != null and cardAddr !=''">-->
- <!-- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
- <!-- </if>-->
<if test = "cardNum != null and cardNum !=''">
AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
@@ -244,16 +238,10 @@
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
-<!-- <if test = "clientId != null and clientId > 0">-->
-<!-- AND rec.clientId like CONCAT('%',#{clientId},'%')-->
-<!-- </if>-->
<if test = "clientNum != null and clientNum > 0">
AND rec.clientNum like CONCAT('%',#{clientNum},'%')
</if>
-<!-- <if test = "cardAddr != null and cardAddr !=''">-->
-<!-- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
-<!-- </if>-->
<if test = "cardNum != null and cardNum !=''">
AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
index 0f5d2e2..03884b2 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
@@ -5,8 +5,8 @@
<!--@mbg.generated-->
<!--@Table se_reversal-->
<id column="id" jdbcType="BIGINT" property="id" />
- <result column="cardId" jdbcType="BIGINT" property="cardid" />
- <result column="clientId" jdbcType="BIGINT" property="clientid" />
+ <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
+ <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
<result column="cardBalance" jdbcType="FLOAT" property="cardbalance" />
<result column="systemBalance" jdbcType="FLOAT" property="systembalance" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt
+ id, cardNum, clientNum, cardBalance, systemBalance, remarks, `operator`, operateDt
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -30,38 +30,25 @@
where id = #{id,jdbcType=BIGINT}
</delete>
- <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
<!--@mbg.generated-->
- insert into se_reversal (id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt)
- values (#{id,jdbcType=BIGINT},
- #{cardid,jdbcType=BIGINT},
- #{clientid,jdbcType=BIGINT},
- #{cardbalance,jdbcType=FLOAT},
- #{systembalance,jdbcType=FLOAT},
- #{remarks,jdbcType=VARCHAR},
- #{operator,jdbcType=BIGINT},
- #{operatedt,jdbcType=TIMESTAMP})
+ insert into se_reversal (id, cardNum, clientNum, cardBalance,
+ systemBalance, remarks, `operator`,
+ operateDt)
+ values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{cardbalance,jdbcType=FLOAT},
+ #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
+ #{operatedt,jdbcType=TIMESTAMP})
</insert>
-
-<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">-->
-<!-- <!–@mbg.generated–>-->
-<!-- insert into se_reversal (cardId, clientId, cardBalance, -->
-<!-- systemBalance, remarks, `operator`, -->
-<!-- operateDt)-->
-<!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT}, -->
-<!-- #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
-<!-- #{operatedt,jdbcType=TIMESTAMP})-->
-<!-- </insert>-->
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into se_reversal
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- cardId,
+ <if test="cardnum != null">
+ cardNum,
</if>
- <if test="clientid != null">
- clientId,
+ <if test="clientnum != null">
+ clientNum,
</if>
<if test="cardbalance != null">
cardBalance,
@@ -80,11 +67,11 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ #{clientnum,jdbcType=VARCHAR},
</if>
<if test="cardbalance != null">
#{cardbalance,jdbcType=FLOAT},
@@ -107,11 +94,11 @@
<!--@mbg.generated-->
update se_reversal
<set>
- <if test="cardid != null">
- cardId = #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ cardNum = #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- clientId = #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ clientNum = #{clientnum,jdbcType=VARCHAR},
</if>
<if test="cardbalance != null">
cardBalance = #{cardbalance,jdbcType=FLOAT},
@@ -134,8 +121,8 @@
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
<!--@mbg.generated-->
update se_reversal
- set cardId = #{cardid,jdbcType=BIGINT},
- clientId = #{clientid,jdbcType=BIGINT},
+ set cardNum = #{cardnum,jdbcType=VARCHAR},
+ clientNum = #{clientnum,jdbcType=VARCHAR},
cardBalance = #{cardbalance,jdbcType=FLOAT},
systemBalance = #{systembalance,jdbcType=FLOAT},
remarks = #{remarks,jdbcType=VARCHAR},
@@ -147,22 +134,22 @@
<!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栧啿姝h褰曟暟-->
<select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
SELECT
- COUNT(*) AS recordCount
- FROM se_client_card card
- INNER JOIN se_reversal rev ON rev.cardId = card.id
- INNER JOIN ba_client cli ON card.clientId = cli.id
- , (SELECT @i:=0) AS itable
+ COUNT(*) AS recordCount
+ FROM se_reversal rev
+ INNER JOIN se_client_card card ON rev.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON rev.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
- <if test = "reversallTimeStart != null and reversalTimeStop != null">
- AND card.unlockDt BETWEEN #{reversallTimeStart} AND #{reversalTimeStop}
+ <if test = "reversalTimeStart != null and reversalTimeStop != null">
+ AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
</if>
</where>
</select>
@@ -172,29 +159,29 @@
SELECT
(@i:=@i+1) AS id,
cli.`name` AS clientName,
- cli.id AS clientId,
- card.cardAddr,
+ cli.num AS clientNum,
+ card.cardNum,
rev.cardBalance,
(SELECT `name` FROM ba_user WHERE id = rev.operator) AS operator,
rev.operateDt
FROM se_reversal rev
- INNER JOIN se_client_card card ON rev.cardId = card.id
- INNER JOIN ba_client cli ON rev.clientId = cli.id
+ INNER JOIN se_client_card card ON rev.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON rev.clientNum = cli.num
, (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "reversalTimeStart != null and reversalTimeStop != null">
AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
</if>
</where>
-
+ ORDER BY rev.operateDt DESC
<if test="pageCurr != null and pageSize != null">
LIMIT ${pageCurr}, ${pageSize}
</if>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml
index 0642219..329661f 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml
@@ -5,8 +5,8 @@
<!--@mbg.generated-->
<!--@Table se_unlock-->
<id column="id" jdbcType="BIGINT" property="id" />
- <result column="cardId" jdbcType="BIGINT" property="cardid" />
- <result column="clientId" jdbcType="BIGINT" property="clientid" />
+ <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
+ <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
<result column="money" jdbcType="FLOAT" property="money" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="operator" jdbcType="BIGINT" property="operator" />
@@ -14,7 +14,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, cardId, clientId, money, remarks, `operator`, operateDt
+ id, cardNum, clientNum, money, remarks, `operator`, operateDt
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -29,36 +29,25 @@
where id = #{id,jdbcType=BIGINT}
</delete>
- <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
<!--@mbg.generated-->
- insert into se_unlock (id, cardId, clientId, money, remarks, `operator`, operateDt)
- values (#{id,jdbcType=BIGINT},
- #{cardid,jdbcType=BIGINT},
- #{clientid,jdbcType=BIGINT},
- #{money,jdbcType=FLOAT},
- #{remarks,jdbcType=VARCHAR},
- #{operator,jdbcType=BIGINT},
- #{operatedt,jdbcType=TIMESTAMP})
+ insert into se_unlock (id, cardNum, clientNum, money,
+ remarks, `operator`, operateDt
+ )
+ values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
+ #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}
+ )
</insert>
-<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true">-->
-<!-- <!–@mbg.generated–>-->
-<!-- insert into se_unlock (cardId, clientId, money, -->
-<!-- remarks, `operator`, operateDt-->
-<!-- )-->
-<!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
-<!-- #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}-->
-<!-- )-->
-<!-- </insert>-->
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into se_unlock
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- cardId,
+ <if test="cardnum != null">
+ cardNum,
</if>
- <if test="clientid != null">
- clientId,
+ <if test="clientnum != null">
+ clientNum,
</if>
<if test="money != null">
money,
@@ -74,11 +63,11 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cardid != null">
- #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ #{clientnum,jdbcType=VARCHAR},
</if>
<if test="money != null">
#{money,jdbcType=FLOAT},
@@ -98,11 +87,11 @@
<!--@mbg.generated-->
update se_unlock
<set>
- <if test="cardid != null">
- cardId = #{cardid,jdbcType=BIGINT},
+ <if test="cardnum != null">
+ cardNum = #{cardnum,jdbcType=VARCHAR},
</if>
- <if test="clientid != null">
- clientId = #{clientid,jdbcType=BIGINT},
+ <if test="clientnum != null">
+ clientNum = #{clientnum,jdbcType=VARCHAR},
</if>
<if test="money != null">
money = #{money,jdbcType=FLOAT},
@@ -122,8 +111,8 @@
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
<!--@mbg.generated-->
update se_unlock
- set cardId = #{cardid,jdbcType=BIGINT},
- clientId = #{clientid,jdbcType=BIGINT},
+ set cardNum = #{cardnum,jdbcType=VARCHAR},
+ clientNum = #{clientnum,jdbcType=VARCHAR},
money = #{money,jdbcType=FLOAT},
remarks = #{remarks,jdbcType=VARCHAR},
`operator` = #{operator,jdbcType=BIGINT},
@@ -136,16 +125,16 @@
SELECT
COUNT(*) AS recordCount
FROM se_unlock unl
- INNER JOIN se_client_card card ON unl.cardId = card.id
- INNER JOIN ba_client cli ON unl.clientId = cli.id
- , (SELECT @i:=0) AS itable
+ INNER JOIN se_client_card card ON unl.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON unl.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "unlocklTimeStart != null and unlockTimeStop != null">
@@ -159,29 +148,29 @@
SELECT
(@i:=@i+1) AS id,
cli.`name` AS clientName,
- cli.id AS clientId,
- card.cardAddr,
+ cli.num AS clientNum,
+ card.cardNum,
unl.money,
(SELECT `name` FROM ba_user WHERE id = unl.operator) AS operator,
unl.operateDt
FROM se_unlock unl
- INNER JOIN se_client_card card ON unl.cardId = card.id
- INNER JOIN ba_client cli ON unl.clientId = cli.id
- , (SELECT @i:=0) AS itable
+ INNER JOIN se_client_card card ON unl.cardNum = card.cardNum
+ INNER JOIN ba_client cli ON unl.clientNum = cli.num
+ , (SELECT @i:=0) AS itable
<where>
<if test = "clientName != null and clientName !=''">
AND cli.name like CONCAT('%',#{clientName},'%')
</if>
- <if test = "cardAddr != null and cardAddr !=''">
- AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
+ <if test = "cardNum != null and cardNum !=''">
+ AND card.cardNum like CONCAT('%',#{cardNum},'%')
</if>
<if test = "unlocklTimeStart != null and unlockTimeStop != null">
AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop}
</if>
</where>
-
+ ORDER BY unl.operateDt DESC
<if test="pageCurr != null and pageSize != null">
LIMIT ${pageCurr}, ${pageSize}
</if>
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java
new file mode 100644
index 0000000..bc30e74
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java
@@ -0,0 +1,23 @@
+package com.dy.pipIrrBase.result;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023/12/20 13:46
+ * @LastEditTime 2023/12/20 13:46
+ * @Description
+ */
+
+@Getter
+@AllArgsConstructor
+public enum SystemResultCode {
+ /**
+ * 瑙掕壊
+ */
+ PERMISSION_ERROR(10001, "鎺堟潈閿欒");
+
+ private final Integer code;
+ private final String message;
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
index 0e1704e..013d155 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -6,8 +6,10 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
+import com.dy.pipIrrBase.result.SystemResultCode;
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
+import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -16,23 +18,26 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
@Slf4j
@Tag(name = "瑙掕壊绠$悊", description = "瑙掕壊澧炲垹鏀规煡绛夋搷浣�")
@RestController
@RequestMapping(path="role")
+@RequiredArgsConstructor
@SuppressWarnings("unchecked")//java鐗堟湰瓒婇珮锛屽娉涘瀷绾︽潫瓒婁弗锛屾墍浠ラ厤缃甋uppressWarnings("unchecked")
public class RoleCtrl {
private RoleSv sv ;
+ private final RoleSv roleSv;
@Autowired
private void setSv(RoleSv sv){
@@ -129,7 +134,7 @@
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
po.id = null ;
- int count;
+ Long count;
try {
po.deleted = Deleted.NO ;//榛樿涓嶅垹闄�
count = this.sv.save(po);
@@ -252,4 +257,55 @@
}
}
+ @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 = "addPermissions", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @Transactional(rollbackFor = Exception.class)
+ @SsoAop("-1")//@SsoAop(power = "-1")
+ public BaseResponse<Boolean> permission(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaRolePermissions po, @Parameter(hidden = true) BindingResult bindingResult){
+ if(bindingResult != null && bindingResult.hasErrors()){
+ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
+ }
+
+ /**
+ * 濡傛灉roleid鍜宺oleName閮界┖锛氭彁绀洪敊璇俊鎭�
+ * 濡傛灉roleid涓虹┖锛氭柊寤鸿鑹蹭笖鎺堟潈
+ * 1. 娣诲姞瑙掕壊璁板綍
+ * 2. 娣诲姞瑙掕壊銆佹潈闄愬叧鑱旇褰�
+ * 濡傛灉roleid涓嶄负绌猴細淇敼瑙掕壊鎺堟潈
+ * 1. 鍒犻櫎瑙掕壊銆佹潈闄愯褰�
+ * 2. 娣诲姞瑙掕壊銆佹潈闄愯褰�
+ */
+
+ Long roleid = Optional.ofNullable(po.getRoleid()).orElse(0L);
+ String roleName = Optional.ofNullable(po.getRoleName()).orElse("");
+ String permissions = Optional.ofNullable(po.getPermissions()).orElse("");
+
+ if(roleid == 0 && roleName.length() == 0) {
+ return BaseResponseUtils.buildFail(SystemResultCode.PERMISSION_ERROR.getMessage());
+ }
+
+ // 鏂板缓瑙掕壊涓旀巿鏉�
+ if(roleid == 0) {
+ BaRole baRole = new BaRole();
+ baRole.setName(roleName);
+ roleid = Optional.ofNullable(roleSv.save(baRole)).orElse(0L);
+ po.setRoleid(roleid);
+ roleSv.addPermissions(po);
+ return BaseResponseUtils.buildSuccess(true) ;
+ }
+
+ // 淇敼瑙掕壊鎺堟潈
+ roleSv.delPermissionsByRoleId(roleid);
+ roleSv.addPermissions(po);
+ return BaseResponseUtils.buildSuccess(true) ;
+ }
+
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
index d67b381..073fe7d 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
@@ -3,8 +3,10 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.daoBa.BaRoleMapper;
+import com.dy.pipIrrGlobal.daoBa.BaRolePermissionsMapper;
import com.dy.pipIrrGlobal.daoBa.BaRolePrivilegeMapper;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
+import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -32,6 +34,8 @@
this.rolePrivDao = dao;
}
+ @Autowired
+ private BaRolePermissionsMapper baRolePermissionsMapper;
/**
* 寰楀埌鎵�鏈夎鑹�
@@ -78,9 +82,15 @@
* @param po 瀹炰綋
* @return 褰卞搷璁板綍鏁伴噺
*/
+
+ /**
+ * 12鏈�20鏃� 鏈卞疂姘戜慨鏀硅繑鍥炲�硷紝娣诲姞瑙掕壊鍚庤繑鍥炰富閿�
+ */
@Transactional
- public int save(BaRole po){
- return this.dao.putin(po) ;
+ public Long save(BaRole po){
+ //return this.dao.putin(po) ;
+ this.dao.putin(po) ;
+ return po.getId();
}
/**
@@ -126,5 +136,22 @@
return this.dao.deleteLogicById(id) ;
}
+ /**
+ * 娣诲姞鎺堟潈璁板綍
+ * @param po
+ * @return
+ */
+ public Integer addPermissions(BaRolePermissions po) {
+ return baRolePermissionsMapper.insert(po);
+ }
+
+ /**
+ * 渚濇嵁瑙掕壊缂栧彿鍒犻櫎鎺堟潈璁板綍
+ * @param roleid
+ * @return
+ */
+ public Integer delPermissionsByRoleId(Long roleid) {
+ return baRolePermissionsMapper.delPermissionsByRoleId(roleid);
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
index a6f3675..ffe2d73 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -11,6 +11,7 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.util.Constant;
+import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import com.mysql.cj.util.StringUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -49,7 +50,6 @@
private void setSv(UserSv sv) {
this.sv = sv;
}
-
/**
* 瀹㈡埛绔姹傚緱鍒伴粯璁ゅ瘑鐮�
@@ -474,4 +474,31 @@
return BaseResponseUtils.buildSuccess(true);
}
}
+
+ /**
+ * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鐢ㄦ埛淇℃伅
+ * @param userId 鐢ㄦ埛缂栧彿
+ * @return 鐢ㄦ埛淇℃伅鍒楄〃
+ */
+ @Operation(summary = "鑾峰緱鍏ㄩ儴鐢ㄦ埛淇℃伅", description = "杩斿洖鍏ㄩ儴鐢ㄦ埛淇℃伅鏁版嵁")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "杩斿洖鍏ㄩ儴鐢ㄦ埛鏁版嵁锛圔aseResponse.content:QueryResultVo[{}]锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = BaUser.class))}
+ )
+ })
+ @GetMapping("/getUserInfos/{userId}")
+ @SsoAop("-1")
+ public BaseResponse<QueryResultVo<List<VoUserInfo>>> getUserInfos(@PathVariable("userId") Long userId) {
+ try {
+ List<VoUserInfo> res = this.sv.getUserInfos(userId);
+ System.out.println(" :" + res);
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鏌ヨ鐢ㄦ埛淇℃伅寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
index 0c900bd..ebe2415 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
@@ -6,6 +6,7 @@
import com.dy.pipIrrGlobal.daoBa.BaUserRoleMapper;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.pojoBa.BaUserRole;
+import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -162,5 +163,12 @@
return val;
}
-
+ /**
+ * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鐢ㄦ埛淇℃伅
+ * @param userId 鐢ㄦ埛缂栧彿
+ * @return 鐢ㄦ埛淇℃伅鍒楄〃
+ */
+ public List<VoUserInfo> getUserInfos(Long userId) {
+ return dao.getUserInfos(userId);
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
index aec2f6d..d04a1e2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -14,6 +14,7 @@
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.recharge.DtoRecharge;
import com.dy.pipIrrSell.recharge.RechargeCtrl;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -46,7 +47,6 @@
public class ActiveCardCtrl {
private final ActiveCardSv activeCardSv;
private final ClientCardSv clientCardSv;
-
private final RechargeCtrl rechargeCtrl;
@Operation(summary = "鑾峰緱涓�椤靛紑鍗¤褰�", description = "杩斿洖涓�椤靛紑鍗℃暟鎹�")
@@ -97,7 +97,7 @@
*/
VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum());
if(voAreaCode == null) {
- return BaseResponseUtils.buildFail("璇ュ啘鎴疯鏀垮尯鍒掑紓甯革紝璇疯仈绯荤郴缁熺鐞嗗憳");
+ return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage());
}
String provinceId = voAreaCode.getProvinceId();
String cityId = voAreaCode.getCityId();
@@ -117,7 +117,7 @@
Integer number = Integer.parseInt(cardNum.substring(12));
number = number + 1;
if(number > 9999) {
- return BaseResponseUtils.buildFail("姘村崱缂栧彿宸叉弧锛岃鑱旂郴绯荤粺绠$悊鍛�");
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_OVERRUN.getMessage());
}
cardNum = cardNum.substring(0, 12) + String.format("%04d", number);
} else {
@@ -126,7 +126,6 @@
/**
- * cardId 姘村崱缂栧彿锛堟彃鍏ヨ褰曞悗鐢熸垚锛�
* cardAddr 姘村崱鍦板潃锛堜粎浠呭啓鍏ワ紝鏃犱笟鍔★級
* clientNum 鍐滄埛缂栧彿
* cardCost 鍗$墖璐圭敤
@@ -137,9 +136,7 @@
* operator 鎿嶄綔浜虹紪鍙�
* activeTime 寮�鍗℃椂闂�
*/
- //Long cardId = 0L;
String cardAddr = po.getCardAddr();
- //Long clientId = po.getClientId();
String clientNum = po.getClientNum();
Integer cardCost = po.getCardCost();
Float amount = po.getAmount();
@@ -153,7 +150,6 @@
*/
SeClientCard seClientCard = new SeClientCard();
seClientCard.setCardaddr(cardAddr);
- //seClientCard.setClientid(clientId);
seClientCard.setCardnum(cardNum);
seClientCard.setClientnum(clientNum);
seClientCard.setMoney(0.0);
@@ -163,7 +159,7 @@
Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ;
if(cardId == 0) {
- return BaseResponseUtils.buildFail("寮�鍗″け璐�-鍐滄埛鍗″啓鍏ュ紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -172,8 +168,6 @@
SeActiveCard activeCard = new SeActiveCard();
activeCard.setCardnum(cardNum);
activeCard.setClientnum(clientNum);
- //activeCard.setCardid(cardId);
- //activeCard.setClientid(clientId);
activeCard.setCardcost(cardCost);
activeCard.setPaymentid(paymentId);
activeCard.setOperatetype(OperateTypeENUM.ACTIVE.getCode());
@@ -182,7 +176,7 @@
activeCard.setOperatedt(createTime);
Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("寮�鍗″け璐�-寮�鍗¤褰曞啓鍏ュ紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR.getMessage());
}
/**
@@ -196,7 +190,7 @@
dtoRecharge.setPrice(0f);
BaseResponse<Boolean> job = rechargeCtrl.addRecharge(dtoRecharge);
if(!job.getCode().equals("0001")) {
- return BaseResponseUtils.buildFail("寮�鍗℃垚鍔燂紝浣嗗厖鍊煎け璐�");
+ return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_RECHARGE_EXCEPTION.getMessage());
}
}
@@ -233,7 +227,6 @@
*/
Long cardId = 0L;
String cardNum = po.getCardNum();
- //String clientNum = po.getClientNum();
String clientNum = "";
Integer cardCost = po.getCardCost();
Double reissueAmount = po.getReissueAmount();
@@ -247,7 +240,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_ERROR.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientNum = map.get("clientNum").toString();
@@ -263,7 +256,7 @@
seClientCard.setLastoper(LastOperateENUM.REPLACE.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("琛ュ崱澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -272,8 +265,6 @@
SeActiveCard activeCard = new SeActiveCard();
activeCard.setCardnum(cardNum);
activeCard.setClientnum(clientNum);
- //activeCard.setCardid(cardId);
- //activeCard.setClientid(clientId);
activeCard.setCardcost(cardCost);
activeCard.setPaymentid(paymentId);
activeCard.setReissueamount(reissueAmount);
@@ -283,7 +274,7 @@
activeCard.setOperatedt(replaceTime);
Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("琛ュ崱澶辫触-琛ュ崱璁板綍鍐欏叆寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
index 7d054f5..d320e2a 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoCancel;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -26,10 +27,7 @@
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
/**
* @author ZhuBaoMin
@@ -87,18 +85,18 @@
}
/**
- * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛�
- * cardAddr 姘村崱鍦板潃
- * clientId 鍐滄埛缂栧彿
+ * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛屼慨鏀瑰啘鎴峰崱浣跨敤锛�
+ * cardNum 姘村崱缂栧彿
+ * clientNum 鍐滄埛缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardNum鍙嶆煡锛屾坊鍔犳敞閿�浣跨敤锛�
* refund 閫�娆鹃噾棰�
* refundType 閫�娆炬柟寮�
* remarks 澶囨敞
* operator 鎿嶄綔浜虹紪鍙�
- * cancelTime 鎸傚け鏃堕棿
+ * cancelTime 鎸傚け鏃堕棿
*/
Long cardId = 0L;
- String cardAddr = po.getCardAddr();
- Long clientId = po.getClientId();
+ String cardNum = po.getCardNum();
+ String clientNum = "";
Float refund = po.getRefund();
Byte refundType = po.getRefundType();
String remarks = po.getRemarks();
@@ -106,12 +104,14 @@
Date cancelTime = new Date();
/**
- * 渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛堜富閿級
+ * 渚濇嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿
*/
- cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
- if(cardId == 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
+ if(map == null || map.size() <= 0) {
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
+ cardId = Long.parseLong(map.get("cardId").toString());
+ clientNum = map.get("clientNum").toString();
/**
* 淇敼鍐滄埛鍗′俊鎭細
@@ -124,15 +124,15 @@
seClientCard.setLastoper(LastOperateENUM.CANCEL.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("娉ㄩ攢澶辫触-鍐滄埛鍗℃敞閿�寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
* 娣诲姞鎸傚け璁板綍
*/
SeCancel seCancel = new SeCancel();
- seCancel.setCardid(cardId);
- seCancel.setClientid(clientId);
+ seCancel.setCardnum(cardNum);
+ seCancel.setClientnum(clientNum);
seCancel.setRefund(refund);
seCancel.setRefundtype(refundType);
seCancel.setRemarks(remarks);
@@ -140,7 +140,7 @@
seCancel.setOperatedt(cancelTime);
Long rec = Optional.ofNullable(cancelSv.add(seCancel)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("娉ㄩ攢澶辫触-娉ㄩ攢璁板綍鍐欏叆寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CANCELL_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java
index 5b6a43e..dc59bf5 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java
@@ -23,17 +23,17 @@
public static final long serialVersionUID = 1L;
/**
- * 姘村崱鍦板潃
+ * 姘村崱缂栧彿
*/
- @Schema(description = "姘村崱鍦板潃", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@NotBlank
- private String cardAddr;
+ private String cardNum;
/**
* 鍐滄埛缂栧彿
*/
- @Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- private Long clientId;
+ //@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ //private Long clientId;
/**
* 閫�娆鹃噾棰�
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java
index a032c0d..b8714a2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java
@@ -24,8 +24,8 @@
@Schema(description = "鍐滄埛濮撳悕")
public String clientName;
- @Schema(description = "IC鍗″彿")
- public String cardAddr;
+ @Schema(description = "姘村崱缂栧彿")
+ public String cardNum;
@Schema(description = "娉ㄩ攢鏃堕棿_寮�濮�")
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java
index 576af15..6bd7d35 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java
@@ -23,17 +23,17 @@
public static final long serialVersionUID = 1L;
/**
- * 姘村崱鍦板潃
+ * 姘村崱缂栧彿
*/
- @Schema(description = "姘村崱鍦板潃", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@NotBlank
- private String cardAddr;
+ private String cardNum;
/**
* 鍐滄埛缂栧彿
*/
- @Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- private Long clientId;
+ //@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ //private Long clientId;
/**
* 浣欓
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
index 300456f..a6b337b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoLoss;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -25,11 +26,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
/**
* @author ZhuBaoMin
@@ -81,15 +78,14 @@
@Transactional(rollbackFor = Exception.class)
@SsoAop("-1")//@SsoAop(power = "-1")
public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid DtoLoss po, @Parameter(hidden = true) BindingResult bindingResult){
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(bindingResult != null && bindingResult.hasErrors()){
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
/**
- * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛�
- * cardAddr 姘村崱鍦板潃
- * clientId 鍐滄埛缂栧彿
+ * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardNum鍙嶆煡锛�
+ * cardNum 姘村崱缂栧彿
+ * clientNum 鍐滄埛缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardNum鍙嶆煡锛屾坊鍔犳寕澶变娇鐢級
* money 浣欓
* refund 閫�娆鹃噾棰�
* remarks 澶囨敞
@@ -97,8 +93,8 @@
* lossTime 鎸傚け鏃堕棿
*/
Long cardId = 0L;
- String cardAddr = po.getCardAddr();
- Long clientId = po.getClientId();
+ String cardNum = po.getCardNum();
+ String clientNum = "";
Float money = po.getMoney();
Float refund = po.getRefund();
String remarks = po.getRemarks();
@@ -106,12 +102,14 @@
Date lossTime = new Date();
/**
- * 渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛堜富閿級
+ * 渚濇嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿
*/
- cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
- if(cardId == 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
+ if(map == null || map.size() <= 0) {
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
+ cardId = Long.parseLong(map.get("cardId").toString());
+ clientNum = map.get("clientNum").toString();
/**
* 淇敼鍐滄埛鍗′俊鎭細
@@ -124,15 +122,15 @@
seClientCard.setLastoper(LastOperateENUM.LOSS.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("鎸傚け澶辫触-鍐滄埛鍗℃寕澶卞紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
* 娣诲姞鎸傚け璁板綍
*/
SeLoss seLoss = new SeLoss();
- seLoss.setCardid(cardId);
- seLoss.setClientid(clientId);
+ seLoss.setCardnum(cardNum);
+ seLoss.setClientnum(clientNum);
seLoss.setMoney(money);
seLoss.setRefund(refund);
seLoss.setRemarks(remarks);
@@ -140,7 +138,7 @@
seLoss.setOperatedt(lossTime);
Long rec = Optional.ofNullable(lossSv.add(seLoss)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("鎸傚け澶辫触-鎸傚け璁板綍鍐欏叆寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_LOSS_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
index 0066355..3114323 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -11,6 +11,7 @@
import com.dy.pipIrrGlobal.voSe.VoRecharge;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -98,10 +99,7 @@
* rechargeTime 鍏呭�兼椂闂�
*/
Long cardId = 0L;
- //String cardAddr = po.getCardAddr();
- //Long clientId = po.getClientId();
String cardNum = po.getCardNum();
- //String clientNum = po.getClientNum();
String clientNum = "";
Float money = po.getMoney();
Float amount = po.getAmount();
@@ -118,7 +116,7 @@
*/
Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
if(map == null || map.size() <= 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
cardId = Long.parseLong(map.get("cardId").toString());
clientNum = map.get("clientNum").toString();
@@ -134,7 +132,7 @@
seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍐滄埛鍗′慨鏀瑰紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
@@ -145,8 +143,6 @@
* 娣诲姞鍏呭�艰褰�
*/
SeRecharge seRecharge = new SeRecharge();
- //seRecharge.setCardid(cardId);
- //seRecharge.setClientid(clientId);
seRecharge.setCardnum(cardNum);
seRecharge.setClientnum(clientNum);
seRecharge.setMoney(money);
@@ -160,15 +156,13 @@
seRecharge.setOperatedt(rechargeTime);
Long rec = Optional.ofNullable(rechargeSv.add(seRecharge)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍏呭�艰褰曞啓鍏ュ紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage());
}
/**
* 娣诲姞琛ュ崱鍘嗗彶璁板綍
*/
SeRechargeHistory seRechargeHistory = new SeRechargeHistory();
- //seRechargeHistory.setCardid(cardId);
- //seRechargeHistory.setClientid(clientId);
seRechargeHistory.setCardnum(cardNum);
seRechargeHistory.setClientnum(clientNum);
seRechargeHistory.setMoney(money);
@@ -183,7 +177,7 @@
Long rec_history = Optional.ofNullable(rechargeSv.addHistory(seRechargeHistory)).orElse(0L);
if(rec_history == 0) {
- return BaseResponseUtils.buildFail("鍏呭�煎け璐�-鍏呭�煎巻鍙茶褰曞啓鍏ュ紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_RECHARGE_HISTORY_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java
new file mode 100644
index 0000000..38c69da
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java
@@ -0,0 +1,62 @@
+package com.dy.pipIrrSell.result;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2023/12/20 13:53
+ * @LastEditTime 2023/12/20 13:53
+ * @Description
+ */
+
+@Getter
+@AllArgsConstructor
+public enum SellResultCode {
+ /**
+ * 寮�鍗�/琛ュ崱
+ */
+ AREA_CODE_MISTAKE(10001, "璇ュ啘鎴疯鏀垮尯鍒掑紓甯�"),
+ CARD_NUMBER_OVERRUN(10002, "姘村崱缂栧彿宸叉弧"),
+ ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR(10003, "寮�鍗″け璐�-鍐滄埛鍗″啓鍏ュ紓甯�"),
+ ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR(10004, "寮�鍗″け璐�-寮�鍗¤褰曞啓鍏ュ紓甯�"),
+ ACTIVE_FAIL_RECHARGE_EXCEPTION(10005, "寮�鍗″け璐�-鍏呭�煎紓甯�"),
+ CARD_NUMBER_ERROR(10006, "鍗″彿閿欒锛岃鍗′笉瀛樺湪"),
+ REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR(10007, "琛ュ崱澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ REPLACE_FAIL_WRITE_RECHARGE_ERROR(10008, "琛ュ崱澶辫触-琛ュ崱璁板綍鍐欏叆寮傚父"),
+
+ /**
+ * 鍏呭��
+ */
+ CARD_NUMBER_MISTAKE(20001, "鍗″彿閿欒锛岃鍗′笉瀛樺湪"),
+ RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR(20002, "鍏呭�煎け璐�-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ RECHARGE_FAIL_WRITE_RECHARGE_ERROR(20003, "鍏呭�煎け璐�-鍏呭�艰褰曞啓鍏ュ紓甯�"),
+ RECHARGE_FAIL_WRITE_RECHARGE_HISTORY_ERROR(20004, "鍏呭�煎け璐�-鍏呭�煎巻鍙茶褰曞啓鍏ュ紓甯�"),
+
+ /**
+ * 鎸傚け
+ */
+ LOSS_FAIL_WRITE_CLIENT_CARD_ERROR(30001, "鎸傚け澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ LOSS_FAIL_WRITE_LOSS_ERROR(30002, "鎸傚け澶辫触-鎸傚け璁板綍鍐欏叆寮傚父"),
+
+ /**
+ * 娉ㄩ攢
+ */
+ CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR(40001, "娉ㄩ攢澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ CANCEL_FAIL_WRITE_CANCELL_ERROR(40002, "娉ㄩ攢澶辫触-娉ㄩ攢璁板綍鍐欏叆寮傚父"),
+
+ /**
+ * 瑙i攣
+ */
+ UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR(50001, "瑙i攣澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ UNLOCK_FAIL_WRITE_UNLOCK_ERROR(50002, "瑙i攣澶辫触-瑙i攣璁板綍鍐欏叆寮傚父"),
+
+ /**
+ * 鍐叉
+ */
+ REVERSAL_FAIL_WRITE_CLIENT_CARD_ERROR(60001, "鍐叉澶辫触-鍐滄埛鍗′慨鏀瑰紓甯�"),
+ REVERSAL_FAIL_WRITE_REVERSAL_ERROR(60002, "鍐叉澶辫触-鍐叉璁板綍鍐欏叆寮傚父");
+
+ private final Integer code;
+ private final String message;
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java
index 8c2a766..a212300 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java
@@ -23,17 +23,17 @@
public static final long serialVersionUID = 1L;
/**
- * 姘村崱鍦板潃
+ * 姘村崱缂栧彿
*/
- @Schema(description = "姘村崱鍦板潃", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@NotBlank
- private String cardAddr;
+ private String cardNum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- private Long clientId;
+ private String clientNum;
/**
* 鍗$墖浣欓
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java
index e2e0be8..9f026eb 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java
@@ -24,8 +24,8 @@
@Schema(description = "鍐滄埛濮撳悕")
public String clientName;
- @Schema(description = "IC鍗″彿")
- public String cardAddr;
+ @Schema(description = "姘村崱缂栧彿")
+ public String cardNum;
@Schema(description = "鍐叉鏃堕棿_寮�濮�")
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
index 4756804..f21dbd5 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoReversal;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -25,11 +26,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
/**
* @author ZhuBaoMin
@@ -81,15 +78,14 @@
@Transactional(rollbackFor = Exception.class)
@SsoAop("-1")//@SsoAop(power = "-1")
public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid DtoReversal po, @Parameter(hidden = true) BindingResult bindingResult){
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if(bindingResult != null && bindingResult.hasErrors()){
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
/**
- * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛�
- * cardAddr 姘村崱鍦板潃
- * clientId 鍐滄埛缂栧彿
+ * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛屼慨鏀瑰啘鎴峰崱浣跨敤锛�
+ * cardNum 姘村崱鍦板潃
+ * clientNum 鍐滄埛缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardNum鍙嶆煡锛屾坊鍔犲啿姝d娇鐢級
* cardBalance 鍗$墖浣欓
* systemBalance 绯荤粺浣欓
* remarks 澶囨敞
@@ -97,8 +93,8 @@
* reversalTime 鍐叉
*/
Long cardId = 0L;
- String cardAddr = po.getCardAddr();
- Long clientId = po.getClientId();
+ String cardNum = po.getCardNum();
+ String clientNum = "";
Float cardBalance = po.getCardBalance();
Float systemBalance = po.getSystemBalance();
String remarks = po.getRemarks();
@@ -106,12 +102,14 @@
Date reversalTime = new Date();
/**
- * 渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛堜富閿級
+ * 渚濇嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿
*/
- cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
- if(cardId == 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
+ if(map == null || map.size() <= 0) {
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
+ cardId = Long.parseLong(map.get("cardId").toString());
+ clientNum = map.get("clientNum").toString();
/**
* 淇敼鍐滄埛鍗′俊鎭細
@@ -124,15 +122,15 @@
seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("鍐叉澶辫触-鍐滄埛鍗″啿姝e紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
- * 娣诲姞瑙i攣璁板綍
+ * 娣诲姞鍐叉璁板綍
*/
SeReversal reversal = new SeReversal();
- reversal.setCardid(cardId);
- reversal.setClientid(clientId);
+ reversal.setCardnum(cardNum);
+ reversal.setClientnum(clientNum);
reversal.setCardbalance(cardBalance);
reversal.setSystembalance(systemBalance);
reversal.setRemarks(remarks);
@@ -140,7 +138,7 @@
reversal.setOperatedt(reversalTime);
Long rec = Optional.ofNullable(reversalSv.add(reversal)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("瑙i攣澶辫触-瑙i攣璁板綍鍐欏叆寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.REVERSAL_FAIL_WRITE_REVERSAL_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java
index 4c311b3..043da7b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java
@@ -23,17 +23,17 @@
public static final long serialVersionUID = 1L;
/**
- * 姘村崱鍦板潃
+ * 姘村崱缂栧彿
*/
- @Schema(description = "姘村崱鍦板潃", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- @NotBlank
- private String cardAddr;
+ @Schema(description = "姘村崱缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @NotBlank(message = "姘村崱缂栧彿涓嶈兘涓虹┖")
+ private String cardNum;
/**
* 鍐滄埛缂栧彿
*/
@Schema(description = "鍐滄埛缂栧彿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- private Long clientId;
+ private String clientNum;
/**
* 浣欓
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
index c4684c6..5af9f24 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoUnlock;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
+import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -26,10 +27,7 @@
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
/**
* @author ZhuBaoMin
@@ -87,29 +85,31 @@
}
/**
- * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛�
- * cardAddr 姘村崱鍦板潃
- * clientId 鍐滄埛缂栧彿
+ * cardId 姘村崱缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardAddr鍙嶆煡锛屼慨鏀瑰啘鎴峰崱浣跨敤锛�
+ * cardNum 姘村崱鍦板潃
+ * clientNum 鍐滄埛缂栧彿锛堥潪浼犲叆鍙傛暟锛岀敱cardNum鍙嶆煡锛屾坊鍔犺В閿佷娇鐢級
* money 浣欓
* remarks 澶囨敞
* operator 鎿嶄綔浜虹紪鍙�
* unlockTime 瑙i攣鏃堕棿
*/
Long cardId = 0L;
- String cardAddr = po.getCardAddr();
- Long clientId = po.getClientId();
+ String cardNum = po.getCardNum();
+ String clientNum = "";
Float money = po.getMoney();
String remarks = po.getRemarks();
Long operator = po.getOperator();
Date unlockTime = new Date();
/**
- * 渚濇嵁姘村崱鍦板潃鑾峰彇姘村崱缂栧彿锛堜富閿級
+ * 渚濇嵁姘村崱缂栧彿鑾峰彇姘村崱琛ㄤ富閿強鍐滄埛缂栧彿
*/
- cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
- if(cardId == 0) {
- return BaseResponseUtils.buildFail("鍗″彿閿欒锛岃鍗′笉瀛樺湪");
+ Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
+ if(map == null || map.size() <= 0) {
+ return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
}
+ cardId = Long.parseLong(map.get("cardId").toString());
+ clientNum = map.get("clientNum").toString();
/**
* 淇敼鍐滄埛鍗′俊鎭細
@@ -122,22 +122,22 @@
seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode());
Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
if(rec_updateClientCard == 0) {
- return BaseResponseUtils.buildFail("瑙i攣澶辫触-鍐滄埛鍗¤В閿佸紓甯�");
+ return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
}
/**
* 娣诲姞瑙i攣璁板綍
*/
SeUnlock seUnlock = new SeUnlock();
- seUnlock.setCardid(cardId);
- seUnlock.setClientid(clientId);
+ seUnlock.setCardnum(cardNum);
+ seUnlock.setClientnum(clientNum);
seUnlock.setMoney(money);
seUnlock.setRemarks(remarks);
seUnlock.setOperator(operator);
seUnlock.setOperatedt(unlockTime);
Long rec = Optional.ofNullable(unlockSv.add(seUnlock)).orElse(0L);
if(rec == 0) {
- return BaseResponseUtils.buildFail("瑙i攣澶辫触-瑙i攣璁板綍鍐欏叆寮傚父");
+ return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_UNLOCK_ERROR.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
--
Gitblit v1.8.0