| | |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | <!-- mqtt 依赖 --> |
| | | <dependency> |
| | | <groupId>org.eclipse.paho</groupId> |
| | | <artifactId>org.eclipse.paho.client.mqttv3</artifactId> |
| | | <version>1.2.5</version> |
| | | </dependency> |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
对比新文件 |
| | |
| | | package com.lunhan.water.common.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "mqtt") |
| | | @Order(10) |
| | | public class MqttConfig { |
| | | /** |
| | | * 是否启用 |
| | | */ |
| | | private Boolean enable; |
| | | /** |
| | | * 主机 |
| | | */ |
| | | private String host; |
| | | |
| | | /** |
| | | * 端口 |
| | | */ |
| | | private Integer port; |
| | | |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | private String user; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String password; |
| | | |
| | | /** |
| | | * 订阅主题 |
| | | */ |
| | | private String topic; |
| | | |
| | | /** |
| | | * 订阅消息的客户端id |
| | | */ |
| | | private String clientId; |
| | | |
| | | /** |
| | | * 连接超时时间 |
| | | */ |
| | | private Integer connectionTimeout; |
| | | |
| | | /** |
| | | * 心跳 |
| | | */ |
| | | private Integer keepAliveInterval; |
| | | |
| | | /** |
| | | * 发送消息的客户端id |
| | | */ |
| | | private String serverClientId; |
| | | } |
| | |
| | | public static JdbcSetConfig jdbc = SpringUtil.getBean(JdbcSetConfig.class); |
| | | public static FileConfig file = SpringUtil.getBean(FileConfig.class); |
| | | public static RedisConfig redis = SpringUtil.getBean(RedisConfig.class); |
| | | |
| | | public static WxConfig wx = SpringUtil.getBean(WxConfig.class); |
| | | public static WeiXinPayConfig weiXinPay = SpringUtil.getBean(WeiXinPayConfig.class); |
| | | public static String getTokenHeader() { |
| | | return jwt.getTokenHeader(); |
| | | //return properties.getProperty("jwt.tokenHeader", ""); |
对比新文件 |
| | |
| | | package com.lunhan.water.common.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Data |
| | | @Configuration |
| | | public class WeiXinPayConfig { |
| | | @Value("${pay.weiXin.merchantId}") |
| | | public String merchantId; |
| | | |
| | | @Value("${pay.weiXin.merchantKey}") |
| | | public String merchantKey; |
| | | |
| | | @Value("${pay.weiXin.keyPath}") |
| | | public String keyPath; |
| | | |
| | | @Value("${pay.weiXin.privateKeyPath}") |
| | | public String privateKeyPath; |
| | | |
| | | @Value("${pay.weiXin.certificateSn}") |
| | | public String certificateSn; |
| | | |
| | | @Value("${pay.weiXin.appID}") |
| | | public String appID; |
| | | |
| | | @Value("${pay.weiXin.notifyBasicUrl}") |
| | | private String notifyBasicUrl; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @ConfigurationProperties(prefix = "wx") |
| | | public class WxConfig { |
| | | private String appId; |
| | | private String secret; |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getSecret() { |
| | | return secret; |
| | | } |
| | | |
| | | public void setSecret(String secret) { |
| | | this.secret = secret; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.security; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import java.io.BufferedReader; |
| | | import java.io.FileReader; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.*; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | |
| | | public class RSAUtil { |
| | | private static String getKey(String filePath) { |
| | | try { |
| | | // Read key from file |
| | | String strKeyPEM = ""; |
| | | BufferedReader br = new BufferedReader(new FileReader(filePath)); |
| | | String line; |
| | | while ((line = br.readLine()) != null) { |
| | | strKeyPEM += line + "\n"; |
| | | } |
| | | br.close(); |
| | | return strKeyPEM; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA读取文件(" + filePath + ")失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 从pem文件获取私钥PrivateKey |
| | | * |
| | | * @param filePath pem文件路径 |
| | | */ |
| | | public static PrivateKey getPrivateKey(String filePath) { |
| | | String privateKeyPEM = RSAUtil.getKey(filePath); |
| | | return RSAUtil.getPrivateKeyFromString(privateKeyPEM); |
| | | } |
| | | /** |
| | | * String转私钥PrivateKey |
| | | * |
| | | * @param key |
| | | */ |
| | | public static PrivateKey getPrivateKeyFromString(String key) { |
| | | try { |
| | | String privateKeyPEM = key; |
| | | privateKeyPEM = privateKeyPEM.replaceFirst("\\-+BEGIN PRIVATE KEY\\-+[^a-zA-Z0-9_\\-]+", ""); |
| | | privateKeyPEM = privateKeyPEM.replaceFirst("\\-+END PRIVATE KEY\\-+", "").replaceAll("\\s+", ""); |
| | | byte[] encoded = Base64.decodeBase64(privateKeyPEM); |
| | | |
| | | KeyFactory kf = KeyFactory.getInstance("RSA"); |
| | | PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded); |
| | | return kf.generatePrivate(keySpec); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA从字符串获取私钥失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static PublicKey getPublicKey(String filename) throws IOException, GeneralSecurityException { |
| | | String publicKeyPEM = RSAUtil.getKey(filename); |
| | | return RSAUtil.getPublicKeyFromString(publicKeyPEM); |
| | | } |
| | | |
| | | public static PublicKey getPublicKeyFromString(String key) { |
| | | try { |
| | | String publicKeyPEM = key; |
| | | publicKeyPEM = publicKeyPEM.replace("-----BEGIN PUBLIC KEY-----\n", ""); |
| | | publicKeyPEM = publicKeyPEM.replace("-----END PUBLIC KEY-----", ""); |
| | | byte[] encoded = Base64.decodeBase64(publicKeyPEM); |
| | | KeyFactory kf = KeyFactory.getInstance("RSA"); |
| | | PublicKey pubKey = kf.generatePublic(new X509EncodedKeySpec(encoded)); |
| | | return pubKey; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA从字符串获取公钥失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static String sign(PrivateKey privateKey, String message) { |
| | | try { |
| | | Signature sign = Signature.getInstance("SHA1withRSA"); |
| | | sign.initSign(privateKey); |
| | | sign.update(message.getBytes(StandardCharsets.UTF_8)); |
| | | return new String(Base64.encodeBase64(sign.sign()), StandardCharsets.UTF_8); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA签名生成失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | public static boolean verify(PublicKey publicKey, String message, String signature) { |
| | | try { |
| | | Signature sign = Signature.getInstance("SHA1withRSA"); |
| | | sign.initVerify(publicKey); |
| | | sign.update(message.getBytes(StandardCharsets.UTF_8)); |
| | | return sign.verify(Base64.decodeBase64(signature.getBytes(StandardCharsets.UTF_8))); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA签名验证失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static String encryptRSA(String rawText, String publicKey) { |
| | | return RSAUtil.encryptRSA(rawText, RSAUtil.getPublicKeyFromString(publicKey)); |
| | | } |
| | | public static String encryptRSA(String rawText, PublicKey publicKey) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance("RSA"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | return Base64.encodeBase64String(cipher.doFinal(rawText.getBytes(StandardCharsets.UTF_8))); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA加密失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //公钥加密 |
| | | // public static String encrypt(String content, String publicKey) { |
| | | // return RSAUtil.encrypt(content, RSAUtil.getPublicKeyFromString(publicKey)); |
| | | // } |
| | | // public static String encrypt(String content, PublicKey publicKey) { |
| | | // try { |
| | | // byte[] output = RSAUtil.encrypt(content.getBytes(), publicKey); |
| | | // BASE64Encoder encoder = new BASE64Encoder(); |
| | | // return encoder.encode(output); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException("RSA加密失败: " + e.getMessage()); |
| | | // } |
| | | // } |
| | | //公钥加密 |
| | | public static byte[] encrypt(byte[] content, PublicKey publicKey) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");//java默认"RSA"="RSA/ECB/PKCS1Padding" |
| | | cipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | return cipher.doFinal(content); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA加密失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static String decryptRSA(String cipherText, String privateKey) { |
| | | return RSAUtil.decryptRSA(cipherText, RSAUtil.getPrivateKey(privateKey)); |
| | | } |
| | | |
| | | public static String decryptRSA(String cipherText, PrivateKey privateKey) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance("RSA"); |
| | | cipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | return new String(cipher.doFinal(Base64.decodeBase64(cipherText)), StandardCharsets.UTF_8); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA解密失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //私钥解密 |
| | | // public static String decrypt(String content, String privateKey) { |
| | | // return RSAUtil.decrypt(content, RSAUtil.getPrivateKey(privateKey)); |
| | | // } |
| | | // public static String decrypt(String content, PrivateKey privateKey) { |
| | | // try { |
| | | // byte[] buffer = RSAUtil.decrypt(content.getBytes(), privateKey); |
| | | // BASE64Encoder encoder = new BASE64Encoder(); |
| | | // return encoder.encode(buffer); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException("RSA解密失败: " + e.getMessage()); |
| | | // } |
| | | // } |
| | | //私钥解密 |
| | | public static byte[] decrypt(byte[] content, PrivateKey privateKey) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); |
| | | cipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | return cipher.doFinal(content); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA解密失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return LocalDateTimeUtil.toFormatString(dateTime, ConstantFactory.STR_DATE); |
| | | } |
| | | /** |
| | | * 获取当前时间戳 |
| | | */ |
| | | public static Long nowTimeStampSec() { |
| | | return Instant.now().getEpochSecond(); |
| | | } |
| | | /** |
| | | * 将dateTime格式化成时间字符串 |
| | | * @param date LocalDate对象 |
| | | * @param format 指定时间格式(例:yyyy-MM-dd) |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat; |
| | | |
| | | import com.lunhan.water.common.security.RSAUtil; |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.RandVerifyCode; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.Signature; |
| | | import java.util.Base64; |
| | | |
| | | public class WechatAuthorization { |
| | | public String schema; |
| | | public String merchantId; |
| | | public String certificateSerialNo; |
| | | public String privateKeyPath; |
| | | |
| | | public WechatAuthorization(String merchantId, String certificateSerialNo, String privateKeyPath) { |
| | | this.schema = "WECHATPAY2-SHA256-RSA2048"; |
| | | this.merchantId = merchantId; |
| | | this.certificateSerialNo = certificateSerialNo; |
| | | this.privateKeyPath = privateKeyPath; |
| | | } |
| | | |
| | | public WechatAuthorization(String schema, String merchantId, String certificateSerialNo, String privateKeyPath) { |
| | | this.schema = schema; |
| | | this.merchantId = merchantId; |
| | | this.certificateSerialNo = certificateSerialNo; |
| | | this.privateKeyPath = privateKeyPath; |
| | | } |
| | | |
| | | /** |
| | | * 构建授权信息 GET - getToken("GET", httpurl, ""); POST - getToken("POST", httpurl, json) |
| | | * @param method 请求方法 GET/POST |
| | | * @param url 请求接口地址 |
| | | * @param body 请求正文内容,GET请求传空字符串 |
| | | */ |
| | | public String getAuthorization(String method, String url, String body) { |
| | | return String.format("%s %s", schema, this.getToken(method, url, body)); |
| | | } |
| | | |
| | | // Authorization: <schema> <token> |
| | | // GET - getToken("GET", httpurl, "") |
| | | // POST - getToken("POST", httpurl, json) |
| | | String getToken(String method, String url, String body) { |
| | | String nonceStr = RandVerifyCode.complexCode(8); |
| | | long timestamp = LocalDateTimeUtil.nowTimeStampSec(); |
| | | String message = buildMessage(method, url, timestamp, nonceStr, body); |
| | | String signature = sign(message.getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | return "mchid=\"" + merchantId + "\"," |
| | | + "nonce_str=\"" + nonceStr + "\"," |
| | | + "timestamp=\"" + timestamp + "\"," |
| | | + "serial_no=\"" + certificateSerialNo + "\"," |
| | | + "signature=\"" + signature + "\""; |
| | | } |
| | | |
| | | public String sign(byte[] message) { |
| | | try { |
| | | Signature sign = Signature.getInstance("SHA256withRSA"); |
| | | sign.initSign(RSAUtil.getPrivateKey(privateKeyPath)); |
| | | sign.update(message); |
| | | |
| | | return Base64.getEncoder().encodeToString(sign.sign()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("RSA错误: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | String buildMessage(String method, String url, long timestamp, String nonceStr, String body) { |
| | | return method + "\n" |
| | | + url + "\n" |
| | | + timestamp + "\n" |
| | | + nonceStr + "\n" |
| | | + body + "\n"; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.enums.EHttpContentType; |
| | | import com.lunhan.water.common.util.HttpUtil; |
| | | import com.lunhan.water.common.util.SerializeUtil; |
| | | import com.lunhan.water.common.util.StringUtil; |
| | | import com.lunhan.water.common.wechat.req.ReqCreateWechatPay; |
| | | import com.lunhan.water.common.wechat.req.ReqCreateWeiXinRefund; |
| | | import com.lunhan.water.common.wechat.res.ResWechatPrePay; |
| | | import com.lunhan.water.common.wechat.res.ResWeiXinRefund; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import javax.crypto.spec.GCMParameterSpec; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.InvalidAlgorithmParameterException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | public class WechatPayV3Util { |
| | | private static final String BASIC_API = "https://api.mch.weixin.qq.com"; |
| | | private static final int KEY_LENGTH_BYTE = 32; |
| | | private static final int TAG_LENGTH_BIT = 128; |
| | | |
| | | /** |
| | | * 解密 |
| | | * @param associatedData 附加数据 |
| | | * @param nonce 随机串 |
| | | * @param cipherText 数据密文 |
| | | * @param aesKey apiv3秘钥 |
| | | * @return 结果 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public static String decryptToString(byte[] associatedData, byte[] nonce, String cipherText,byte[] aesKey) throws Exception { |
| | | try { |
| | | if (aesKey.length != KEY_LENGTH_BYTE) { |
| | | throw new IllegalArgumentException("无效的ApiV3Key,长度必须为32个字节"); |
| | | } |
| | | |
| | | Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); |
| | | |
| | | SecretKeySpec key = new SecretKeySpec(aesKey, "AES"); |
| | | GCMParameterSpec spec = new GCMParameterSpec(TAG_LENGTH_BIT, nonce); |
| | | |
| | | cipher.init(Cipher.DECRYPT_MODE, key, spec); |
| | | if(associatedData != null && associatedData.length > 0) { |
| | | cipher.updateAAD(associatedData); |
| | | }else { |
| | | cipher.updateAAD("".getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | |
| | | return new String(cipher.doFinal(Base64.decodeBase64(cipherText)), StandardCharsets.UTF_8); |
| | | |
| | | } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { |
| | | throw new IllegalStateException(e); |
| | | } catch (InvalidKeyException | InvalidAlgorithmParameterException e) { |
| | | throw new IllegalArgumentException(e); |
| | | } |
| | | } |
| | | |
| | | public static ExecutedResult<String> createPay(ReqCreateWechatPay request, WechatAuthorization auth) { |
| | | String url = "/v3/pay/transactions/jsapi"; |
| | | |
| | | String body = SerializeUtil.toJson(request); |
| | | |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Authorization", auth.getAuthorization("POST", url, body)); |
| | | headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"); |
| | | headers.put("Accept", "text/html,application/xhtml+xml,application/xml,application/json;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"); |
| | | |
| | | String response = null; |
| | | try { |
| | | response = HttpUtil.doPost(BASIC_API + url, body, EHttpContentType.JSON, headers); |
| | | } catch (Exception e) { |
| | | return ExecutedResult.failed("微信支付发起支付失败: " + e.getMessage()); |
| | | } |
| | | ResWechatPrePay result = SerializeUtil.toObject(response, ResWechatPrePay.class); |
| | | if (Objects.isNull(result) || StringUtil.isNullOrEmpty(result.getPrepayId())) { |
| | | return ExecutedResult.failed("微信支付返回报文无法解析: " + response); |
| | | } |
| | | return ExecutedResult.success(result.getPrepayId()); |
| | | } |
| | | |
| | | public static ExecutedResult<ResWeiXinRefund> createRefund(ReqCreateWeiXinRefund request, WechatAuthorization auth) { |
| | | String url = "/v3/refund/domestic/refunds"; |
| | | |
| | | String body = SerializeUtil.toJson(request); |
| | | |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Authorization", auth.getAuthorization("POST", url, body)); |
| | | headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"); |
| | | headers.put("Accept", "text/html,application/xhtml+xml,application/xml,application/json;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"); |
| | | |
| | | String response = null; |
| | | try { |
| | | response = HttpUtil.doPost(BASIC_API + url, body, EHttpContentType.JSON, headers); |
| | | } catch (Exception e) { |
| | | return ExecutedResult.failed("微信支付发起退款失败: " + e.getMessage()); |
| | | } |
| | | ResWeiXinRefund result = SerializeUtil.toObject(response, ResWeiXinRefund.class); |
| | | if (Objects.isNull(result) || StringUtil.isNullOrEmpty(result.getRefund_id())) { |
| | | return ExecutedResult.failed("微信支付返回报文无法解析: " + response); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.req; |
| | | |
| | | public class CreatePay_Amount { |
| | | /** |
| | | * 订单总金额,单位为分 示例值:100 |
| | | */ |
| | | private Long total; |
| | | |
| | | public Long getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(Long total) { |
| | | this.total = total; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.req; |
| | | |
| | | public class CreatePay_Payer { |
| | | /** |
| | | * 用户在直连商户appid下的唯一标识。 下单前需获取到用户的Openid 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o |
| | | */ |
| | | private String openid; |
| | | |
| | | public String getOpenid() { |
| | | return openid; |
| | | } |
| | | |
| | | public void setOpenid(String openid) { |
| | | this.openid = openid; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.req; |
| | | |
| | | public class ReqCreateWechatPay { |
| | | /** |
| | | * 应用ID 示例值:wxd678efh567hg6787 |
| | | */ |
| | | private String appid; |
| | | /** |
| | | * 直连商户号 示例值:1230000109 |
| | | */ |
| | | private String mchid; |
| | | /** |
| | | * 商品描述 示例值:Image形象店-深圳腾大-QQ公仔 |
| | | */ |
| | | private String description; |
| | | /** |
| | | * 商户订单号 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一 |
| | | */ |
| | | private String out_trade_no; |
| | | /** |
| | | * 异步接收微信支付结果通知的回调地址,通知url必须为外网可访问的url,不能携带参数。 公网域名必须为https |
| | | */ |
| | | private String notify_url; |
| | | /** |
| | | * 订单金额信息 |
| | | */ |
| | | private CreatePay_Amount amount; |
| | | /** |
| | | * 支付者信息 |
| | | */ |
| | | private CreatePay_Payer payer; |
| | | |
| | | public String getAppid() { |
| | | return appid; |
| | | } |
| | | |
| | | public void setAppid(String appid) { |
| | | this.appid = appid; |
| | | } |
| | | |
| | | public String getMchid() { |
| | | return mchid; |
| | | } |
| | | |
| | | public void setMchid(String mchid) { |
| | | this.mchid = mchid; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getOut_trade_no() { |
| | | return out_trade_no; |
| | | } |
| | | |
| | | public void setOut_trade_no(String out_trade_no) { |
| | | this.out_trade_no = out_trade_no; |
| | | } |
| | | |
| | | public String getNotify_url() { |
| | | return notify_url; |
| | | } |
| | | |
| | | public void setNotify_url(String notify_url) { |
| | | this.notify_url = notify_url; |
| | | } |
| | | |
| | | public CreatePay_Amount getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(CreatePay_Amount amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | | public CreatePay_Payer getPayer() { |
| | | return payer; |
| | | } |
| | | |
| | | public void setPayer(CreatePay_Payer payer) { |
| | | this.payer = payer; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.req; |
| | | |
| | | public class ReqCreateWeiXinRefund { |
| | | /** |
| | | * 【微信支付订单号】 原支付交易对应的微信订单号,与out_trade_no二选一 |
| | | */ |
| | | private String transaction_id; |
| | | |
| | | /** |
| | | * 【商户退款单号】 商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。 |
| | | */ |
| | | private String out_refund_no; |
| | | |
| | | /** |
| | | * 【退款原因】 若商户传入,会在下发给用户的退款消息中体现退款原因 |
| | | */ |
| | | private String reason; |
| | | |
| | | /** |
| | | * 退款结果回调url】 异步接收微信支付退款结果通知的回调地址,通知url必须为外网可访问的url,不能携带参数。 如果参数中传了notify_url,则商户平台上配置的回调地址将不会生效,优先回调当前传的这个地址 |
| | | */ |
| | | private String notify_url; |
| | | |
| | | /** |
| | | * 【金额信息】 订单金额信息 |
| | | */ |
| | | private WeiXinRefund_Amount amount; |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | public String getOut_refund_no() { |
| | | return out_refund_no; |
| | | } |
| | | |
| | | public void setOut_refund_no(String out_refund_no) { |
| | | this.out_refund_no = out_refund_no; |
| | | } |
| | | |
| | | public String getReason() { |
| | | return reason; |
| | | } |
| | | |
| | | public void setReason(String reason) { |
| | | this.reason = reason; |
| | | } |
| | | |
| | | public String getNotify_url() { |
| | | return notify_url; |
| | | } |
| | | |
| | | public void setNotify_url(String notify_url) { |
| | | this.notify_url = notify_url; |
| | | } |
| | | |
| | | public WeiXinRefund_Amount getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(WeiXinRefund_Amount amount) { |
| | | this.amount = amount; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.req; |
| | | |
| | | public class WeiXinRefund_Amount { |
| | | /** |
| | | * 【退款金额】 退款金额,单位为分,只能为整数,不能超过原订单支付金额 |
| | | */ |
| | | private Integer refund; |
| | | |
| | | /** |
| | | * 【原订单金额】 原支付交易的订单总金额,单位为分,只能为整数 |
| | | */ |
| | | private Integer total; |
| | | |
| | | /** |
| | | * 【退款币种】 符合ISO 4217标准的三位字母代码,目前只支持人民币:CNY |
| | | */ |
| | | private String currency; |
| | | |
| | | public Integer getRefund() { |
| | | return refund; |
| | | } |
| | | |
| | | public void setRefund(Integer refund) { |
| | | this.refund = refund; |
| | | } |
| | | |
| | | public Integer getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(Integer total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public String getCurrency() { |
| | | return currency; |
| | | } |
| | | |
| | | public void setCurrency(String currency) { |
| | | this.currency = currency; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.res; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | |
| | | public class ResWechatPrePay { |
| | | @JsonProperty("prepay_id") |
| | | private String prepayId; |
| | | |
| | | public String getPrepayId() { |
| | | return prepayId; |
| | | } |
| | | |
| | | public void setPrepayId(String prepayId) { |
| | | this.prepayId = prepayId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.common.wechat.res; |
| | | |
| | | public class ResWeiXinRefund { |
| | | /** |
| | | * 【微信支付退款号】 微信支付退款号 |
| | | */ |
| | | private String refund_id; |
| | | |
| | | /** |
| | | * 【商户退款单号】 商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔 |
| | | */ |
| | | private String out_refund_no; |
| | | |
| | | /** |
| | | * 【微信支付订单号】 微信支付交易订单号 |
| | | */ |
| | | private String transaction_id; |
| | | |
| | | /** |
| | | * 【退款渠道】 退款渠道 ORIGINAL:原路退款,BALANCE:退回到余额,OTHER_BALANCE:原账户异常退到其他余额账户,OTHER_BANKCARD:原银行卡异常退到其他银行卡 |
| | | */ |
| | | private String channel; |
| | | |
| | | /** |
| | | * 【退款入账账户】 取当前退款单的退款入账方,有以下几种情况: |
| | | * 1)退回银行卡:{银行名称}{卡类型}{卡尾号} |
| | | * 2)退回支付用户零钱:支付用户零钱 |
| | | * 3)退还商户:商户基本账户商户结算银行账户 |
| | | * 4)退回支付用户零钱通:支付用户零钱通 |
| | | */ |
| | | private String user_received_account; |
| | | |
| | | /** |
| | | * 【退款创建时间】 退款受理时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒 |
| | | */ |
| | | private String create_time; |
| | | |
| | | /** |
| | | * 【退款成功时间】 退款成功时间,退款状态status为SUCCESS(退款成功)时,返回该字段。遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒 |
| | | */ |
| | | private String success_time; |
| | | |
| | | /** |
| | | * 【退款状态】 退款到银行发现用户的卡作废或者冻结了,导致原路退款银行卡失败,可前往商户平台(pay.weixin.qq.com)-交易中心,手动处理此笔退款。 |
| | | * 可选取值: |
| | | * SUCCESS: 退款成功 |
| | | * CLOSED: 退款关闭 |
| | | * PROCESSING: 退款处理中 |
| | | * ABNORMAL: 退款异常 |
| | | */ |
| | | private String status; |
| | | |
| | | public String getRefund_id() { |
| | | return refund_id; |
| | | } |
| | | |
| | | public void setRefund_id(String refund_id) { |
| | | this.refund_id = refund_id; |
| | | } |
| | | |
| | | public String getOut_refund_no() { |
| | | return out_refund_no; |
| | | } |
| | | |
| | | public void setOut_refund_no(String out_refund_no) { |
| | | this.out_refund_no = out_refund_no; |
| | | } |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | public String getChannel() { |
| | | return channel; |
| | | } |
| | | |
| | | public void setChannel(String channel) { |
| | | this.channel = channel; |
| | | } |
| | | |
| | | public String getUser_received_account() { |
| | | return user_received_account; |
| | | } |
| | | |
| | | public void setUser_received_account(String user_received_account) { |
| | | this.user_received_account = user_received_account; |
| | | } |
| | | |
| | | public String getCreate_time() { |
| | | return create_time; |
| | | } |
| | | |
| | | public void setCreate_time(String create_time) { |
| | | this.create_time = create_time; |
| | | } |
| | | |
| | | public String getSuccess_time() { |
| | | return success_time; |
| | | } |
| | | |
| | | public void setSuccess_time(String success_time) { |
| | | this.success_time = success_time; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | public enum EBusinessType { |
| | | /** |
| | | * 充值=1, |
| | | */ |
| | | RECHARGE("充值", 1), |
| | | /** |
| | | * 送水=2, |
| | | */ |
| | | WATER_DELIVERY("送水", 2), |
| | | |
| | | /** |
| | | * 消费=3消费, |
| | | */ |
| | | CONSUMPTION("消费", 3), |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | EBusinessType(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | * @return |
| | | */ |
| | | public static EBusinessType getByValue(Integer value) { |
| | | return Arrays.stream(EBusinessType.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EBusinessType{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 资金变动枚举 |
| | | */ |
| | | public enum ECapitalChange { |
| | | COUNTER_Recharge("充值", "data-center-service", 100), |
| | | MOBILE_Recharge("充值", "移动端充值", 101), |
| | | WATER_BILL_COUNTER_PAY("消费", "购水消费", 200), |
| | | // WATER_BILL_MOBILE_PAY("水费缴费", "水费移动端缴费", 201) |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | ECapitalChange(String name, String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | */ |
| | | public static ECapitalChange getByValue(Integer value) { |
| | | return Arrays.stream(ECapitalChange.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ECapitalChange{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 支付状态枚举 待支付=10,支付中=20,支付成功=200,部分退款=220,支付失败=300,支付取消=400,全额退款=420 |
| | | */ |
| | | public enum EPayState { |
| | | /** |
| | | * 待支付=10, |
| | | */ |
| | | WAITING("待支付", 10), |
| | | |
| | | /** |
| | | * 支付中=20, |
| | | */ |
| | | PAYING("支付中", 20), |
| | | |
| | | /** |
| | | * 支付成功=200, |
| | | */ |
| | | SUCCESS("支付成功", 200), |
| | | |
| | | /** |
| | | * 部分退款=220, |
| | | */ |
| | | PART_REFUND("部分退款", 220), |
| | | |
| | | /** |
| | | * 支付失败=300, |
| | | */ |
| | | FAILED("支付失败", 300), |
| | | |
| | | /** |
| | | * 支付取消=400, |
| | | */ |
| | | CANCELED("支付取消", 400), |
| | | |
| | | /** |
| | | * 全额退款=420, |
| | | */ |
| | | REFUND("全额退款", 420), |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | EPayState(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | * @return |
| | | */ |
| | | public static EPayState getByValue(Integer value) { |
| | | return Arrays.stream(EPayState.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EPayState{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | public enum EPayType { |
| | | CASH_PAY("现金", 1), |
| | | WX_PAY("微信", 2), |
| | | ALI_PAY("支付宝", 3), |
| | | BALANCE("余额", 4) |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | EPayType(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | */ |
| | | public static EPayType getByValue(Integer value) { |
| | | return Arrays.stream(EPayType.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EPayType{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | public enum EPayWay { |
| | | /** |
| | | * App=1, |
| | | */ |
| | | APP("App", 1), |
| | | /** |
| | | * Web=2, |
| | | */ |
| | | WEB("Web", 2), |
| | | /** |
| | | * H5=3, |
| | | */ |
| | | H5("H5", 3), |
| | | /** |
| | | * SDK=4, |
| | | */ |
| | | SDK("SDK", 4), |
| | | /** |
| | | * 扫码(静态)=5, |
| | | */ |
| | | SCAN_STATIC("扫码(静态)", 5), |
| | | /** |
| | | * 扫码(动态)=6, |
| | | */ |
| | | SCAN_DYNAMIC("扫码(动态)", 6), |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | EPayWay(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | * @return |
| | | */ |
| | | public static EPayWay getByValue(Integer value) { |
| | | return Arrays.stream(EPayWay.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EPayWay{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | public enum EPaymentChannel { |
| | | /** |
| | | * 微信=10010, |
| | | */ |
| | | WE_CHAT("微信", 10010), |
| | | /** |
| | | * 支付宝=10020, |
| | | */ |
| | | ALI_PAY("支付宝", 10020), |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | EPaymentChannel(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | * @return |
| | | */ |
| | | public static EPaymentChannel getByValue(Integer value) { |
| | | return Arrays.stream(EPaymentChannel.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "EPaymentChannel{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 充值类型 |
| | | */ |
| | | public enum ERechargeType { |
| | | COUNTER("柜台业务", 1), |
| | | MOBILE("移动端", 2) |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | ERechargeType(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | */ |
| | | public static ERechargeType getByValue(Integer value) { |
| | | return Arrays.stream(ERechargeType.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ERechargeType{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 退款状态枚举 待退款=10,退款中=20,退款成功=200,退款失败=300,退款取消=400 |
| | | */ |
| | | public enum ERefundState { |
| | | /** |
| | | * 待退款=10, |
| | | */ |
| | | WAITING("待退款", 10), |
| | | |
| | | /** |
| | | * 退款中=20, |
| | | */ |
| | | REFUNDING("退款中", 20), |
| | | |
| | | /** |
| | | * 退款成功=200, |
| | | */ |
| | | SUCCESS("退款成功", 200), |
| | | |
| | | /** |
| | | * 退款失败=300, |
| | | */ |
| | | FAILED("退款失败", 300), |
| | | |
| | | /** |
| | | * 退款取消=400, |
| | | */ |
| | | CANCELED("退款取消", 400) |
| | | ; |
| | | |
| | | /** |
| | | * 枚举描述 |
| | | */ |
| | | private String desc; |
| | | /** |
| | | * 枚举值 |
| | | */ |
| | | private Integer value; |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | /** |
| | | * 构造方法 |
| | | * @param desc 枚举描述 |
| | | * @param value 枚举值 |
| | | */ |
| | | ERefundState(String desc, Integer value) { |
| | | this.desc = desc; |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * 根据值获取枚举 |
| | | * |
| | | * @param value 枚举值 |
| | | * @return |
| | | */ |
| | | public static ERefundState getByValue(Integer value) { |
| | | return Arrays.stream(ERefundState.values()) |
| | | .filter(e -> Objects.equals(e.getValue(), value)) |
| | | .findAny() |
| | | .orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ERefundState{" + |
| | | "desc='" + desc + '\'' + |
| | | ", value=" + value + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | * 普通管理员=2, |
| | | */ |
| | | ADMIN_USER("普通管理员", 2), |
| | | |
| | | /** |
| | | * 普通用户=3, |
| | | */ |
| | | USER("普通用户", 3), |
| | | /** |
| | | * 客户会员=4, |
| | | */ |
| | | CUSTOMER_USER("客户会员", 4), |
| | | ; |
| | | ; |
| | | |
| | | private String desc;//枚举描述 |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.request.pay; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AlipayBean { |
| | | /** |
| | | * 商户订单号,必填 |
| | | * |
| | | */ |
| | | private String out_trade_no; |
| | | /** |
| | | * 订单名称,必填 |
| | | */ |
| | | private String subject; |
| | | /** |
| | | * 付款金额,必填 |
| | | * 根据支付宝接口协议,必须使用下划线 |
| | | */ |
| | | private String total_amount; |
| | | /** |
| | | * 商品描述,可空 |
| | | */ |
| | | private String body; |
| | | /** |
| | | * 超时时间参数 |
| | | */ |
| | | private String timeout_express= "15m"; |
| | | /** |
| | | * 产品编号 |
| | | */ |
| | | private String product_code= "FAST_INSTANT_TRADE_PAY"; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.request.pay; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ReqCreatePay { |
| | | /** |
| | | * 业务类型 EBusinessType(1充值 2送水 3购水) |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 微信用户标识openid |
| | | */ |
| | | private String wechatOpenid; |
| | | |
| | | /** |
| | | * 交易金额 |
| | | */ |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 业务描述(当商户支持时,此项为支付时展示的商品描述) |
| | | */ |
| | | private String businessComment; |
| | | |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | private String facilityCode; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.request.pay; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | @Data |
| | | public class ReqOrderPay { |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 业务类型 EBusinessType(1充值 2送水 3购水) |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | private BigDecimal payAmount; |
| | | /** |
| | | * 业务描述(当商户支持时,此项为支付时展示的商品描述) |
| | | */ |
| | | private String businessComment; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.request.pay; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ReqPayRefund { |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 业务描述(当商户支持时,此项为展示的退款原因) |
| | | */ |
| | | private String businessComment; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.paymentrecords; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreatePaymentRecords { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | private String facilityCode; |
| | | /** |
| | | * 消费金额 |
| | | */ |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 本次出水量(单位ml) |
| | | */ |
| | | private BigDecimal waterAmount; |
| | | /** |
| | | * 本次出水秒数 |
| | | */ |
| | | private BigDecimal waterSeconds; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 缴费状态 EBillPayStatus |
| | | */ |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private String payTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.paymentrecords; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyPaymentRecords { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | private String facilityCode; |
| | | /** |
| | | * 消费金额 |
| | | */ |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 本次出水量(单位ml) |
| | | */ |
| | | private BigDecimal waterAmount; |
| | | /** |
| | | * 本次出水秒数 |
| | | */ |
| | | private BigDecimal waterSeconds; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 缴费状态 EBillPayStatus |
| | | */ |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private String payTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.rechargeorder; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateRechargeOrder { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 订单金额 |
| | | */ |
| | | private BigDecimal orderAmount; |
| | | /** |
| | | * 折扣金额 |
| | | */ |
| | | private BigDecimal discountAmount; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 支付类型 1现金 2微信 3支付宝 4余额 |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private Long payTime; |
| | | /** |
| | | * 状态10待支付 20支付中 200完成支付 300支付失败 |
| | | */ |
| | | private Integer payState; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.rechargeorder; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyRechargeOrder { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | private String orderNo; |
| | | /** |
| | | * 订单金额 |
| | | */ |
| | | private BigDecimal orderAmount; |
| | | /** |
| | | * 折扣金额 |
| | | */ |
| | | private BigDecimal discountAmount; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 支付类型 1现金 2微信 3支付宝 4余额 |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private Long payTime; |
| | | /** |
| | | * 状态10待支付 20支付中 200完成支付 300支付失败 |
| | | */ |
| | | private Integer payState; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.rechargerecords; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateRechargeRecords { |
| | | /** |
| | | * 充值订单号 |
| | | */ |
| | | private String rechargeOrder; |
| | | /** |
| | | * 充值类型 |
| | | */ |
| | | private String rechargeType; |
| | | /** |
| | | * 支付方式 |
| | | */ |
| | | private String paymentMethod; |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | private BigDecimal rechargeAmount; |
| | | /** |
| | | * 充值状态(0=未充值,1=已充值) |
| | | */ |
| | | private Integer rechargeStatus; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.rechargerecords; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyRechargeRecords { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 充值订单号 |
| | | */ |
| | | private String rechargeOrder; |
| | | /** |
| | | * 充值类型 |
| | | */ |
| | | private String rechargeType; |
| | | /** |
| | | * 支付方式 |
| | | */ |
| | | private String paymentMethod; |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | private BigDecimal rechargeAmount; |
| | | /** |
| | | * 充值状态(0=未充值,1=已充值) |
| | | */ |
| | | private Integer rechargeStatus; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.refundrecord; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateRefundRecord { |
| | | /** |
| | | * 退款流水号 |
| | | */ |
| | | private String refundNo; |
| | | /** |
| | | * 原交易流水号 |
| | | */ |
| | | private String tradeNo; |
| | | /** |
| | | * 原交易总金额 |
| | | */ |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 本次退款金额 |
| | | */ |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述 |
| | | */ |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | private String payWayName; |
| | | /** |
| | | * 回调地址配置 |
| | | */ |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | private String thirdRefundNo; |
| | | /** |
| | | * 业务回调地址配置 |
| | | */ |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 退款发起时间 |
| | | */ |
| | | private Long submitTime; |
| | | /** |
| | | * 退款发起时间展示 |
| | | */ |
| | | private String submitTimeView; |
| | | /** |
| | | * 退款通知时间 |
| | | */ |
| | | private Long notifyTime; |
| | | /** |
| | | * 退款通知时间展示 |
| | | */ |
| | | private String notifyTimeView; |
| | | /** |
| | | * 退款成功时间 |
| | | */ |
| | | private Long refundTime; |
| | | /** |
| | | * 退款成功时间展示 |
| | | */ |
| | | private String refundTimeView; |
| | | /** |
| | | * 实际退款金额 |
| | | */ |
| | | private BigDecimal thirdRefundAmount; |
| | | /** |
| | | * 退款关闭时间 |
| | | */ |
| | | private Long closedTime; |
| | | /** |
| | | * 退款关闭时间展示 |
| | | */ |
| | | private String closedTimeView; |
| | | /** |
| | | * 退款关闭说明 |
| | | */ |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 状态(ERefundState) 待退款=10,退款中=20,退款成功=200,退款失败=300,退款取消=400 |
| | | */ |
| | | private Integer refundState; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.refundrecord; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyRefundRecord { |
| | | /** |
| | | * 自增id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 退款流水号 |
| | | */ |
| | | private String refundNo; |
| | | /** |
| | | * 原交易流水号 |
| | | */ |
| | | private String tradeNo; |
| | | /** |
| | | * 原交易总金额 |
| | | */ |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 本次退款金额 |
| | | */ |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述 |
| | | */ |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | private String payWayName; |
| | | /** |
| | | * 回调地址配置 |
| | | */ |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | private String thirdRefundNo; |
| | | /** |
| | | * 业务回调地址配置 |
| | | */ |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 退款发起时间 |
| | | */ |
| | | private Long submitTime; |
| | | /** |
| | | * 退款发起时间展示 |
| | | */ |
| | | private String submitTimeView; |
| | | /** |
| | | * 退款通知时间 |
| | | */ |
| | | private Long notifyTime; |
| | | /** |
| | | * 退款通知时间展示 |
| | | */ |
| | | private String notifyTimeView; |
| | | /** |
| | | * 退款成功时间 |
| | | */ |
| | | private Long refundTime; |
| | | /** |
| | | * 退款成功时间展示 |
| | | */ |
| | | private String refundTimeView; |
| | | /** |
| | | * 实际退款金额 |
| | | */ |
| | | private BigDecimal thirdRefundAmount; |
| | | /** |
| | | * 退款关闭时间 |
| | | */ |
| | | private Long closedTime; |
| | | /** |
| | | * 退款关闭时间展示 |
| | | */ |
| | | private String closedTimeView; |
| | | /** |
| | | * 退款关闭说明 |
| | | */ |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 状态(ERefundState) 待退款=10,退款中=20,退款成功=200,退款失败=300,退款取消=400 |
| | | */ |
| | | private Integer refundState; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.sysregion; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateSysRegion { |
| | | /** |
| | | * 行政代码 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 上级行政代码 |
| | | */ |
| | | private String parentCode; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 简称 |
| | | */ |
| | | private String shortName; |
| | | /** |
| | | * 邮政编码 |
| | | */ |
| | | private String zipCode; |
| | | /** |
| | | * 区号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 层级 |
| | | */ |
| | | private Integer level; |
| | | /** |
| | | * 拼音 |
| | | */ |
| | | private String pinYin; |
| | | /** |
| | | * 拼音简写 |
| | | */ |
| | | private String pinYinShort; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private BigDecimal lng; |
| | | /** |
| | | * 维度 |
| | | */ |
| | | private BigDecimal lat; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.sysregion; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifySysRegion { |
| | | /** |
| | | * 主键Id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 行政代码 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 上级行政代码 |
| | | */ |
| | | private String parentCode; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 简称 |
| | | */ |
| | | private String shortName; |
| | | /** |
| | | * 邮政编码 |
| | | */ |
| | | private String zipCode; |
| | | /** |
| | | * 区号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 层级 |
| | | */ |
| | | private Integer level; |
| | | /** |
| | | * 拼音 |
| | | */ |
| | | private String pinYin; |
| | | /** |
| | | * 拼音简写 |
| | | */ |
| | | private String pinYinShort; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private BigDecimal lng; |
| | | /** |
| | | * 维度 |
| | | */ |
| | | private BigDecimal lat; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.traderecord; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateTradeRecord { |
| | | /** |
| | | * 交易流水号 |
| | | */ |
| | | private String tradeNo; |
| | | /** |
| | | * 交易金额 |
| | | */ |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述(如果商户支持,此项将作为支付时展示的商品名) |
| | | */ |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | private String payWayName; |
| | | /** |
| | | * 第三方支付回调地址 |
| | | */ |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | private String thirdTradeNo; |
| | | /** |
| | | * 业务回调地址 |
| | | */ |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 交易发起时间 |
| | | */ |
| | | private Long submitTime; |
| | | /** |
| | | * 交易发起时间展示 |
| | | */ |
| | | private String submitTimeView; |
| | | /** |
| | | * 交易通知时间 |
| | | */ |
| | | private Long notifyTime; |
| | | /** |
| | | * 交易通知时间展示 |
| | | */ |
| | | private String notifyTimeView; |
| | | /** |
| | | * 交易成功时间 |
| | | */ |
| | | private Long paidTime; |
| | | /** |
| | | * 交易成功时间展示 |
| | | */ |
| | | private String paidTimeView; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | private BigDecimal paidAmount; |
| | | /** |
| | | * 交易关闭时间 |
| | | */ |
| | | private Long closedTime; |
| | | /** |
| | | * 交易关闭时间展示 |
| | | */ |
| | | private String closedTimeView; |
| | | /** |
| | | * 交易关闭说明 |
| | | */ |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 状态(EPayState) 待支付=10,支付中=20,支付成功=200,部分退款=220,支付失败=300,支付取消=400,全额退款=420 |
| | | */ |
| | | private Integer payState; |
| | | /** |
| | | * 是否能退款 不可退款=0,可退款=1 |
| | | */ |
| | | private Integer canRefund; |
| | | /** |
| | | * 已退款金额 |
| | | */ |
| | | private BigDecimal refundAmount; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.traderecord; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyTradeRecord { |
| | | /** |
| | | * 自增id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 交易流水号 |
| | | */ |
| | | private String tradeNo; |
| | | /** |
| | | * 交易金额 |
| | | */ |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述(如果商户支持,此项将作为支付时展示的商品名) |
| | | */ |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | private String payWayName; |
| | | /** |
| | | * 第三方支付回调地址 |
| | | */ |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | private String thirdTradeNo; |
| | | /** |
| | | * 业务回调地址 |
| | | */ |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 交易发起时间 |
| | | */ |
| | | private Long submitTime; |
| | | /** |
| | | * 交易发起时间展示 |
| | | */ |
| | | private String submitTimeView; |
| | | /** |
| | | * 交易通知时间 |
| | | */ |
| | | private Long notifyTime; |
| | | /** |
| | | * 交易通知时间展示 |
| | | */ |
| | | private String notifyTimeView; |
| | | /** |
| | | * 交易成功时间 |
| | | */ |
| | | private Long paidTime; |
| | | /** |
| | | * 交易成功时间展示 |
| | | */ |
| | | private String paidTimeView; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | private BigDecimal paidAmount; |
| | | /** |
| | | * 交易关闭时间 |
| | | */ |
| | | private Long closedTime; |
| | | /** |
| | | * 交易关闭时间展示 |
| | | */ |
| | | private String closedTimeView; |
| | | /** |
| | | * 交易关闭说明 |
| | | */ |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * 状态(EPayState) 待支付=10,支付中=20,支付成功=200,部分退款=220,支付失败=300,支付取消=400,全额退款=420 |
| | | */ |
| | | private Integer payState; |
| | | /** |
| | | * 是否能退款 不可退款=0,可退款=1 |
| | | */ |
| | | private Integer canRefund; |
| | | /** |
| | | * 已退款金额 |
| | | */ |
| | | private BigDecimal refundAmount; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.usercapitalchange; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateUserCapitalChange { |
| | | /** |
| | | * 所属用户 |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 所属用户户号 |
| | | */ |
| | | private String userCode; |
| | | /** |
| | | * 变动业务 ECapitalChange |
| | | */ |
| | | private Integer business; |
| | | /** |
| | | * 变动业务名称 |
| | | */ |
| | | private String businessName; |
| | | /** |
| | | * 业务唯一标识 |
| | | */ |
| | | private String businessCode; |
| | | /** |
| | | * 变动前余额 |
| | | */ |
| | | private BigDecimal beforeMoney; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | private BigDecimal changeMoney; |
| | | /** |
| | | * 变动后余额 |
| | | */ |
| | | private BigDecimal afterMoney; |
| | | /** |
| | | * 描述 |
| | | */ |
| | | private String description; |
| | | /** |
| | | * 用户所属水卡编号 |
| | | */ |
| | | private String userCardNumber; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.usercapitalchange; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyUserCapitalChange { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 所属用户 |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 所属用户户号 |
| | | */ |
| | | private String userCode; |
| | | /** |
| | | * 变动业务 ECapitalChange |
| | | */ |
| | | private Integer business; |
| | | /** |
| | | * 变动业务名称 |
| | | */ |
| | | private String businessName; |
| | | /** |
| | | * 业务唯一标识 |
| | | */ |
| | | private String businessCode; |
| | | /** |
| | | * 变动前余额 |
| | | */ |
| | | private BigDecimal beforeMoney; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | private BigDecimal changeMoney; |
| | | /** |
| | | * 变动后余额 |
| | | */ |
| | | private BigDecimal afterMoney; |
| | | /** |
| | | * 描述 |
| | | */ |
| | | private String description; |
| | | /** |
| | | * 用户所属水卡编号 |
| | | */ |
| | | private String userCardNumber; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.userlogin; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqCreateUserLogin { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 支付密码 |
| | | */ |
| | | private String paymentPassword; |
| | | /** |
| | | * 微信open id |
| | | */ |
| | | private String wxOpenId; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 头像地址 |
| | | */ |
| | | private String headImg; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.entity.request.userlogin; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class ReqModifyUserLogin { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 支付密码 |
| | | */ |
| | | private String paymentPassword; |
| | | /** |
| | | * 微信open id |
| | | */ |
| | | private String wxOpenId; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 头像地址 |
| | | */ |
| | | private String headImg; |
| | | /** |
| | | * 状态 EState |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String comment; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.response.region; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class ResBasicRegionTree { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 父级编码 |
| | | */ |
| | | private String parentCode; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 简称 |
| | | */ |
| | | private String shortName; |
| | | /** |
| | | * 层级 |
| | | */ |
| | | private Integer level; |
| | | /** |
| | | * 拼音 |
| | | */ |
| | | private String pinYin; |
| | | /** |
| | | * 拼音简写 |
| | | */ |
| | | private String pinYinShort; |
| | | /** |
| | | * 父级ID |
| | | */ |
| | | private String parentId; |
| | | /** |
| | | * 子级列表 |
| | | */ |
| | | private List<ResBasicRegionTree> children; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getParentCode() { |
| | | return parentCode; |
| | | } |
| | | |
| | | public void setParentCode(String parentCode) { |
| | | this.parentCode = parentCode; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getShortName() { |
| | | return shortName; |
| | | } |
| | | |
| | | public void setShortName(String shortName) { |
| | | this.shortName = shortName; |
| | | } |
| | | |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public String getPinYin() { |
| | | return pinYin; |
| | | } |
| | | |
| | | public void setPinYin(String pinYin) { |
| | | this.pinYin = pinYin; |
| | | } |
| | | |
| | | public String getPinYinShort() { |
| | | return pinYinShort; |
| | | } |
| | | |
| | | public void setPinYinShort(String pinYinShort) { |
| | | this.pinYinShort = pinYinShort; |
| | | } |
| | | |
| | | public String getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(String parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public List<ResBasicRegionTree> getChildren() { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<ResBasicRegionTree> children) { |
| | | this.children = children; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.response.region; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | @Data |
| | | public class ResRegionTree { |
| | | /** |
| | | * id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 编码 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 简称 |
| | | */ |
| | | private String shortName; |
| | | /** |
| | | * 层级 |
| | | */ |
| | | private Integer level; |
| | | /** |
| | | * 拼音 |
| | | */ |
| | | private String pinYin; |
| | | /** |
| | | * 拼音简写 |
| | | */ |
| | | private String pinYinShort; |
| | | /** |
| | | * 父级编码 |
| | | */ |
| | | private String parentCode; |
| | | /** |
| | | * 子级列表 |
| | | */ |
| | | private List<ResRegionTree> children; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchPaymentRecords extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchRechargeOrder extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchRechargeRecords extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchRefundRecord extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchSysRegion extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchTradeRecord extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchUserCapitalChange extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.search; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SearchUserLogin extends SearchBasicDTO { |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.weixin; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AccessTokenDto { |
| | | private String access_token; |
| | | private String expires_in; |
| | | private String refresh_token; |
| | | private String openid; |
| | | private String scope; |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.entity.weixin; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class WeiXinUserDto { |
| | | /** |
| | | * 用户的唯一标识 |
| | | */ |
| | | private String openId; |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 |
| | | */ |
| | | private String sex; |
| | | /** |
| | | * 用户个人资料填写的省份 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 普通用户个人资料填写的城市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 国家,如中国为CN |
| | | */ |
| | | private String country; |
| | | /** |
| | | * 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。若用户更换头像,原有头像URL将失效。 |
| | | */ |
| | | private String headImgUrl; |
| | | /** |
| | | * 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom) |
| | | */ |
| | | private List<String> privilege; |
| | | /** |
| | | * 只有在用户将公众号绑定到微信开放平台账号后,才会出现该字段。 |
| | | */ |
| | | private String unionId; |
| | | |
| | | public String getOpenId() { |
| | | return openId; |
| | | } |
| | | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getProvince() { |
| | | return province; |
| | | } |
| | | |
| | | public void setProvince(String province) { |
| | | this.province = province; |
| | | } |
| | | |
| | | public String getCity() { |
| | | return city; |
| | | } |
| | | |
| | | public void setCity(String city) { |
| | | this.city = city; |
| | | } |
| | | |
| | | public String getCountry() { |
| | | return country; |
| | | } |
| | | |
| | | public void setCountry(String country) { |
| | | this.country = country; |
| | | } |
| | | |
| | | public String getHeadImgUrl() { |
| | | return headImgUrl; |
| | | } |
| | | |
| | | public void setHeadImgUrl(String headImgUrl) { |
| | | this.headImgUrl = headImgUrl; |
| | | } |
| | | |
| | | public List<String> getPrivilege() { |
| | | return privilege; |
| | | } |
| | | |
| | | public void setPrivilege(List<String> privilege) { |
| | | this.privilege = privilege; |
| | | } |
| | | |
| | | public String getUnionId() { |
| | | return unionId; |
| | | } |
| | | |
| | | public void setUnionId(String unionId) { |
| | | this.unionId = unionId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.PaymentRecordsService; |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqCreatePaymentRecords; |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqModifyPaymentRecords; |
| | | import com.lunhan.water.entity.search.SearchPaymentRecords; |
| | | import com.lunhan.water.repository.vo.PaymentRecordsVO; |
| | | |
| | | /** |
| | | * 9000.PaymentRecords |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "paymentRecords") |
| | | public class PaymentRecordsController extends BasicController { |
| | | @Autowired |
| | | private PaymentRecordsService service; |
| | | |
| | | /** |
| | | * 创建[null] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreatePaymentRecords request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[null] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyPaymentRecords request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[null]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[null] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<PaymentRecordsVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[null] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<PaymentRecordsVO>> search(@RequestBody SearchPaymentRecords request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.RechargeOrderService; |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqCreateRechargeOrder; |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqModifyRechargeOrder; |
| | | import com.lunhan.water.entity.search.SearchRechargeOrder; |
| | | import com.lunhan.water.repository.vo.RechargeOrderVO; |
| | | |
| | | /** |
| | | * 9000.用户充值订单 |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "rechargeOrder") |
| | | public class RechargeOrderController extends BasicController { |
| | | @Autowired |
| | | private RechargeOrderService service; |
| | | |
| | | /** |
| | | * 创建[用户充值订单] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateRechargeOrder request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[用户充值订单] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyRechargeOrder request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[用户充值订单]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[用户充值订单] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<RechargeOrderVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[用户充值订单] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<RechargeOrderVO>> search(@RequestBody SearchRechargeOrder request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.RechargeRecordsService; |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqCreateRechargeRecords; |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqModifyRechargeRecords; |
| | | import com.lunhan.water.entity.search.SearchRechargeRecords; |
| | | import com.lunhan.water.repository.vo.RechargeRecordsVO; |
| | | |
| | | /** |
| | | * 9000.充值记录 |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "rechargeRecords") |
| | | public class RechargeRecordsController extends BasicController { |
| | | @Autowired |
| | | private RechargeRecordsService service; |
| | | |
| | | /** |
| | | * 创建[充值记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateRechargeRecords request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[充值记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyRechargeRecords request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[充值记录]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[充值记录] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<RechargeRecordsVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[充值记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<RechargeRecordsVO>> search(@RequestBody SearchRechargeRecords request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.RefundRecordService; |
| | | import com.lunhan.water.entity.request.refundrecord.ReqCreateRefundRecord; |
| | | import com.lunhan.water.entity.request.refundrecord.ReqModifyRefundRecord; |
| | | import com.lunhan.water.entity.search.SearchRefundRecord; |
| | | import com.lunhan.water.repository.vo.RefundRecordVO; |
| | | |
| | | /** |
| | | * 9000.退款记录 |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "refundRecord") |
| | | public class RefundRecordController extends BasicController { |
| | | @Autowired |
| | | private RefundRecordService service; |
| | | |
| | | /** |
| | | * 创建[退款记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateRefundRecord request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[退款记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyRefundRecord request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[退款记录]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[退款记录] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<RefundRecordVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[退款记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<RefundRecordVO>> search(@RequestBody SearchRefundRecord request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.TradeRecordService; |
| | | import com.lunhan.water.entity.request.traderecord.ReqCreateTradeRecord; |
| | | import com.lunhan.water.entity.request.traderecord.ReqModifyTradeRecord; |
| | | import com.lunhan.water.entity.search.SearchTradeRecord; |
| | | import com.lunhan.water.repository.vo.TradeRecordVO; |
| | | |
| | | /** |
| | | * 9000.支付记录 |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "tradeRecord") |
| | | public class TradeRecordController extends BasicController { |
| | | @Autowired |
| | | private TradeRecordService service; |
| | | |
| | | /** |
| | | * 创建[支付记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateTradeRecord request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[支付记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyTradeRecord request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[支付记录]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[支付记录] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<TradeRecordVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[支付记录] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<TradeRecordVO>> search(@RequestBody SearchTradeRecord request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.host.BasicController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.lunhan.water.service.UserCapitalChangeService; |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqCreateUserCapitalChange; |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqModifyUserCapitalChange; |
| | | import com.lunhan.water.entity.search.SearchUserCapitalChange; |
| | | import com.lunhan.water.repository.vo.UserCapitalChangeVO; |
| | | |
| | | /** |
| | | * 9000.用户资金变动 |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "userCapitalChange") |
| | | public class UserCapitalChangeController extends BasicController { |
| | | @Autowired |
| | | private UserCapitalChangeService service; |
| | | |
| | | /** |
| | | * 创建[用户资金变动] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateUserCapitalChange request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[用户资金变动] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifyUserCapitalChange request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[用户资金变动]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[用户资金变动] |
| | | * @author lin.liu |
| | | */ |
| | | @GetMapping(value = "get/{id}") |
| | | public ExecutedResult<UserCapitalChangeVO> get(@PathVariable Long id) { |
| | | return service.get(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询[用户资金变动] |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<UserCapitalChangeVO>> search(@RequestBody SearchUserCapitalChange request) { |
| | | return service.search(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller.base; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.entity.request.sysregion.ReqCreateSysRegion; |
| | | import com.lunhan.water.entity.request.sysregion.ReqModifySysRegion; |
| | | import com.lunhan.water.entity.response.region.ResRegionTree; |
| | | import com.lunhan.water.entity.search.SearchSysRegion; |
| | | import com.lunhan.water.host.BasicController; |
| | | import com.lunhan.water.host.api.NonLogin; |
| | | import com.lunhan.water.repository.vo.SysRegionVO; |
| | | import com.lunhan.water.service.SysRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 06.统系行政地区 |
| | | * @author lin.liu |
| | | * @description 系统行政地区 |
| | | * @order 06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "sysRegion") |
| | | public class SysRegionController extends BasicController { |
| | | @Autowired |
| | | private SysRegionService service; |
| | | |
| | | /** |
| | | * 创建[系统行政地区] |
| | | * @author lin.liu |
| | | * @description 创建[系统行政地区] |
| | | */ |
| | | @PostMapping(value = "create") |
| | | public ExecutedResult<Long> create(@RequestBody ReqCreateSysRegion request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return this.service.create(request); |
| | | } |
| | | |
| | | /** |
| | | * 编辑[系统行政地区] |
| | | * @author lin.liu |
| | | * @description 编辑[系统行政地区] |
| | | */ |
| | | @PostMapping(value = "modify") |
| | | public ExecutedResult<String> modify(@RequestBody ReqModifySysRegion request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | // 必须大于0 |
| | | .addGreater(ParameterUtil.named("[系统行政地区]id"), request.getId(), 0L) |
| | | // 非空 |
| | | //.addNotNullOrEmpty(ParameterUtil.named("名称"), request.getName()) |
| | | // 限制最大长度 |
| | | //.addLengthMax(ParameterUtil.named("名称"), request.getName(), ConstantFactory.LENGTH_MAX50) |
| | | ; |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return this.service.modify(request); |
| | | } |
| | | |
| | | /** |
| | | * 获取[系统行政地区] |
| | | * @author lin.liu |
| | | * @description 获取[系统行政地区] |
| | | */ |
| | | @GetMapping(value = "get/{code}") |
| | | public ExecutedResult<SysRegionVO> get(@PathVariable String code) { |
| | | return this.service.get(code); |
| | | } |
| | | /** |
| | | * 根据id批量获取[系统行政地区] |
| | | * @author lin.liu |
| | | * @description 根据id批量获取[系统行政地区] |
| | | */ |
| | | @PostMapping(value = "getList") |
| | | public ExecutedResult<List<SysRegionVO>> getList(@RequestBody ReqListId request) { |
| | | return this.service.getList(request.getListId()); |
| | | } |
| | | |
| | | /** |
| | | * 获取指定区域的子级区域 |
| | | * |
| | | * @param code 区域编号,不传获取所有一级区域 |
| | | * @author lin.liu |
| | | * @date 2024/05/13 |
| | | */ |
| | | @GetMapping(value = "getListChild") |
| | | public ExecutedResult<List<ResRegionTree>> getListChild(@RequestParam String code) { |
| | | return this.service.getListChild(code); |
| | | } |
| | | /** |
| | | * 查询[系统行政地区] |
| | | * @author lin.liu |
| | | * @description 查询[系统行政地区] |
| | | */ |
| | | @PostMapping(value = "search") |
| | | public ExecutedResult<PagerResult<SysRegionVO>> search(@RequestBody SearchSysRegion request) { |
| | | return this.service.search(request); |
| | | } |
| | | /** |
| | | * 获取指定区域的子级区域(包含自身) |
| | | * |
| | | * @param code 区域编号 |
| | | * @author lin.liu |
| | | * @date 2024/05/13 |
| | | */ |
| | | @NonLogin |
| | | @GetMapping(value = "currAndTree/{code}") |
| | | public ExecutedResult<ResRegionTree> currAndTree(@PathVariable String code) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | .addNotNullOrEmpty(ParameterUtil.named("区域编号"), code); |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return ExecutedResult.failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return this.service.currAndTree(code); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | //package com.lunhan.water.host.controller.pay; |
| | | // |
| | | //import com.alipay.api.AlipayApiException; |
| | | //import com.lunhan.water.common.ExecutedResult; |
| | | //import com.lunhan.water.common.util.ParameterUtil; |
| | | //import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | //import com.lunhan.water.common.validator.ParameterValidator; |
| | | //import com.lunhan.water.entity.enums.EBusinessType; |
| | | //import com.lunhan.water.entity.request.pay.ReqCreatePay; |
| | | //import com.lunhan.water.entity.request.pay.ReqOrderPay; |
| | | //import com.lunhan.water.entity.request.pay.ReqPayRefund; |
| | | //import com.lunhan.water.host.BasicController; |
| | | //import com.lunhan.water.service.PaymentServices; |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | // |
| | | //import java.util.Map; |
| | | // |
| | | ///** |
| | | // * 50.支付服务 |
| | | // * |
| | | // * @author li。ling。yu |
| | | // * @date 2023/10/19 |
| | | // * @order 50 |
| | | // */ |
| | | //@Slf4j |
| | | //@RestController |
| | | //@RequestMapping(value = "/pay/service") |
| | | //public class PaymentServicesController extends BasicController { |
| | | // |
| | | // @Autowired |
| | | // private PaymentServices services; |
| | | // |
| | | // /** |
| | | // * 发起微信支付 |
| | | // * @param request 请求参数 |
| | | // * |
| | | // * @return 返回微信jsapi支付参数 |
| | | // */ |
| | | // @PostMapping(value = "wxPay") |
| | | // public ExecutedResult<Map<String, Object>> wxPay(@RequestBody ReqCreatePay request) { |
| | | // //#region 参数验证 |
| | | // ParameterValidator validator = new ParameterValidator() |
| | | // // 必须是枚举值 |
| | | // .addMustEnum(ParameterUtil.named("业务类型"), request.getBusinessType(), EBusinessType.class) |
| | | // // 必须大于0 |
| | | // //.addNotNullOrEmpty(ParameterUtil.named("订单号"), request.getBusinessNo()) |
| | | // ; |
| | | // ParameterValidateResult result = validator.validate(); |
| | | // if (result.getIsFiled()) { |
| | | // return ExecutedResult.failed(result.getErrorMsg()); |
| | | // } |
| | | // //#endregion |
| | | // return services.weiXinPay(this.getTokenUser(), request); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 发起微信退款 |
| | | // * @param request 请求参数 |
| | | // * |
| | | // * @return 返回退款流水号 |
| | | // */ |
| | | // @PostMapping(value = "wxRefund") |
| | | // public ExecutedResult<String> wxRefund(@RequestBody ReqPayRefund request) { |
| | | // //PaymentMerchantPO merchant = super.getTokenUser(); |
| | | // return services.weiXinRefund(request); |
| | | // } |
| | | //} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.host.controller.user; |
| | | |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | | import com.lunhan.water.common.ConstantFactory; |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.config.SysConfig; |
| | | import com.lunhan.water.common.enums.EResultCode; |
| | | import com.lunhan.water.common.exceptions.BusinessException; |
| | | import com.lunhan.water.common.jwt.JWTUtil; |
| | | import com.lunhan.water.common.jwt.LoginUserDTO; |
| | | import com.lunhan.water.common.util.HttpUtil; |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.ParameterUtil; |
| | | import com.lunhan.water.common.util.SerializeUtil; |
| | | import com.lunhan.water.common.validator.ParameterValidateResult; |
| | | import com.lunhan.water.common.validator.ParameterValidator; |
| | | import com.lunhan.water.entity.enums.EState; |
| | | import com.lunhan.water.entity.enums.EUserType; |
| | | import com.lunhan.water.entity.request.ReqChangePassword; |
| | | import com.lunhan.water.entity.request.ReqListId; |
| | | import com.lunhan.water.entity.request.ReqNeedCode; |
| | | import com.lunhan.water.entity.request.ReqUserLogin; |
| | | import com.lunhan.water.entity.weixin.WeiXinUserDto; |
| | | import com.lunhan.water.host.BasicController; |
| | | import com.lunhan.water.host.api.NonLogin; |
| | | import com.lunhan.water.repository.po.UserLoginPO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import com.lunhan.water.service.UserLoginService; |
| | | import com.lunhan.water.entity.request.userlogin.ReqCreateUserLogin; |
| | | import com.lunhan.water.entity.request.userlogin.ReqModifyUserLogin; |
| | | import com.lunhan.water.entity.search.SearchUserLogin; |
| | | import com.lunhan.water.repository.vo.UserLoginVO; |
| | | |
| | | /** |
| | | * 9000.UserLogin |
| | | * @author lin.liu |
| | | * @order 9000 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "user") |
| | | public class UserLoginController extends BasicController { |
| | | @Autowired |
| | | private UserLoginService userLoginService; |
| | | /** |
| | | * 微信小程序授权 |
| | | * @param request 请求参数 |
| | | */ |
| | | @NonLogin |
| | | @PostMapping(value = "wxAuthorize") |
| | | public ExecutedResult<WeiXinUserDto> wxAuthorization(@RequestBody ReqNeedCode request) { |
| | | return success(this.wxMiniAppAuth(request.getCode())); |
| | | } |
| | | /** |
| | | * 微信登录 |
| | | * @param request 请求参数 |
| | | */ |
| | | @NonLogin |
| | | @PostMapping(value = "wxLogin") |
| | | public ExecutedResult<LoginUserDTO> wxLogin(@RequestBody ReqNeedCode request) { |
| | | //微信授权 |
| | | WeiXinUserDto userInfo = this.wxMiniAppAuth(request.getCode()); |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String openId = userInfo.getOpenId(); |
| | | |
| | | UserLoginPO user = userLoginService.get4Openid(openId); |
| | | if (Objects.isNull(user)) { |
| | | // 微信未绑定账号,新增用户 |
| | | ReqCreateUserLogin reqCreateUser = new ReqCreateUserLogin(); |
| | | reqCreateUser.setUserName(openId); |
| | | reqCreateUser.setPassword(""); |
| | | reqCreateUser.setWxOpenId(openId); |
| | | reqCreateUser.setNickName(userInfo.getNickName()); |
| | | reqCreateUser.setHeadImg(userInfo.getHeadImgUrl()); |
| | | reqCreateUser.setPhone(""); |
| | | reqCreateUser.setComment(""); |
| | | ExecutedResult<Long> createAdmin = userLoginService.create(reqCreateUser); |
| | | if (createAdmin.isFailed()) { |
| | | return ExecutedResult.failed(createAdmin.getMsg()); |
| | | } |
| | | |
| | | user = userLoginService.get4Openid(openId); |
| | | } |
| | | if (!Objects.equals(user.getStatus(), EState.NORMAL.getValue())) { |
| | | return ExecutedResult.failed("账号异常, 请联系管理员!"); |
| | | } |
| | | LoginUserDTO loginUser = new LoginUserDTO(); |
| | | loginUser.setUserType(EUserType.ADMIN_USER.getValue()); |
| | | loginUser.setUserId(openId); |
| | | loginUser.setNickName(user.getNickName()); |
| | | loginUser.setHeadImg(user.getHeadImg()); |
| | | loginUser.setPhone(""); |
| | | loginUser.setToken(JWTUtil.getToken(loginUser)); |
| | | return ExecutedResult.success(loginUser); |
| | | } |
| | | /** |
| | | * 微信小程序授权 |
| | | */ |
| | | private WeiXinUserDto wxMiniAppAuth(String code) { |
| | | //微信接口服务,通过调用微信接口服务中jscode2session接口获取到openid和session_key |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + SysConfig.wx.getAppId() + "&secret=" + SysConfig.wx.getSecret() + "&js_code=" + code + "&grant_type=authorization_code"; |
| | | String response = HttpUtil.doGet(url); |
| | | JsonObject jsonObject = new JsonParser().parse(response).getAsJsonObject(); |
| | | if (!jsonObject.has("errcode")) { |
| | | String sessionKey = jsonObject.get("session_key").toString(); |
| | | String openId = jsonObject.get("openid").toString(); |
| | | } |
| | | if (jsonObject.has("errcode")) { |
| | | String errCode = jsonObject.get("errcode").getAsString(); |
| | | switch (errCode) { |
| | | case "1": |
| | | throw new BusinessException(EResultCode.FAILED, "微信授权失败,请稍后再试."); |
| | | case "40029": |
| | | throw new BusinessException(EResultCode.FAILED, "微信授权code无效"); |
| | | case "40163": |
| | | throw new BusinessException(EResultCode.FAILED, "微信授权code已被使用"); |
| | | case "45011": |
| | | throw new BusinessException(EResultCode.FAILED, "访问次数过于频繁,请稍后再试"); |
| | | |
| | | default: |
| | | throw new BusinessException(EResultCode.FAILED, "微信返回错误:" + errCode); |
| | | } |
| | | } |
| | | return SerializeUtil.toObject(response, WeiXinUserDto.class); |
| | | } |
| | | /** |
| | | * 修改密码 |
| | | * @param request 请求参数 |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping("/changePassword") |
| | | public ExecutedResult<String> changePassword(@RequestBody ReqChangePassword request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | .addNotNullOrEmpty(ParameterUtil.named("旧密码"), request.getOldPassword()) |
| | | .addNotNullOrEmpty(ParameterUtil.named("新密码"), request.getNewPassword()) |
| | | .addLengthMax(ParameterUtil.named("新密码"), request.getNewPassword(), ConstantFactory.LENGTH_MAX50); |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return ExecutedResult.failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | LoginUserDTO user = super.getTokenUser(); |
| | | return userLoginService.changePassword(user, request); |
| | | } |
| | | |
| | | /** |
| | | * 帐号密码登录 |
| | | * @param request 请求参数 |
| | | * @author lin.liu |
| | | */ |
| | | @PostMapping("login") |
| | | @NonLogin |
| | | public ExecutedResult<LoginUserDTO> login(@RequestBody ReqUserLogin request) { |
| | | //#region 参数验证 |
| | | ParameterValidator validator = new ParameterValidator() |
| | | .addNotNullOrEmpty(ParameterUtil.named("用户名"), request.getUserName()) |
| | | .addNotNullOrEmpty(ParameterUtil.named("密码"), request.getPassword()); |
| | | ParameterValidateResult result = validator.validate(); |
| | | if (result.getIsFiled()) { |
| | | return ExecutedResult.failed(result.getErrorMsg()); |
| | | } |
| | | //#endregion |
| | | return userLoginService.login(request); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.host.mqtt; |
| | | |
| | | |
| | | |
| | | import com.lunhan.water.common.config.MqttConfig; |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Order(20) |
| | | public class MQTTConnect { |
| | | @Autowired |
| | | private MqttConfig mqttConfig; |
| | | |
| | | //生成配置对象,用户名,密码等 |
| | | public MqttConnectOptions getOptions() { |
| | | MqttConnectOptions options = new MqttConnectOptions(); |
| | | options.setCleanSession(false); |
| | | options.setUserName(mqttConfig.getUser()); |
| | | options.setPassword(mqttConfig.getPassword().toCharArray()); |
| | | options.setConnectionTimeout(mqttConfig.getConnectionTimeout()); |
| | | //设置心跳 |
| | | options.setKeepAliveInterval(mqttConfig.getKeepAliveInterval()); |
| | | return options; |
| | | } |
| | | |
| | | public MqttConnectOptions getOptions(MqttConnectOptions options) { |
| | | options.setCleanSession(false); |
| | | options.setUserName(mqttConfig.getUser()); |
| | | options.setPassword(mqttConfig.getPassword().toCharArray()); |
| | | options.setConnectionTimeout(mqttConfig.getConnectionTimeout()); |
| | | //设置心跳 |
| | | options.setKeepAliveInterval(mqttConfig.getKeepAliveInterval()); |
| | | return options; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.host.mqtt; |
| | | |
| | | |
| | | |
| | | import com.lunhan.water.common.config.MqttConfig; |
| | | import com.lunhan.water.common.enums.ELogger; |
| | | import org.eclipse.paho.client.mqttv3.*; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.InitializingBean; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 发布端 |
| | | * Title:Server |
| | | * Description: 服务器向多个客户端推送主题,即不同客户端可向服务器订阅相同主题 |
| | | */ |
| | | @Component |
| | | @Order(7) |
| | | public class MQTTServer implements InitializingBean { |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(ELogger.DEBUG.getLogFileName()); |
| | | @Autowired |
| | | private MqttConfig mqttConfig; |
| | | @Autowired |
| | | private MQTTConnect mqttConnect; |
| | | static MqttClient client; |
| | | |
| | | private void connect() throws MqttException { |
| | | //防止重复创建MQTTClient实例 |
| | | if (client == null) { |
| | | //就是这里的clientId,服务器用来区分用户的,不能重复 |
| | | String host = "tcp://" + mqttConfig.getHost() + ":" + mqttConfig.getPort(); |
| | | client = new MqttClient(host, mqttConfig.getServerClientId(), new MemoryPersistence());// MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | //client.setCallback(new PushCallback()); |
| | | } |
| | | MqttConnectOptions options = mqttConnect.getOptions(); |
| | | //判断拦截状态,这里注意一下,如果没有这个判断,是非常坑的 |
| | | if (!client.isConnected()) { |
| | | client.connect(options); |
| | | LOGGER.info("---------------------mqtt连接成功"); |
| | | } else {//这里的逻辑是如果连接成功就重新连接 |
| | | client.disconnect(); |
| | | client.connect(mqttConnect.getOptions(options)); |
| | | LOGGER.info("---------------------mqtt连接成功"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public boolean publish(MqttTopic topic , MqttMessage message) throws MqttException { |
| | | MqttDeliveryToken token = topic.publish(message); |
| | | token.waitForCompletion(); |
| | | LOGGER.debug("消息发送成功! " + token.isComplete()); |
| | | return token.isComplete(); |
| | | } |
| | | |
| | | /** |
| | | * mqtt发送消息 |
| | | * @param topic 发布消息的主题 |
| | | * @param data 消息内容 |
| | | */ |
| | | public boolean send(String topic, String data) throws MqttException { |
| | | MqttConnectOptions options = mqttConnect.getOptions(); |
| | | try { |
| | | client.connect(mqttConnect.getOptions(options)); |
| | | } catch (Exception e) {} |
| | | MqttTopic mqttTopic = client.getTopic(topic); |
| | | |
| | | MqttMessage message = new MqttMessage(); |
| | | //消息等级 |
| | | //level 0:最多一次的传输 |
| | | //level 1:至少一次的传输,(鸡肋) |
| | | //level 2: 只有一次的传输 |
| | | message.setQos(0); |
| | | //如果重复消费,则把值改为true,然后发送一条空的消息,之前的消息就会覆盖,然后在改为false |
| | | message.setRetained(false); |
| | | |
| | | message.setPayload(data.getBytes()); |
| | | |
| | | return this.publish(mqttTopic, message); |
| | | } |
| | | |
| | | @Override |
| | | public void afterPropertiesSet() throws Exception { |
| | | // MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | // client = new MqttClient(HOST, clientid, new MemoryPersistence()); |
| | | if (Objects.equals(mqttConfig.getEnable(), Boolean.FALSE)) { |
| | | return; |
| | | } |
| | | this.connect(); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.host.mqtt; |
| | | |
| | | |
| | | |
| | | import com.lunhan.water.common.config.MqttConfig; |
| | | import org.springframework.beans.factory.InitializingBean; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @Component |
| | | @Order(40) |
| | | public class MQTTStart implements InitializingBean { |
| | | @Autowired |
| | | private MQTTSubsribe mqttSubsribe; |
| | | @Autowired |
| | | private MqttConfig mqttConfig; |
| | | |
| | | @Override |
| | | public void afterPropertiesSet() throws Exception { |
| | | if (Objects.equals(mqttConfig.getEnable(), Boolean.FALSE)) { |
| | | return; |
| | | } |
| | | mqttSubsribe.init(); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.host.mqtt; |
| | | |
| | | |
| | | |
| | | import com.lunhan.water.common.config.MqttConfig; |
| | | import com.lunhan.water.common.enums.ELogger; |
| | | import org.eclipse.paho.client.mqttv3.MqttClient; |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.eclipse.paho.client.mqttv3.MqttException; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 订阅端 |
| | | */ |
| | | @Component |
| | | @Order(30) |
| | | public class MQTTSubsribe { |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(ELogger.DEBUG.getLogFileName()); |
| | | @Autowired |
| | | private MqttConfig mqttConfig; |
| | | @Autowired |
| | | private MQTTConnect mqttConnect; |
| | | |
| | | /** |
| | | * 测试和正式环境不要使用同样的clientId 和主题 |
| | | * 如果和正式环境一样,正式环境启动后,本地再次启动会频繁断开重连,订阅的主题一样的话,测试的数据正式环境也会消费这些数据 |
| | | */ |
| | | //private static final String clientid = "测试clients";//测试 |
| | | // private String topic = "lunhan"; |
| | | |
| | | public MqttClient client; |
| | | |
| | | //方法实现说明 断线重连方法,如果是持久订阅,重连是不需要再次订阅,如果是非持久订阅,重连是需要重新订阅主题 取决于options.setCleanSession(true); |
| | | // true为非持久订阅 |
| | | public void connect() throws MqttException { |
| | | //防止重复创建MQTTClient实例 |
| | | if (client == null) { |
| | | //就是这里的clientId,服务器用来区分用户的,不能重复,clientId不能和发布的clientId一样,否则会出现频繁断开连接和重连的问题 |
| | | //不仅不能和发布的clientId一样,而且也不能和其他订阅的clientId一样,如果想要接收之前的离线数据,这就需要将client的 setCleanSession |
| | | // 设置为false,这样服务器才能保留它的session,再次建立连接的时候,它就会继续使用这个session了。 这时此连接clientId 是不能更改的。 |
| | | //但是其实还有一个问题,就是使用热部署的时候还是会出现频繁断开连接和重连的问题,可能是因为刚启动时的连接没断开,然后热部署的时候又进行了重连,重启一下就可以了 |
| | | //+ System.currentTimeMillis() |
| | | String host = "tcp://" + mqttConfig.getHost() + ":" + mqttConfig.getPort(); |
| | | client = new MqttClient(host, mqttConfig.getClientId(), new MemoryPersistence());// MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | //如果是订阅者则添加回调类,发布不需要 |
| | | client.setCallback(new PushCallback(MQTTSubsribe.this)); |
| | | // client.setCallback(new PushCallback()); |
| | | } |
| | | MqttConnectOptions options = mqttConnect.getOptions(); |
| | | //判断拦截状态,这里注意一下,如果没有这个判断,是非常坑的 |
| | | if (!client.isConnected()) { |
| | | client.connect(options); |
| | | LOGGER.info("----------mqtt连接成功"); |
| | | } else {//这里的逻辑是如果连接成功就重新连接 |
| | | client.disconnect(); |
| | | client.connect(mqttConnect.getOptions(options)); |
| | | LOGGER.info("----------mqtt连接成功"); |
| | | } |
| | | } |
| | | |
| | | public void init() { |
| | | try { |
| | | this.connect(); |
| | | LOGGER.info("----------mqtt执行"); |
| | | this.subscribe(mqttConfig.getTopic()); |
| | | LOGGER.info("----------mqtt执行订阅"); |
| | | } catch (MqttException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订阅某个主题,qos默认为0 |
| | | * |
| | | * @param topic . |
| | | */ |
| | | public void subscribe(String topic) { |
| | | subscribe(topic,2); |
| | | } |
| | | |
| | | /** |
| | | * 订阅某个主题 |
| | | * |
| | | * @param topic . |
| | | * @param qos . |
| | | */ |
| | | public void subscribe(String topic, int qos) { |
| | | |
| | | try { |
| | | client.subscribe(topic,qos); |
| | | //MQTT 协议中订阅关系是持久化的,因此如果不需要订阅某些 Topic,需要调用 unsubscribe 方法取消订阅关系。 |
| | | // client.unsubscribe("需要解除订阅关系的主题"); |
| | | } catch (MqttException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.host.mqtt; |
| | | |
| | | import com.lunhan.water.common.enums.ELogger; |
| | | import com.lunhan.water.common.util.LoggerUtil; |
| | | import com.lunhan.water.common.util.ThreadPoolUtil; |
| | | import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; |
| | | import org.eclipse.paho.client.mqttv3.MqttCallback; |
| | | import org.eclipse.paho.client.mqttv3.MqttMessage; |
| | | import org.slf4j.Logger; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | ; |
| | | |
| | | /** |
| | | * 发布消息的回调类 |
| | | * <p> |
| | | * 必须实现MqttCallback的接口并实现对应的相关接口方法CallBack 类将实现 MqttCallBack。 |
| | | * 每个客户机标识都需要一个回调实例。在此示例中,构造函数传递客户机标识以另存为实例数据。 |
| | | * 在回调中,将它用来标识已经启动了该回调的哪个实例。 |
| | | * 必须在回调类中实现三个方法: |
| | | * <p> |
| | | * public void messageArrived(MqttTopic topic, MqttMessage message)接收已经预订的发布。 |
| | | * <p> |
| | | * public void connectionLost(Throwable cause)在断开连接时调用。 |
| | | * <p> |
| | | * public void deliveryComplete(MqttDeliveryToken token)) |
| | | * 接收到已经发布的 QoS 1 或 QoS 2 消息的传递令牌时调用。 |
| | | * 由 MqttClient.connect 激活此回调。 |
| | | */ |
| | | public class PushCallback implements MqttCallback { |
| | | private static final Logger LOGGER_DEBUG = LoggerUtil.get(ELogger.DEBUG); |
| | | private static final Logger LOGGER_ERROR = LoggerUtil.get(ELogger.SYS_ERROR); |
| | | |
| | | private MQTTSubsribe mqttSubsribe; |
| | | |
| | | public PushCallback(MQTTSubsribe mqttSubsribe) { |
| | | this.mqttSubsribe = mqttSubsribe; |
| | | } |
| | | |
| | | public void connectionLost(Throwable cause) { |
| | | // 连接丢失后,一般在这里面进行重连 |
| | | LOGGER_DEBUG.info("---------------------mqtt连接断开"); |
| | | |
| | | while (true) { |
| | | try {//如果没有发生异常说明连接成功,如果发生异常,则死循环 |
| | | mqttSubsribe.init(); |
| | | LOGGER_DEBUG.info("---------------------mqtt重连成功"); |
| | | break; |
| | | } catch (Exception e) { |
| | | LOGGER_ERROR.error("mqtt连接丢失", e); |
| | | continue; |
| | | } finally { |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | // 重新设置中断状态 |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void deliveryComplete(IMqttDeliveryToken token) { |
| | | LOGGER_DEBUG.info("deliveryComplete---------" + token.isComplete()); |
| | | } |
| | | |
| | | public void messageArrived(String topic, MqttMessage message) { |
| | | // subscribe后得到的消息会执行到这里面 |
| | | String msg = new String(message.getPayload(), StandardCharsets.UTF_8); |
| | | |
| | | LOGGER_DEBUG.info("收到mqtt消息,主题: " + topic + ", Qos: " + message.getQos() + ", 消息内容: " + msg); |
| | | //这里可以针对收到的消息做处理 |
| | | ThreadPoolUtil.getDefaultPool().execute(() -> { |
| | | try { |
| | | //调用方法 |
| | | //dataUploadYwjRecordService.mqttReceived(topic, msg); |
| | | } catch (Exception e) { |
| | | LOGGER_ERROR.error("messageArrived", e); |
| | | } |
| | | }); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchPaymentRecords; |
| | | import com.lunhan.water.repository.mapper.PaymentRecordsMapper; |
| | | import com.lunhan.water.repository.po.PaymentRecordsPO; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class PaymentRecordsMapperImpl extends BasicMapperImpl<PaymentRecordsPO, PaymentRecordsMapper> { |
| | | PaymentRecordsMapperImpl(PaymentRecordsMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<PaymentRecordsPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchPaymentRecords search = (SearchPaymentRecords)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<PaymentRecordsPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(PaymentRecordsPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, PaymentRecordsPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), PaymentRecordsPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, PaymentRecordsPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, PaymentRecordsPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(PaymentRecordsPO::getName, search.getKeywords()) |
| | | // .or().like(PaymentRecordsPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(PaymentRecordsPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(PaymentRecordsPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(PaymentRecordsPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(PaymentRecordsPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(PaymentRecordsPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(PaymentRecordsPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(PaymentRecordsPO::getId); |
| | | } |
| | | Page<PaymentRecordsPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(PaymentRecordsPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(PaymentRecordsPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public PaymentRecordsPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<PaymentRecordsPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchRechargeOrder; |
| | | import com.lunhan.water.repository.mapper.RechargeOrderMapper; |
| | | import com.lunhan.water.repository.po.RechargeOrderPO; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class RechargeOrderMapperImpl extends BasicMapperImpl<RechargeOrderPO, RechargeOrderMapper> { |
| | | RechargeOrderMapperImpl(RechargeOrderMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<RechargeOrderPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchRechargeOrder search = (SearchRechargeOrder)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<RechargeOrderPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(RechargeOrderPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, RechargeOrderPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), RechargeOrderPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, RechargeOrderPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, RechargeOrderPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(RechargeOrderPO::getName, search.getKeywords()) |
| | | // .or().like(RechargeOrderPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(RechargeOrderPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(RechargeOrderPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(RechargeOrderPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(RechargeOrderPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(RechargeOrderPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(RechargeOrderPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(RechargeOrderPO::getId); |
| | | } |
| | | Page<RechargeOrderPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(RechargeOrderPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(RechargeOrderPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | public RechargeOrderPO getByOrderNo(String orderNo) { |
| | | LambdaQueryWrapper<RechargeOrderPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(RechargeOrderPO::getOrderNo,orderNo); |
| | | return DB.selectOne(queryWrapper); |
| | | } |
| | | public RechargeOrderPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<RechargeOrderPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchRechargeRecords; |
| | | import com.lunhan.water.repository.mapper.RechargeRecordsMapper; |
| | | import com.lunhan.water.repository.po.RechargeRecordsPO; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class RechargeRecordsMapperImpl extends BasicMapperImpl<RechargeRecordsPO, RechargeRecordsMapper> { |
| | | RechargeRecordsMapperImpl(RechargeRecordsMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<RechargeRecordsPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchRechargeRecords search = (SearchRechargeRecords)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<RechargeRecordsPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(RechargeRecordsPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, RechargeRecordsPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), RechargeRecordsPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, RechargeRecordsPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, RechargeRecordsPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(RechargeRecordsPO::getName, search.getKeywords()) |
| | | // .or().like(RechargeRecordsPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(RechargeRecordsPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(RechargeRecordsPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(RechargeRecordsPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(RechargeRecordsPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(RechargeRecordsPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(RechargeRecordsPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(RechargeRecordsPO::getId); |
| | | } |
| | | Page<RechargeRecordsPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(RechargeRecordsPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(RechargeRecordsPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | public RechargeRecordsPO getByRechargeOrder(String rechargeOrder) { |
| | | LambdaQueryWrapper<RechargeRecordsPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(RechargeRecordsPO::getRechargeOrder,rechargeOrder) |
| | | .eq(RechargeRecordsPO::getRechargeStatus,0); |
| | | return DB.selectOne(queryWrapper); |
| | | } |
| | | public RechargeRecordsPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<RechargeRecordsPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchRefundRecord; |
| | | import com.lunhan.water.repository.mapper.RefundRecordMapper; |
| | | import com.lunhan.water.repository.po.RefundRecordPO; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class RefundRecordMapperImpl extends BasicMapperImpl<RefundRecordPO, RefundRecordMapper> { |
| | | RefundRecordMapperImpl(RefundRecordMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<RefundRecordPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchRefundRecord search = (SearchRefundRecord)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<RefundRecordPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(RefundRecordPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, RefundRecordPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), RefundRecordPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, RefundRecordPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, RefundRecordPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(RefundRecordPO::getName, search.getKeywords()) |
| | | // .or().like(RefundRecordPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(RefundRecordPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(RefundRecordPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(RefundRecordPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(RefundRecordPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(RefundRecordPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(RefundRecordPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(RefundRecordPO::getId); |
| | | } |
| | | Page<RefundRecordPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(RefundRecordPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(RefundRecordPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | public RefundRecordPO get4RefundNo(String refundNo) { |
| | | LambdaQueryWrapper<RefundRecordPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(RefundRecordPO::getRefundNo,refundNo); |
| | | return super.selectOne(queryWrapper); |
| | | } |
| | | public RefundRecordPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<RefundRecordPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.ListUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import com.lunhan.water.entity.dto.OrderByDTO; |
| | | import com.lunhan.water.entity.dto.SearchBasicDTO; |
| | | import com.lunhan.water.entity.enums.EOrderBy; |
| | | import com.lunhan.water.entity.search.SearchSysRegion; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import com.lunhan.water.repository.mapper.SysRegionMapper; |
| | | import com.lunhan.water.repository.po.SysRegionPO; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | * @description 系统行政地区 |
| | | */ |
| | | @Repository |
| | | public class SysRegionMapperImpl extends BasicMapperImpl<SysRegionPO, SysRegionMapper> { |
| | | SysRegionMapperImpl(SysRegionMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<SysRegionPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchSysRegion search = (SearchSysRegion)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<SysRegionPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(SysRegionPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, SysRegionPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), SysRegionPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, SysRegionPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, SysRegionPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(SysRegionPO::getName, search.getKeywords()) |
| | | // .or().like(SysRegionPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(SysRegionPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(SysRegionPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(SysRegionPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(SysRegionPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(SysRegionPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(SysRegionPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(SysRegionPO::getId); |
| | | } |
| | | Page<SysRegionPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(SysRegionPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | public List<SysRegionPO> getList4Parent(String code) { |
| | | LambdaQueryWrapper<SysRegionPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(SysRegionPO::getParentCode,code); |
| | | return DB.selectList(queryWrapper); |
| | | } |
| | | public SysRegionPO get4Code(String code) { |
| | | LambdaQueryWrapper<SysRegionPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(SysRegionPO::getCode,code); |
| | | return DB.selectOne(queryWrapper); |
| | | } |
| | | public List<SysRegionPO> getList4LevelChild(Integer level) { |
| | | LambdaQueryWrapper<SysRegionPO> queryWrapper = this.query(); |
| | | queryWrapper.gt(SysRegionPO::getLevel,level); |
| | | return DB.selectList(queryWrapper); |
| | | } |
| | | public List<SysRegionPO> getList4Level(Integer level) { |
| | | LambdaQueryWrapper<SysRegionPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(SysRegionPO::getLevel,level); |
| | | return DB.selectList(queryWrapper); |
| | | } |
| | | public Boolean addNotIncrement(SysRegionPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public SysRegionPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<SysRegionPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchTradeRecord; |
| | | import com.lunhan.water.repository.mapper.TradeRecordMapper; |
| | | import com.lunhan.water.repository.po.TradeRecordPO; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class TradeRecordMapperImpl extends BasicMapperImpl<TradeRecordPO, TradeRecordMapper> { |
| | | TradeRecordMapperImpl(TradeRecordMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<TradeRecordPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchTradeRecord search = (SearchTradeRecord)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<TradeRecordPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(TradeRecordPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, TradeRecordPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), TradeRecordPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, TradeRecordPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, TradeRecordPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(TradeRecordPO::getName, search.getKeywords()) |
| | | // .or().like(TradeRecordPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(TradeRecordPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(TradeRecordPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(TradeRecordPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(TradeRecordPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(TradeRecordPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(TradeRecordPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(TradeRecordPO::getId); |
| | | } |
| | | Page<TradeRecordPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(TradeRecordPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(TradeRecordPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | public TradeRecordPO get4TradeNo(String tradeNo) { |
| | | LambdaQueryWrapper<TradeRecordPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(TradeRecordPO::getTradeNo,tradeNo); |
| | | return super.selectOne(queryWrapper); |
| | | } |
| | | public TradeRecordPO get4Business(Integer businessType, String businessNo) { |
| | | LambdaQueryWrapper<TradeRecordPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(TradeRecordPO::getBusinessType,businessType); |
| | | queryWrapper.eq(TradeRecordPO::getBusinessNo,businessNo); |
| | | queryWrapper.eq(TradeRecordPO::getPayState,EPayState.SUCCESS.getValue()); |
| | | return super.selectOne(queryWrapper); |
| | | } |
| | | public TradeRecordPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<TradeRecordPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchUserCapitalChange; |
| | | import com.lunhan.water.repository.mapper.UserCapitalChangeMapper; |
| | | import com.lunhan.water.repository.po.UserCapitalChangePO; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class UserCapitalChangeMapperImpl extends BasicMapperImpl<UserCapitalChangePO, UserCapitalChangeMapper> { |
| | | UserCapitalChangeMapperImpl(UserCapitalChangeMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<UserCapitalChangePO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchUserCapitalChange search = (SearchUserCapitalChange)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<UserCapitalChangePO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(UserCapitalChangePO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, UserCapitalChangePO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), UserCapitalChangePO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, UserCapitalChangePO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, UserCapitalChangePO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(UserCapitalChangePO::getName, search.getKeywords()) |
| | | // .or().like(UserCapitalChangePO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(UserCapitalChangePO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(UserCapitalChangePO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(UserCapitalChangePO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(UserCapitalChangePO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(UserCapitalChangePO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(UserCapitalChangePO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(UserCapitalChangePO::getId); |
| | | } |
| | | Page<UserCapitalChangePO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(UserCapitalChangePO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(UserCapitalChangePO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public UserCapitalChangePO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | |
| | | public List<UserCapitalChangePO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.dto.*; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.repository.BasicMapperImpl; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import com.lunhan.water.entity.search.SearchUserLogin; |
| | | import com.lunhan.water.repository.mapper.UserLoginMapper; |
| | | import com.lunhan.water.repository.po.UserLoginPO; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Repository |
| | | public class UserLoginMapperImpl extends BasicMapperImpl<UserLoginPO, UserLoginMapper> { |
| | | UserLoginMapperImpl(UserLoginMapper mapper) { |
| | | super(mapper); |
| | | } |
| | | |
| | | @Override |
| | | public PagerResult<UserLoginPO> search(SearchBasicDTO request) { |
| | | // 还原查询条件真实类型 |
| | | SearchUserLogin search = (SearchUserLogin)request; |
| | | // 查询条件 |
| | | LambdaQueryWrapper<UserLoginPO> queryWrapper = this.query(); |
| | | // 非逻辑删除 |
| | | queryWrapper.eq(UserLoginPO::getIsDelete, EYesOrNo.NO.getValue()); |
| | | // 状态 |
| | | //queryWrapper.eq(NumericUtil.tryParseInt(search.getStatus()).compareTo(0) > 0, UserLoginPO::getStatus, search.getStatus()); |
| | | // 状态列表 |
| | | //queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListStatus()), UserLoginPO::getStatus, search.getListStatus()); |
| | | |
| | | // 数据创建时间-起始 |
| | | queryWrapper.ge(NumericUtil.tryParseLong(search.getCreateTimeStart()).compareTo(0L) > 0, UserLoginPO::getCreateTime, search.getCreateTimeStart()); |
| | | // 数据创建时间-截止 |
| | | queryWrapper.le(NumericUtil.tryParseLong(search.getCreateTimeEnd()).compareTo(0L) > 0, UserLoginPO::getCreateTime, search.getCreateTimeEnd()); |
| | | // 关键字 |
| | | //if (StringUtil.isNotNullOrEmpty(search.getKeywords())) { |
| | | // queryWrapper.and(q -> |
| | | // q.like(UserLoginPO::getName, search.getKeywords()) |
| | | // .or().like(UserLoginPO::getPhone, search.getKeywords()) |
| | | // ); |
| | | //} |
| | | |
| | | // 排序处理 |
| | | if (ListUtil.isNotNullOrEmpty(search.getOrderBy())) { |
| | | for (OrderByDTO item : search.getOrderBy()) { |
| | | EOrderBy orderBy = EOrderBy.getByValue(item.getOrderBy()); |
| | | // 顺序排序 |
| | | if (item.getIsAsc()) { |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByAsc(UserLoginPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByAsc(UserLoginPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByAsc(UserLoginPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } else { |
| | | // 倒叙排序 |
| | | switch (orderBy) { |
| | | // 主键 |
| | | case ID: |
| | | queryWrapper.orderByDesc(UserLoginPO::getId); |
| | | break; |
| | | // 数据创建时间 |
| | | case CREATE_TIME: |
| | | queryWrapper.orderByDesc(UserLoginPO::getCreateTime); |
| | | break; |
| | | // 最后更新时间 |
| | | case UPDATE_TIME: |
| | | queryWrapper.orderByDesc(UserLoginPO::getUpdateTime); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc(UserLoginPO::getId); |
| | | } |
| | | Page<UserLoginPO> pageResult = super.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper); |
| | | return new PagerResult<>(pageResult.getSize(), pageResult.getCurrent(), pageResult.getTotal(), pageResult.getRecords()); |
| | | } |
| | | |
| | | public Boolean add(UserLoginPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public Boolean addNotIncrement(UserLoginPO item) { |
| | | int rowCount = super.insert(item); |
| | | return rowCount == 1; |
| | | } |
| | | |
| | | public UserLoginPO getById(Long id) { |
| | | return super.get(id); |
| | | } |
| | | public UserLoginPO get4Openid(String openId) { |
| | | LambdaQueryWrapper<UserLoginPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(UserLoginPO::getWxOpenId, openId); |
| | | return DB.selectOne(queryWrapper); |
| | | } |
| | | public UserLoginPO get4UserName(String userName) { |
| | | LambdaQueryWrapper<UserLoginPO> queryWrapper = this.query(); |
| | | queryWrapper.eq(UserLoginPO::getUserName, userName); |
| | | return DB.selectOne(queryWrapper); |
| | | } |
| | | public List<UserLoginPO> getListById(List<Long> listId) { |
| | | return super.getList(listId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.PaymentRecordsPO; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | public interface PaymentRecordsMapper extends BasicMapper<PaymentRecordsPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.RechargeOrderPO; |
| | | |
| | | /** |
| | | * 用户充值订单 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface RechargeOrderMapper extends BasicMapper<RechargeOrderPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.RechargeRecordsPO; |
| | | |
| | | /** |
| | | * 充值记录 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface RechargeRecordsMapper extends BasicMapper<RechargeRecordsPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.RefundRecordPO; |
| | | |
| | | /** |
| | | * 退款记录 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface RefundRecordMapper extends BasicMapper<RefundRecordPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.SysRegionPO; |
| | | |
| | | /** |
| | | * 系统行政地区 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface SysRegionMapper extends BasicMapper<SysRegionPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.TradeRecordPO; |
| | | |
| | | /** |
| | | * 支付记录 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface TradeRecordMapper extends BasicMapper<TradeRecordPO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.UserCapitalChangePO; |
| | | |
| | | /** |
| | | * 用户资金变动 mapper |
| | | * @author lin.liu |
| | | */ |
| | | public interface UserCapitalChangeMapper extends BasicMapper<UserCapitalChangePO> { |
| | | } |
对比新文件 |
| | |
| | | package com.lunhan.water.repository.mapper; |
| | | |
| | | import com.lunhan.water.repository.BasicMapper;import com.lunhan.water.repository.po.UserLoginPO; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | public interface UserLoginMapper extends BasicMapper<UserLoginPO> { |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("payment_records") |
| | | public class PaymentRecordsPO implements Serializable { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private Long userId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | /** |
| | | * 设备编号 |
| | | */ |
| | | @TableField(value = "facility_code") |
| | | private String facilityCode; |
| | | /** |
| | | * 消费金额 |
| | | */ |
| | | @TableField(value = "payment_amount") |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 本次出水量(单位ml) |
| | | */ |
| | | @TableField(value = "water_amount") |
| | | private BigDecimal waterAmount; |
| | | /** |
| | | * 本次出水秒数 |
| | | */ |
| | | @TableField(value = "water_seconds") |
| | | private BigDecimal waterSeconds; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "comment") |
| | | private String comment; |
| | | /** |
| | | * 缴费状态 EBillPayStatus |
| | | */ |
| | | @TableField(value = "pay_status") |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @TableField(value = "pay_time") |
| | | private String payTime; |
| | | /** |
| | | * 是否删除(逻辑删除) |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据最后更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("recharge_order") |
| | | public class RechargeOrderPO implements Serializable { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private Long userId; |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @TableField(value = "order_no") |
| | | private String orderNo; |
| | | /** |
| | | * 订单金额 |
| | | */ |
| | | @TableField(value = "order_amount") |
| | | private BigDecimal orderAmount; |
| | | /** |
| | | * 折扣金额 |
| | | */ |
| | | @TableField(value = "discount_amount") |
| | | private BigDecimal discountAmount; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | @TableField(value = "payment_amount") |
| | | private BigDecimal paymentAmount; |
| | | /** |
| | | * 支付类型 1现金 2微信 3支付宝 4余额 |
| | | */ |
| | | @TableField(value = "pay_type") |
| | | private Integer payType; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @TableField(value = "pay_time") |
| | | private Long payTime; |
| | | /** |
| | | * 状态10待支付 20支付中 200完成支付 300支付失败 |
| | | */ |
| | | @TableField(value = "pay_state") |
| | | private Integer payState; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "remark") |
| | | private String remark; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("recharge_records") |
| | | public class RechargeRecordsPO implements Serializable { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 充值订单号 |
| | | */ |
| | | @TableField(value = "recharge_order") |
| | | private String rechargeOrder; |
| | | /** |
| | | * 充值类型 |
| | | */ |
| | | @TableField(value = "recharge_type") |
| | | private String rechargeType; |
| | | /** |
| | | * 支付方式 |
| | | */ |
| | | @TableField(value = "payment_method") |
| | | private String paymentMethod; |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | @TableField(value = "recharge_amount") |
| | | private BigDecimal rechargeAmount; |
| | | /** |
| | | * 充值状态(0=未充值,1=已充值) |
| | | */ |
| | | @TableField(value = "recharge_status") |
| | | private Integer rechargeStatus; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "comment") |
| | | private String comment; |
| | | /** |
| | | * 数据创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据最后更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | /** |
| | | * 数据创建人 |
| | | */ |
| | | @TableField(value = "create_user") |
| | | private String createUser; |
| | | /** |
| | | * 数据创建人名称 |
| | | */ |
| | | @TableField(value = "create_user_name") |
| | | private String createUserName; |
| | | /** |
| | | * 最后更新人 |
| | | */ |
| | | @TableField(value = "update_user") |
| | | private String updateUser; |
| | | /** |
| | | * 最后更新人名称 |
| | | */ |
| | | @TableField(value = "update_user_name") |
| | | private String updateUserName; |
| | | /** |
| | | * 是否删除(逻辑删除) |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("refund_record") |
| | | public class RefundRecordPO implements Serializable { |
| | | /** |
| | | * 自增id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 退款流水号 |
| | | */ |
| | | @TableField(value = "refund_no") |
| | | private String refundNo; |
| | | /** |
| | | * 原交易流水号 |
| | | */ |
| | | @TableField(value = "trade_no") |
| | | private String tradeNo; |
| | | /** |
| | | * 原交易总金额 |
| | | */ |
| | | @TableField(value = "trade_amount") |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 本次退款金额 |
| | | */ |
| | | @TableField(value = "refund_amount") |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | @TableField(value = "business_no") |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述 |
| | | */ |
| | | @TableField(value = "business_comment") |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | @TableField(value = "business_type") |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | @TableField(value = "payment_channel") |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | @TableField(value = "channel_name") |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | @TableField(value = "pay_way") |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | @TableField(value = "pay_way_name") |
| | | private String payWayName; |
| | | /** |
| | | * 回调地址配置 |
| | | */ |
| | | @TableField(value = "callback_url") |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | @TableField(value = "third_refund_no") |
| | | private String thirdRefundNo; |
| | | /** |
| | | * 业务回调地址配置 |
| | | */ |
| | | @TableField(value = "business_callback_url") |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 退款发起时间 |
| | | */ |
| | | @TableField(value = "submit_time") |
| | | private Long submitTime; |
| | | /** |
| | | * 退款发起时间展示 |
| | | */ |
| | | @TableField(value = "submit_time_view") |
| | | private String submitTimeView; |
| | | /** |
| | | * 退款通知时间 |
| | | */ |
| | | @TableField(value = "notify_time") |
| | | private Long notifyTime; |
| | | /** |
| | | * 退款通知时间展示 |
| | | */ |
| | | @TableField(value = "notify_time_view") |
| | | private String notifyTimeView; |
| | | /** |
| | | * 退款成功时间 |
| | | */ |
| | | @TableField(value = "refund_time") |
| | | private Long refundTime; |
| | | /** |
| | | * 退款成功时间展示 |
| | | */ |
| | | @TableField(value = "refund_time_view") |
| | | private String refundTimeView; |
| | | /** |
| | | * 实际退款金额 |
| | | */ |
| | | @TableField(value = "third_refund_amount") |
| | | private BigDecimal thirdRefundAmount; |
| | | /** |
| | | * 退款关闭时间 |
| | | */ |
| | | @TableField(value = "closed_time") |
| | | private Long closedTime; |
| | | /** |
| | | * 退款关闭时间展示 |
| | | */ |
| | | @TableField(value = "closed_time_view") |
| | | private String closedTimeView; |
| | | /** |
| | | * 退款关闭说明 |
| | | */ |
| | | @TableField(value = "closed_comment") |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "comment") |
| | | private String comment; |
| | | /** |
| | | * 状态(ERefundState) 待退款=10,退款中=20,退款成功=200,退款失败=300,退款取消=400 |
| | | */ |
| | | @TableField(value = "refund_state") |
| | | private Integer refundState; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据最后更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | /** |
| | | * null |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("sys_region") |
| | | public class SysRegionPO implements Serializable { |
| | | /** |
| | | * 主键Id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 行政代码 |
| | | */ |
| | | @TableField(value = "code") |
| | | private String code; |
| | | /** |
| | | * 上级行政代码 |
| | | */ |
| | | @TableField(value = "parent_code") |
| | | private String parentCode; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @TableField(value = "name") |
| | | private String name; |
| | | /** |
| | | * 简称 |
| | | */ |
| | | @TableField(value = "short_name") |
| | | private String shortName; |
| | | /** |
| | | * 邮政编码 |
| | | */ |
| | | @TableField(value = "zip_code") |
| | | private String zipCode; |
| | | /** |
| | | * 区号 |
| | | */ |
| | | @TableField(value = "city_code") |
| | | private String cityCode; |
| | | /** |
| | | * 层级 |
| | | */ |
| | | @TableField(value = "level") |
| | | private Integer level; |
| | | /** |
| | | * 拼音 |
| | | */ |
| | | @TableField(value = "pin_yin") |
| | | private String pinYin; |
| | | /** |
| | | * 拼音简写 |
| | | */ |
| | | @TableField(value = "pin_yin_short") |
| | | private String pinYinShort; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField(value = "lng") |
| | | private BigDecimal lng; |
| | | /** |
| | | * 维度 |
| | | */ |
| | | @TableField(value = "lat") |
| | | private BigDecimal lat; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField(value = "sort") |
| | | private Integer sort; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "remark") |
| | | private String remark; |
| | | /** |
| | | * 是否删除(逻辑删除) |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | /** |
| | | * 数据创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 最后更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("trade_record") |
| | | public class TradeRecordPO implements Serializable { |
| | | /** |
| | | * 自增id |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 交易流水号 |
| | | */ |
| | | @TableField(value = "trade_no") |
| | | private String tradeNo; |
| | | /** |
| | | * 交易金额 |
| | | */ |
| | | @TableField(value = "trade_amount") |
| | | private BigDecimal tradeAmount; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | @TableField(value = "business_no") |
| | | private String businessNo; |
| | | /** |
| | | * 业务描述(如果商户支持,此项将作为支付时展示的商品名) |
| | | */ |
| | | @TableField(value = "business_comment") |
| | | private String businessComment; |
| | | /** |
| | | * 业务类型 EBusinessType |
| | | */ |
| | | @TableField(value = "business_type") |
| | | private Integer businessType; |
| | | /** |
| | | * 支付渠道 |
| | | */ |
| | | @TableField(value = "payment_channel") |
| | | private Integer paymentChannel; |
| | | /** |
| | | * 支付渠道名称 |
| | | */ |
| | | @TableField(value = "channel_name") |
| | | private String channelName; |
| | | /** |
| | | * 支付方式(EPayWay) App=1,Web=2,H5=3,SDK=4,扫码(静态)=5,扫码(动态)=6 |
| | | */ |
| | | @TableField(value = "pay_way") |
| | | private Integer payWay; |
| | | /** |
| | | * 支付方式名称 |
| | | */ |
| | | @TableField(value = "pay_way_name") |
| | | private String payWayName; |
| | | /** |
| | | * 第三方支付回调地址 |
| | | */ |
| | | @TableField(value = "callback_url") |
| | | private String callbackUrl; |
| | | /** |
| | | * 第三方交易流水号 |
| | | */ |
| | | @TableField(value = "third_trade_no") |
| | | private String thirdTradeNo; |
| | | /** |
| | | * 业务回调地址 |
| | | */ |
| | | @TableField(value = "business_callback_url") |
| | | private String businessCallbackUrl; |
| | | /** |
| | | * 交易发起时间 |
| | | */ |
| | | @TableField(value = "submit_time") |
| | | private Long submitTime; |
| | | /** |
| | | * 交易发起时间展示 |
| | | */ |
| | | @TableField(value = "submit_time_view") |
| | | private String submitTimeView; |
| | | /** |
| | | * 交易通知时间 |
| | | */ |
| | | @TableField(value = "notify_time") |
| | | private Long notifyTime; |
| | | /** |
| | | * 交易通知时间展示 |
| | | */ |
| | | @TableField(value = "notify_time_view") |
| | | private String notifyTimeView; |
| | | /** |
| | | * 交易成功时间 |
| | | */ |
| | | @TableField(value = "paid_time") |
| | | private Long paidTime; |
| | | /** |
| | | * 交易成功时间展示 |
| | | */ |
| | | @TableField(value = "paid_time_view") |
| | | private String paidTimeView; |
| | | /** |
| | | * 实际支付金额 |
| | | */ |
| | | @TableField(value = "paid_amount") |
| | | private BigDecimal paidAmount; |
| | | /** |
| | | * 交易关闭时间 |
| | | */ |
| | | @TableField(value = "closed_time") |
| | | private Long closedTime; |
| | | /** |
| | | * 交易关闭时间展示 |
| | | */ |
| | | @TableField(value = "closed_time_view") |
| | | private String closedTimeView; |
| | | /** |
| | | * 交易关闭说明 |
| | | */ |
| | | @TableField(value = "closed_comment") |
| | | private String closedComment; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "comment") |
| | | private String comment; |
| | | /** |
| | | * 状态(EPayState) 待支付=10,支付中=20,支付成功=200,部分退款=220,支付失败=300,支付取消=400,全额退款=420 |
| | | */ |
| | | @TableField(value = "pay_state") |
| | | private Integer payState; |
| | | /** |
| | | * 是否能退款 不可退款=0,可退款=1 |
| | | */ |
| | | @TableField(value = "can_refund") |
| | | private Integer canRefund; |
| | | /** |
| | | * 已退款金额 |
| | | */ |
| | | @TableField(value = "refund_amount") |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据最后更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("user_capital_change") |
| | | public class UserCapitalChangePO implements Serializable { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 所属用户 |
| | | */ |
| | | @TableField(value = "user_id") |
| | | private Long userId; |
| | | /** |
| | | * 变动业务 ECapitalChange |
| | | */ |
| | | @TableField(value = "business") |
| | | private Integer business; |
| | | /** |
| | | * 变动业务名称 |
| | | */ |
| | | @TableField(value = "business_name") |
| | | private String businessName; |
| | | /** |
| | | * 业务唯一标识 |
| | | */ |
| | | @TableField(value = "business_code") |
| | | private String businessCode; |
| | | /** |
| | | * 变动前余额 |
| | | */ |
| | | @TableField(value = "before_money") |
| | | private BigDecimal beforeMoney; |
| | | /** |
| | | * 变动金额 |
| | | */ |
| | | @TableField(value = "change_money") |
| | | private BigDecimal changeMoney; |
| | | /** |
| | | * 变动后余额 |
| | | */ |
| | | @TableField(value = "after_money") |
| | | private BigDecimal afterMoney; |
| | | /** |
| | | * 描述 |
| | | */ |
| | | @TableField(value = "description") |
| | | private String description; |
| | | /** |
| | | * 是否删除(逻辑删除) |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | /** |
| | | * 数据创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | /** |
| | | * 数据创建人 |
| | | */ |
| | | @TableField(value = "create_user") |
| | | private String createUser; |
| | | /** |
| | | * 数据创建人名称 |
| | | */ |
| | | @TableField(value = "create_user_name") |
| | | private String createUserName; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.po; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | @TableName("user_login") |
| | | public class UserLoginPO implements Serializable { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @TableField(value = "user_name") |
| | | private String userName; |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @TableField(value = "password") |
| | | private String password; |
| | | /** |
| | | * 支付密码 |
| | | */ |
| | | @TableField(value = "payment_password") |
| | | private String paymentPassword; |
| | | /** |
| | | * 微信open id |
| | | */ |
| | | @TableField(value = "wx_open_id") |
| | | private String wxOpenId; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @TableField(value = "nick_name") |
| | | private String nickName; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @TableField(value = "phone") |
| | | private String phone; |
| | | /** |
| | | * 头像地址 |
| | | */ |
| | | @TableField(value = "head_img") |
| | | private String headImg; |
| | | /** |
| | | * 状态 EState |
| | | */ |
| | | @TableField(value = "status") |
| | | private Integer status; |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @TableField(value = "balance") |
| | | private BigDecimal balance; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField(value = "comment") |
| | | private String comment; |
| | | /** |
| | | * 是否删除(逻辑删除) |
| | | */ |
| | | @TableLogic |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | /** |
| | | * 数据创建时间 |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Long createTime; |
| | | /** |
| | | * 数据更新时间 |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Timestamp updateTime; |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.PaymentRecordsPO; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class PaymentRecordsVO extends PaymentRecordsPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.RechargeOrderPO; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class RechargeOrderVO extends RechargeOrderPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.RechargeRecordsPO; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class RechargeRecordsVO extends RechargeRecordsPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.RefundRecordPO; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class RefundRecordVO extends RefundRecordPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.SysRegionPO; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class SysRegionVO extends SysRegionPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.TradeRecordPO; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class TradeRecordVO extends TradeRecordPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.UserCapitalChangePO; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class UserCapitalChangeVO extends UserCapitalChangePO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.repository.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import com.lunhan.water.common.util.LocalDateTimeUtil; |
| | | import com.lunhan.water.common.util.NumericUtil; |
| | | import java.util.Objects; |
| | | import com.lunhan.water.repository.po.UserLoginPO; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Data |
| | | public class UserLoginVO extends UserLoginPO implements BasicVO { |
| | | |
| | | @Override |
| | | public String getCreateTimeView() { |
| | | if (NumericUtil.tryParseLong(this.getCreateTime()).compareTo(0L) > 0) { |
| | | return LocalDateTimeUtil.toFormatString(this.getCreateTime()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public String getUpdateTimeView() { |
| | | if (Objects.isNull(this.getUpdateTime())) { |
| | | return ""; |
| | | } |
| | | return LocalDateTimeUtil.toFormatFullString(this.getUpdateTime()); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.PaymentRecordsMapperImpl; |
| | | import com.lunhan.water.repository.po.PaymentRecordsPO; |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqCreatePaymentRecords; |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqModifyPaymentRecords; |
| | | import com.lunhan.water.entity.search.SearchPaymentRecords; |
| | | import com.lunhan.water.repository.vo.PaymentRecordsVO; |
| | | import com.lunhan.water.service.convert.PaymentRecordsConvert; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class PaymentRecordsService extends BaseService { |
| | | @Autowired |
| | | private PaymentRecordsMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreatePaymentRecords request) { |
| | | // 转换po |
| | | PaymentRecordsPO item = PaymentRecordsConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[null]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyPaymentRecords request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<PaymentRecordsPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | PaymentRecordsPO item = PaymentRecordsConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[null]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<PaymentRecordsVO> get(Long id) { |
| | | PaymentRecordsVO result = new PaymentRecordsVO(); |
| | | |
| | | PaymentRecordsPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = PaymentRecordsConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<PaymentRecordsPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // PaymentRecordsPO item = new PaymentRecordsPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<PaymentRecordsPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // PaymentRecordsPO item = new PaymentRecordsPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<PaymentRecordsPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // PaymentRecordsPO item = new PaymentRecordsPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[null]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<PaymentRecordsPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<PaymentRecordsPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // PaymentRecordsPO item = new PaymentRecordsPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[null]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<PaymentRecordsVO>> getList(List<Long> listId) { |
| | | List<PaymentRecordsVO> result = new ArrayList<>(); |
| | | |
| | | List<PaymentRecordsPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = PaymentRecordsConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<PaymentRecordsVO>> search(SearchPaymentRecords search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<PaymentRecordsPO> pageList = mapper.search(search); |
| | | List<PaymentRecordsVO> listVo = new ArrayList<>(); |
| | | List<PaymentRecordsPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = PaymentRecordsConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<PaymentRecordsVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<PaymentRecordsPO> check4Id(Long id) { |
| | | PaymentRecordsPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[null]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<PaymentRecordsPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找null |
| | | List<PaymentRecordsPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[null]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(PaymentRecordsPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的null |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[null]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | package com.lunhan.water.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.google.gson.JsonObject; |
| | | import com.lunhan.water.common.ConstantFactory; |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.config.SysConfig; |
| | | import com.lunhan.water.common.enums.ELogger; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.jwt.LoginUserDTO; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.common.wechat.WechatAuthorization; |
| | | import com.lunhan.water.common.wechat.WechatPayV3Util; |
| | | import com.lunhan.water.common.wechat.req.*; |
| | | import com.lunhan.water.common.wechat.res.ResWeiXinRefund; |
| | | import com.lunhan.water.entity.enums.*; |
| | | import com.lunhan.water.entity.request.pay.ReqCreatePay; |
| | | import com.lunhan.water.entity.request.pay.ReqOrderPay; |
| | | import com.lunhan.water.entity.request.pay.ReqPayRefund; |
| | | |
| | | import com.lunhan.water.repository.impl.*; |
| | | import com.lunhan.water.repository.po.*; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PaymentServices { |
| | | // 微信公众号推送消息模板id |
| | | private static final Logger log = LoggerUtil.get(PaymentServices.class); |
| | | private Logger logger = LoggerUtil.get(this.getClass()); |
| | | private Logger loggerPay = LoggerUtil.get(ELogger.PAY_SERVICE); |
| | | @Autowired |
| | | private PaymentRecordsMapperImpl paymentRecordsMapper; |
| | | @Autowired |
| | | private RechargeOrderMapperImpl rechargeOrderMapper; |
| | | @Autowired |
| | | private UserLoginMapperImpl userLoginMapper; |
| | | @Autowired |
| | | private RefundRecordMapperImpl refundRecordDao; |
| | | @Autowired |
| | | private RechargeRecordsMapperImpl dao; |
| | | @Autowired |
| | | private UserCapitalChangeMapperImpl capitalChangeDao; |
| | | @Autowired |
| | | private TradeRecordMapperImpl tradeRecordDao; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 发起微信支付 |
| | | * |
| | | * @param loginUser 登录用户信息 |
| | | * @param request 请求参数 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ExecutedResult<Map<String, Object>> weiXinPay(LoginUserDTO loginUser, ReqCreatePay request) { |
| | | EBusinessType type = EBusinessType.getByValue(request.getBusinessType()); |
| | | if (Objects.isNull(type)) { |
| | | return ExecutedResult.failed("业务不支持." + request.getBusinessType()); |
| | | } |
| | | String callbackUrl = SysConfig.weiXinPay.getNotifyBasicUrl() + String.format("/notify/pay/%s/%s/%s", |
| | | EPaymentChannel.WE_CHAT.getValue(), |
| | | EPayWay.SCAN_DYNAMIC.getValue(), |
| | | request.getBusinessType() |
| | | ); |
| | | //查询支付用户信息 |
| | | UserLoginPO user = userLoginMapper.get4Openid(loginUser.getUserId()); |
| | | if (Objects.isNull(user)) { |
| | | return ExecutedResult.failed("用户信息不存在!"); |
| | | } |
| | | switch (type) { |
| | | case RECHARGE: |
| | | //查询充值订单 |
| | | RechargeOrderPO rechargeOrderPO = rechargeOrderMapper.getByOrderNo(request.getBusinessNo()); |
| | | if (Objects.isNull(rechargeOrderPO)) { |
| | | return ExecutedResult.failed("未查询到充值订单!"); |
| | | } |
| | | //修改充值订单为支付中 |
| | | rechargeOrderPO.setPayState(EPayState.PAYING.getValue()); |
| | | rechargeOrderMapper.updateById(rechargeOrderPO); |
| | | //获取订单金额 |
| | | request.setTradeAmount(rechargeOrderPO.getPaymentAmount()); |
| | | request.setWechatOpenid(user.getWxOpenId()); |
| | | request.setBusinessComment("用户充值"); |
| | | //添加充值记录 |
| | | RechargeRecordsPO item = new RechargeRecordsPO(); |
| | | item.setRechargeOrder(request.getBusinessNo()); |
| | | item.setRechargeType(ERechargeType.MOBILE.getDesc()); |
| | | item.setPaymentMethod(EPayType.WX_PAY.getDesc()); |
| | | item.setRechargeStatus(EYesOrNo.NO.getValue()); |
| | | item.setRechargeAmount(request.getTradeAmount()); |
| | | item.setComment("水卡充值"); |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | item.setCreateUser(loginUser.getUserId()); |
| | | item.setCreateUserName(loginUser.getNickName()); |
| | | dao.insert(item); |
| | | break; |
| | | } |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | // 生成支付流水记录 |
| | | TradeRecordPO trade = new TradeRecordPO(); |
| | | trade.setTradeNo("TN" + SnowFlakeUtil.getId()); |
| | | trade.setTradeAmount(request.getTradeAmount()); |
| | | trade.setBusinessType(request.getBusinessType()); |
| | | trade.setBusinessNo(request.getBusinessNo()); |
| | | trade.setBusinessComment(request.getBusinessComment()); |
| | | trade.setPaymentChannel(EPaymentChannel.WE_CHAT.getValue()); |
| | | trade.setChannelName(EPaymentChannel.WE_CHAT.getDesc()); |
| | | trade.setPayWay(EPayWay.SCAN_DYNAMIC.getValue()); |
| | | trade.setPayWayName(EPayWay.SCAN_DYNAMIC.getDesc()); |
| | | // 这里不需要通知第三方,回调地址为空 |
| | | trade.setCallbackUrl(""); |
| | | trade.setThirdTradeNo(""); |
| | | trade.setSubmitTime(0L); |
| | | trade.setSubmitTimeView(""); |
| | | trade.setPayState(EPayState.WAITING.getValue()); |
| | | trade.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | |
| | | int createTrade = tradeRecordDao.insert(trade); |
| | | if (createTrade < 1) { |
| | | return ExecutedResult.failed("发起支付失败: 创建支付流水失败."); |
| | | } |
| | | // 发起微信支付 |
| | | ExecutedResult<Map<String, Object>> doWeiXinPay = this.doWeiXinPay(request, trade.getTradeNo(), callbackUrl); |
| | | if (doWeiXinPay.isFailed()) { |
| | | return ExecutedResult.failed(doWeiXinPay.getMsg(), doWeiXinPay.getMsgCode()); |
| | | } |
| | | TradeRecordPO upd = new TradeRecordPO(); |
| | | upd.setId(trade.getId()); |
| | | upd.setPayState(EPayState.PAYING.getValue()); |
| | | upd.setSubmitTime(now); |
| | | upd.setSubmitTimeView(nowView); |
| | | int modifyTrade = tradeRecordDao.updateById(upd); |
| | | if (modifyTrade < 1) { |
| | | return ExecutedResult.failed("回写微信支付状态失败!"); |
| | | } |
| | | return doWeiXinPay; |
| | | } |
| | | |
| | | /** |
| | | * 发起微信支付 |
| | | * |
| | | * @param request 支付请求参数 |
| | | * @param tradeCode 支付流水号 |
| | | * @param callbackUrl 支付结果通知地址 |
| | | */ |
| | | private ExecutedResult<Map<String, Object>> doWeiXinPay(ReqCreatePay request, String tradeCode, String callbackUrl) { |
| | | String merchantId = SysConfig.weiXinPay.getMerchantId(); |
| | | // 支付证书序列号 |
| | | String certificateSerialNo = SysConfig.weiXinPay.getCertificateSn(); |
| | | // 支付证书私钥存放路径 |
| | | String privateKeyPath = SysConfig.weiXinPay.getPrivateKeyPath(); |
| | | String appID = SysConfig.weiXinPay.getAppID(); |
| | | |
| | | ReqCreateWechatPay reqPay = new ReqCreateWechatPay(); |
| | | reqPay.setAppid(appID); |
| | | reqPay.setMchid(merchantId); |
| | | reqPay.setOut_trade_no(tradeCode); |
| | | reqPay.setDescription(request.getBusinessComment()); |
| | | reqPay.setNotify_url(""); |
| | | if (StringUtil.isNotNullOrEmpty(callbackUrl)) { |
| | | reqPay.setNotify_url(callbackUrl); |
| | | } |
| | | // 微信支付,金额单位为“分”,这里需要乘以100 |
| | | Long amount = Long.parseLong(NumericUtil.toNumberString(request.getTradeAmount().multiply(new BigDecimal(ConstantFactory.NUM100)), 0)); |
| | | reqPay.setAmount(new CreatePay_Amount() {{ |
| | | setTotal(amount); |
| | | }}); |
| | | reqPay.setPayer(new CreatePay_Payer() {{ |
| | | setOpenid(request.getWechatOpenid()); |
| | | }}); |
| | | |
| | | WechatAuthorization author = new WechatAuthorization( |
| | | merchantId, |
| | | certificateSerialNo, |
| | | privateKeyPath |
| | | ); |
| | | |
| | | String wxTradeCode = ""; |
| | | try { |
| | | loggerPay.info("发起微信支付: " + SerializeUtil.toJson(reqPay)); |
| | | ExecutedResult<String> createPay = WechatPayV3Util.createPay(reqPay, author); |
| | | loggerPay.info("发起微信支付-结果: " + SerializeUtil.toJson(createPay)); |
| | | if (createPay.isFailed()) { |
| | | return ExecutedResult.failed("发起第三方支付失败: " + createPay.getMsg(), createPay.getMsgCode()); |
| | | } |
| | | wxTradeCode = createPay.getData(); |
| | | } catch (Exception e) { |
| | | return ExecutedResult.failed("发起第三方支付失败: " + e.getMessage()); |
| | | } |
| | | String prepayId = wxTradeCode; |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | |
| | | String timeStamp = LocalDateTimeUtil.nowTimeStampStr(); |
| | | String randomStr = RandVerifyCode.complexCode(10); |
| | | result.put("appId", appID); |
| | | result.put("timeStamp", timeStamp); |
| | | result.put("nonceStr", randomStr); |
| | | prepayId = "prepay_id=" + prepayId; |
| | | result.put("package", prepayId); |
| | | result.put("signType", "RSA"); |
| | | |
| | | String signText = appID + "\n" + timeStamp + "\n" + randomStr + "\n" + prepayId + "\n"; |
| | | String paySign = author.sign(signText.getBytes(StandardCharsets.UTF_8)); |
| | | result.put("paySign", paySign); |
| | | |
| | | loggerPay.info("发起微信支付-返回前端: " + SerializeUtil.toJson(result)); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 支付退款 |
| | | * |
| | | * @param request 请求参数 |
| | | * @return 退款流水号 |
| | | */ |
| | | public ExecutedResult<String> weiXinRefund(ReqPayRefund request) { |
| | | TradeRecordPO trade = tradeRecordDao.get4Business(request.getBusinessType(), request.getBusinessNo()); |
| | | if (Objects.isNull(trade) || !Objects.equals(trade.getBusinessNo(), request.getBusinessNo())) { |
| | | return ExecutedResult.failed("支付流水不存在!" + request.getBusinessNo()); |
| | | } |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | // 添加退款记录 |
| | | RefundRecordPO refund = new RefundRecordPO(); |
| | | refund.setRefundNo("RN" + SnowFlakeUtil.getId()); |
| | | refund.setTradeNo(trade.getTradeNo()); |
| | | refund.setTradeAmount(trade.getPaidAmount()); |
| | | refund.setRefundAmount(request.getRefundAmount()); |
| | | refund.setBusinessType(request.getBusinessType()); |
| | | refund.setBusinessNo(request.getBusinessNo()); |
| | | refund.setBusinessComment(request.getBusinessComment()); |
| | | refund.setPaymentChannel(trade.getPaymentChannel()); |
| | | refund.setChannelName(trade.getChannelName()); |
| | | refund.setPayWay(trade.getPayWay()); |
| | | refund.setPayWayName(trade.getPayWayName()); |
| | | // 这里不需要通知第三方,回调地址为空 |
| | | refund.setCallbackUrl(""); |
| | | |
| | | refund.setThirdRefundNo(""); |
| | | refund.setSubmitTime(0L); |
| | | refund.setSubmitTimeView(""); |
| | | refund.setNotifyTime(0L); |
| | | refund.setNotifyTimeView(""); |
| | | refund.setRefundTime(0L); |
| | | refund.setRefundTimeView(""); |
| | | refund.setThirdRefundAmount(BigDecimal.ZERO); |
| | | refund.setClosedTime(0L); |
| | | refund.setClosedTimeView(""); |
| | | refund.setClosedComment(""); |
| | | refund.setComment(""); |
| | | refund.setRefundState(ERefundState.WAITING.getValue()); |
| | | refund.setCreateTime(now); |
| | | |
| | | int addRefund = refundRecordDao.insert(refund); |
| | | if (addRefund < 1) { |
| | | return ExecutedResult.failed("创建退款失败!"); |
| | | } |
| | | ExecutedResult<String> doWeiXinRefund = this.doWeiXinRefund(request, trade, refund.getRefundNo(), SysConfig.weiXinPay.getNotifyBasicUrl() + String.format("/notify/refund/%s/%s/%s", |
| | | refund.getPaymentChannel(), |
| | | refund.getPayWay(), |
| | | refund.getBusinessType()) |
| | | ); |
| | | if (doWeiXinRefund.isFailed()) { |
| | | return ExecutedResult.failed(doWeiXinRefund.getMsg(), doWeiXinRefund.getMsgCode()); |
| | | } |
| | | RefundRecordPO upd = new RefundRecordPO(); |
| | | upd.setId(refund.getId()); |
| | | upd.setRefundState(ERefundState.REFUNDING.getValue()); |
| | | upd.setSubmitTime(now); |
| | | upd.setSubmitTimeView(nowView); |
| | | int modifyRefund = refundRecordDao.updateById(upd); |
| | | if (modifyRefund < 1) { |
| | | return ExecutedResult.failed("回写退款状态失败!"); |
| | | } |
| | | return ExecutedResult.success(refund.getRefundNo()); |
| | | } |
| | | |
| | | private ExecutedResult<String> doWeiXinRefund(ReqPayRefund request, TradeRecordPO trade, String refundNo, String callbackUrl) { |
| | | String certificateSerialNo = SysConfig.weiXinPay.getCertificateSn(); |
| | | // 支付证书私钥存放路径 |
| | | String privateKeyPath = SysConfig.weiXinPay.getPrivateKeyPath(); |
| | | |
| | | Integer total = Integer.parseInt(NumericUtil.toNumberString(trade.getPaidAmount().multiply(new BigDecimal(ConstantFactory.NUM100.toString())), 0)); |
| | | Integer refundAmount = Integer.parseInt(NumericUtil.toNumberString(request.getRefundAmount().multiply(new BigDecimal(ConstantFactory.NUM100.toString())), 0)); |
| | | WeiXinRefund_Amount amount = new WeiXinRefund_Amount(); |
| | | amount.setTotal(total); |
| | | amount.setRefund(refundAmount); |
| | | amount.setCurrency("CNY"); |
| | | |
| | | ReqCreateWeiXinRefund reqWeiXinRefund = new ReqCreateWeiXinRefund(); |
| | | reqWeiXinRefund.setTransaction_id(trade.getThirdTradeNo()); |
| | | reqWeiXinRefund.setOut_refund_no(refundNo); |
| | | reqWeiXinRefund.setAmount(amount); |
| | | reqWeiXinRefund.setReason(request.getBusinessComment()); |
| | | reqWeiXinRefund.setNotify_url(callbackUrl); |
| | | WechatAuthorization author = new WechatAuthorization( |
| | | SysConfig.weiXinPay.getMerchantId(), |
| | | certificateSerialNo, |
| | | privateKeyPath |
| | | ); |
| | | try { |
| | | ExecutedResult<ResWeiXinRefund> createRefund = WechatPayV3Util.createRefund(reqWeiXinRefund, author); |
| | | if (createRefund.isFailed()) { |
| | | return ExecutedResult.failed("发起第三方支付失败: " + createRefund.getMsg(), createRefund.getMsgCode()); |
| | | } |
| | | // 这里不回写微信的退款流水号,统一到退款通知时回写 |
| | | } catch (Exception e) { |
| | | return ExecutedResult.failed("发起第三方支付失败: " + e.getMessage()); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 执行支付成功 |
| | | * |
| | | * @param tradeNo 支付流水号 |
| | | * @param thirdTradeNo 第三方支付流水号 |
| | | * @param paidAmount 实际支付金额 |
| | | * @param payTime 支付完成时间 |
| | | */ |
| | | public ExecutedResult<String> doPaidSuccess(String tradeNo, String thirdTradeNo, BigDecimal paidAmount, LocalDateTime payTime) { |
| | | ExecutedResult<TradeRecordPO> checkTrade = this.checkTrade(tradeNo); |
| | | if (checkTrade.isFailed()) { |
| | | return ExecutedResult.failed(checkTrade.getMsg()); |
| | | } |
| | | TradeRecordPO trade = checkTrade.getData(); |
| | | // 重复通知 |
| | | if (Objects.equals(trade.getPayState(), EPayState.SUCCESS.getValue())) { |
| | | return ExecutedResult.success(); |
| | | } |
| | | if (!Objects.equals(trade.getPayState(), EPayState.PAYING.getValue())) { |
| | | return ExecutedResult.success(); |
| | | } |
| | | EBusinessType type = EBusinessType.getByValue(trade.getBusinessType()); |
| | | switch (type) { |
| | | case RECHARGE: |
| | | //充值订单 |
| | | RechargeRecordsPO recordsPO = dao.getByRechargeOrder(trade.getBusinessNo()); |
| | | LoggerUtil.get(ELogger.PAY_SERVICE).info(trade.getBusinessNo() + ", 查找支付流水: " + SerializeUtil.toJson(recordsPO)); |
| | | if (recordsPO.getRechargeStatus() == 0) { |
| | | //修改充值记录中的充值状态=1 |
| | | recordsPO.setRechargeStatus(1); |
| | | dao.updateById(recordsPO); |
| | | |
| | | RechargeOrderPO rechargeOrderPO = rechargeOrderMapper.getByOrderNo(trade.getBusinessNo()); |
| | | if (Objects.nonNull(rechargeOrderPO)) { |
| | | //修改充值订单为已充值 |
| | | rechargeOrderPO.setPayType(EPayType.WX_PAY.getValue()); |
| | | rechargeOrderPO.setPayTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | rechargeOrderPO.setPayState(EPayState.SUCCESS.getValue()); |
| | | rechargeOrderMapper.updateById(rechargeOrderPO); |
| | | //修改用户余额 |
| | | UserLoginPO user = userLoginMapper.getById(rechargeOrderPO.getUserId()); |
| | | UserLoginPO userLoginPO = new UserLoginPO(); |
| | | userLoginPO.setId(user.getId()); |
| | | //余额加上交易金额=充值后的余额 |
| | | userLoginPO.setBalance(userLoginPO.getBalance().add(trade.getTradeAmount())); |
| | | int modify = userLoginMapper.updateById(userLoginPO); |
| | | //添加资金明细记录 |
| | | UserCapitalChangePO changePO = new UserCapitalChangePO(); |
| | | changePO.setUserId(user.getId()); |
| | | changePO.setBusiness(ECapitalChange.MOBILE_Recharge.getValue()); |
| | | changePO.setBusinessName(ECapitalChange.MOBILE_Recharge.getDesc()); |
| | | changePO.setBusinessCode(recordsPO.getRechargeOrder()); |
| | | changePO.setChangeMoney(paidAmount); |
| | | changePO.setBeforeMoney(user.getBalance()); |
| | | changePO.setAfterMoney(userLoginPO.getBalance()); |
| | | changePO.setDescription("微信充值"); |
| | | changePO.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | changePO.setCreateUser("0"); |
| | | changePO.setCreateUserName("系统"); |
| | | int addCapitalChange = capitalChangeDao.insert(changePO); |
| | | LoggerUtil.get(ELogger.PAY_SERVICE).info("添加资金变动: " + addCapitalChange); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | TradeRecordPO upd = new TradeRecordPO(); |
| | | upd.setId(trade.getId()); |
| | | upd.setNotifyTime(now); |
| | | upd.setNotifyTimeView(nowView); |
| | | upd.setThirdTradeNo(thirdTradeNo); |
| | | upd.setPayState(EPayState.SUCCESS.getValue()); |
| | | upd.setPaidTime(LocalDateTimeUtil.getTimeStamp(payTime).getTime()); |
| | | upd.setPaidTimeView(LocalDateTimeUtil.toFormatFullString(payTime)); |
| | | upd.setPaidAmount(paidAmount); |
| | | upd.setCanRefund(EYesOrNo.YES.getValue()); |
| | | int updateTrade = tradeRecordDao.updateById(upd); |
| | | if (updateTrade < 1) { |
| | | return ExecutedResult.failed("修改支付流水状态失败!"); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(trade.getBusinessCallbackUrl())) { |
| | | JsonObject data = new JsonObject(); |
| | | data.addProperty("isSuccess", Boolean.TRUE); |
| | | data.addProperty("errorMsg", ""); |
| | | data.addProperty("businessNo", trade.getBusinessNo()); |
| | | data.addProperty("tradeAmount", trade.getTradeAmount()); |
| | | data.addProperty("paidAmount", paidAmount); |
| | | String timeStr = ""; |
| | | if (Objects.isNull(payTime)) { |
| | | timeStr = LocalDateTimeUtil.toFormatString(payTime); |
| | | } |
| | | data.addProperty("paidTime", timeStr); |
| | | |
| | | ThreadPoolUtil.getDefaultPool().execute(() -> { |
| | | try { |
| | | logger.info("通知业务方支付结果: " + data); |
| | | String response = HttpUtil.postJson(trade.getBusinessCallbackUrl(), data, new HashMap<>()); |
| | | logger.info("通知业务方支付结果-返回: " + response); |
| | | } catch (Exception e) { |
| | | logger.error("通知业务方支付结果失败!", e); |
| | | } |
| | | }); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验支付流水号是否存在 |
| | | * |
| | | * @param tradeNo 支付流水号 |
| | | */ |
| | | public ExecutedResult<TradeRecordPO> checkTrade(String tradeNo) { |
| | | TradeRecordPO trade = tradeRecordDao.get4TradeNo(tradeNo); |
| | | if (Objects.isNull(trade) || !Objects.equals(trade.getTradeNo(), tradeNo)) { |
| | | return ExecutedResult.failed("支付流水不存在!" + tradeNo); |
| | | } |
| | | return ExecutedResult.success(trade); |
| | | } |
| | | |
| | | /** |
| | | * 校验退款流水号是否存在 |
| | | * |
| | | * @param refundNo 退款流水号 |
| | | */ |
| | | public ExecutedResult<RefundRecordPO> checkRefund(String refundNo) { |
| | | RefundRecordPO refund = refundRecordDao.get4RefundNo(refundNo); |
| | | if (Objects.isNull(refund) || !Objects.equals(refund.getRefundNo(), refundNo)) { |
| | | return ExecutedResult.failed("退款流水不存在!" + refundNo); |
| | | } |
| | | return ExecutedResult.success(refund); |
| | | } |
| | | |
| | | /** |
| | | * 执行支付失败 |
| | | * |
| | | * @param tradeNo 支付流水号 |
| | | * @param thirdTradeNo 第三方支付流水号 |
| | | * @param reason 失败原因 |
| | | */ |
| | | public ExecutedResult<String> doPaidFailed(String tradeNo, String thirdTradeNo, String reason) { |
| | | ExecutedResult<TradeRecordPO> checkTrade = this.checkTrade(tradeNo); |
| | | if (checkTrade.isFailed()) { |
| | | return ExecutedResult.failed(checkTrade.getMsg()); |
| | | } |
| | | TradeRecordPO trade = checkTrade.getData(); |
| | | // 重复通知 |
| | | if (Objects.equals(trade.getPayState(), EPayState.FAILED.getValue())) { |
| | | return ExecutedResult.success(); |
| | | } |
| | | if (!Objects.equals(trade.getPayState(), EPayState.PAYING.getValue())) { |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | EBusinessType type = EBusinessType.getByValue(trade.getBusinessType()); |
| | | switch (type) { |
| | | case RECHARGE: |
| | | //充值订单 |
| | | RechargeRecordsPO recordsPO = dao.getByRechargeOrder(trade.getBusinessNo()); |
| | | LoggerUtil.get(ELogger.PAY_SERVICE).info(trade.getBusinessNo() + ", 查找支付流水: " + SerializeUtil.toJson(recordsPO)); |
| | | if (recordsPO != null) { |
| | | RechargeRecordsPO updRecharge = new RechargeRecordsPO(); |
| | | updRecharge.setId(recordsPO.getId()); |
| | | updRecharge.setComment("充值失败!" + reason); |
| | | dao.updateById(updRecharge); |
| | | } |
| | | break; |
| | | } |
| | | TradeRecordPO upd = new TradeRecordPO(); |
| | | upd.setId(trade.getId()); |
| | | upd.setNotifyTime(now); |
| | | upd.setNotifyTimeView(nowView); |
| | | upd.setThirdTradeNo(thirdTradeNo); |
| | | upd.setPayState(EPayState.FAILED.getValue()); |
| | | upd.setClosedComment("微信返回支付失败: " + reason); |
| | | |
| | | int updateTrade = tradeRecordDao.updateById(upd); |
| | | if (updateTrade < 1) { |
| | | return ExecutedResult.failed("修改支付流水状态失败!"); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(trade.getBusinessCallbackUrl())) { |
| | | JsonObject data = new JsonObject(); |
| | | data.addProperty("isSuccess", Boolean.FALSE); |
| | | data.addProperty("errorMsg", reason); |
| | | data.addProperty("businessNo", trade.getBusinessNo()); |
| | | data.addProperty("tradeAmount", trade.getTradeAmount()); |
| | | data.addProperty("paidAmount", BigDecimal.ZERO); |
| | | data.addProperty("paidTime", ""); |
| | | |
| | | ThreadPoolUtil.getDefaultPool().execute(() -> { |
| | | try { |
| | | logger.info("通知业务方支付结果: " + data); |
| | | String response = HttpUtil.postJson(trade.getBusinessCallbackUrl(), data, new HashMap<>()); |
| | | logger.info("通知业务方支付结果-返回: " + response); |
| | | } catch (Exception e) { |
| | | logger.error("通知业务方支付结果失败!", e); |
| | | } |
| | | }); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 执行退款成功 |
| | | * |
| | | * @param refundNo 退款流水号 |
| | | * @param thirdRefundNo 第三方退款流水号 |
| | | * @param refundAmount 实际退款金额 |
| | | * @param refundTime 退款成功时间 |
| | | * @return |
| | | */ |
| | | public ExecutedResult<String> doRefundSuccess(String refundNo, String thirdRefundNo, BigDecimal refundAmount, LocalDateTime refundTime) { |
| | | ExecutedResult<RefundRecordPO> checkTrade = this.checkRefund(refundNo); |
| | | if (checkTrade.isFailed()) { |
| | | return ExecutedResult.failed(checkTrade.getMsg()); |
| | | } |
| | | RefundRecordPO refund = checkTrade.getData(); |
| | | |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | |
| | | RefundRecordPO upd = new RefundRecordPO(); |
| | | upd.setId(refund.getId()); |
| | | upd.setNotifyTime(now); |
| | | upd.setNotifyTimeView(nowView); |
| | | upd.setThirdRefundNo(thirdRefundNo); |
| | | upd.setRefundState(ERefundState.SUCCESS.getValue()); |
| | | upd.setRefundTime(LocalDateTimeUtil.getTimeStamp(refundTime).getTime()); |
| | | upd.setRefundTimeView(LocalDateTimeUtil.toFormatFullString(refundTime)); |
| | | upd.setRefundAmount(refundAmount); |
| | | int updateTrade = refundRecordDao.updateById(upd); |
| | | if (updateTrade < 1) { |
| | | return ExecutedResult.failed("修改退款流水状态失败!"); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(refund.getCallbackUrl())) { |
| | | JsonObject data = new JsonObject(); |
| | | data.addProperty("isSuccess", Boolean.TRUE); |
| | | data.addProperty("errorMsg", ""); |
| | | data.addProperty("businessNo", refund.getBusinessNo()); |
| | | data.addProperty("paidAmount", refund.getTradeAmount()); |
| | | data.addProperty("tradeAmount", refund.getRefundAmount()); |
| | | data.addProperty("refundAmount", refundAmount); |
| | | String timeStr = ""; |
| | | if (Objects.isNull(refundTime)) { |
| | | timeStr = LocalDateTimeUtil.toFormatString(refundTime); |
| | | } |
| | | data.addProperty("refundTime", timeStr); |
| | | |
| | | ThreadPoolUtil.getDefaultPool().execute(() -> { |
| | | try { |
| | | logger.info("通知业务方退款结果: " + data); |
| | | String response = HttpUtil.postJson(refund.getBusinessCallbackUrl(), data, new HashMap<>()); |
| | | logger.info("通知业务方退款结果-返回: " + response); |
| | | } catch (Exception e) { |
| | | logger.error("通知业务方退款结果失败!", e); |
| | | } |
| | | }); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 执行退款失败 |
| | | * |
| | | * @param refundNo 退款流水号 |
| | | * @param thirdRefundNo 第三方退款流水号 |
| | | * @param reason 失败原因 |
| | | */ |
| | | public ExecutedResult<String> doRefundFailed(String refundNo, String thirdRefundNo, String reason) { |
| | | ExecutedResult<RefundRecordPO> checkTrade = this.checkRefund(refundNo); |
| | | if (checkTrade.isFailed()) { |
| | | return ExecutedResult.failed(checkTrade.getMsg()); |
| | | } |
| | | RefundRecordPO refund = checkTrade.getData(); |
| | | |
| | | Long now = LocalDateTimeUtil.nowTimeStamp(); |
| | | String nowView = LocalDateTimeUtil.nowDateTimeFullStr(); |
| | | |
| | | RefundRecordPO upd = new RefundRecordPO(); |
| | | upd.setId(refund.getId()); |
| | | upd.setNotifyTime(now); |
| | | upd.setNotifyTimeView(nowView); |
| | | upd.setThirdRefundNo(thirdRefundNo); |
| | | upd.setRefundState(ERefundState.FAILED.getValue()); |
| | | upd.setClosedComment("微信返回退款失败: " + reason); |
| | | |
| | | int updateTrade = refundRecordDao.updateById(upd); |
| | | if (updateTrade < 1) { |
| | | return ExecutedResult.failed("修改退款流水状态失败!"); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(refund.getBusinessCallbackUrl())) { |
| | | JsonObject data = new JsonObject(); |
| | | data.addProperty("isSuccess", Boolean.FALSE); |
| | | data.addProperty("errorMsg", reason); |
| | | data.addProperty("businessNo", refund.getBusinessNo()); |
| | | data.addProperty("paidAmount", refund.getTradeAmount()); |
| | | data.addProperty("tradeAmount", refund.getRefundAmount()); |
| | | data.addProperty("refundAmount", BigDecimal.ZERO); |
| | | data.addProperty("refundTime", ""); |
| | | |
| | | ThreadPoolUtil.getDefaultPool().execute(() -> { |
| | | try { |
| | | logger.info("通知业务方退款结果: " + data); |
| | | String response = HttpUtil.postJson(refund.getBusinessCallbackUrl(), data, new HashMap<>()); |
| | | logger.info("通知业务方退款结果-返回: " + response); |
| | | } catch (Exception e) { |
| | | logger.error("通知业务方退款结果失败!", e); |
| | | } |
| | | }); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.RechargeOrderMapperImpl; |
| | | import com.lunhan.water.repository.po.RechargeOrderPO; |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqCreateRechargeOrder; |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqModifyRechargeOrder; |
| | | import com.lunhan.water.entity.search.SearchRechargeOrder; |
| | | import com.lunhan.water.repository.vo.RechargeOrderVO; |
| | | import com.lunhan.water.service.convert.RechargeOrderConvert; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class RechargeOrderService extends BaseService { |
| | | @Autowired |
| | | private RechargeOrderMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateRechargeOrder request) { |
| | | // 转换po |
| | | RechargeOrderPO item = RechargeOrderConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[用户充值订单]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyRechargeOrder request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<RechargeOrderPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | RechargeOrderPO item = RechargeOrderConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[用户充值订单]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<RechargeOrderVO> get(Long id) { |
| | | RechargeOrderVO result = new RechargeOrderVO(); |
| | | |
| | | RechargeOrderPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = RechargeOrderConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeOrderPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeOrderPO item = new RechargeOrderPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[用户充值订单]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeOrderPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeOrderPO item = new RechargeOrderPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[用户充值订单]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeOrderPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeOrderPO item = new RechargeOrderPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[用户充值订单]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<RechargeOrderPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<RechargeOrderPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // RechargeOrderPO item = new RechargeOrderPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[用户充值订单]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[用户充值订单]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[用户充值订单]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<RechargeOrderVO>> getList(List<Long> listId) { |
| | | List<RechargeOrderVO> result = new ArrayList<>(); |
| | | |
| | | List<RechargeOrderPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = RechargeOrderConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<RechargeOrderVO>> search(SearchRechargeOrder search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<RechargeOrderPO> pageList = mapper.search(search); |
| | | List<RechargeOrderVO> listVo = new ArrayList<>(); |
| | | List<RechargeOrderPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = RechargeOrderConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<RechargeOrderVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<RechargeOrderPO> check4Id(Long id) { |
| | | RechargeOrderPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[用户充值订单]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<RechargeOrderPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找用户充值订单 |
| | | List<RechargeOrderPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[用户充值订单]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(RechargeOrderPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的用户充值订单 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[用户充值订单]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.RechargeRecordsMapperImpl; |
| | | import com.lunhan.water.repository.po.RechargeRecordsPO; |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqCreateRechargeRecords; |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqModifyRechargeRecords; |
| | | import com.lunhan.water.entity.search.SearchRechargeRecords; |
| | | import com.lunhan.water.repository.vo.RechargeRecordsVO; |
| | | import com.lunhan.water.service.convert.RechargeRecordsConvert; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class RechargeRecordsService extends BaseService { |
| | | @Autowired |
| | | private RechargeRecordsMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateRechargeRecords request) { |
| | | // 转换po |
| | | RechargeRecordsPO item = RechargeRecordsConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[充值记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyRechargeRecords request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<RechargeRecordsPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | RechargeRecordsPO item = RechargeRecordsConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[充值记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<RechargeRecordsVO> get(Long id) { |
| | | RechargeRecordsVO result = new RechargeRecordsVO(); |
| | | |
| | | RechargeRecordsPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = RechargeRecordsConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeRecordsPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeRecordsPO item = new RechargeRecordsPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[充值记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeRecordsPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeRecordsPO item = new RechargeRecordsPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[充值记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RechargeRecordsPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RechargeRecordsPO item = new RechargeRecordsPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[充值记录]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<RechargeRecordsPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<RechargeRecordsPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // RechargeRecordsPO item = new RechargeRecordsPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[充值记录]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[充值记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[充值记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<RechargeRecordsVO>> getList(List<Long> listId) { |
| | | List<RechargeRecordsVO> result = new ArrayList<>(); |
| | | |
| | | List<RechargeRecordsPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = RechargeRecordsConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<RechargeRecordsVO>> search(SearchRechargeRecords search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<RechargeRecordsPO> pageList = mapper.search(search); |
| | | List<RechargeRecordsVO> listVo = new ArrayList<>(); |
| | | List<RechargeRecordsPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = RechargeRecordsConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<RechargeRecordsVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<RechargeRecordsPO> check4Id(Long id) { |
| | | RechargeRecordsPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[充值记录]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<RechargeRecordsPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找充值记录 |
| | | List<RechargeRecordsPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[充值记录]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(RechargeRecordsPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的充值记录 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[充值记录]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.RefundRecordMapperImpl; |
| | | import com.lunhan.water.repository.po.RefundRecordPO; |
| | | import com.lunhan.water.entity.request.refundrecord.ReqCreateRefundRecord; |
| | | import com.lunhan.water.entity.request.refundrecord.ReqModifyRefundRecord; |
| | | import com.lunhan.water.entity.search.SearchRefundRecord; |
| | | import com.lunhan.water.repository.vo.RefundRecordVO; |
| | | import com.lunhan.water.service.convert.RefundRecordConvert; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class RefundRecordService extends BaseService { |
| | | @Autowired |
| | | private RefundRecordMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateRefundRecord request) { |
| | | // 转换po |
| | | RefundRecordPO item = RefundRecordConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[退款记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyRefundRecord request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<RefundRecordPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | RefundRecordPO item = RefundRecordConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[退款记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<RefundRecordVO> get(Long id) { |
| | | RefundRecordVO result = new RefundRecordVO(); |
| | | |
| | | RefundRecordPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = RefundRecordConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RefundRecordPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RefundRecordPO item = new RefundRecordPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[退款记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RefundRecordPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RefundRecordPO item = new RefundRecordPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[退款记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<RefundRecordPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // RefundRecordPO item = new RefundRecordPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[退款记录]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<RefundRecordPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<RefundRecordPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // RefundRecordPO item = new RefundRecordPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[退款记录]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[退款记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[退款记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<RefundRecordVO>> getList(List<Long> listId) { |
| | | List<RefundRecordVO> result = new ArrayList<>(); |
| | | |
| | | List<RefundRecordPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = RefundRecordConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<RefundRecordVO>> search(SearchRefundRecord search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<RefundRecordPO> pageList = mapper.search(search); |
| | | List<RefundRecordVO> listVo = new ArrayList<>(); |
| | | List<RefundRecordPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = RefundRecordConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<RefundRecordVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<RefundRecordPO> check4Id(Long id) { |
| | | RefundRecordPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[退款记录]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<RefundRecordPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找退款记录 |
| | | List<RefundRecordPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[退款记录]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(RefundRecordPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的退款记录 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[退款记录]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.ExecutedResult; |
| | | import com.lunhan.water.common.PagerResult; |
| | | import com.lunhan.water.common.enums.EYesOrNo; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.request.sysregion.ReqCreateSysRegion; |
| | | import com.lunhan.water.entity.request.sysregion.ReqModifySysRegion; |
| | | import com.lunhan.water.entity.response.region.ResRegionTree; |
| | | import com.lunhan.water.entity.search.SearchSysRegion; |
| | | import com.lunhan.water.repository.impl.SysRegionMapperImpl; |
| | | import com.lunhan.water.repository.po.SysRegionPO; |
| | | import com.lunhan.water.repository.vo.SysRegionVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author lin.liu |
| | | * @description 系统行政地区 |
| | | */ |
| | | @Service |
| | | public class SysRegionService extends BaseService { |
| | | @Autowired |
| | | private SysRegionMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateSysRegion request) { |
| | | // 转换po |
| | | SysRegionPO item = CopierUtil.mapTo(request, SysRegionPO.class); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[系统行政地区]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifySysRegion request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<SysRegionPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | SysRegionPO item = CopierUtil.mapTo(request, SysRegionPO.class); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[系统行政地区]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<SysRegionVO> get(String code) { |
| | | SysRegionVO result = new SysRegionVO(); |
| | | |
| | | SysRegionPO find = mapper.get4Code(code); |
| | | if (null != find) { |
| | | result = CopierUtil.mapTo(find, SysRegionVO.class); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<SysRegionPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // SysRegionPO item = new SysRegionPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[系统行政地区]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<SysRegionPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // SysRegionPO item = new SysRegionPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item);\n" + |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[系统行政地区]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<SysRegionPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // SysRegionPO item = new SysRegionPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item);\n" + |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[系统行政地区]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<SysRegionPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<SysRegionPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // SysRegionPO item = new SysRegionPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[系统行政地区]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[系统行政地区]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[系统行政地区]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<SysRegionVO>> getList(List<Long> listId) { |
| | | List<SysRegionVO> result = new ArrayList<>(); |
| | | |
| | | List<SysRegionPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | result = CopierUtil.mapTo(list, SysRegionVO.class); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | public ExecutedResult<List<ResRegionTree>> getListChild(String code) { |
| | | List<SysRegionPO> list = null; |
| | | if (StringUtil.isNullOrEmpty(code)) { |
| | | list = mapper.getList4Level(1); |
| | | } else { |
| | | list = mapper.getList4Parent(code); |
| | | } |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.success(new ArrayList<>()); |
| | | } |
| | | return ExecutedResult.success(CopierUtil.mapTo(list, ResRegionTree.class)); |
| | | } |
| | | public void fillChildMenu(ResRegionTree view, List<SysRegionPO> list) { |
| | | List<SysRegionPO> listChild = list.stream() |
| | | .filter(c -> c.getParentCode().equals(view.getCode())) |
| | | .collect(Collectors.toList()); |
| | | view.setChildren(new ArrayList<>()); |
| | | if (ListUtil.isNullOrEmpty(listChild)) { |
| | | return; |
| | | } |
| | | listChild = listChild.stream() |
| | | .sorted(Comparator.comparing(SysRegionPO::getSort)) |
| | | .collect(Collectors.toList()); |
| | | for (SysRegionPO child : listChild) { |
| | | ResRegionTree viewChild = CopierUtil.mapTo(child, ResRegionTree.class); |
| | | this.fillChildMenu(viewChild, list); |
| | | view.getChildren().add(viewChild); |
| | | } |
| | | } |
| | | public ExecutedResult<PagerResult<SysRegionVO>> search(SearchSysRegion search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<SysRegionPO> pageList = mapper.search(search); |
| | | List<SysRegionVO> listVo = new ArrayList<>(); |
| | | List<SysRegionPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = CopierUtil.mapTo(list, SysRegionVO.class); |
| | | } |
| | | PagerResult<SysRegionVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<SysRegionPO> check4Id(Long id) { |
| | | SysRegionPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[系统行政地区]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<SysRegionPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找系统行政地区 |
| | | List<SysRegionPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[系统行政地区]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(SysRegionPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的系统行政地区 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[系统行政地区]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | } |
| | | public void fillChild(ResRegionTree view, List<SysRegionPO> list) { |
| | | List<SysRegionPO> listChild = list.stream() |
| | | .filter(c -> c.getParentCode().equals(view.getCode())) |
| | | .collect(Collectors.toList()); |
| | | view.setChildren(new ArrayList<>()); |
| | | if (ListUtil.isNullOrEmpty(listChild)) { |
| | | return; |
| | | } |
| | | listChild = listChild.stream() |
| | | .sorted(Comparator.comparing(SysRegionPO::getSort)) |
| | | .collect(Collectors.toList()); |
| | | for (SysRegionPO child : listChild) { |
| | | ResRegionTree viewChild = CopierUtil.mapTo(child, ResRegionTree.class); |
| | | this.fillChild(viewChild, list); |
| | | view.getChildren().add(viewChild); |
| | | } |
| | | } |
| | | public ExecutedResult<SysRegionPO> check4Code(String code) { |
| | | SysRegionPO exists = mapper.get4Code(code); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[系统行政地区]不存在:" + code); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | public ExecutedResult<ResRegionTree> currAndTree(String code) { |
| | | // 校验区域信息 |
| | | ExecutedResult<SysRegionPO> checkRegion = this.check4Code(code); |
| | | if (checkRegion.isFailed()) { |
| | | return ExecutedResult.failed(checkRegion.getMsg()); |
| | | } |
| | | SysRegionPO curr = checkRegion.getData(); |
| | | ResRegionTree result = CopierUtil.mapTo(curr, ResRegionTree.class); |
| | | |
| | | List<SysRegionPO> list = mapper.getList4LevelChild(curr.getLevel()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.success(result); |
| | | } |
| | | this.fillChild(result, list); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.TradeRecordMapperImpl; |
| | | import com.lunhan.water.repository.po.TradeRecordPO; |
| | | import com.lunhan.water.entity.request.traderecord.ReqCreateTradeRecord; |
| | | import com.lunhan.water.entity.request.traderecord.ReqModifyTradeRecord; |
| | | import com.lunhan.water.entity.search.SearchTradeRecord; |
| | | import com.lunhan.water.repository.vo.TradeRecordVO; |
| | | import com.lunhan.water.service.convert.TradeRecordConvert; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class TradeRecordService extends BaseService { |
| | | @Autowired |
| | | private TradeRecordMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateTradeRecord request) { |
| | | // 转换po |
| | | TradeRecordPO item = TradeRecordConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[支付记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyTradeRecord request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<TradeRecordPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | TradeRecordPO item = TradeRecordConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[支付记录]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<TradeRecordVO> get(Long id) { |
| | | TradeRecordVO result = new TradeRecordVO(); |
| | | |
| | | TradeRecordPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = TradeRecordConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<TradeRecordPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // TradeRecordPO item = new TradeRecordPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[支付记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<TradeRecordPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // TradeRecordPO item = new TradeRecordPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[支付记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<TradeRecordPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // TradeRecordPO item = new TradeRecordPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[支付记录]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<TradeRecordPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<TradeRecordPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // TradeRecordPO item = new TradeRecordPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[支付记录]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[支付记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[支付记录]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<TradeRecordVO>> getList(List<Long> listId) { |
| | | List<TradeRecordVO> result = new ArrayList<>(); |
| | | |
| | | List<TradeRecordPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = TradeRecordConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<TradeRecordVO>> search(SearchTradeRecord search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<TradeRecordPO> pageList = mapper.search(search); |
| | | List<TradeRecordVO> listVo = new ArrayList<>(); |
| | | List<TradeRecordPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = TradeRecordConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<TradeRecordVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<TradeRecordPO> check4Id(Long id) { |
| | | TradeRecordPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[支付记录]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<TradeRecordPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找支付记录 |
| | | List<TradeRecordPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[支付记录]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(TradeRecordPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的支付记录 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[支付记录]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.util.*; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.UserCapitalChangeMapperImpl; |
| | | import com.lunhan.water.repository.po.UserCapitalChangePO; |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqCreateUserCapitalChange; |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqModifyUserCapitalChange; |
| | | import com.lunhan.water.entity.search.SearchUserCapitalChange; |
| | | import com.lunhan.water.repository.vo.UserCapitalChangeVO; |
| | | import com.lunhan.water.service.convert.UserCapitalChangeConvert; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class UserCapitalChangeService extends BaseService { |
| | | @Autowired |
| | | private UserCapitalChangeMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateUserCapitalChange request) { |
| | | // 转换po |
| | | UserCapitalChangePO item = UserCapitalChangeConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[用户资金变动]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyUserCapitalChange request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<UserCapitalChangePO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | UserCapitalChangePO item = UserCapitalChangeConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[用户资金变动]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<UserCapitalChangeVO> get(Long id) { |
| | | UserCapitalChangeVO result = new UserCapitalChangeVO(); |
| | | |
| | | UserCapitalChangePO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = UserCapitalChangeConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserCapitalChangePO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserCapitalChangePO item = new UserCapitalChangePO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[用户资金变动]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserCapitalChangePO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserCapitalChangePO item = new UserCapitalChangePO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[用户资金变动]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserCapitalChangePO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserCapitalChangePO item = new UserCapitalChangePO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[用户资金变动]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<UserCapitalChangePO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<UserCapitalChangePO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // UserCapitalChangePO item = new UserCapitalChangePO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[用户资金变动]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[用户资金变动]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[用户资金变动]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<UserCapitalChangeVO>> getList(List<Long> listId) { |
| | | List<UserCapitalChangeVO> result = new ArrayList<>(); |
| | | |
| | | List<UserCapitalChangePO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = UserCapitalChangeConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<UserCapitalChangeVO>> search(SearchUserCapitalChange search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<UserCapitalChangePO> pageList = mapper.search(search); |
| | | List<UserCapitalChangeVO> listVo = new ArrayList<>(); |
| | | List<UserCapitalChangePO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = UserCapitalChangeConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<UserCapitalChangeVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<UserCapitalChangePO> check4Id(Long id) { |
| | | UserCapitalChangePO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[用户资金变动]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<UserCapitalChangePO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找用户资金变动 |
| | | List<UserCapitalChangePO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[用户资金变动]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(UserCapitalChangePO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的用户资金变动 |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[用户资金变动]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | }} |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service; |
| | | |
| | | import com.lunhan.water.common.*; |
| | | import com.lunhan.water.common.enums.*; |
| | | import com.lunhan.water.common.jwt.JWTUtil; |
| | | import com.lunhan.water.common.jwt.LoginUserDTO; |
| | | import com.lunhan.water.common.model.Tuple; |
| | | import com.lunhan.water.common.security.MD5Util; |
| | | import com.lunhan.water.common.util.*; |
| | | import com.lunhan.water.entity.enums.EState; |
| | | import com.lunhan.water.entity.enums.EUserType; |
| | | import com.lunhan.water.entity.request.ReqChangePassword; |
| | | import com.lunhan.water.entity.request.ReqUserLogin; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import com.lunhan.water.repository.impl.UserLoginMapperImpl; |
| | | import com.lunhan.water.repository.po.UserLoginPO; |
| | | import com.lunhan.water.entity.request.userlogin.ReqCreateUserLogin; |
| | | import com.lunhan.water.entity.request.userlogin.ReqModifyUserLogin; |
| | | import com.lunhan.water.entity.search.SearchUserLogin; |
| | | import com.lunhan.water.repository.vo.UserLoginVO; |
| | | import com.lunhan.water.service.convert.UserLoginConvert; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author lin.liu |
| | | */ |
| | | @Service |
| | | public class UserLoginService extends BaseService { |
| | | @Autowired |
| | | private UserLoginMapperImpl mapper; |
| | | |
| | | public ExecutedResult<Long> create(ReqCreateUserLogin request) { |
| | | // 转换po |
| | | UserLoginPO item = UserLoginConvert.INSTANCE.toCreate(request); |
| | | // 设置状态 |
| | | //item.setStatus(EState.NORMAL.getValue()); |
| | | // 设置记录创建时间 |
| | | item.setCreateTime(LocalDateTimeUtil.nowTimeStamp()); |
| | | // 是否删除(逻辑删除)初始值 |
| | | item.setIsDelete(EYesOrNo.NO.getValue()); |
| | | |
| | | int rowCount = mapper.insert(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("创建[null]失败。"); |
| | | } |
| | | return ExecutedResult.success(item.getId()); |
| | | } |
| | | |
| | | public ExecutedResult<String> modify(ReqModifyUserLogin request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<UserLoginPO> checkExists = this.check4Id(request.getId()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | UserLoginPO item = UserLoginConvert.INSTANCE.toModify(request); |
| | | |
| | | int rowCount = mapper.updateById(item); |
| | | if (rowCount != 1) { |
| | | return ExecutedResult.failed("编辑[null]失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | |
| | | public ExecutedResult<UserLoginVO> get(Long id) { |
| | | UserLoginVO result = new UserLoginVO(); |
| | | |
| | | UserLoginPO find = mapper.get(id); |
| | | if (null != find) { |
| | | // 转换vo |
| | | result = UserLoginConvert.INSTANCE.toVo(find); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | // public ExecutedResult<String> stop(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserLoginPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserLoginPO item = new UserLoginPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.DISABLED.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("停用[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> enable(Long id) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserLoginPO> checkExists = this.check4Id(id); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserLoginPO item = new UserLoginPO(); |
| | | // item.setId(id); |
| | | // item.setStatus(EState.NORMAL.getValue()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("启用[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> setSort(ReqSetSort request) { |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<UserLoginPO> checkExists = this.check4Id(request.getId()); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // UserLoginPO item = new UserLoginPO(); |
| | | // item.setId(request.getId()); |
| | | // item.setSort(request.getSort()); |
| | | // |
| | | // int rowCount = mapper.updateById(item); |
| | | // if (rowCount != 1) { |
| | | // return ExecutedResult.failed("设置[null]排序值失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> listSetSort(ReqListSetSort request) { |
| | | // // id列表 |
| | | // List<Long> listId = request.getList().stream().map(ReqSetSort::getId).collect(Collectors.toList()); |
| | | // // 验证记录是否存在 |
| | | // ExecutedResult<List<UserLoginPO>> checkExists = this.check4Id(listId); |
| | | // if (checkExists.isFailed()) { |
| | | // return ExecutedResult.failed(checkExists.getMsg()); |
| | | // } |
| | | // |
| | | // List<UserLoginPO> listUpdate = request.getList().stream() |
| | | // .map(c -> { |
| | | // UserLoginPO item = new UserLoginPO(); |
| | | // item.setId(c.getId()); |
| | | // item.setSort(c.getSort()); |
| | | // return item; |
| | | // }) |
| | | // .collect(Collectors.toList()); |
| | | // Boolean result = mapper.modifyList(listUpdate); |
| | | // if (result) { |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // return ExecutedResult.failed("[null]设置排序值失败"); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> remove(Long id) { |
| | | // Boolean result = mapper.deleteLogic(id); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | // |
| | | // public ExecutedResult<String> removeList(List<Long> ids) { |
| | | // Boolean result = mapper.deleteLogic(ids); |
| | | // if (BooleanUtils.isFalse(result)) { |
| | | // return ExecutedResult.failed("删除[null]失败。"); |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | |
| | | public ExecutedResult<List<UserLoginVO>> getList(List<Long> listId) { |
| | | List<UserLoginVO> result = new ArrayList<>(); |
| | | |
| | | List<UserLoginPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | // 转换vo |
| | | result = UserLoginConvert.INSTANCE.toVo(list); |
| | | } |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | public ExecutedResult<PagerResult<UserLoginVO>> search(SearchUserLogin search) { |
| | | // 处理创建时间范围-查询参数 |
| | | Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange()); |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) { |
| | | search.setCreateTimeStart(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem1()).getTime()); |
| | | } |
| | | if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem2())) { |
| | | search.setCreateTimeEnd(LocalDateTimeUtil.getTimeStamp(createTimeRange.getItem2()).getTime()); |
| | | } |
| | | |
| | | PagerResult<UserLoginPO> pageList = mapper.search(search); |
| | | List<UserLoginVO> listVo = new ArrayList<>(); |
| | | List<UserLoginPO> list = pageList.getList(); |
| | | if (ListUtil.isNotNullOrEmpty(list)) { |
| | | pageList.setLastId(list.get(list.size() - 1).getId()); |
| | | // 转换vo |
| | | listVo = UserLoginConvert.INSTANCE.toVo(list); |
| | | } |
| | | PagerResult<UserLoginVO> result = new PagerResult<>(pageList.getLimit(), pageList.getPage(), pageList.getTotal(), listVo); |
| | | result.setLastId(pageList.getLastId()); |
| | | return ExecutedResult.success(result); |
| | | } |
| | | |
| | | protected ExecutedResult<UserLoginPO> check4Id(Long id) { |
| | | UserLoginPO exists = mapper.get(id); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[null]不存在:" + id); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<List<UserLoginPO>> check4Id(List<Long> listId) { |
| | | // 从数据库查找null |
| | | List<UserLoginPO> list = mapper.getList(listId); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[null]不存在." + listId); |
| | | } |
| | | // 数据库找到的id列表 |
| | | List<Long> listIdFind = list.stream().map(UserLoginPO::getId).collect(Collectors.toList()); |
| | | // 数量不一致 |
| | | if (listId.size() != listIdFind.size()) { |
| | | // 筛选数据库不存在的null |
| | | List<Long> listIdNotFound = listId.stream().filter(c -> !listIdFind.contains(c)).collect(Collectors.toList()); |
| | | if (ListUtil.isNullOrEmpty(list)) { |
| | | return ExecutedResult.failed("[null]不存在." + listIdNotFound); |
| | | } |
| | | } |
| | | return ExecutedResult.success(list); |
| | | } |
| | | |
| | | public UserLoginPO get4Openid(String openId) { |
| | | return mapper.get4Openid(openId); |
| | | } |
| | | // 修改密码 |
| | | public ExecutedResult<String> changePassword(LoginUserDTO user, ReqChangePassword request) { |
| | | String openId = user.getUserId(); |
| | | // 验证记录是否存在 |
| | | ExecutedResult<UserLoginPO> checkExists = this.check4Openid(openId); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | String oldPass = MD5Util.encrypt(request.getOldPassword() + ConstantFactory.KEY_PASSWORD); |
| | | if (BooleanUtils.isFalse(oldPass.equals(checkExists.getData().getPassword()))) { |
| | | return ExecutedResult.failed("密码校验失败。"); |
| | | } |
| | | return this.changePasswordDo(checkExists.getData().getId(), request.getNewPassword()); |
| | | } |
| | | private ExecutedResult<String> changePasswordDo(Long userLoginId, String password) { |
| | | UserLoginPO item = new UserLoginPO(); |
| | | item.setId(userLoginId); |
| | | // 密码加密 |
| | | item.setPassword(MD5Util.encrypt(password + ConstantFactory.KEY_PASSWORD)); |
| | | int modify = mapper.updateById(item); |
| | | if (modify>0) { |
| | | return ExecutedResult.success(); |
| | | } |
| | | return ExecutedResult.failed("密码修改失败。"); |
| | | } |
| | | |
| | | // 设置登录帐号 |
| | | public ExecutedResult<String> setUserName(String openId, String userCode) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<UserLoginPO> checkExists = this.check4Openid(openId); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed(checkExists.getMsg()); |
| | | } |
| | | // 转换po |
| | | UserLoginPO item = new UserLoginPO(); |
| | | item.setId(checkExists.getData().getId()); |
| | | item.setUserName(userCode); |
| | | // 密码加密 |
| | | item.setPassword(MD5Util.encrypt("88888888" + ConstantFactory.KEY_PASSWORD)); |
| | | |
| | | int result = this.mapper.updateById(item); |
| | | if (result<1) { |
| | | return ExecutedResult.failed("设置登录帐号失败。"); |
| | | } |
| | | return ExecutedResult.success(); |
| | | } |
| | | protected ExecutedResult<UserLoginPO> check4Openid(String openId) { |
| | | UserLoginPO exists = mapper.get4Openid(openId); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[用户登录]不存在:" + openId); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | protected ExecutedResult<UserLoginPO> check4UserName(String userName) { |
| | | UserLoginPO exists = mapper.get4UserName(userName); |
| | | if (Objects.isNull(exists)) { |
| | | return ExecutedResult.failed("[用户登录]不存在:" + userName); |
| | | } |
| | | return ExecutedResult.success(exists); |
| | | } |
| | | public ExecutedResult<LoginUserDTO> login(ReqUserLogin request) { |
| | | // 验证记录是否存在 |
| | | ExecutedResult<UserLoginPO> checkExists = this.check4UserName(request.getUserName()); |
| | | if (checkExists.isFailed()) { |
| | | return ExecutedResult.failed("帐号或密码错误"); |
| | | } |
| | | UserLoginPO user = checkExists.getData(); |
| | | String password = MD5Util.encrypt(request.getPassword() + ConstantFactory.KEY_PASSWORD); |
| | | if (!Objects.equals(user.getPassword(), password)) { |
| | | return ExecutedResult.failed("帐号或密码错误"); |
| | | } |
| | | if (!Objects.equals(user.getStatus(), EState.NORMAL.getValue())) { |
| | | return ExecutedResult.failed("账号异常, 请联系管理员!"); |
| | | } |
| | | |
| | | // 构建登录用户 |
| | | LoginUserDTO loginUser = new LoginUserDTO(); |
| | | loginUser.setUserType(EUserType.CUSTOMER_USER.getValue()); |
| | | loginUser.setUserId(user.getWxOpenId()); |
| | | loginUser.setUserName(user.getUserName()); |
| | | loginUser.setNickName(user.getNickName()); |
| | | loginUser.setHeadImg(user.getHeadImg()); |
| | | loginUser.setPhone(user.getPhone()); |
| | | loginUser.setListRole(new ArrayList<>()); |
| | | loginUser.setListRoleName(new ArrayList<>()); |
| | | |
| | | // 保存用户信息到jwt |
| | | String token = JWTUtil.getToken(loginUser); |
| | | loginUser.setToken(token); |
| | | return ExecutedResult.success(loginUser); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqCreatePaymentRecords; |
| | | import com.lunhan.water.entity.request.paymentrecords.ReqModifyPaymentRecords; |
| | | import com.lunhan.water.repository.po.PaymentRecordsPO; |
| | | import com.lunhan.water.repository.vo.PaymentRecordsVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * PaymentRecords |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface PaymentRecordsConvert { |
| | | PaymentRecordsConvert INSTANCE = Mappers.getMapper(PaymentRecordsConvert.class); |
| | | |
| | | PaymentRecordsPO toCreate(ReqCreatePaymentRecords request); |
| | | PaymentRecordsPO toModify(ReqModifyPaymentRecords request); |
| | | |
| | | PaymentRecordsVO toVo(PaymentRecordsPO item); |
| | | List<PaymentRecordsVO> toVo(List<PaymentRecordsPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqCreateRechargeOrder; |
| | | import com.lunhan.water.entity.request.rechargeorder.ReqModifyRechargeOrder; |
| | | import com.lunhan.water.repository.po.RechargeOrderPO; |
| | | import com.lunhan.water.repository.vo.RechargeOrderVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户充值订单 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface RechargeOrderConvert { |
| | | RechargeOrderConvert INSTANCE = Mappers.getMapper(RechargeOrderConvert.class); |
| | | |
| | | RechargeOrderPO toCreate(ReqCreateRechargeOrder request); |
| | | RechargeOrderPO toModify(ReqModifyRechargeOrder request); |
| | | |
| | | RechargeOrderVO toVo(RechargeOrderPO item); |
| | | List<RechargeOrderVO> toVo(List<RechargeOrderPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqCreateRechargeRecords; |
| | | import com.lunhan.water.entity.request.rechargerecords.ReqModifyRechargeRecords; |
| | | import com.lunhan.water.repository.po.RechargeRecordsPO; |
| | | import com.lunhan.water.repository.vo.RechargeRecordsVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 充值记录 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface RechargeRecordsConvert { |
| | | RechargeRecordsConvert INSTANCE = Mappers.getMapper(RechargeRecordsConvert.class); |
| | | |
| | | RechargeRecordsPO toCreate(ReqCreateRechargeRecords request); |
| | | RechargeRecordsPO toModify(ReqModifyRechargeRecords request); |
| | | |
| | | RechargeRecordsVO toVo(RechargeRecordsPO item); |
| | | List<RechargeRecordsVO> toVo(List<RechargeRecordsPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.refundrecord.ReqCreateRefundRecord; |
| | | import com.lunhan.water.entity.request.refundrecord.ReqModifyRefundRecord; |
| | | import com.lunhan.water.repository.po.RefundRecordPO; |
| | | import com.lunhan.water.repository.vo.RefundRecordVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 退款记录 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface RefundRecordConvert { |
| | | RefundRecordConvert INSTANCE = Mappers.getMapper(RefundRecordConvert.class); |
| | | |
| | | RefundRecordPO toCreate(ReqCreateRefundRecord request); |
| | | RefundRecordPO toModify(ReqModifyRefundRecord request); |
| | | |
| | | RefundRecordVO toVo(RefundRecordPO item); |
| | | List<RefundRecordVO> toVo(List<RefundRecordPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.sysregion.ReqCreateSysRegion; |
| | | import com.lunhan.water.entity.request.sysregion.ReqModifySysRegion; |
| | | import com.lunhan.water.repository.po.SysRegionPO; |
| | | import com.lunhan.water.repository.vo.SysRegionVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统行政地区 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface SysRegionConvert { |
| | | SysRegionConvert INSTANCE = Mappers.getMapper(SysRegionConvert.class); |
| | | |
| | | SysRegionPO toCreate(ReqCreateSysRegion request); |
| | | SysRegionPO toModify(ReqModifySysRegion request); |
| | | |
| | | SysRegionVO toVo(SysRegionPO item); |
| | | List<SysRegionVO> toVo(List<SysRegionPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.traderecord.ReqCreateTradeRecord; |
| | | import com.lunhan.water.entity.request.traderecord.ReqModifyTradeRecord; |
| | | import com.lunhan.water.repository.po.TradeRecordPO; |
| | | import com.lunhan.water.repository.vo.TradeRecordVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 支付记录 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface TradeRecordConvert { |
| | | TradeRecordConvert INSTANCE = Mappers.getMapper(TradeRecordConvert.class); |
| | | |
| | | TradeRecordPO toCreate(ReqCreateTradeRecord request); |
| | | TradeRecordPO toModify(ReqModifyTradeRecord request); |
| | | |
| | | TradeRecordVO toVo(TradeRecordPO item); |
| | | List<TradeRecordVO> toVo(List<TradeRecordPO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqCreateUserCapitalChange; |
| | | import com.lunhan.water.entity.request.usercapitalchange.ReqModifyUserCapitalChange; |
| | | import com.lunhan.water.repository.po.UserCapitalChangePO; |
| | | import com.lunhan.water.repository.vo.UserCapitalChangeVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户资金变动 |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface UserCapitalChangeConvert { |
| | | UserCapitalChangeConvert INSTANCE = Mappers.getMapper(UserCapitalChangeConvert.class); |
| | | |
| | | UserCapitalChangePO toCreate(ReqCreateUserCapitalChange request); |
| | | UserCapitalChangePO toModify(ReqModifyUserCapitalChange request); |
| | | |
| | | UserCapitalChangeVO toVo(UserCapitalChangePO item); |
| | | List<UserCapitalChangeVO> toVo(List<UserCapitalChangePO> list); |
| | | } |
对比新文件 |
| | |
| | | /** |
| | | # __----~~~~~~~~~~~------___ |
| | | # . . ~~//====...... __--~ ~~ |
| | | # -. \_|// |||\\ ~~~~~~::::... /~ |
| | | # ___-==_ _-~o~ \/ ||| \\ _/~~- |
| | | # __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ |
| | | # _-~~ .=~ | \\-_ '-~7 /- / || \ / |
| | | # .~ .~ | \\ -_ / /- / || \ / |
| | | # / ____ / | \\ ~-_/ /|- _/ .|| \ / |
| | | # |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ |
| | | # ' ~-| /| |-~\~~ __--~~ |
| | | # |-~~-_/ | | ~\_ _-~ /\ |
| | | # / \ \__ \/~ \__ |
| | | # _--~ _/ | .-~~____--~-/ ~~==. |
| | | # ((->/~ '.|||' -_| ~~-/ , . _|| |
| | | # -_ ~\ ~~---l__i__i__i--~~_/ |
| | | # _-~-__ ~) \--______________--~~ |
| | | # //.-~~~-~_--~- |-------~~~~~~~~ |
| | | # //.-~~~--\ |
| | | # 神兽保佑 |
| | | # 永无BUG! |
| | | */ |
| | | package com.lunhan.water.service.convert; |
| | | |
| | | import com.lunhan.water.entity.request.userlogin.ReqCreateUserLogin; |
| | | import com.lunhan.water.entity.request.userlogin.ReqModifyUserLogin; |
| | | import com.lunhan.water.repository.po.UserLoginPO; |
| | | import com.lunhan.water.repository.vo.UserLoginVO; |
| | | |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * UserLogin |
| | | * @author {#=author} |
| | | */ |
| | | @Mapper |
| | | public interface UserLoginConvert { |
| | | UserLoginConvert INSTANCE = Mappers.getMapper(UserLoginConvert.class); |
| | | |
| | | UserLoginPO toCreate(ReqCreateUserLogin request); |
| | | UserLoginPO toModify(ReqModifyUserLogin request); |
| | | |
| | | UserLoginVO toVo(UserLoginPO item); |
| | | List<UserLoginVO> toVo(List<UserLoginPO> list); |
| | | } |
| | |
| | | private static final String PORT = "57654"; |
| | | private static final String USER = "lunhan"; |
| | | private static final String PASSWORD = "lunhan.20240330"; |
| | | private static final String DB_NAME = "test_db1"; |
| | | private static final String DB_NAME = "water_ration_system"; |
| | | private static final String AUTHOR = "lin.liu"; |
| | | |
| | | public static Connection CONN = null; |
| | |
| | | |
| | | //region 输出文件路径设置 |
| | | class OutSet { |
| | | public static final String PO = "./src/main/java/com/lunhan/xxx/repository/po/"; |
| | | public static final String VO = "./src/main/java/com/lunhan/xxx/repository/vo/"; |
| | | public static final String CONVERT_MAPPER = "./src/main/java/com/lunhan/xxx/service/convert/"; |
| | | public static final String MAPPER_IMPL = "./src/main/java/com/lunhan/xxx/repository/impl/"; |
| | | public static final String MAPPER = "./src/main/java/com/lunhan/xxx/repository/mapper/"; |
| | | public static final String SERVICE = "./src/main/java/com/lunhan/xxx/service/"; |
| | | public static final String Controller = "./src/main/java/com/lunhan/xxx/host/controller/"; |
| | | public static final String SEARCH = "./src/main/java/com/lunhan/xxx/entity/search/"; |
| | | public static final String RequestDTO = "./src/main/java/com/lunhan/xxx/entity/request/"; |
| | | public static final String ResponseDTO = "./src/main/java/com/lunhan/xxx/entity/response/"; |
| | | public static final String PO = "./src/main/java/com/lunhan/water/repository/po/"; |
| | | public static final String VO = "./src/main/java/com/lunhan/water/repository/vo/"; |
| | | public static final String CONVERT_MAPPER = "./src/main/java/com/lunhan/water/service/convert/"; |
| | | public static final String MAPPER_IMPL = "./src/main/java/com/lunhan/water/repository/impl/"; |
| | | public static final String MAPPER = "./src/main/java/com/lunhan/water/repository/mapper/"; |
| | | public static final String SERVICE = "./src/main/java/com/lunhan/water/service/"; |
| | | public static final String Controller = "./src/main/java/com/lunhan/water/host/controller/"; |
| | | public static final String SEARCH = "./src/main/java/com/lunhan/water/entity/search/"; |
| | | public static final String RequestDTO = "./src/main/java/com/lunhan/water/entity/request/"; |
| | | public static final String ResponseDTO = "./src/main/java/com/lunhan/water/entity/response/"; |
| | | } |
| | | //endregion |
| | | |
| | |
| | | * 只生成以下配置的表 |
| | | */ |
| | | private static final List<String> ONLY_TABLES = Arrays.asList( |
| | | |
| | | "user_capital_change","recharge_records" |
| | | ); |
| | | |
| | | public static void main(String[] args) { |