Explorar o código

Merge remote-tracking branch 'origin/dev' into dev

jinshihui hai 1 semana
pai
achega
9057dfbd05

+ 149 - 292
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/PayController.java

@@ -2,57 +2,52 @@ package com.ylx.web.controller.massage;
 
 
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.io.file.FileWriter;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.ContentType;
 import cn.hutool.http.ContentType;
-import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
+import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result;
+import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.service.WxPayService;
 import com.ijpay.core.IJPayHttpResponse;
 import com.ijpay.core.IJPayHttpResponse;
-import com.ijpay.core.enums.AuthTypeEnum;
 import com.ijpay.core.enums.RequestMethodEnum;
 import com.ijpay.core.enums.RequestMethodEnum;
-import com.ijpay.core.kit.AesUtil;
 import com.ijpay.core.kit.HttpKit;
 import com.ijpay.core.kit.HttpKit;
 import com.ijpay.core.kit.PayKit;
 import com.ijpay.core.kit.PayKit;
 import com.ijpay.core.kit.WxPayKit;
 import com.ijpay.core.kit.WxPayKit;
-import com.ijpay.core.utils.DateTimeZoneUtil;
 import com.ijpay.wxpay.WxPayApi;
 import com.ijpay.wxpay.WxPayApi;
-import com.ijpay.wxpay.WxPayApiConfigKit;
 import com.ijpay.wxpay.enums.WxDomainEnum;
 import com.ijpay.wxpay.enums.WxDomainEnum;
-import com.ijpay.wxpay.enums.v3.BasePayApiEnum;
-import com.ijpay.wxpay.enums.v3.CertAlgorithmTypeEnum;
 import com.ijpay.wxpay.enums.v3.TransferApiEnum;
 import com.ijpay.wxpay.enums.v3.TransferApiEnum;
-import com.ijpay.wxpay.model.v3.*;
-import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiServiceExtension;
+import com.ijpay.wxpay.model.v3.BatchTransferModel;
+import com.ijpay.wxpay.model.v3.TransferDetailInput;
 import com.ylx.common.config.WxPayConfig;
 import com.ylx.common.config.WxPayConfig;
 import com.ylx.common.core.domain.R;
 import com.ylx.common.core.domain.R;
+import com.ylx.common.weixinPay.enums.WxPayTypeEnum;
+import com.ylx.giftCard.domain.GiftCardOrder;
+import com.ylx.giftCard.enums.GiftCardOrderStatusEnum;
+import com.ylx.giftCard.service.IGiftCardOrderService;
 import com.ylx.massage.domain.TRecharge;
 import com.ylx.massage.domain.TRecharge;
-import com.ylx.massage.enums.BillTypeEnum;
-import com.ylx.massage.enums.PayTypeEnum;
-import com.ylx.massage.domain.ProductOrderInfo;
-import com.ylx.massage.domain.TConsumptionLog;
 import com.ylx.massage.domain.TWxUser;
 import com.ylx.massage.domain.TWxUser;
 import com.ylx.massage.enums.BillTypeEnum;
 import com.ylx.massage.enums.BillTypeEnum;
-import com.ylx.massage.enums.ProductOrderStatusEnum;
-import com.ylx.massage.service.IProductOrderInfoService;
 import com.ylx.massage.service.RefundVoucherService;
 import com.ylx.massage.service.RefundVoucherService;
-import com.ylx.massage.service.TOrderService;
 import com.ylx.massage.service.TRechargeService;
 import com.ylx.massage.service.TRechargeService;
 import com.ylx.massage.service.TWxUserService;
 import com.ylx.massage.service.TWxUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayInputStream;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
 import java.security.cert.X509Certificate;
 import java.security.cert.X509Certificate;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 
 import static com.ylx.common.constant.HttpStatus.SUCCESS;
 import static com.ylx.common.constant.HttpStatus.SUCCESS;
 
 
