mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-28 02:57:55 +08:00
Merge branch 'dev' into dev-g
This commit is contained in:
@@ -10,6 +10,7 @@ import com.jsowell.common.response.RestApiResponse;
|
|||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
||||||
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
||||||
|
import com.jsowell.thirdparty.platform.dto.RetryOrderDTO;
|
||||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
@@ -468,4 +469,38 @@ public class ChangZhouController extends ThirdPartyBaseController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取充电订单信息
|
||||||
|
* retry_notification_order_info
|
||||||
|
* @param request
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/retry_notification_order_info")
|
||||||
|
public CommonResult<?> retry_notification_order_info(HttpServletRequest request , @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("{}-获取充电订单信息 params:{}" , platformName , JSON.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
if (!verifyToken(request.getHeader("Authorization"))) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
if (!verifySignature(dto)) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
|
||||||
|
}
|
||||||
|
// 解析入参
|
||||||
|
RetryOrderDTO retryOrderDTO = parseParamsDTO(dto , RetryOrderDTO.class);
|
||||||
|
// 执行逻辑
|
||||||
|
Map<String, String> map = platformLogic.retryNotificationOrderInfo(retryOrderDTO.getStartChargeSeqs());
|
||||||
|
logger.info("{}-获取充电订单信息 result:{}" , platformName , map);
|
||||||
|
return CommonResult.success(0 , "获取充电订单信息成功!" , map.get("Data") , map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("{}-获取充电订单信息 error" , platformName , e);
|
||||||
|
}
|
||||||
|
return CommonResult.failed("{}-获取充电订单信息发生异常");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,4 +208,14 @@ public class SiChuanController extends ThirdPartyBaseController {
|
|||||||
return CommonResult.success(0 , "推送充电站信息成功!" , s , null);
|
return CommonResult.success(0 , "推送充电站信息成功!" , s , null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
|||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.*;
|
||||||
import com.jsowell.pile.vo.base.MemberWalletVO;
|
import com.jsowell.pile.vo.base.MemberWalletVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
|
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberWalletInfoVO;
|
import com.jsowell.pile.vo.uniapp.customer.MemberWalletInfoVO;
|
||||||
@@ -60,7 +60,7 @@ public class MemberController extends BaseController {
|
|||||||
private PileStationInfoService pileStationInfoService;
|
private PileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberFeedbackService memberFeedbackService;
|
private MemberFeedbackInfoService memberFeedbackInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发短信接口 business
|
* 下发短信接口 business
|
||||||
@@ -688,12 +688,12 @@ public class MemberController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveFeedback")
|
@PostMapping("/saveFeedback")
|
||||||
public RestApiResponse<?> saveFeedback(HttpServletRequest request, @RequestBody MemberFeedbackDTO dto) {
|
public RestApiResponse<?> saveFeedback(HttpServletRequest request, @RequestBody MemberFeedbackInfoDTO dto) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
memberFeedbackService.saveFeedback(dto);
|
memberFeedbackInfoService.saveFeedbackInfo(dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
logger.error("用户反馈信息保存 error", e);
|
logger.error("用户反馈信息保存 error", e);
|
||||||
@@ -714,7 +714,7 @@ public class MemberController extends BaseController {
|
|||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
List<MemberFeedbackVO> list = memberFeedbackService.getFeedbackList(memberId);
|
List<MemberFeedbackInfoVO> list = memberFeedbackInfoService.getInfoListByMemberId(memberId);
|
||||||
logger.info("用户获取反馈信息列表 list:{}", JSON.toJSONString(list));
|
logger.info("用户获取反馈信息列表 list:{}", JSON.toJSONString(list));
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
|
|||||||
@@ -131,9 +131,9 @@ public class MemberService {
|
|||||||
public void checkVerificationCode(MemberRegisterAndLoginDTO dto) {
|
public void checkVerificationCode(MemberRegisterAndLoginDTO dto) {
|
||||||
// 取出缓存中的验证码进行对比,如果缓存中没有,则超时
|
// 取出缓存中的验证码进行对比,如果缓存中没有,则超时
|
||||||
String captchaCode = redisCache.getCacheObject(CacheConstants.SMS_VERIFICATION_CODE_KEY + dto.getMobileNumber());
|
String captchaCode = redisCache.getCacheObject(CacheConstants.SMS_VERIFICATION_CODE_KEY + dto.getMobileNumber());
|
||||||
if (StringUtils.isEmpty(captchaCode)) {
|
// if (StringUtils.isEmpty(captchaCode)) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_TIMEOUT_ERROR);
|
// throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_TIMEOUT_ERROR);
|
||||||
}
|
// }
|
||||||
// 获取通用验证码
|
// 获取通用验证码
|
||||||
String commonCaptchaCode = redisCache.getCacheObject(CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + dto.getMobileNumber());
|
String commonCaptchaCode = redisCache.getCacheObject(CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + dto.getMobileNumber());
|
||||||
|
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
package com.jsowell.web.controller.pile;
|
|
||||||
|
|
||||||
import com.jsowell.common.annotation.Log;
|
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
|
||||||
import com.jsowell.common.core.domain.AjaxResult;
|
|
||||||
import com.jsowell.common.core.page.TableDataInfo;
|
|
||||||
import com.jsowell.common.enums.BusinessType;
|
|
||||||
import com.jsowell.pile.dto.MemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.service.MemberFeedbackService;
|
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员反馈信息Controller
|
|
||||||
*
|
|
||||||
* @author jsowell
|
|
||||||
* @date 2023-10-12
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/member/feedback")
|
|
||||||
public class MemberFeedbackController extends BaseController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MemberFeedbackService memberFeedbackService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询会员反馈列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('member:feedback:list')")
|
|
||||||
@PostMapping("/list")
|
|
||||||
public TableDataInfo list(@RequestBody QueryMemberFeedbackDTO dto) {
|
|
||||||
List<MemberFeedbackVO> list = memberFeedbackService.selectFeedbackList(dto);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID获取反馈详情
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('member:feedback:query')")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
||||||
MemberFeedbackVO feedback = memberFeedbackService.getFeedbackById(id);
|
|
||||||
return AjaxResult.success(feedback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改反馈内容(回复)
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('member:feedback:edit')")
|
|
||||||
@Log(title = "修改会员反馈", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/edit")
|
|
||||||
public AjaxResult edit(@RequestBody QueryMemberFeedbackDTO dto) {
|
|
||||||
memberFeedbackService.updateFeedback(dto);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除反馈信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('member:feedback:remove')")
|
|
||||||
@Log(title = "删除会员反馈", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping
|
|
||||||
public AjaxResult remove(@RequestParam List<Long> ids) {
|
|
||||||
memberFeedbackService.deleteFeedbackByIds(ids);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.jsowell.web.controller.pile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.jsowell.pile.service.MemberFeedbackInfoService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.jsowell.common.annotation.Log;
|
||||||
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
|
import com.jsowell.common.enums.BusinessType;
|
||||||
|
import com.jsowell.pile.domain.MemberFeedbackInfo;
|
||||||
|
import com.jsowell.common.util.poi.ExcelUtil;
|
||||||
|
import com.jsowell.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户问题反馈Controller
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pile/memberFeedbackInfo")
|
||||||
|
public class MemberFeedbackInfoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private MemberFeedbackInfoService memberFeedbackInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
startPage();
|
||||||
|
List<MemberFeedbackInfo> list = memberFeedbackInfoService.selectMemberFeedbackInfoList(memberFeedbackInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出用户问题反馈列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:export')")
|
||||||
|
@Log(title = "用户问题反馈", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
List<MemberFeedbackInfo> list = memberFeedbackInfoService.selectMemberFeedbackInfoList(memberFeedbackInfo);
|
||||||
|
ExcelUtil<MemberFeedbackInfo> util = new ExcelUtil<MemberFeedbackInfo>(MemberFeedbackInfo.class);
|
||||||
|
util.exportExcel(response, list, "用户问题反馈数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户问题反馈详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(memberFeedbackInfoService.selectMemberFeedbackInfoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户问题反馈
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:add')")
|
||||||
|
@Log(title = "用户问题反馈", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
return toAjax(memberFeedbackInfoService.insertMemberFeedbackInfo(memberFeedbackInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户问题反馈
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:edit')")
|
||||||
|
@Log(title = "用户问题反馈", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
return toAjax(memberFeedbackInfoService.updateMemberFeedbackInfo(memberFeedbackInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户问题反馈
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('pile:info:remove')")
|
||||||
|
@Log(title = "用户问题反馈", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(memberFeedbackInfoService.deleteMemberFeedbackInfoByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后管管理员通过feedbackCode查询信息详情
|
||||||
|
* @param feedbackCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getMemberFeedbackDetailByCode/{feedbackCode}")
|
||||||
|
public MemberFeedbackInfoVO getMemberFeedbackDetailByCode(@PathVariable("feedbackCode") String feedbackCode) {
|
||||||
|
return memberFeedbackInfoService.getMemberFeedbackDetailByCode(feedbackCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后管管理员处理用户反馈信息(实际调用修改方法,将该反馈信息状态改为处理中)
|
||||||
|
* @param memberFeedbackInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/dealUserFeedback")
|
||||||
|
public AjaxResult dealUserFeedback(@RequestBody MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
memberFeedbackInfoService.dealUserFeedback(memberFeedbackInfo);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,7 +52,7 @@ public class Constants {
|
|||||||
public static final int PILE_CONNECTOR_CODE_LENGTH_FOR_EBIKE = PILE_SN_LENGTH_FOR_EBIKE + CONNECTOR_CODE_LENGTH_FOR_EBIKE;
|
public static final int PILE_CONNECTOR_CODE_LENGTH_FOR_EBIKE = PILE_SN_LENGTH_FOR_EBIKE + CONNECTOR_CODE_LENGTH_FOR_EBIKE;
|
||||||
|
|
||||||
// 汇付手续费费率
|
// 汇付手续费费率
|
||||||
public static final String FEE_RATES = "0.0055";
|
public static final String FEE_RATES = "0.0060";
|
||||||
|
|
||||||
|
|
||||||
public static final String SOCKET_IP = "127.0.0.1";
|
public static final String SOCKET_IP = "127.0.0.1";
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public enum ThirdPlatformTypeEnum {
|
|||||||
WEI_WANG_XIN_DIAN("23", "微网新电", "MA005DBW1"),
|
WEI_WANG_XIN_DIAN("23", "微网新电", "MA005DBW1"),
|
||||||
HU_ZHOU_PLATFORM("24", "湖州市监管平台", "MA27U00HZ"),
|
HU_ZHOU_PLATFORM("24", "湖州市监管平台", "MA27U00HZ"),
|
||||||
CHANG_ZHOU_PLATFORM("25", "新运常畅充", "0585PCW57"),
|
CHANG_ZHOU_PLATFORM("25", "新运常畅充", "0585PCW57"),
|
||||||
SI_CHUAN_PLATFORM("26", "四川省平台", ""),
|
SI_CHUAN_PLATFORM("26", "四川省平台", "MA01H3BQ2"),
|
||||||
JI_LIN_PLATFORM("27", "吉林省平台", ""),
|
JI_LIN_PLATFORM("27", "吉林省平台", ""),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.jsowell.common.util;
|
package com.jsowell.common.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.github.qcloudsms.SmsSingleSender;
|
import com.github.qcloudsms.SmsSingleSender;
|
||||||
import com.github.qcloudsms.SmsSingleSenderResult;
|
import com.github.qcloudsms.SmsSingleSenderResult;
|
||||||
import com.github.qcloudsms.httpclient.HTTPException;
|
import com.github.qcloudsms.httpclient.HTTPException;
|
||||||
import com.jsowell.common.constant.CacheConstants;
|
import com.jsowell.common.constant.CacheConstants;
|
||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -15,6 +17,7 @@ import java.io.IOException;
|
|||||||
/**
|
/**
|
||||||
* 发送短信验证码工具类
|
* 发送短信验证码工具类
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class SMSUtil {
|
public class SMSUtil {
|
||||||
|
|
||||||
@@ -52,6 +55,7 @@ public class SMSUtil {
|
|||||||
SmsSingleSenderResult result = ssender.sendWithParam(NATION_CODE, phoneNumber, TEMPLATE_ID, params, SMS_SIGN, "", "");
|
SmsSingleSenderResult result = ssender.sendWithParam(NATION_CODE, phoneNumber, TEMPLATE_ID, params, SMS_SIGN, "", "");
|
||||||
if (result.result != 0) {
|
if (result.result != 0) {
|
||||||
reStr = "error";
|
reStr = "error";
|
||||||
|
log.error("发送验证码失败:{}", JSON.toJSONString(result));
|
||||||
} else {
|
} else {
|
||||||
// 改为保存redis
|
// 改为保存redis
|
||||||
String redisKey = CacheConstants.SMS_VERIFICATION_CODE_KEY + phoneNumber;
|
String redisKey = CacheConstants.SMS_VERIFICATION_CODE_KEY + phoneNumber;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.jsowell.common.util.id;
|
|||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
import com.jsowell.common.util.RandomUtil;
|
import com.jsowell.common.util.RandomUtil;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID生成器工具类
|
* ID生成器工具类
|
||||||
*
|
*
|
||||||
@@ -130,5 +132,47 @@ public class IdUtils {
|
|||||||
return String.valueOf(num);
|
return String.valueOf(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成以FB开头的流水号
|
||||||
|
* @param length 流水号总长度(必须大于14,因为FB+年月日时分秒(14位)已经占用了16位)
|
||||||
|
* @return 生成的流水号
|
||||||
|
* @throws IllegalArgumentException 如果length小于16时抛出异常
|
||||||
|
*/
|
||||||
|
public static String generateFBSerialNumber(int length) {
|
||||||
|
if (length < 16) {
|
||||||
|
throw new IllegalArgumentException("长度至少为16位数!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前时间并格式化为yyyyMMddHHmmss
|
||||||
|
String timePart = DateUtils.dateTimeNow(DateUtils.YYMMDDHHMMSS);
|
||||||
|
|
||||||
|
// 计算需要的随机数长度
|
||||||
|
int randomLength = length - 2 - 14; // 2(FB) + 14(时间部分)
|
||||||
|
|
||||||
|
// 生成随机数部分
|
||||||
|
String randomPart = generateRandomNumber(randomLength);
|
||||||
|
|
||||||
|
// 组合所有部分
|
||||||
|
return "FB" + timePart + randomPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成指定长度的随机数字字符串
|
||||||
|
* @param length 随机数长度
|
||||||
|
* @return 随机数字字符串
|
||||||
|
*/
|
||||||
|
private static String generateRandomNumber(int length) {
|
||||||
|
if (length <= 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Random random = new Random();
|
||||||
|
StringBuilder sb = new StringBuilder(length);
|
||||||
|
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
sb.append(random.nextInt(10));
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
package com.jsowell.pile.domain;
|
|
||||||
|
|
||||||
import com.jsowell.common.core.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class MemberFeedback extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员id
|
|
||||||
*/
|
|
||||||
private String memberId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员姓名
|
|
||||||
*/
|
|
||||||
private String memberName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系方式
|
|
||||||
*/
|
|
||||||
private String contactInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 反馈类型 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
|
||||||
*/
|
|
||||||
private String feedbackType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 反馈内容
|
|
||||||
*/
|
|
||||||
private String feedbackContent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理状态(0=未处理,1=处理中,2=已处理,3=待跟进)
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理员回复内容
|
|
||||||
*/
|
|
||||||
private String replyContent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理员回复时间
|
|
||||||
*/
|
|
||||||
private Date replyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除标记(0=未删除,1=已删除)
|
|
||||||
*/
|
|
||||||
private String delFlag;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.jsowell.pile.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.jsowell.common.annotation.Excel;
|
||||||
|
import com.jsowell.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户问题反馈对象 member_feedback_info
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class MemberFeedbackInfo extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈信息流水号
|
||||||
|
*/
|
||||||
|
private String feedbackCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "会员ID")
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员姓名/昵称
|
||||||
|
*/
|
||||||
|
@Excel(name = "会员姓名/昵称")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
@Excel(name = "手机号码")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈类型(1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
||||||
|
*/
|
||||||
|
@Excel(name = "反馈类型", readConverterExp = "1==功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他")
|
||||||
|
private String feedbackType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈内容
|
||||||
|
*/
|
||||||
|
@Excel(name = "反馈内容")
|
||||||
|
private String feedbackContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理状态(0=未处理,1=处理中,2=已处理,3=待跟进)
|
||||||
|
*/
|
||||||
|
@Excel(name = "处理状态", readConverterExp = "0==未处理,1=处理中,2=已处理,3=待跟进")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员回复内容
|
||||||
|
*/
|
||||||
|
@Excel(name = "管理员回复内容")
|
||||||
|
private String replyContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员回复时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "管理员回复时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date replyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标识(0-正常;1-删除)
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
@@ -7,13 +7,23 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class MemberFeedbackDTO {
|
public class MemberFeedbackInfoDTO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员ID
|
* 会员ID
|
||||||
*/
|
*/
|
||||||
private String memberId;
|
private String memberId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈内容
|
* 反馈内容
|
||||||
*/
|
*/
|
||||||
@@ -21,9 +31,8 @@ public class MemberFeedbackDTO {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈类型
|
* 反馈类型
|
||||||
|
* 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他
|
||||||
*/
|
*/
|
||||||
private String feedbackType;
|
private String feedbackType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.MemberFeedbackInfo;
|
||||||
|
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户问题反馈Mapper接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface MemberFeedbackInfoMapper {
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 用户问题反馈
|
||||||
|
*/
|
||||||
|
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈列表
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 用户问题反馈集合
|
||||||
|
*/
|
||||||
|
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户问题反馈
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberFeedbackInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberFeedbackInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据memberId查询信息列表
|
||||||
|
* @param memberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过反馈编码查询反馈信息详情
|
||||||
|
* @param feedbackCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode);
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package com.jsowell.pile.mapper;
|
|
||||||
|
|
||||||
import com.jsowell.pile.domain.MemberFeedback;
|
|
||||||
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface MemberFeedbackMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存会员反馈信息
|
|
||||||
* @param memberFeedback
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public int insertMemberFeedback(MemberFeedback memberFeedback);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据会员ID查询会员反馈信息列表
|
|
||||||
* @param memberId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<MemberFeedbackVO> selectMemberFeedbackList(String memberId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询会员反馈信息列表
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<MemberFeedbackVO> getFeedbackList(QueryMemberFeedbackDTO dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据会员ID查询会员反馈信息
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
MemberFeedbackVO getFeedbackById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID更新会员反馈信息
|
|
||||||
* @param dto
|
|
||||||
*/
|
|
||||||
void updateFeedback(QueryMemberFeedbackDTO dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID删除会员反馈信息
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
void deleteMemberFeedbackById(Long id);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
|
import com.jsowell.pile.domain.MemberFeedbackInfo;
|
||||||
|
import com.jsowell.pile.dto.MemberFeedbackInfoDTO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户问题反馈Service接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
public interface MemberFeedbackInfoService {
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 用户问题反馈
|
||||||
|
*/
|
||||||
|
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈列表
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 用户问题反馈集合
|
||||||
|
*/
|
||||||
|
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的用户问题反馈主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberFeedbackInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户问题反馈信息
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMemberFeedbackInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存用户提出的反馈建议信息
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
void saveFeedbackInfo(MemberFeedbackInfoDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过memberId查询反馈信息列表
|
||||||
|
* @param memberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过反馈编码查询反馈信息详情
|
||||||
|
* @param feedbackCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台管理员处理用户反馈信息
|
||||||
|
* @param memberFeedbackInfo
|
||||||
|
*/
|
||||||
|
void dealUserFeedback(MemberFeedbackInfo memberFeedbackInfo);
|
||||||
|
}
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package com.jsowell.pile.service;
|
|
||||||
|
|
||||||
import com.jsowell.pile.dto.MemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface MemberFeedbackService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户反馈信息保存
|
|
||||||
* @param dto
|
|
||||||
*/
|
|
||||||
void saveFeedback(MemberFeedbackDTO dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户反馈信息列表
|
|
||||||
* @param memberId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<MemberFeedbackVO> getFeedbackList(String memberId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 条件查询用户反馈信息列表 (管理后台使用)
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<MemberFeedbackVO> selectFeedbackList(QueryMemberFeedbackDTO dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据memberId获取用户反馈信息
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
MemberFeedbackVO getFeedbackById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据memberId删除用户反馈信息
|
|
||||||
* @param dto
|
|
||||||
*/
|
|
||||||
void updateFeedback(QueryMemberFeedbackDTO dto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ids删除用户反馈信息
|
|
||||||
* @param ids
|
|
||||||
*/
|
|
||||||
void deleteFeedbackByIds(List<Long> ids);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
|
import com.jsowell.common.util.DateUtils;
|
||||||
|
import com.jsowell.common.util.id.IdUtils;
|
||||||
|
import com.jsowell.pile.dto.MemberFeedbackInfoDTO;
|
||||||
|
import com.jsowell.pile.service.MemberFeedbackInfoService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.jsowell.pile.mapper.MemberFeedbackInfoMapper;
|
||||||
|
import com.jsowell.pile.domain.MemberFeedbackInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户问题反馈Service业务层处理
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2025-06-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MemberFeedbackInfoServiceImpl implements MemberFeedbackInfoService {
|
||||||
|
@Autowired
|
||||||
|
private MemberFeedbackInfoMapper memberFeedbackInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 用户问题反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id) {
|
||||||
|
return memberFeedbackInfoMapper.selectMemberFeedbackInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户问题反馈列表
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 用户问题反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
return memberFeedbackInfoMapper.selectMemberFeedbackInfoList(memberFeedbackInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
memberFeedbackInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return memberFeedbackInfoMapper.insertMemberFeedbackInfo(memberFeedbackInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户问题反馈
|
||||||
|
*
|
||||||
|
* @param memberFeedbackInfo 用户问题反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
memberFeedbackInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return memberFeedbackInfoMapper.updateMemberFeedbackInfo(memberFeedbackInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户问题反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的用户问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberFeedbackInfoByIds(Long[] ids) {
|
||||||
|
return memberFeedbackInfoMapper.deleteMemberFeedbackInfoByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户问题反馈信息
|
||||||
|
*
|
||||||
|
* @param id 用户问题反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberFeedbackInfoById(Long id) {
|
||||||
|
return memberFeedbackInfoMapper.deleteMemberFeedbackInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存用户提出的反馈建议信息
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void saveFeedbackInfo(MemberFeedbackInfoDTO dto) {
|
||||||
|
MemberFeedbackInfo info = MemberFeedbackInfo.builder()
|
||||||
|
.memberId(dto.getMemberId())
|
||||||
|
.nickName(dto.getNickName())
|
||||||
|
.phoneNumber(dto.getPhoneNumber())
|
||||||
|
.feedbackType(dto.getFeedbackType())
|
||||||
|
.feedbackContent(dto.getFeedbackContent())
|
||||||
|
.status(Constants.ZERO)
|
||||||
|
.build();
|
||||||
|
// 生成24位流水号
|
||||||
|
String feedbackCode = IdUtils.generateFBSerialNumber(24);
|
||||||
|
info.setFeedbackCode(feedbackCode);
|
||||||
|
|
||||||
|
insertMemberFeedbackInfo(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过memberId查询反馈信息列表
|
||||||
|
* @param memberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId) {
|
||||||
|
return memberFeedbackInfoMapper.getInfoListByMemberId(memberId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过反馈编码查询反馈信息详情
|
||||||
|
* @param feedbackCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode) {
|
||||||
|
return memberFeedbackInfoMapper.getMemberFeedbackDetailByCode(feedbackCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后管管理员处理用户反馈信息(实际调用修改方法,将该反馈信息状态改为处理中)
|
||||||
|
* @param memberFeedbackInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void dealUserFeedback(MemberFeedbackInfo memberFeedbackInfo) {
|
||||||
|
// 将本条反馈信息状态改为 1-处理中
|
||||||
|
memberFeedbackInfo.setStatus(Constants.ONE);
|
||||||
|
// 修改数据库
|
||||||
|
this.updateMemberFeedbackInfo(memberFeedbackInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.jsowell.common.constant.Constants;
|
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
|
||||||
import com.jsowell.common.util.DateUtils;
|
|
||||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
|
||||||
import com.jsowell.pile.domain.MemberFeedback;
|
|
||||||
import com.jsowell.pile.dto.MemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
|
|
||||||
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
|
||||||
import com.jsowell.pile.mapper.MemberFeedbackMapper;
|
|
||||||
import com.jsowell.pile.service.MemberFeedbackService;
|
|
||||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class MemberFeedbackServiceImpl implements MemberFeedbackService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
MemberBasicInfoMapper memberBasicInfoMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
MemberFeedbackMapper memberFeedbackMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户反馈保存
|
|
||||||
* @param dto
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void saveFeedback(MemberFeedbackDTO dto) {
|
|
||||||
MemberBasicInfo memberInfo = memberBasicInfoMapper.selectInfoByMemberId(dto.getMemberId());
|
|
||||||
if (memberInfo == null) {
|
|
||||||
throw new IllegalArgumentException("");
|
|
||||||
}
|
|
||||||
MemberFeedback memberFeedback = MemberFeedback.builder ()
|
|
||||||
.memberId(dto.getMemberId())
|
|
||||||
.memberName(memberInfo.getNickName())
|
|
||||||
.contactInfo(memberInfo.getMobileNumber()) // 联系方式
|
|
||||||
.feedbackType(dto.getFeedbackType()) //反馈类型
|
|
||||||
.feedbackContent(dto.getFeedbackContent())
|
|
||||||
.status(Constants.ONE)
|
|
||||||
.createTime(DateUtils.getNowDate())
|
|
||||||
.delFlag(Constants.ZERO)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 保存反馈信息至数据库
|
|
||||||
memberFeedbackMapper.insertMemberFeedback(memberFeedback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户反馈列表
|
|
||||||
* @param memberId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MemberFeedbackVO> getFeedbackList(String memberId) {
|
|
||||||
return memberFeedbackMapper.selectMemberFeedbackList(memberId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 条件查询用户反馈列表 (后管)
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MemberFeedbackVO> selectFeedbackList(QueryMemberFeedbackDTO dto) {
|
|
||||||
//分页
|
|
||||||
dto.setPageNum(dto.getPageNum() == null? 1 : dto.getPageNum());
|
|
||||||
dto.setPageSize(dto.getPageSize() == null? 10 : dto.getPageSize());
|
|
||||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
|
||||||
return memberFeedbackMapper.getFeedbackList(dto);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id获取用户反馈信息
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public MemberFeedbackVO getFeedbackById(Long id) {
|
|
||||||
return memberFeedbackMapper.getFeedbackById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id更新用户反馈信息
|
|
||||||
* @param dto
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updateFeedback(QueryMemberFeedbackDTO dto) {
|
|
||||||
memberFeedbackMapper.updateFeedback(dto);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id删除用户反馈信息
|
|
||||||
* @param ids
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteFeedbackByIds(List<Long> ids) {
|
|
||||||
for (Long id : ids) {
|
|
||||||
memberFeedbackMapper.deleteMemberFeedbackById(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -795,48 +795,5 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService {
|
|||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
List<String> list = Lists.newArrayList(
|
|
||||||
"0.06",
|
|
||||||
"0.06",
|
|
||||||
"0.09",
|
|
||||||
"0.06",
|
|
||||||
"0.05",
|
|
||||||
"0.09",
|
|
||||||
"0.02",
|
|
||||||
"0.18",
|
|
||||||
"0.10",
|
|
||||||
"0.03",
|
|
||||||
"0.06",
|
|
||||||
"0.11");
|
|
||||||
|
|
||||||
// 总手续费
|
|
||||||
BigDecimal totalFeeAmount = BigDecimal.ZERO;
|
|
||||||
BigDecimal totalTradeAmount = BigDecimal.ZERO;
|
|
||||||
|
|
||||||
for (String s : list) {
|
|
||||||
BigDecimal settleAmount = new BigDecimal(s);
|
|
||||||
BigDecimal fee = settleAmount.multiply(new BigDecimal(Constants.FEE_RATES)).setScale(2, RoundingMode.UP);
|
|
||||||
// 交易金额 = 结算金额 - 手续费
|
|
||||||
BigDecimal tradeAmount = settleAmount.subtract(fee);
|
|
||||||
|
|
||||||
totalFeeAmount = totalFeeAmount.add(fee);
|
|
||||||
totalTradeAmount = totalTradeAmount.add(tradeAmount);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("总手续费" + totalFeeAmount);
|
|
||||||
System.out.println("总交易金额" + totalTradeAmount);
|
|
||||||
|
|
||||||
|
|
||||||
// BigDecimal settleAmount = new BigDecimal("330.37");
|
|
||||||
// // 计算手续费 = 结算金额 * 0.55%
|
|
||||||
// BigDecimal fee = settleAmount.multiply(new BigDecimal(Constants.FEE_RATES));
|
|
||||||
// SplitSettleAmountVO resultVO = new SplitSettleAmountVO();
|
|
||||||
// resultVO.setSettleAmount(settleAmount);
|
|
||||||
// resultVO.setFeeAmount(fee);
|
|
||||||
// resultVO.setTradeAmount(settleAmount.subtract(fee));
|
|
||||||
// System.out.println(JSON.toJSONString(resultVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,15 @@ import java.util.Date;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
public class MemberFeedbackVO {
|
public class MemberFeedbackInfoVO {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈信息流水号
|
||||||
|
*/
|
||||||
|
private String feedbackCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员id
|
* 会员id
|
||||||
*/
|
*/
|
||||||
@@ -19,12 +24,12 @@ public class MemberFeedbackVO {
|
|||||||
/**
|
/**
|
||||||
* 会员姓名
|
* 会员姓名
|
||||||
*/
|
*/
|
||||||
private String memberName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系方式
|
* 联系方式
|
||||||
*/
|
*/
|
||||||
private String contactInfo;
|
private String phoneNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈类型 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
* 反馈类型 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.jsowell.pile.mapper.MemberFeedbackInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.jsowell.pile.domain.MemberFeedbackInfo" id="MemberFeedbackInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="feedbackCode" column="feedback_code" />
|
||||||
|
<result property="memberId" column="member_id" />
|
||||||
|
<result property="nickName" column="nick_name" />
|
||||||
|
<result property="phoneNumber" column="phone_number" />
|
||||||
|
<result property="feedbackType" column="feedback_type" />
|
||||||
|
<result property="feedbackContent" column="feedback_content" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="replyContent" column="reply_content" />
|
||||||
|
<result property="replyTime" column="reply_time" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectMemberFeedbackInfoVo">
|
||||||
|
select id, feedback_code, member_id, nick_name, phone_number, feedback_type, feedback_content, status, reply_content, reply_time, create_time, update_time, del_flag from member_feedback_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, feedback_code, member_id, nick_name, phone_number, feedback_type, feedback_content, status, reply_content, reply_time, create_time, update_time, del_flag
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMemberFeedbackInfoList" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo" resultMap="MemberFeedbackInfoResult">
|
||||||
|
<include refid="selectMemberFeedbackInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="feedbackCode != null and feedbackCode != ''"> and feedback_code = #{feedbackCode}</if>
|
||||||
|
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
|
||||||
|
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||||
|
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
||||||
|
<if test="feedbackType != null and feedbackType != ''"> and feedback_type = #{feedbackType}</if>
|
||||||
|
<if test="feedbackContent != null and feedbackContent != ''"> and feedback_content = #{feedbackContent}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="replyContent != null and replyContent != ''"> and reply_content = #{replyContent}</if>
|
||||||
|
<if test="replyTime != null "> and reply_time = #{replyTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMemberFeedbackInfoById" parameterType="Long" resultMap="MemberFeedbackInfoResult">
|
||||||
|
<include refid="selectMemberFeedbackInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMemberFeedbackInfo" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into member_feedback_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="feedbackCode != null and feedbackCode != ''">feedback_code,</if>
|
||||||
|
<if test="memberId != null and memberId != ''">member_id,</if>
|
||||||
|
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||||
|
<if test="phoneNumber != null">phone_number,</if>
|
||||||
|
<if test="feedbackType != null and feedbackType != ''">feedback_type,</if>
|
||||||
|
<if test="feedbackContent != null and feedbackContent != ''">feedback_content,</if>
|
||||||
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
<if test="replyContent != null">reply_content,</if>
|
||||||
|
<if test="replyTime != null">reply_time,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="feedbackCode != null and feedbackCode != ''">#{feedbackCode},</if>
|
||||||
|
<if test="memberId != null and memberId != ''">#{memberId},</if>
|
||||||
|
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||||
|
<if test="phoneNumber != null">#{phoneNumber},</if>
|
||||||
|
<if test="feedbackType != null and feedbackType != ''">#{feedbackType},</if>
|
||||||
|
<if test="feedbackContent != null and feedbackContent != ''">#{feedbackContent},</if>
|
||||||
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
<if test="replyContent != null">#{replyContent},</if>
|
||||||
|
<if test="replyTime != null">#{replyTime},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateMemberFeedbackInfo" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo">
|
||||||
|
update member_feedback_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="feedbackCode != null and feedbackCode != ''">feedback_code = #{feedbackCode},</if>
|
||||||
|
<if test="memberId != null and memberId != ''">member_id = #{memberId},</if>
|
||||||
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||||
|
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
|
||||||
|
<if test="feedbackType != null and feedbackType != ''">feedback_type = #{feedbackType},</if>
|
||||||
|
<if test="feedbackContent != null and feedbackContent != ''">feedback_content = #{feedbackContent},</if>
|
||||||
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
<if test="replyContent != null">reply_content = #{replyContent},</if>
|
||||||
|
<if test="replyTime != null">reply_time = #{replyTime},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMemberFeedbackInfoById" parameterType="Long">
|
||||||
|
delete from member_feedback_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMemberFeedbackInfoByIds" parameterType="String">
|
||||||
|
delete from member_feedback_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="getInfoListByMemberId" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO">
|
||||||
|
SELECT
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
FROM member_feedback_info
|
||||||
|
WHERE member_id = #{memberId,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMemberFeedbackDetailByCode" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from member_feedback_info
|
||||||
|
where feedback_code = #{feedbackCode,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -1,206 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.jsowell.pile.mapper.MemberFeedbackMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.jsowell.pile.domain.MemberFeedback" id="MemberFeedbackResultMap">
|
|
||||||
<result property="id" column="id"/>
|
|
||||||
<result property="memberId" column="member_id"/>
|
|
||||||
<result property="memberName" column="member_name"/>
|
|
||||||
<result property="contactInfo" column="contact_info"/>
|
|
||||||
<result property="feedbackType" column="feedback_type"/>
|
|
||||||
<result property="feedbackContent" column="feedback_content"/>
|
|
||||||
<result property="status" column="status"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
<result property="replyContent" column="reply_content"/>
|
|
||||||
<result property="replyTime" column="reply_time"/>
|
|
||||||
<result property="delFlag" column="del_flag"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectCarCouponRecordVo">
|
|
||||||
select id,
|
|
||||||
member_id,
|
|
||||||
member_name,
|
|
||||||
contact_info,
|
|
||||||
feedback_type,
|
|
||||||
feedback_content,
|
|
||||||
status,
|
|
||||||
create_time,
|
|
||||||
update_time,
|
|
||||||
reply_content,
|
|
||||||
reply_time,
|
|
||||||
del_flag
|
|
||||||
from member_feedback
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<insert id="insertMemberFeedback" parameterType="com.jsowell.pile.domain.MemberFeedback">
|
|
||||||
insert into member_feedback
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
id,
|
|
||||||
</if>
|
|
||||||
<if test="memberId != null">
|
|
||||||
member_id,
|
|
||||||
</if>
|
|
||||||
<if test="memberName != null">
|
|
||||||
member_name,
|
|
||||||
</if>
|
|
||||||
<if test="contactInfo != null">
|
|
||||||
contact_info,
|
|
||||||
</if>
|
|
||||||
<if test="feedbackType != null">
|
|
||||||
feedback_type,
|
|
||||||
</if>
|
|
||||||
<if test="feedbackContent != null">
|
|
||||||
feedback_content,
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time,
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time,
|
|
||||||
</if>
|
|
||||||
<if test="replyContent != null">
|
|
||||||
reply_content,
|
|
||||||
</if>
|
|
||||||
<if test="replyTime != null">
|
|
||||||
reply_time,
|
|
||||||
</if>
|
|
||||||
<if test="delFlag != null">
|
|
||||||
del_flag,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
#{id},
|
|
||||||
</if>
|
|
||||||
<if test="memberId != null">
|
|
||||||
#{memberId},
|
|
||||||
</if>
|
|
||||||
<if test="memberName != null">
|
|
||||||
#{memberName},
|
|
||||||
</if>
|
|
||||||
<if test="contactInfo != null">
|
|
||||||
#{contactInfo},
|
|
||||||
</if>
|
|
||||||
<if test="feedbackType != null">
|
|
||||||
#{feedbackType},
|
|
||||||
</if>
|
|
||||||
<if test="feedbackContent != null">
|
|
||||||
#{feedbackContent},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
#{status},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
#{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
#{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="replyContent != null">
|
|
||||||
#{replyContent},
|
|
||||||
</if>
|
|
||||||
<if test="replyTime != null">
|
|
||||||
#{replyTime},
|
|
||||||
</if>
|
|
||||||
<if test="delFlag != null">
|
|
||||||
#{delFlag},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="updateFeedback">
|
|
||||||
UPDATE member_feedback
|
|
||||||
<set>
|
|
||||||
<if test="status != null">
|
|
||||||
status = #{status},
|
|
||||||
</if>
|
|
||||||
<if test="replyContent != null">
|
|
||||||
reply_content = #{replyContent},
|
|
||||||
</if>
|
|
||||||
<if test="replyTime != null">
|
|
||||||
reply_time = #{replyTime},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
WHERE id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteMemberFeedbackById">
|
|
||||||
DELETE
|
|
||||||
FROM member_feedback
|
|
||||||
WHERE id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectMemberFeedbackList" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
|
|
||||||
SELECT member_id,
|
|
||||||
member_name,
|
|
||||||
contact_info,
|
|
||||||
feedback_type,
|
|
||||||
feedback_content,
|
|
||||||
status,
|
|
||||||
create_time,
|
|
||||||
update_time,
|
|
||||||
reply_content,
|
|
||||||
reply_time
|
|
||||||
FROM member_feedback
|
|
||||||
WHERE member_id = #{memberId}
|
|
||||||
AND del_flag = '0'
|
|
||||||
ORDER BY create_time DESC
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getFeedbackList" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
|
|
||||||
SELECT
|
|
||||||
id,
|
|
||||||
member_id,
|
|
||||||
member_name,
|
|
||||||
contact_info,
|
|
||||||
feedback_type,
|
|
||||||
feedback_content,
|
|
||||||
status,
|
|
||||||
create_time,
|
|
||||||
update_time,
|
|
||||||
reply_content,
|
|
||||||
reply_time
|
|
||||||
FROM member_feedback
|
|
||||||
<where>
|
|
||||||
del_flag = '0'
|
|
||||||
<if test="memberId != null and memberId != ''">
|
|
||||||
AND member_id = #{memberId}
|
|
||||||
</if>
|
|
||||||
<if test="memberName != null and memberName != ''">
|
|
||||||
AND member_name = #{memberName}
|
|
||||||
</if>
|
|
||||||
<if test="feedbackType != null and feedbackType != ''">
|
|
||||||
AND feedback_type = #{feedbackType}
|
|
||||||
</if>
|
|
||||||
<if test="status != null and status != ''">
|
|
||||||
AND status = #{status}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
ORDER BY create_time DESC
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getFeedbackById" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
|
|
||||||
SELECT id,
|
|
||||||
member_id,
|
|
||||||
member_name,
|
|
||||||
contact_info,
|
|
||||||
feedback_type,
|
|
||||||
feedback_content,
|
|
||||||
status,
|
|
||||||
create_time,
|
|
||||||
update_time,
|
|
||||||
reply_content,
|
|
||||||
reply_time
|
|
||||||
FROM member_feedback
|
|
||||||
WHERE id = #{id}
|
|
||||||
AND del_flag = '0'
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -164,23 +164,68 @@ public class NotificationService {
|
|||||||
// 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue
|
// 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 根据平台类型获取Service
|
||||||
|
ThirdPartyPlatformService platformService =null;
|
||||||
try {
|
try {
|
||||||
// 根据平台类型获取Service
|
// 根据平台类型获取Service
|
||||||
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
|
platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("获取平台服务失败", e);
|
||||||
|
}
|
||||||
//充电订单信息推送
|
//充电订单信息推送
|
||||||
|
try {
|
||||||
|
if(platformService != null){
|
||||||
platformService.notificationChargeOrderInfo(orderCode, secretInfoVO);
|
platformService.notificationChargeOrderInfo(orderCode, secretInfoVO);
|
||||||
//订单信息推送
|
}
|
||||||
platformService.notificationChargeOrderInfo(orderCode);
|
|
||||||
//停止充电结果推送
|
|
||||||
platformService.notificationStopChargeResult(orderCode);
|
|
||||||
//推送充换电站用能统计信息
|
|
||||||
platformService.notificationOperationStatsInfo(stationId);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("充电订单信息推送error", e);
|
logger.error("充电订单信息推送error", e);
|
||||||
}
|
}
|
||||||
|
//订单信息推送
|
||||||
|
try {
|
||||||
|
if (platformService != null) {
|
||||||
|
platformService.notificationChargeOrderInfo(orderCode);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("订单信息推送error", e);
|
||||||
|
}
|
||||||
|
//停止充电结果推送
|
||||||
|
try {
|
||||||
|
if (platformService != null) {
|
||||||
|
platformService.notificationStopChargeResult(orderCode);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("停止充电结果推送error", e);
|
||||||
|
}
|
||||||
|
//推送充换电站用能统计信息
|
||||||
|
try {
|
||||||
|
if (platformService != null) {
|
||||||
|
platformService.notificationOperationStatsInfo(stationId);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("推送充换电站用能统计信息error", e);
|
||||||
|
}
|
||||||
|
//推送充电账单信息
|
||||||
|
try {
|
||||||
|
if (platformService != null) {
|
||||||
|
platformService.notificationPayOrderInfo(orderCode);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error("推送充电账单信息error", e);
|
||||||
|
}
|
||||||
|
//推送充电历史订单信息
|
||||||
|
try {
|
||||||
|
// 根据平台类型获取Service
|
||||||
|
if (platformService != null) {
|
||||||
|
platformService.notificationChargeOrderInfoHistory(orderCode);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("历史充电订单信息推送error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void commonPushStartChargeResult(NotificationDTO dto) {
|
public void commonPushStartChargeResult(NotificationDTO dto) {
|
||||||
logger.info("开始调用commonPushStartChargeResult接口");
|
logger.info("开始调用commonPushStartChargeResult接口");
|
||||||
|
|||||||
59
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/PayOrderInfo.java
vendored
Normal file
59
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/PayOrderInfo.java
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
package com.jsowell.thirdparty.platform.domain;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PayOrderInfo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电订单号
|
||||||
|
*/
|
||||||
|
@JSONField(name = "StartChargeSeq")
|
||||||
|
private String startChargeSeq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电费(优惠前) 保2
|
||||||
|
*/
|
||||||
|
@JSONField(name = "ElecTotal")
|
||||||
|
private BigDecimal elecTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总服务费(优惠前) 保2
|
||||||
|
*/
|
||||||
|
@JSONField(name = "ServiceTotal")
|
||||||
|
private BigDecimal serviceTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计总金额(优惠前) 保2
|
||||||
|
*/
|
||||||
|
@JSONField(name = "Total")
|
||||||
|
private BigDecimal total;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电费(实际支付)
|
||||||
|
*/
|
||||||
|
@JSONField(name = "ElecPaid")
|
||||||
|
private BigDecimal elecPaid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总服务费(实际支付)
|
||||||
|
*/
|
||||||
|
@JSONField(name = "ServicePaid")
|
||||||
|
private BigDecimal servicePaid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计总金额(实际支付)
|
||||||
|
*/
|
||||||
|
@JSONField(name = "Paid")
|
||||||
|
private BigDecimal paid;
|
||||||
|
|
||||||
|
}
|
||||||
20
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/RetryOrderDTO.java
vendored
Normal file
20
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/RetryOrderDTO.java
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package com.jsowell.thirdparty.platform.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class RetryOrderDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电订单号
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "StartChargeSeqs")
|
||||||
|
private String startChargeSeqs;
|
||||||
|
}
|
||||||
@@ -271,6 +271,15 @@ public interface ThirdPartyPlatformService extends InitializingBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取充电订单信息
|
||||||
|
* retry_notification_order_info
|
||||||
|
*/
|
||||||
|
default Map<String, String> retryNotificationOrderInfo(String orderCode) {
|
||||||
|
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// =================================================================================== //
|
// =================================================================================== //
|
||||||
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由对方平台实现此接口,我方平台调用的通知接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由对方平台实现此接口,我方平台调用的通知接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
|
||||||
// =================================================================================== //
|
// =================================================================================== //
|
||||||
@@ -474,6 +483,14 @@ public interface ThirdPartyPlatformService extends InitializingBean {
|
|||||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电账单信息
|
||||||
|
* notification_pay_order_info
|
||||||
|
*/
|
||||||
|
default String notificationPayOrderInfo(String orderCode) {
|
||||||
|
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------- 以下是公用方法 --------------------------------------- //
|
// -------------------------------------- 以下是公用方法 --------------------------------------- //
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
|
|||||||
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
|
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
|
||||||
import com.jsowell.thirdparty.lianlian.vo.*;
|
import com.jsowell.thirdparty.lianlian.vo.*;
|
||||||
import com.jsowell.thirdparty.platform.common.ChargeDetail;
|
import com.jsowell.thirdparty.platform.common.ChargeDetail;
|
||||||
|
import com.jsowell.thirdparty.platform.domain.PayOrderInfo;
|
||||||
import com.jsowell.thirdparty.platform.domain.SupChargeDetails;
|
import com.jsowell.thirdparty.platform.domain.SupChargeDetails;
|
||||||
import com.jsowell.thirdparty.platform.domain.SupStationInfo;
|
import com.jsowell.thirdparty.platform.domain.SupStationInfo;
|
||||||
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
||||||
@@ -789,6 +790,105 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电账单信息
|
||||||
|
* notification_pay_order_info
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String notificationPayOrderInfo(String orderCode){
|
||||||
|
//获取订单信息
|
||||||
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
if (orderBasicInfo == null) {
|
||||||
|
return "没有此订单信息";
|
||||||
|
}
|
||||||
|
//获取订单详情信息
|
||||||
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
|
||||||
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getChangZhouSecretInfo();
|
||||||
|
String operatorId = Constants.OPERATORID_JIANG_SU;
|
||||||
|
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
||||||
|
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
|
||||||
|
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
|
||||||
|
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
|
||||||
|
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
|
||||||
|
|
||||||
|
//《***优惠前***》
|
||||||
|
//电费
|
||||||
|
BigDecimal electricityAmount = orderDetail.getTotalElectricityAmount();
|
||||||
|
//服务费
|
||||||
|
BigDecimal serviceAmount = orderDetail.getTotalServiceAmount();
|
||||||
|
//订单金额
|
||||||
|
BigDecimal orderAmount = orderDetail.getTotalOrderAmount();
|
||||||
|
|
||||||
|
|
||||||
|
//《***优惠金额***》
|
||||||
|
//优惠电费
|
||||||
|
BigDecimal discountElectricityAmount =
|
||||||
|
orderDetail.getDiscountElectricityAmount() == null ? BigDecimal.ZERO:orderDetail.getDiscountElectricityAmount();
|
||||||
|
//优惠服务费
|
||||||
|
BigDecimal discountServiceAmount =
|
||||||
|
orderDetail.getDiscountServiceAmount() == null ? BigDecimal.ZERO:orderDetail.getDiscountServiceAmount();
|
||||||
|
|
||||||
|
|
||||||
|
//《***优惠后***》
|
||||||
|
//电费
|
||||||
|
BigDecimal afterDiscountElectricityAmount = electricityAmount.subtract(discountElectricityAmount);
|
||||||
|
//服务费
|
||||||
|
BigDecimal afterDiscountServiceAmount = serviceAmount.subtract(discountServiceAmount);
|
||||||
|
//订单金额
|
||||||
|
BigDecimal afterDiscountOrderAmount = orderAmount.subtract(discountElectricityAmount).subtract(discountServiceAmount);
|
||||||
|
|
||||||
|
|
||||||
|
PayOrderInfo payOrderInfo = PayOrderInfo.builder()
|
||||||
|
.startChargeSeq(orderCode)
|
||||||
|
.elecTotal(electricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.serviceTotal(serviceAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.total(orderAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.elecPaid(afterDiscountElectricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.servicePaid(afterDiscountServiceAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.paid(afterDiscountOrderAmount.setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
String url = urlAddress + "notification_pay_order_info";
|
||||||
|
|
||||||
|
String jsonString = JSON.toJSONString(payOrderInfo);
|
||||||
|
log.info("请求参数:{}", jsonString);
|
||||||
|
|
||||||
|
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||||
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取充电订单信息 retry_notification_order_info
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String ,String> retryNotificationOrderInfo(String orderCode) {
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getChangZhouSecretInfo();
|
||||||
|
int SuccStat = 0;
|
||||||
|
//查询订单信息
|
||||||
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
if (orderBasicInfo == null) {
|
||||||
|
SuccStat = 1;
|
||||||
|
}
|
||||||
|
map.put("SuccStat", SuccStat);
|
||||||
|
//调用推送订单信息
|
||||||
|
notificationChargeOrderInfo(orderCode, thirdPartySecretInfoVO);
|
||||||
|
|
||||||
|
return ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换时段充电明细
|
* 转换时段充电明细
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.jsowell.thirdparty.platform.service.impl;
|
package com.jsowell.thirdparty.platform.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
@@ -38,9 +40,7 @@ import com.jsowell.thirdparty.platform.domain.*;
|
|||||||
import com.jsowell.thirdparty.platform.dto.SupStationInfoDTO;
|
import com.jsowell.thirdparty.platform.dto.SupStationInfoDTO;
|
||||||
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
||||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
import com.jsowell.thirdparty.platform.util.*;
|
||||||
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
|
||||||
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
|
|
||||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||||
import com.yi.business.geo.GeoCodeInfo;
|
import com.yi.business.geo.GeoCodeInfo;
|
||||||
import com.yi.business.geo.TermRelationTreeCoordinate;
|
import com.yi.business.geo.TermRelationTreeCoordinate;
|
||||||
@@ -51,6 +51,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -100,6 +101,55 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
ThirdPartyPlatformFactory.register(thirdPlatformType, this);
|
ThirdPartyPlatformFactory.register(thirdPlatformType, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getToken(String urlAddress, String operatorId, String operatorSecret, String dataSecretIv, String signSecret, String dataSecret) {
|
||||||
|
String token = "";
|
||||||
|
log.info("operatorId:{}, operatorSecret:{}, dataSecretIv:{}, signSecret:{}, dataSecret:{}", operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||||
|
try {
|
||||||
|
// 请求地址
|
||||||
|
String requestUrl = urlAddress + "query_token";
|
||||||
|
|
||||||
|
// 请求data
|
||||||
|
Map<String, String> data = new HashMap<>();
|
||||||
|
data.put("OperatorID", operatorId);
|
||||||
|
data.put("OperatorSecret", operatorSecret);
|
||||||
|
data.put("DataSecretIV", dataSecretIv);
|
||||||
|
String dataJson = JSONUtil.toJsonStr(data);
|
||||||
|
|
||||||
|
// 加密
|
||||||
|
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
|
||||||
|
dataSecret.getBytes(), dataSecretIv.getBytes());
|
||||||
|
String strData = Encodes.encodeBase64(encryptText);
|
||||||
|
|
||||||
|
Map<String, String> request = new LinkedHashMap<>();
|
||||||
|
request.put("OperatorID", operatorId);
|
||||||
|
request.put("Data", strData);
|
||||||
|
request.put("TimeStamp", DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
|
||||||
|
request.put("Seq", "0001");
|
||||||
|
|
||||||
|
// 生成签名
|
||||||
|
String sig = GBSignUtils.sign(request, signSecret);
|
||||||
|
request.put("Sig", sig);
|
||||||
|
|
||||||
|
String tokenRequest = JSONUtil.toJsonStr(request);
|
||||||
|
log.info("请求参数:{}", tokenRequest);
|
||||||
|
String response = HttpUtil.post(requestUrl, tokenRequest);
|
||||||
|
LianLianResultVO result = JSON.parseObject(response, LianLianResultVO.class);
|
||||||
|
log.info("返回参数:{}", response);
|
||||||
|
|
||||||
|
if (result.getRet() == 0) {
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64((String) result.getData()),
|
||||||
|
dataSecret.getBytes(), dataSecretIv.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
Map<String, Object> resultMap = (Map<String, Object>) JSON.parse(dataStr);
|
||||||
|
token = String.valueOf(resultMap.get("AccessToken"));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query_token 获取token,提供给第三方平台使用
|
* query_token 获取token,提供给第三方平台使用
|
||||||
@@ -346,6 +396,12 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
|
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
|
||||||
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
|
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
|
||||||
|
|
||||||
|
String operatorId1 = "MA01H3BQ2";
|
||||||
|
String operatorSecret1 = thirdPartySecretInfoVO.getOurOperatorSecret();
|
||||||
|
String dataSecret1 = thirdPartySecretInfoVO.getOurDataSecret();
|
||||||
|
String dataSecretIv1 = thirdPartySecretInfoVO.getOurDataSecretIv();
|
||||||
|
String signSecret1 = thirdPartySecretInfoVO.getOurSigSecret();
|
||||||
|
|
||||||
|
|
||||||
// 组装中电联平台所需要的数据格式
|
// 组装中电联平台所需要的数据格式
|
||||||
SupStationInfoDTO info = SupStationInfoDTO.builder()
|
SupStationInfoDTO info = SupStationInfoDTO.builder()
|
||||||
@@ -452,7 +508,11 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
System.out.println("jsonString : " + jsonString);
|
System.out.println("jsonString : " + jsonString);
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
|
//使用对方的密钥配置信息和我方的operatorId
|
||||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||||
|
|
||||||
|
log.info("token : " + token);
|
||||||
|
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user