@@ -67,29 +62,19 @@ import static com.ylx.common.constant.HttpStatus.SUCCESS;
 @Api(tags = {"微信支付"})
 @Api(tags = {"微信支付"})
 public class PayController {
 public class PayController {
 
 
-
-    @Autowired
+    @Resource
     private WxPayConfig wxPayProperties;
     private WxPayConfig wxPayProperties;
-
     @Resource
     @Resource
     private TRechargeService rechargeService;
     private TRechargeService rechargeService;
-
-    @Resource
-    private TOrderService orderService;
-
     @Resource
     @Resource
     private RefundVoucherService refundVoucherService;
     private RefundVoucherService refundVoucherService;
-
-    @Resource
-    private IProductOrderInfoService productOrderInfoService;
-
     @Resource
     @Resource
     private TWxUserService wxUserService;
     private TWxUserService wxUserService;
-
-    //    @Resource
-//    private JsapiServiceExtension service;
     String serialNo;
     String serialNo;
-    String platSerialNo;
+    @Resource
+    private WxPayService wxPayService;
+    @Resource
+    private IGiftCardOrderService giftCardOrderService;
 
 
     /**
     /**
      * 小程序微信支付的第一步,统一下单
      * 小程序微信支付的第一步,统一下单
@@ -101,118 +86,9 @@ public class PayController {
         return rechargeService.getPay(rechargeResp.getRechargeNo(), recharge.getdMoney(), recharge.getcOpenId(), BillTypeEnum.RECHARGE.getInfo(), BillTypeEnum.RECHARGE.getCode().toString());
         return rechargeService.getPay(rechargeResp.getRechargeNo(), recharge.getdMoney(), recharge.getcOpenId(), BillTypeEnum.RECHARGE.getInfo(), BillTypeEnum.RECHARGE.getCode().toString());
     }
     }
 
 
-    /**
-     * 支付
-     *
-     * @param setOutTradeNo
-     * @param amount
-     * @param openId
-     * @param description
-     * @return
-     * @throws Exception
-     */
-    public R<String> getPay(String setOutTradeNo, BigDecimal amount, String openId, String description) throws Exception {
-        String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
-        UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
-                .setAppid(wxPayProperties.getAppId())
-                .setMchid(wxPayProperties.getMchId())
-                //商品描述
-                .setDescription(description)
-                //订单号
-                .setOut_trade_no(setOutTradeNo)
-                //交易结束时间
-                .setTime_expire(timeExpire)
-                //附加数据
-                .setAttach("夜来香")
-                //通知地址异步接收微信支付结果通知的回调地址,通知url必须为外网可访问的url,不能携带参数。 公网域名必须为https,如果是走专线接入,使用专线NAT IP或者私有回调域名可使用http
-                //示例值:https://www.weixin.qq.com/wxpay/pay.php
-                .setNotify_url(wxPayProperties.getNotifyUrl())
-                //支付金额以分为单位
-                .setAmount(new Amount().setTotal(amount.multiply(new BigDecimal(100)).intValue()))
-                //交易人
-                .setPayer(new Payer().setOpenid(openId));
-
-        log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
-        IJPayHttpResponse response = WxPayApi.v3(
-                RequestMethodEnum.POST,
-                WxDomainEnum.CHINA.toString(),
-                BasePayApiEnum.JS_API_PAY.toString(),
-                wxPayProperties.getMchId(),
-                getSerialNumber(),
-                null,
-                wxPayProperties.getCertKeyPath(),
-                JSONUtil.toJsonStr(unifiedOrderModel)
-        );
-
-        log.info("统一下单响应 {}", response);
-        // 根据证书序列号查询对应的证书来验证签名结果
-        boolean verifySignature = WxPayKit.verifySignature(response, wxPayProperties.getPlatFormPath());
-        log.info("verifySignature: {}", verifySignature);
-        if (response.getStatus() == SUCCESS && verifySignature) {
-            String body = response.getBody();
-            JSONObject jsonObject = JSONUtil.parseObj(body);
-            String prepayId = jsonObject.getStr("prepay_id");
-            Map<String, String> map = WxPayKit.jsApiCreateSign(wxPayProperties.getAppId(), prepayId, wxPayProperties.getCertKeyPath());
-            log.info("唤起支付参数:{}", map);
-            return R.ok(JSONUtil.toJsonStr(map));
-        }
-        return R.ok(JSONUtil.toJsonStr(response));
-    }
-
-    //服务商模式下单
-    public R<String> getPay1(String setOutTradeNo, BigDecimal amount, String openId, String description) throws Exception {
-        String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
-        UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
-                .setSp_appid(wxPayProperties.getAppId())
-                .setSp_mchid(wxPayProperties.getMchId())
-                .setSub_mchid("123")//子商户号
-                //商品描述
-                .setDescription(description)
-                //订单号
-                .setOut_trade_no(setOutTradeNo)
-                //交易结束时间
-                .setTime_expire(timeExpire)
-                //附加数据
-                .setAttach("夜来香")
-                //通知地址异步接收微信支付结果通知的回调地址,通知url必须为外网可访问的url,不能携带参数。 公网域名必须为https,如果是走专线接入,使用专线NAT IP或者私有回调域名可使用http
-                //示例值:https://www.weixin.qq.com/wxpay/pay.php
-                .setNotify_url(wxPayProperties.getNotifyUrl())
-                //分账标识
-                .setSettle_info(new SettleInfo().setProfit_sharing(true))
-                //支付金额以分为单位
-                .setAmount(new Amount().setTotal(amount.multiply(new BigDecimal(100)).intValue()))
-                //交易人
-                .setPayer(new Payer().setSp_openid(openId));
-
-        log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
-        IJPayHttpResponse response = WxPayApi.v3(
-                RequestMethodEnum.POST,
-                WxDomainEnum.CHINA.toString(),
-                BasePayApiEnum.PARTNER_JS_API_PAY.toString(),
-                wxPayProperties.getMchId(),
-                getSerialNumber(),
-                null,
-                wxPayProperties.getCertKeyPath(),
-                JSONUtil.toJsonStr(unifiedOrderModel)
-        );
-
-        log.info("统一下单响应 {}", response);
-        // 根据证书序列号查询对应的证书来验证签名结果
-        boolean verifySignature = WxPayKit.verifySignature(response, wxPayProperties.getPlatFormPath());
-        log.info("verifySignature: {}", verifySignature);
-        if (response.getStatus() == SUCCESS && verifySignature) {
-            String body = response.getBody();
-            JSONObject jsonObject = JSONUtil.parseObj(body);
-            String prepayId = jsonObject.getStr("prepay_id");
-            Map<String, String> map = WxPayKit.jsApiCreateSign(wxPayProperties.getAppId(), prepayId, wxPayProperties.getCertKeyPath());
-            log.info("唤起支付参数:{}", map);
-            return R.ok(JSONUtil.toJsonStr(map));
-        }
-        return R.ok(JSONUtil.toJsonStr(response));
-    }
-
     /**
     /**
      * 获取商户API证书序列号
      * 获取商户API证书序列号
+     *
      * @return String 证书序列号
      * @return String 证书序列号
      */
      */
     private String getSerialNumber() {
     private String getSerialNumber() {
@@ -225,175 +101,155 @@ public class PayController {
                 boolean isValid = PayKit.checkCertificateIsValid(certificate, wxPayProperties.getMchId(), -2);
                 boolean isValid = PayKit.checkCertificateIsValid(certificate, wxPayProperties.getMchId(), -2);
                 log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
                 log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
             }
             }
-//            System.out.println("输出证书信息:\n" + certificate.toString());
-//            // 输出关键信息,截取部分并进行标记
-//            System.out.println("证书序列号:" + certificate.getSerialNumber().toString(16));
-//            System.out.println("版本号:" + certificate.getVersion());
-//            System.out.println("签发者:" + certificate.getIssuerDN());
-//            System.out.println("有效起始日期:" + certificate.getNotBefore());
-//            System.out.println("有效终止日期:" + certificate.getNotAfter());
-//            System.out.println("主体名:" + certificate.getSubjectDN());
-//            System.out.println("签名算法:" + certificate.getSigAlgName());
-//            System.out.println("签名:" + certificate.getSignature().toString());
         }
         }
         System.out.println("serialNo:" + serialNo);
         System.out.println("serialNo:" + serialNo);
         return serialNo;
         return serialNo;
     }
     }
 
 
-    /**
-     * 微信支付回调接口
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/payNotify", method = {org.springframework.web.bind.annotation.RequestMethod.POST, org.springframework.web.bind.annotation.RequestMethod.GET})
-    @ResponseBody
-    @ApiOperation("微信支付回调接口")
-    public void payNotify(HttpServletRequest request, HttpServletResponse response) {
-        log.info("微信支付回调接口====================================>>>>微信支付回调接口");
-        Map<String, String> map = new HashMap<>(12);
+//    /**
+//     * 微信支付回调接口
+//     *
+//     * @param request
+//     * @param response
+//     */
+//    @RequestMapping(value = "/payNotify", method = {org.springframework.web.bind.annotation.RequestMethod.POST, org.springframework.web.bind.annotation.RequestMethod.GET})
+//    @ResponseBody
+//    @ApiOperation("微信支付回调接口")
+//    public void payNotify(HttpServletRequest request, HttpServletResponse response) {
+//        log.info("微信支付回调接口====================================>>>>微信支付回调接口");
+//        Map<String, String> map = new HashMap<>(12);
+//        try {
+//            String timestamp = request.getHeader("Wechatpay-Timestamp");
+//            String nonce = request.getHeader("Wechatpay-Nonce");
+//            String serialNo = request.getHeader("Wechatpay-Serial");
+//            String signature = request.getHeader("Wechatpay-Signature");
+//
+//            log.info("timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
+//            String result = HttpKit.readData(request);
+//            log.info("支付通知密文 {}", result);
+//
+//            // 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号
+//            String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
+//                    wxPayProperties.getMchKey(), wxPayProperties.getPlatFormPath());
+//
+//            log.info("支付通知明文 {}", plainText);
+//
+//            if (StrUtil.isNotEmpty(plainText)) {
+//                response.setStatus(200);
+//                map.put("code", "SUCCESS");
+//                map.put("message", "SUCCESS");
+//                // 处理业务逻辑
+//                JSONObject jsonObject = new JSONObject(plainText);
+//                if (jsonObject.get("attach").equals(BillTypeEnum.WX_PAY.getCode().toString())) {
+//                    // 服务订单支付成功
+//                    orderService.payNotifyOrder(jsonObject.get("out_trade_no").toString());
+//                } else if (jsonObject.get("attach").equals(PayTypeEnum.WX_PAY.getCode().toString())) {
+//                    // 商品订单支付成功
+//                    String productOrderNo = jsonObject.get("out_trade_no").toString();
+//                    log.info("商品订单支付回调开始处理,订单号:{}", productOrderNo);
+//                    productOrderInfoService.handleWxPayCallback(productOrderNo);
+//                    log.info("商品订单支付回调处理完成,订单号:{}", productOrderNo);
+//                } else {
+//                    TRecharge outTradeNo = rechargeService.increaseAmount(jsonObject.get("out_trade_no").toString());
+//                }
+//            } else {
+//                response.setStatus(500);
+//                map.put("code", "ERROR");
+//                map.put("message", "签名错误");
+//            }
+//            response.setHeader("Content-type", ContentType.JSON.toString());
+//            response.getOutputStream().write(JSONUtil.toJsonStr(map).getBytes(StandardCharsets.UTF_8));
+//            response.flushBuffer();
+//        } catch (Exception e) {
+//            log.error("系统异常", e);
+//        }
+//    }
+
+    @PostMapping("/payNotify")
+    public Map<String, String> handlePayNotify(@RequestBody String notifyData, @RequestHeader("Wechatpay-Signature") SignatureHeader signature) {
+
+        Map<String, String> resp = new HashMap<>();
         try {
         try {
-            String timestamp = request.getHeader("Wechatpay-Timestamp");
-            String nonce = request.getHeader("Wechatpay-Nonce");
-            String serialNo = request.getHeader("Wechatpay-Serial");
-            String signature = request.getHeader("Wechatpay-Signature");
+            // 1. SDK验签+解密报文
+            WxPayOrderNotifyV3Result.DecryptNotifyResult result = wxPayService.parseOrderNotifyV3Result(notifyData, signature).getResult();
 
 
-            log.info("timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
-            String result = HttpKit.readData(request);
-            log.info("支付通知密文 {}", result);
+            String outTradeNo = result.getOutTradeNo();
+            String tradeState = result.getTradeState();
 
 
-            // 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号
-            String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
-                    wxPayProperties.getMchKey(), wxPayProperties.getPlatFormPath());
+            log.info("微信V3回调解密成功,商户订单号:{},微信单号:{},交易状态:{}",
+                    outTradeNo, result.getTransactionId(), tradeState);
 
 
-            log.info("支付通知明文 {}", plainText);
+            // 2. 仅SUCCESS才处理订单
+            if ("SUCCESS".equals(tradeState)) {
 
 
-            if (StrUtil.isNotEmpty(plainText)) {
-                response.setStatus(200);
-                map.put("code", "SUCCESS");
-                map.put("message", "SUCCESS");
-                // 处理业务逻辑
-                JSONObject jsonObject = new JSONObject(plainText);
-                if (jsonObject.get("attach").equals(BillTypeEnum.WX_PAY.getCode().toString())) {
-                    // 服务订单支付成功
-                    orderService.payNotifyOrder(jsonObject.get("out_trade_no").toString());
-                } else if (jsonObject.get("attach").equals(PayTypeEnum.WX_PAY.getCode().toString())) {
-                    // 商品订单支付成功
-                    String productOrderNo = jsonObject.get("out_trade_no").toString();
-                    log.info("商品订单支付回调开始处理,订单号:{}", productOrderNo);
-                    productOrderInfoService.handleWxPayCallback(productOrderNo);
-                    log.info("商品订单支付回调处理完成,订单号:{}", productOrderNo);
-                } else {
-                    TRecharge outTradeNo = rechargeService.increaseAmount(jsonObject.get("out_trade_no").toString());
+                // 2. 获取我们在下单时传入的 attach
+                String attach = result.getAttach();
+                String openid = result.getPayer().getOpenid();
+
+                if (StrUtil.isEmpty(openid)) {
+                    log.error("openid不存在");
+                    resp.put("code", "FAIL");
+                    resp.put("message", "openid不存在");
+                    return resp;
                 }
                 }
-            } else {
-                response.setStatus(500);
-                map.put("code", "ERROR");
-                map.put("message", "签名错误");
-            }
-            response.setHeader("Content-type", ContentType.JSON.toString());
-            response.getOutputStream().write(JSONUtil.toJsonStr(map).getBytes(StandardCharsets.UTF_8));
-            response.flushBuffer();
-        } catch (Exception e) {
-            log.error("系统异常", e);
-        }
-    }
 
 
+                log.info("支付成功用户openId,openId: {}", openid);
 
 
-    @RequestMapping(value = "/test", method = {org.springframework.web.bind.annotation.RequestMethod.POST, org.springframework.web.bind.annotation.RequestMethod.GET})
-    @ResponseBody
-    @ApiOperation("测试")
-    public void test(HttpServletRequest request, HttpServletResponse response) {
-        System.out.println("test=======================>");
-    }
+                TWxUser wxUser = wxUserService.getByOpenId(openid);
+                if (ObjectUtil.isNull(wxUser)) {
+                    log.error("支付成功用户不存在,openId: {}", openid);
+                    resp.put("code", "FAIL");
+                    resp.put("message", "支付成功用户不存在");
+                    return resp;
+                }
 
 
-    @RequestMapping("/get")
-    @ResponseBody
-    public String v3Get() throws Exception {
-        // 获取平台证书列表
-        try {
-            IJPayHttpResponse response = WxPayApi.v3(
-                    RequestMethodEnum.GET,
-                    WxDomainEnum.CHINA.toString(),
-                    CertAlgorithmTypeEnum.getCertSuffixUrl(CertAlgorithmTypeEnum.RSA.getCode()),
-                    wxPayProperties.getMchId(),
-                    getSerialNumber(),
-                    null,
-                    wxPayProperties.getCertKeyPath(),
-                    "",
-                    AuthTypeEnum.RSA.getCode()
-            );
-            Map<String, List<String>> headers = response.getHeaders();
-            log.info("请求头: {}", headers);
-            String timestamp = response.getHeader("Wechatpay-Timestamp");
-            String nonceStr = response.getHeader("Wechatpay-Nonce");
-            String serialNumber = response.getHeader("Wechatpay-Serial");
-            String signature = response.getHeader("Wechatpay-Signature");
-
-            String body = response.getBody();
-            int status = response.getStatus();
-
-            log.info("serialNumber: {}", serialNumber);
-            log.info("status: {}", status);
-            log.info("body: {}", body);
-            int isOk = 200;
-            if (status == isOk) {
-                JSONObject jsonObject = JSONUtil.parseObj(body);
-                JSONArray dataArray = jsonObject.getJSONArray("data");
-                // 默认认为只有一个平台证书
-                JSONObject encryptObject = dataArray.getJSONObject(0);
-                JSONObject encryptCertificate = encryptObject.getJSONObject("encrypt_certificate");
-                String associatedData = encryptCertificate.getStr("associated_data");
-                String cipherText = encryptCertificate.getStr("ciphertext");
-                String nonce = encryptCertificate.getStr("nonce");
-                String algorithm = encryptCertificate.getStr("algorithm");
-                String serialNo = encryptObject.getStr("serial_no");
-                final String platSerialNo = savePlatformCert(associatedData, nonce, cipherText, algorithm, wxPayProperties.getPlatFormPath());
-                log.info("平台证书序列号: {} serialNo: {}", platSerialNo, serialNo);
-                // 根据证书序列号查询对应的证书来验证签名结果
-                boolean verifySignature = WxPayKit.verifySignature(response, wxPayProperties.getPlatFormPath());
-                log.info("verifySignature:{}", verifySignature);
+                // 3. 根据 attach 判断商品类型并进行不同的业务处理
+                if (WxPayTypeEnum.GIFT_CARD.getCode().equals(attach)) {
+                    log.info("检测到购物卡支付成功,订单号: {}", outTradeNo);
+
+                    // 3.1 更新订单支付状态
+                    LambdaQueryWrapper<GiftCardOrder> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(GiftCardOrder::getOrderNo, outTradeNo);
+                    GiftCardOrder cardOrder = this.giftCardOrderService.getOne(wrapper);
+                    if (ObjectUtil.isNull(cardOrder)) {
+                        log.error("订单不存在,订单号: {}", outTradeNo);
+                        resp.put("code", "FAIL");
+                        resp.put("message", "订单不存在");
+                        return resp;
+                    }
+                    // 3.2 检查是否已处理
+                    if (ObjectUtil.equals(GiftCardOrderStatusEnum.PAID.getCode(), cardOrder.getStatus())) {
+                        log.warn("订单已处理过:{}", outTradeNo);
+                        resp.put("code", "SUCCESS");
+                        resp.put("message", "OK");
+                        return resp;
+                    }
+
+                    // 3.3 处理订单相关数据
+                    this.giftCardOrderService.processGiftCardPayment(result, wxUser, cardOrder);
+                } else if (WxPayTypeEnum.EMOTION_GOODS.getCode().equals(attach)) {
+                    log.info("检测到情感服务商品支付成功,订单号: {}", outTradeNo);
+                }
             }
             }
-            return body;
-        } catch (Exception e) {
-            log.error("获取平台证书列表异常", e);
-            return null;
-        }
-    }
 
 
-    private String savePlatformCert(String associatedData, String nonce, String cipherText, String algorithm, String certPath) {
-        try {
-            String key3 = wxPayProperties.getMchKey();
-            String publicKey;
-            if (StrUtil.equals(algorithm, AuthTypeEnum.SM2.getPlatformCertAlgorithm())) {
-                publicKey = PayKit.sm4DecryptToString(key3, cipherText, nonce, associatedData);
-            } else {
-                AesUtil aesUtil = new AesUtil(wxPayProperties.getMchKey().getBytes(StandardCharsets.UTF_8));
-                // 平台证书密文解密
-                // encrypt_certificate 中的  associated_data nonce  ciphertext
-                publicKey = aesUtil.decryptToString(
-                        associatedData.getBytes(StandardCharsets.UTF_8),
-                        nonce.getBytes(StandardCharsets.UTF_8),
-                        cipherText
-                );
-            }
-            if (StrUtil.isNotEmpty(publicKey)) {
-                // 保存证书
-                FileWriter writer = new FileWriter(certPath);
-                writer.write(publicKey);
-                // 获取平台证书序列号
-                X509Certificate certificate = PayKit.getCertificate(new ByteArrayInputStream(publicKey.getBytes()));
-                return certificate.getSerialNumber().toString(16).toUpperCase();
-            }
-            return "";
+            //3. 返回成功
+            resp.put("code", "SUCCESS");
+            resp.put("message", "OK");
+        } catch (WxPayException e) {
+            log.error("微信支付回调异常:{}", e.getMessage(), e);
+            resp.put("code", "FAIL");
+            resp.put("message", e.getMessage());
         } catch (Exception e) {
         } catch (Exception e) {
-            log.error("保存平台证书异常", e);
-            return e.getMessage();
+            log.error("支付回调处理异常:{}", e.getMessage(), e);
+            resp.put("code", "FAIL");
+            resp.put("message", "系统异常");
         }
         }
+        return resp;
     }
     }
 
 
     /**
     /**
      * 微信批量提现
      * 微信批量提现
+     *
      * @param openId
      * @param openId
      * @return String
      * @return String
      */
      */
@@ -463,6 +319,7 @@ public class PayController {
 
 
     /**
     /**
      * 微信退款回调接口
      * 微信退款回调接口
+     *
      * @param request
      * @param request
      * @param response
      * @param response
      */
      */

+ 1 - 1
nightFragrance-common/src/main/java/com/ylx/common/core/domain/model/aliyun/SendSmsEnum.java

@@ -7,7 +7,7 @@ import lombok.Getter;
 @AllArgsConstructor
 @AllArgsConstructor
 public enum SendSmsEnum {
 public enum SendSmsEnum {
 
 
-    SMS_220650023("SMS_220650023", "山西掌柜鼎科技", "验证码短信");
+    SMS_220650024("SMS_220650024", "广誉源", "验证码短信");
 
 
     private final String code;
     private final String code;
 
 

+ 4 - 2
nightFragrance-massage/src/main/java/com/ylx/giftCard/service/IGiftCardOrderService.java

@@ -1,15 +1,17 @@
 package com.ylx.giftCard.service;
 package com.ylx.giftCard.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result;
 import com.ylx.common.core.domain.model.WxLoginUser;
 import com.ylx.common.core.domain.model.WxLoginUser;
 import com.ylx.giftCard.domain.GiftCard;
 import com.ylx.giftCard.domain.GiftCard;
 import com.ylx.giftCard.domain.GiftCardOrder;
 import com.ylx.giftCard.domain.GiftCardOrder;
-
-import java.util.List;
+import com.ylx.massage.domain.TWxUser;
 
 
 public interface IGiftCardOrderService extends IService<GiftCardOrder> {
 public interface IGiftCardOrderService extends IService<GiftCardOrder> {
 
 
     GiftCardOrder buildOrder(GiftCard card, Integer quantity, String merchantId, WxLoginUser wxLoginUser);
     GiftCardOrder buildOrder(GiftCard card, Integer quantity, String merchantId, WxLoginUser wxLoginUser);
 
 
     void cancelOrder(Long id);
     void cancelOrder(Long id);
+
+    void processGiftCardPayment(WxPayOrderNotifyV3Result.DecryptNotifyResult result, TWxUser wxUser, GiftCardOrder cardOrder);
 }
 }

+ 43 - 0
nightFragrance-massage/src/main/java/com/ylx/giftCard/service/impl/GiftCardOrderServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result;
 import com.ylx.common.core.domain.model.WxLoginUser;
 import com.ylx.common.core.domain.model.WxLoginUser;
 import com.ylx.common.exception.ServiceException;
 import com.ylx.common.exception.ServiceException;
 import com.ylx.common.utils.DateUtils;
 import com.ylx.common.utils.DateUtils;
@@ -13,7 +14,11 @@ import com.ylx.giftCard.enums.GiftCardOrderStatusEnum;
 import com.ylx.giftCard.mapper.GiftCardOrderMapper;
 import com.ylx.giftCard.mapper.GiftCardOrderMapper;
 import com.ylx.giftCard.service.IGiftCardOrderService;
 import com.ylx.giftCard.service.IGiftCardOrderService;
 import com.ylx.massage.domain.TJs;
 import com.ylx.massage.domain.TJs;
+import com.ylx.massage.domain.TWxUser;
 import com.ylx.massage.service.TJsService;
 import com.ylx.massage.service.TJsService;
+import com.ylx.massage.service.TWxUserService;
+import com.ylx.shopingfundsdetail.domain.vo.ShoppingFundsDetailAddDto;
+import com.ylx.shopingfundsdetail.service.ShoppingFundsDetailService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +33,12 @@ public class GiftCardOrderServiceImpl extends ServiceImpl<GiftCardOrderMapper, G
 
 
     @Resource
     @Resource
     private TJsService jsService;
     private TJsService jsService;
+    @Resource
+    private TWxUserService wxUserService;
+    @Resource
+    private ShoppingFundsDetailService shoppingFundsDetailService;
+    // 充值
+    public static final int EXPENSE_TYPE_RECHARGE = 0;
 
 
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
@@ -96,6 +107,38 @@ public class GiftCardOrderServiceImpl extends ServiceImpl<GiftCardOrderMapper, G
         log.info("订单取消成功,订单号:{},购物卡ID:{}", order.getOrderNo(), order.getGiftCardId());
         log.info("订单取消成功,订单号:{},购物卡ID:{}", order.getOrderNo(), order.getGiftCardId());
     }
     }
 
 
+    @Transactional(rollbackFor = Exception.class)
+    public void processGiftCardPayment(WxPayOrderNotifyV3Result.DecryptNotifyResult result, TWxUser wxUser,GiftCardOrder cardOrder) {
+
+        // 更新订单状态
+        this.lambdaUpdate()
+                .set(GiftCardOrder::getStatus, GiftCardOrderStatusEnum.PAID.getCode())
+                .eq(GiftCardOrder::getId, cardOrder.getId())
+                .update();
+
+        // 计算充值金额
+        Integer totalCent = result.getAmount().getTotal();
+        BigDecimal payAmount = new BigDecimal(totalCent).divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_HALF_UP);
+
+        // 更新用户余额
+        BigDecimal oldBalance = wxUser.getdBalance();
+        BigDecimal newBalance = oldBalance.add(payAmount);
+        this.wxUserService.lambdaUpdate()
+                .set(TWxUser::getdBalance, newBalance)
+                .eq(TWxUser::getId, wxUser.getId())
+                .update();
+
+        // 记录购物金明细
+        ShoppingFundsDetailAddDto dto = new ShoppingFundsDetailAddDto();
+        dto.setUserId(wxUser.getId());
+        dto.setAmount(payAmount);
+        dto.setOrderNo(result.getOutTradeNo());
+        dto.setExpenseType(EXPENSE_TYPE_RECHARGE);
+        dto.setBalance(newBalance);
+        dto.setGiftCardId(cardOrder.getGiftCardId());
+        shoppingFundsDetailService.addShoppingFundsDetail(dto);
+    }
+
     /**
     /**
      * 生成唯一订单号
      * 生成唯一订单号
      */
      */

+ 30 - 5
nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaProject.java

@@ -23,7 +23,10 @@ public class MaProject extends BaseEntity
     /** id */
     /** id */
     @ApiModelProperty("id")
     @ApiModelProperty("id")
     private Long id;
     private Long id;
-
+    /** 项目ID */
+    @Excel(name = "项目ID")
+    @ApiModelProperty("项目ID")
+    private String  projectId;
     /** 项目名称 */
     /** 项目名称 */
     @Excel(name = "项目名称")
     @Excel(name = "项目名称")
     @ApiModelProperty("项目名称")
     @ApiModelProperty("项目名称")
@@ -49,15 +52,34 @@ public class MaProject extends BaseEntity
     @ApiModelProperty("项目原价")
     @ApiModelProperty("项目原价")
     private BigDecimal projectOriginalPrice;
     private BigDecimal projectOriginalPrice;
 
 
-    /** 项目现价 */
-    @Excel(name = "项目现价")
-    @ApiModelProperty("项目现价")
+
+    /** 项目价格上限 */
+    @Excel(name = "项目价格上限")
+    @ApiModelProperty("项目价格上限")
+    private BigDecimal projectMaxPrice;
+
+    /** 项目价格下限 */
+    @Excel(name = "项目价格下限")
+    @ApiModelProperty("项目价格下限")
+    private BigDecimal projectLowestPrice;
+
+    /** 我的售价 */
+    @Excel(name = "我的售价")
+    @ApiModelProperty("我的售价")
     private BigDecimal projectCurrentPrice;
     private BigDecimal projectCurrentPrice;
+    /** 商户手机号 */
+    @Excel(name = "商户手机号")
+    @ApiModelProperty("商户手机号")
+    private String merchantPhone;
 
 
     /** 项目主图 */
     /** 项目主图 */
     @Excel(name = "项目主图")
     @Excel(name = "项目主图")
     @ApiModelProperty("项目主图")
     @ApiModelProperty("项目主图")
     private String projectMasterImage;
     private String projectMasterImage;
+    /** 商户类型:0-上门按摩,1-同城陪玩 */
+    @Excel(name = "商户类型:0-上门按摩,1-同城陪玩")
+    @ApiModelProperty("商户类型:0-上门按摩,1-同城陪玩")
+    private String merchantType;
 
 
     /** 项目详情图 */
     /** 项目详情图 */
     @Excel(name = "项目详情图")
     @Excel(name = "项目详情图")
@@ -68,7 +90,10 @@ public class MaProject extends BaseEntity
     @Excel(name = "是否启用(0否1是)")
     @Excel(name = "是否启用(0否1是)")
     @ApiModelProperty("是否启用(0否1是)")
     @ApiModelProperty("是否启用(0否1是)")
     private Long projectIsEnable;
     private Long projectIsEnable;
-
+    /** 商户ID */
+    @Excel(name = "商户ID")
+    @ApiModelProperty("商户ID")
+    private String  userId;
     /** 创建人 */
     /** 创建人 */
     @Excel(name = "创建人")
     @Excel(name = "创建人")
     @ApiModelProperty("创建人")
     @ApiModelProperty("创建人")

+ 126 - 199
nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaTechnician.java

@@ -1,248 +1,175 @@
 package com.ylx.massage.domain;
 package com.ylx.massage.domain;
 
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
 import com.ylx.common.annotation.Excel;
 import com.ylx.common.annotation.Excel;
 import com.ylx.common.core.domain.BaseEntity;
 import com.ylx.common.core.domain.BaseEntity;
 
 
+import java.math.BigInteger;
+import java.util.Date;
+
 /**
 /**
  * 技师对象 ma_technician
  * 技师对象 ma_technician
  *
  *
  * @author ylx
  * @author ylx
  * @date 2024-03-22
  * @date 2024-03-22
  */
  */
-public class MaTechnician extends BaseEntity {
+
+@Data
+@TableName("ma_technician")
+@Accessors(chain = true)
+public class MaTechnician extends BaseEntity
+{
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
-    /**
-     * id
-     */
-    private Long id;
+    /** id */
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
 
 
-    /**
-     * 姓名
-     */
+    /** 姓名 */
+    @TableField("te_name")
     @Excel(name = "姓名")
     @Excel(name = "姓名")
     private String teName;
     private String teName;
-
+    /** 昵称 */
+    @Excel(name = "昵称")
+    @TableField("te_nick_name")
+    private String teNickName;
     /**
     /**
-     * 性别(0女1男)
+     * 微信小程序登录会话密钥
      */
      */
-    @Excel(name = "性别(0女1男)")
-    private Long teSex;
-
+    @TableField("c_session_key")
+    @ApiModelProperty("微信小程序登录会话密钥")
+    private String cSessionKey;
+    /** 密码 */
+    @Excel(name = "密码")
+    @TableField("te_pass_word")
+    private String tePassword;
     /**
     /**
-     * 电话
+     * 用户的openId
      */
      */
+    @TableField("c_openid")
+    @ApiModelProperty("用户的openId")
+    private String cOpenid;
+    /** 性别(0女1男) */
+    @Excel(name = "性别(0女1男)")
+    @TableField("te_sex")
+    private Integer teSex;
+
+    /** 电话 */
     @Excel(name = "电话")
     @Excel(name = "电话")
+    @TableField("te_phone")
     private String tePhone;
     private String tePhone;
 
 
-    /**
-     * 地址
-     */
-    @Excel(name = "地址")
+    /** 合作意向城市 */
+    @Excel(name = "合作意向城市")
+    @TableField("te_address")
     private String teAddress;
     private String teAddress;
 
 
-    /**
-     * 年龄
-     */
+    /** 年龄 */
     @Excel(name = "年龄")
     @Excel(name = "年龄")
-    private Long teAge;
+    @TableField("te_age")
+    private Integer teAge;
 
 
-    /**
-     * 头像
-     */
+    /** 头像 */
     @Excel(name = "头像")
     @Excel(name = "头像")
+    @TableField("te_avatar")
     private String teAvatar;
     private String teAvatar;
-
-    /**
-     * 生活照
-     */
+    /** 开通服务:1-上门按摩 2-同城玩乐 */
+    @Excel(name = "开通服务:1-上门按摩 2-同城玩乐")
+    @TableField("openService")
+    private Integer openService;
+    /** 生活照 */
     @Excel(name = "生活照")
     @Excel(name = "生活照")
+    @TableField("life_photos")
     private String lifePhotos;
     private String lifePhotos;
 
 
-    /**
-     * 简介
-     */
+    /** 形象照 */
+    @Excel(name = "形象照")
+    @TableField("avatar")
+    private String avatar;
+
+    /** 身份证 */
+    @Excel(name = "身份证")
+    @TableField("id_card")
+    private String idCard;
+
+    /** 健康证 */
+    @Excel(name = "健康证")
+    @TableField("health_certificate")
+    private String healthCertificate;
+
+    /** 从业资格证 */
+    @Excel(name = "从业资格证")
+    @TableField("qualification_certificate")
+    private String qualificationCertificate;
+
+    /** 无犯罪证明 */
+    @Excel(name = "无犯罪证明")
+    @TableField("no_crime_record")
+    private String noCrimeRecord;
+    /** 宣传视频 */
+    @Excel(name = "宣传视频")
+    @TableField("c_mr_address_id")
+    private String  promoVideo;
+    /** 承诺书 */
+    @Excel(name = "承诺书")
+    @TableField("commitment_pdf")
+    private String commitmentPdf;
+    /** 承诺录音 */
+    @Excel(name = "承诺录音")
+    @TableField("commitment_audio")
+    private String commitmentAudio;
+    /** 承诺录像 */
+    @Excel(name = "承诺录像")
+    @TableField("commitment_video")
+    private String commitmentVideo;
+
+    /** 简介 */
     @Excel(name = "简介")
     @Excel(name = "简介")
+    @TableField("te_brief")
     private String teBrief;
     private String teBrief;
 
 
-    /**
-     * 服务状态(0服务中,1可服务)
-     */
+    /** 服务状态(0服务中,1可服务) */
     @Excel(name = "服务状态(0服务中,1可服务)")
     @Excel(name = "服务状态(0服务中,1可服务)")
-    private Long serviceState;
-
-    /**
-     * 是否在岗(0否1是)
-     */
-    @Excel(name = "是否在岗(0否1是)")
-    private Long postState;
-
-    /**
-     * 是否启用(0否1是)
-     */
+    private Integer serviceState;
+    /** 上岗状态 (-1:未上岗 0:已上岗 1:已申请) */
+    @Excel(name = "上岗状态 (-1:未上岗 0:已上岗 1:已申请)")
+    private Integer  nsStatus2;
+    /** 商户管理状态: 0-正常, 1-限制接单, 2-冻结, 3-注销 */
+    @Excel(name = "商户管理状态: 0-正常, 1-限制接单, 2-冻结, 3-注销")
+    private String  merchantStatus;
+    /** 商户状态(0休息中1在线接单) */
+    @Excel(name = "商户状态(0休息中1在线接单)")
+    private Integer postState;
+    /** 商户类型(0:真实商户 1:虚拟商户) */
+    @Excel(name = "商户类型(0:真实商户 1:虚拟商户)")
+    private Integer  techType;
+    /** 是否启用(0否1是) */
     @Excel(name = "是否启用(0否1是)")
     @Excel(name = "是否启用(0否1是)")
-    private Long teIsEnable;
-
-    /**
-     * 创建人
-     */
+    private Integer teIsEnable;
+    /** 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回*/
+    @Excel(name = "审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回")
+    private Integer auditStatus;
+    /** 审批时间 */
+    @Excel(name = "审批时间")
+    private Date approveTime;
+    /** 创建人 */
     @Excel(name = "创建人")
     @Excel(name = "创建人")
     private Long createUser;
     private Long createUser;
 
 
-    /**
-     * 修改人
-     */
+    /** 修改人 */
     @Excel(name = "修改人")
     @Excel(name = "修改人")
     private Long updateUser;
     private Long updateUser;
 
 
-    /**
-     * 是否删除(0否1是)
-     */
+    /** 是否删除(0否1是) */
     @Excel(name = "是否删除(0否1是)")
     @Excel(name = "是否删除(0否1是)")
     private Long isDelete;
     private Long isDelete;
 
 
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setTeName(String teName) {
-        this.teName = teName;
-    }
-
-    public String getTeName() {
-        return teName;
-    }
-
-    public void setTeSex(Long teSex) {
-        this.teSex = teSex;
-    }
 
 
-    public Long getTeSex() {
-        return teSex;
-    }
 
 
-    public void setTePhone(String tePhone) {
-        this.tePhone = tePhone;
-    }
-
-    public String getTePhone() {
-        return tePhone;
-    }
-
-    public void setTeAddress(String teAddress) {
-        this.teAddress = teAddress;
-    }
-
-    public String getTeAddress() {
-        return teAddress;
-    }
-
-    public void setTeAge(Long teAge) {
-        this.teAge = teAge;
-    }
-
-    public Long getTeAge() {
-        return teAge;
-    }
-
-    public void setTeAvatar(String teAvatar) {
-        this.teAvatar = teAvatar;
-    }
-
-    public String getTeAvatar() {
-        return teAvatar;
-    }
-
-    public void setLifePhotos(String lifePhotos) {
-        this.lifePhotos = lifePhotos;
-    }
-
-    public String getLifePhotos() {
-        return lifePhotos;
-    }
-
-    public void setTeBrief(String teBrief) {
-        this.teBrief = teBrief;
-    }
-
-    public String getTeBrief() {
-        return teBrief;
-    }
-
-    public void setServiceState(Long serviceState) {
-        this.serviceState = serviceState;
-    }
-
-    public Long getServiceState() {
-        return serviceState;
-    }
-
-    public void setPostState(Long postState) {
-        this.postState = postState;
-    }
-
-    public Long getPostState() {
-        return postState;
-    }
-
-    public void setTeIsEnable(Long teIsEnable) {
-        this.teIsEnable = teIsEnable;
-    }
-
-    public Long getTeIsEnable() {
-        return teIsEnable;
-    }
-
-    public void setCreateUser(Long createUser) {
-        this.createUser = createUser;
-    }
-
-    public Long getCreateUser() {
-        return createUser;
-    }
-
-    public void setUpdateUser(Long updateUser) {
-        this.updateUser = updateUser;
-    }
-
-    public Long getUpdateUser() {
-        return updateUser;
-    }
-
-    public void setIsDelete(Long isDelete) {
-        this.isDelete = isDelete;
-    }
-
-    public Long getIsDelete() {
-        return isDelete;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
-                .append("teName", getTeName())
-                .append("teSex", getTeSex())
-                .append("tePhone", getTePhone())
-                .append("teAddress", getTeAddress())
-                .append("teAge", getTeAge())
-                .append("teAvatar", getTeAvatar())
-                .append("lifePhotos", getLifePhotos())
-                .append("teBrief", getTeBrief())
-                .append("serviceState", getServiceState())
-                .append("postState", getPostState())
-                .append("teIsEnable", getTeIsEnable())
-                .append("createUser", getCreateUser())
-                .append("updateUser", getUpdateUser())
-                .append("createTime", getCreateTime())
-                .append("updateTime", getUpdateTime())
-                .append("isDelete", getIsDelete())
-                .toString();
-    }
 }
 }

+ 7 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/TWxUser.java

@@ -84,6 +84,13 @@ public class TWxUser implements Serializable {
     @ApiModelProperty("昵称")
     @ApiModelProperty("昵称")
     private String cNickName;
     private String cNickName;
 
 
+    /**
+     * 密码
+     */
+    @TableField("c_password")
+    @ApiModelProperty("密码")
+    private String cPassword;
+
     /**
     /**
      * 消费金额
      * 消费金额
      */
      */

+ 198 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/Result.java

@@ -0,0 +1,198 @@
+package com.ylx.massage.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.ylx.massage.constant.CommonConstant;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *   接口返回数据格式
+ * @author scott
+ * @email jeecgos@163.com
+ * @date  2019年1月19日
+ */
+@Data
+@ApiModel(value="接口返回对象", description="接口返回对象")
+public class Result<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 成功标志
+     */
+    @ApiModelProperty(value = "成功标志")
+    private boolean success = true;
+
+    /**
+     * 返回处理消息
+     */
+    @ApiModelProperty(value = "返回处理消息")
+    private String message = "";
+
+    /**
+     * 返回代码
+     */
+    @ApiModelProperty(value = "返回代码")
+    private Integer code = 0;
+
+    /**
+     * 返回数据对象 data
+     */
+    @ApiModelProperty(value = "返回数据对象")
+    private T result;
+
+    /**
+     * 时间戳
+     */
+    @ApiModelProperty(value = "时间戳")
+    private long timestamp = System.currentTimeMillis();
+
+    public Result() {
+    }
+
+    /**
+     * 兼容VUE3版token失效不跳转登录页面
+     * @param code
+     * @param message
+     */
+    public Result(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Result<T> success(String message) {
+        this.message = message;
+        this.code = CommonConstant.SC_OK_200;
+        this.success = true;
+        return this;
+    }
+
+    public static<T> Result<T> ok() {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        return r;
+    }
+
+    public static<T> Result<T> ok(String msg) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        //Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
+        r.setResult((T) msg);
+        r.setMessage(msg);
+        return r;
+    }
+
+    public static<T> Result<T> ok(T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> OK() {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        return r;
+    }
+
+    /**
+     * 此方法是为了兼容升级所创建
+     *
+     * @param msg
+     * @param <T>
+     * @return
+     */
+    public static<T> Result<T> OK(String msg) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        //Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
+        r.setResult((T) msg);
+        return r;
+    }
+
+    public static<T> Result<T> OK(String msg,boolean success) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(success);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        r.setResult((T) msg);
+        return r;
+    }
+
+    public static<T> Result<T> OK(T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> OK(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    public static <T> Result<T> ok(String msg, T data) {
+        Result<T> r = new Result<>();
+        r.setMessage(msg) ;
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> error(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(false);
+        r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> error(String msg) {
+        return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
+    }
+
+    public static<T> Result<T> error(int code, String msg) {
+        Result<T> r = new Result<T>();
+        r.setCode(code);
+        r.setMessage(msg);
+        r.setSuccess(false);
+        return r;
+    }
+
+    public Result<T> errorNew(int code, String msg) {
+        this.message = msg;
+        this.code = code;
+        this.success = false;
+        return this;
+    }
+
+    public Result<T> error500(String message) {
+        this.message = message;
+        this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
+        this.success = false;
+        return this;
+    }
+
+    /**
+     * 无权限访问返回结果
+     */
+    public static<T> Result<T> noauth(String msg) {
+        return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg);
+    }
+
+    @JsonIgnore
+    private String onlTable;
+}

+ 22 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/ThirdPartyLoginsVo.java

@@ -0,0 +1,22 @@
+package com.ylx.massage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ThirdPartyLoginsVo implements Serializable {
+    @ApiModelProperty(value = "用户手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "用户类型 1-用户 2-商户")
+    private String userType;
+    @ApiModelProperty(value = "是否开启验证码登录 true-是 false-否")
+    private Boolean codeSwitch;
+    @ApiModelProperty(value = "验证码")
+    private String phoneMsg;
+
+    @ApiModelProperty(value = "密码")
+    private String passWord;
+
+}