Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aae4ef8b48 | ||
|
|
790920f13e | ||
|
|
52650b7ae0 | ||
|
|
c56357adc0 | ||
|
|
085297700a | ||
|
|
7d2f7b2d80 | ||
|
|
a344d0a9df | ||
|
|
374396284d | ||
|
|
01335276c7 | ||
|
|
329aafb487 | ||
|
|
a1b23f7104 | ||
|
|
1c35150b8a | ||
|
|
5ddcf3b62e | ||
|
|
4a5bc0dd25 | ||
|
|
f8a583063f | ||
|
|
87b056b47f | ||
|
|
b5174dce3d | ||
|
|
69eea7ab5f | ||
|
|
3e7655cd96 | ||
|
|
c095746fba | ||
|
|
4fd5d1dbaa | ||
|
|
0b76bc417d | ||
|
|
6af4f70998 | ||
|
|
082896aabc | ||
|
|
73fdf1b517 | ||
|
|
263b6b9849 | ||
|
|
31e93abce9 | ||
|
|
9701fdf0b3 | ||
|
|
234842cd9d | ||
|
|
89c2147c65 | ||
|
|
aa31ef186d | ||
|
|
7e96155e8d | ||
|
|
9770e1f72a | ||
|
|
4446877297 | ||
|
|
c9df5137cb | ||
|
|
c14ab93262 | ||
|
|
59fd9ee9f5 | ||
|
|
a87f114e5b | ||
|
|
6491ed9c7f | ||
|
|
17ec8176fc | ||
|
|
6eac88b2c3 | ||
|
|
690f9a0e4f |
@@ -2,6 +2,7 @@ package cn.pluss.platform.configurer;
|
||||
|
||||
import cn.pluss.platform.configurer.extend.CurrentUserMethodArgumentResolver;
|
||||
import cn.pluss.platform.configurer.extend.FastJsonHttpMessageConverterEx;
|
||||
import cn.pluss.platform.interceptor.EmojiInterceptor;
|
||||
import cn.pluss.platform.interceptor.RequestInfoInterceptor;
|
||||
import cn.pluss.platform.interceptor.TokenRegistryInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -69,9 +70,11 @@ public class WebConfigurer implements WebMvcConfigurer {
|
||||
excludes.add("/Pictures/**");
|
||||
excludes.add("/druid/**");
|
||||
excludes.add("/callback/**");
|
||||
excludes.add("/membercallback/**");
|
||||
registry.addInterceptor(new RequestInfoInterceptor());
|
||||
|
||||
registry.addInterceptor(tokenRegistryInterceptor()).excludePathPatterns(excludes);
|
||||
//registry.addInterceptor(emojiInterceptor()).excludePathPatterns(excludes);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -88,4 +91,8 @@ public class WebConfigurer implements WebMvcConfigurer {
|
||||
public FastJsonHttpMessageConverterEx fastJsonHttpMessageConverterEx() {
|
||||
return new FastJsonHttpMessageConverterEx();
|
||||
}
|
||||
@Bean
|
||||
public EmojiInterceptor emojiInterceptor() {
|
||||
return new EmojiInterceptor();
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,10 @@ import cn.pluss.platform.activityRecommend.ActivityRecommendService;
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import cn.pluss.platform.constants.ProjectConstant;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.util.EmojiUtil;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
@@ -20,10 +22,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.pluss.platform.controller.ActivityRechargeController.synchronous;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
@@ -47,6 +48,8 @@ public class ActivityActivateController {
|
||||
|
||||
@Resource
|
||||
private MerchantStoreService merchantStoreService;
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "获取全部", notes = "返回分页过后的数据", httpMethod = "GET")
|
||||
@@ -80,7 +83,9 @@ public class ActivityActivateController {
|
||||
@PostMapping
|
||||
@ApiOperation(value = "添加数据", notes = "添加新的数据", httpMethod = "POST")
|
||||
public Result<Object> add(@RequestBody ActivityActivate activityActivate) {
|
||||
|
||||
if (activityActivate == null || activityActivate.getUserId() == null) {
|
||||
return ResultGenerator.genFailResult("参数错误!");
|
||||
}
|
||||
ActivityActivate activity = new ActivityActivate();
|
||||
activity.setMerchantCode(activityActivate.getMerchantCode());
|
||||
activity.setStoreId(activityActivate.getStoreId());
|
||||
@@ -98,6 +103,14 @@ public class ActivityActivateController {
|
||||
}
|
||||
activityActivate.setCreateDt(new Date());
|
||||
activityActivateService.saveActivityActivate(activityActivate);
|
||||
//同步到小程序
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
MerchantBaseInfo queryMerchantBaseInfo = new MerchantBaseInfo();
|
||||
queryMerchantBaseInfo.setUserId((String.valueOf(activityActivate.getUserId())));
|
||||
merchantBaseInfo = merchantBaseInfoService.queryMerchantBaseInfo(queryMerchantBaseInfo);
|
||||
List<ActivityActivate> activityActivateList = new ArrayList<>();
|
||||
activityActivateList.add(activityActivate);
|
||||
synchronous(merchantBaseInfo, activityActivateList, Constant.MEMBER_ACTIVATION_ACTIVITY);
|
||||
return ResultGenerator.genSuccessResult("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ import cn.pluss.platform.activityConsumReturn.ActivityConsumReturnService;
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import cn.pluss.platform.constants.ProjectConstant;
|
||||
import cn.pluss.platform.entity.ActivityConsumReturn;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -13,7 +16,10 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
@@ -21,6 +27,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.pluss.platform.controller.ActivityRechargeController.synchronous;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/activityConsumReturn")
|
||||
@@ -30,6 +38,8 @@ public class ActivityConsumReturnController {
|
||||
|
||||
@Resource
|
||||
private ActivityConsumReturnService activityConsumReturnService;
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "获取全部", notes = "返回分页过后的数据", httpMethod = "GET")
|
||||
@@ -59,7 +69,7 @@ public class ActivityConsumReturnController {
|
||||
@PostMapping
|
||||
@ApiOperation(value = "添加数据", notes = "添加新的数据", httpMethod = "POST")
|
||||
public Result<Object> add(@RequestBody List<ActivityConsumReturn> activityConsumReturn) {
|
||||
if (activityConsumReturn == null) {
|
||||
if (activityConsumReturn == null || activityConsumReturn.get(0).getUserId() == null) {
|
||||
return ResultGenerator.genFailResult("参数错误!");
|
||||
}
|
||||
if (activityConsumReturn.size() > 0) {
|
||||
@@ -76,6 +86,12 @@ public class ActivityConsumReturnController {
|
||||
activityConsumReturn2.setCreateDt(new Date());
|
||||
activityConsumReturnService.saveActivityConsumReturn(activityConsumReturn2);
|
||||
}
|
||||
//同步活动到小程序
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
MerchantBaseInfo queryMerchantBaseInfo = new MerchantBaseInfo();
|
||||
queryMerchantBaseInfo.setUserId((String.valueOf(activityConsumReturn.get(0).getUserId())));
|
||||
merchantBaseInfo = merchantBaseInfoService.queryMerchantBaseInfo(queryMerchantBaseInfo);
|
||||
synchronous(merchantBaseInfo, activityConsumReturn, Constant.MEMBER_CONSUME_ACTIVITY);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.pluss.platform.activityRecharge.ActivityRechargeService;
|
||||
import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.Constant;
|
||||
import cn.pluss.platform.constants.ProjectConstant;
|
||||
import cn.pluss.platform.entity.ActivityRecharge;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
@@ -18,12 +19,13 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author DJH
|
||||
@@ -96,6 +98,8 @@ public class ActivityRechargeController {
|
||||
activityRecharge2.setStoreName(merchantStore.getStoreName());
|
||||
activityRechargeService.saveActivityRecharge(activityRecharge2);
|
||||
}
|
||||
//同步活动到小程序
|
||||
synchronous(merchantBaseInfo, activityRechargeList, Constant.MEMBER_RECHARGE_ACTIVITY);
|
||||
}
|
||||
return ResultGenerator.genSuccessResult(activityRechargeList);
|
||||
}
|
||||
@@ -131,4 +135,21 @@ public class ActivityRechargeController {
|
||||
return ResultGenerator.genSuccessResult(activityRecharge);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步活动到小程序
|
||||
* @param merchantBaseInfo
|
||||
* @param list
|
||||
*/
|
||||
public static void synchronous(MerchantBaseInfo merchantBaseInfo, List<?> list, String URL){
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String url = URL;
|
||||
MultiValueMap<String, Object> postMap = new LinkedMultiValueMap();
|
||||
Long id = merchantBaseInfo.getId();
|
||||
postMap.add("list", list);
|
||||
postMap.add("syb_m_id", id);
|
||||
System.out.println("postMap"+postMap);
|
||||
String result = restTemplate.postForObject(url, postMap, String.class);
|
||||
log.info("返回",result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -253,6 +253,40 @@ public class MerchantBaseInfoController {
|
||||
return ResultGenerator.genFailResult("系统繁忙,请稍后再试");
|
||||
}
|
||||
}
|
||||
@GetMapping("/queryMerchantActivityApplet")
|
||||
@ApiOperation(value = "查询商家活动", notes = "查询商家活动", httpMethod = "POST")
|
||||
public Result<?> merchantActivityApplet(@RequestParam Integer id) {
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
try {
|
||||
if(id == null){
|
||||
return ResultGenerator.genFailResult("id为空");
|
||||
}
|
||||
MerchantBaseInfo merchantBaseInfo;
|
||||
MerchantBaseInfo queryMerchantBaseInfo = new MerchantBaseInfo();
|
||||
queryMerchantBaseInfo.setId(id.longValue());
|
||||
merchantBaseInfo = merchantBaseInfoService.queryMerchantBaseInfo(queryMerchantBaseInfo);
|
||||
|
||||
ActivityActivate activityActivate = new ActivityActivate();
|
||||
activityActivate.setMerchantCode(merchantBaseInfo.getMerchantCode());
|
||||
List<ActivityActivate> queryActivityActivateList = activityActivateService
|
||||
.queryActivityActivateList(activityActivate);
|
||||
result.put("activityActivateList", queryActivityActivateList);
|
||||
ActivityRecharge activityRecharge = new ActivityRecharge();
|
||||
activityRecharge.setMerchantCode(merchantBaseInfo.getMerchantCode());
|
||||
List<ActivityRecharge> queryActivityRechargeList = activityRechargeService
|
||||
.queryActivityRechargeList(activityRecharge);
|
||||
result.put("activityRechargeList", queryActivityRechargeList);
|
||||
ActivityConsumReturn activityConsumReturn = new ActivityConsumReturn();
|
||||
activityConsumReturn.setMerchantCode(merchantBaseInfo.getMerchantCode());
|
||||
List<ActivityConsumReturn> queryActivityConsumReturnList = activityConsumReturnService
|
||||
.queryActivityConsumReturnList(activityConsumReturn);
|
||||
result.put("activityConsumReturnList", queryActivityConsumReturnList);
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult("系统繁忙,请稍后再试");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/manageMerchantManageList")
|
||||
@ApiOperation(value = "多商户管理列表", notes = "多商户管理列表", httpMethod = "POST")
|
||||
|
||||
@@ -5,10 +5,7 @@ import cn.pluss.platform.api.PageInfo;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.ProjectConstant;
|
||||
import cn.pluss.platform.entity.ActivityActivate;
|
||||
import cn.pluss.platform.entity.MerchantMenber;
|
||||
import cn.pluss.platform.entity.MerchantMenberRecharge;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.memberOrder.MemberOrderService;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantMenber.MerchantMenberService;
|
||||
@@ -111,7 +108,69 @@ public class MerchantMenberController {
|
||||
merchantMenber.getPage().longValue(), merchantMenber.getSize().longValue(), merchantMenberList);
|
||||
return ResultGenerator.genSuccessResult(pager);
|
||||
}
|
||||
@PostMapping("/info")
|
||||
@ApiOperation(tags = {"页面-会员选择", "小程序"}, value = "获取全部", notes = "返回分页过后的数据", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "MerchantMenber", value = "查询对象的实例信息", paramType = "body", dataType = "MerchantMenber"),})
|
||||
public Result<PageInfo<MerchantMenber>> listInfo(@RequestBody MerchantMenber merchantMenber) {
|
||||
if (merchantMenber.getId() == null) {
|
||||
return ResultGenerator.genFailResult("无商家编码!");
|
||||
}
|
||||
if (merchantMenber.getSize() == null || merchantMenber.getSize() == 0) {
|
||||
merchantMenber.setSize(ProjectConstant.PAGE_SIZE);
|
||||
}
|
||||
if (merchantMenber.getPage() == null || merchantMenber.getPage() == 0) {
|
||||
merchantMenber.setPage(1);
|
||||
}
|
||||
//通过商户id换取商户code
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
MerchantBaseInfo queryMerchantBaseInfo = new MerchantBaseInfo();
|
||||
queryMerchantBaseInfo.setId(Long.valueOf(merchantMenber.getId()));
|
||||
merchantBaseInfo = merchantBaseInfoService.queryMerchantBaseInfo(queryMerchantBaseInfo);
|
||||
String merchantCode = merchantBaseInfo.getMerchantCode();
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("pageSize", merchantMenber.getSize());
|
||||
map.put("offset", (merchantMenber.getPage() - 1) * merchantMenber.getSize());
|
||||
map.put("merchantCode",merchantCode);
|
||||
map.put("memberCode", merchantMenber.getMemberCode());
|
||||
if (StringUtil.isNotEmpty(merchantMenber.getStoreId())) {
|
||||
map.put("storeId", merchantMenber.getStoreId());
|
||||
}
|
||||
if (!StringUtil.isEmpty(merchantMenber.getPhone()) || !StringUtil.isEmpty(merchantMenber.getMemberName())) {
|
||||
map.put("keyWord", "1");
|
||||
}
|
||||
//判断是否有检索条件
|
||||
if (StringUtil.isNotEmpty(merchantMenber.getPhone())) {
|
||||
map.put("phone", merchantMenber.getPhone());
|
||||
}
|
||||
if (StringUtil.isNotEmpty(merchantMenber.getNickName())) {
|
||||
map.put("nickName", merchantMenber.getNickName());
|
||||
}
|
||||
List<MerchantMenber> merchantMenberList = merchantMenberService.queryMerchantMenberPage(map);
|
||||
for (MerchantMenber m : merchantMenberList) {
|
||||
Map<String, Object> orderMap = new HashMap<>();
|
||||
orderMap.put("memberCode", m.getMemberCode());
|
||||
orderMap.put("orderType", "0");
|
||||
orderMap.put("orderStatus", "1");
|
||||
Integer count = memberOrderService.queryMemberOrderPageCount(orderMap);
|
||||
m.setOrderNumber(count + "");
|
||||
|
||||
if (StringUtils.isNotBlank(m.getAppOpenId())) {
|
||||
m.setOpenid(m.getAppOpenId());
|
||||
}
|
||||
}
|
||||
Integer count = merchantMenberService.queryMerchantMenberPageCount(map);
|
||||
|
||||
for (MerchantMenber menber : merchantMenberList) {
|
||||
menber.setNickName(EmojiUtil.emojiRecovery2(menber.getNickName()));
|
||||
}
|
||||
|
||||
// 返回参数
|
||||
PageInfo<MerchantMenber> pager = new PageInfo<>(count.longValue(), (long)StringUtil.getPageCount(count, merchantMenber.getSize()),
|
||||
merchantMenber.getPage().longValue(), merchantMenber.getSize().longValue(), merchantMenberList);
|
||||
return ResultGenerator.genSuccessResult(pager);
|
||||
}
|
||||
@GetMapping("/queryMemberIsExist")
|
||||
@ApiOperation(tags = {"会员开卡"}, value = "获取关注公众号二维码", notes = "获取关注公众号二维码", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -388,7 +389,7 @@ public class MerchantOrderController {
|
||||
@ApiOperation(value = "会员充值", notes = "APP扫码-会员充值", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "MemberRechargeDTO", value = "MemberRechargeDTO", paramType = "MemberRechargeDTO", dataType = "MemberRechargeDTO", required = true)})
|
||||
public Result<Map<String, Object>> memberRecharge(@RequestBody MemberRechargeDTO memberRechargeDTO) {
|
||||
public Result<Map<String, Object>> memberRecharge(@RequestBody MemberRechargeDTO memberRechargeDTO, HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
UserApp userApp = userAppService.queryUserAppByToken();
|
||||
@@ -398,7 +399,7 @@ public class MerchantOrderController {
|
||||
memberRechargeDTO.setMerchantCode(userApp.getMerchantCode());
|
||||
memberRechargeDTO.setUserId(String.valueOf(userApp.getUserId()));
|
||||
memberRechargeDTO.setUserName(userApp.getUserName());
|
||||
return merchantOrderService.toMemberRecharge(memberRechargeDTO);
|
||||
return merchantOrderService.toMemberRecharge(memberRechargeDTO, request);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
MsgException.throwException(e.getMessage());
|
||||
@@ -417,7 +418,7 @@ public class MerchantOrderController {
|
||||
@ApiOperation(tags = {"页面-收款"}, value = "扫码支付", notes = "扫码支付", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "MerchantOrderVo", value = "扫码支付需要传递的参数实例", paramType = "body", dataType = "MerchantOrderVo", required = true)})
|
||||
public Result<Object> scanPay(@RequestBody MerChantOrderDTO merchantOrderDTO) {
|
||||
public Result<Object> scanPay(@RequestBody MerChantOrderDTO merchantOrderDTO, HttpServletRequest req) {
|
||||
UserApp tokenUa = userAppService.queryUserAppByToken();
|
||||
merchantOrderDTO.setMerchantCode(tokenUa.getMerchantCode());
|
||||
//校验金额
|
||||
@@ -425,7 +426,7 @@ public class MerchantOrderController {
|
||||
MsgException.throwException("金额异常");
|
||||
}
|
||||
try {
|
||||
return merchantOrderService.toActivePay(merchantOrderDTO);
|
||||
return merchantOrderService.toActivePay(merchantOrderDTO, req);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
@@ -437,7 +438,7 @@ public class MerchantOrderController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/posScanPay")
|
||||
public Result<Object> posScanPay(@RequestBody MerChantOrderDTO merchantOrderDTO) {
|
||||
public Result<Object> posScanPay(@RequestBody MerChantOrderDTO merchantOrderDTO, HttpServletRequest request) {
|
||||
//首先验签
|
||||
verify(merchantOrderDTO.getTimestamp(), merchantOrderDTO.getRequestId(), merchantOrderDTO.getAppId(), merchantOrderDTO.getToken());
|
||||
//通过后查询商户信息
|
||||
@@ -451,7 +452,7 @@ public class MerchantOrderController {
|
||||
}
|
||||
//进行支付操作
|
||||
try {
|
||||
Result<Object> activePay = merchantOrderService.toActivePay(merchantOrderDTO);
|
||||
Result<Object> activePay = merchantOrderService.toActivePay(merchantOrderDTO, request);
|
||||
String result = activePay.toString();
|
||||
JSONObject jsonData = JSONObject.parseObject(result);
|
||||
Object orderNumber = jsonData.getJSONObject("data").get("orderNumber");
|
||||
@@ -1296,8 +1297,8 @@ public class MerchantOrderController {
|
||||
merchantIncomeService.saveMerchantIncome(merchantIncome);
|
||||
}
|
||||
|
||||
@GetMapping("/couponList/{orderNumber}")
|
||||
public Result<List<Map<String, Object>>> getCouponListByOrderNumber(@PathVariable("orderNumber") String orderNumber) {
|
||||
@GetMapping("/couponList")
|
||||
public Result<List<Map<String, Object>>> getCouponListByOrderNumber(String orderNumber) {
|
||||
List<Map<String, Object>> couponList = merchantOrderService.getCouponList(orderNumber);
|
||||
return ResultGenerator.genSuccessResult(couponList);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entitiy.PushCidAlias;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.MobV2PushUtil;
|
||||
import cn.pluss.platform.util.MobV2PushUtilAndroid;
|
||||
import cn.pluss.platform.util.MobV2PushUtilIOS;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.Setter;
|
||||
@@ -20,9 +21,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.*;
|
||||
|
||||
@@ -68,15 +69,31 @@ public class PushController {
|
||||
* @throws NoSuchAlgorithmException
|
||||
*/
|
||||
@PostMapping("/bindalias")
|
||||
public Result<Object> bindAlias(@RequestBody Map<String, Object> param) throws IOException, NoSuchAlgorithmException {
|
||||
public Result<Object> bindAlias(@RequestBody Map<String, Object> param, HttpServletRequest httpServletRequest) throws IOException, NoSuchAlgorithmException {
|
||||
|
||||
UserApp userApp = userAppService.queryUserAppByToken();
|
||||
|
||||
String uid = userApp.getUserId().toString();
|
||||
String cid = param.get("cid").toString();
|
||||
if (cid.isEmpty()){
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
MobV2PushUtil mobV2PushUtil = new MobV2PushUtil();
|
||||
String token = mobV2PushUtil.getToken();
|
||||
String deviceType = httpServletRequest.getHeader("type");
|
||||
|
||||
String token = "";
|
||||
String aliasUrl = "";
|
||||
|
||||
if (deviceType.equals("1")) {
|
||||
MobV2PushUtilAndroid mobV2PushUtil = new MobV2PushUtilAndroid();
|
||||
token = mobV2PushUtil.getToken();
|
||||
aliasUrl = "https://restapi.getui.com/v2/" + MobV2PushUtilAndroid.appId + "/user/alias";
|
||||
|
||||
} else if (deviceType.equals("2")) {
|
||||
MobV2PushUtilIOS mobV2PushUtilIOS = new MobV2PushUtilIOS();
|
||||
token = mobV2PushUtilIOS.getToken();
|
||||
aliasUrl = "https://restapi.getui.com/v2/" + MobV2PushUtilIOS.appId + "/user/alias";
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
@@ -99,8 +116,7 @@ public class PushController {
|
||||
// 设置为UTF8编码
|
||||
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
||||
|
||||
String tokenInfo = restTemplate.postForObject(
|
||||
"https://restapi.getui.com/v2/" + MobV2PushUtil.appId + "/user/alias", httpEntity,
|
||||
String tokenInfo = restTemplate.postForObject(aliasUrl, httpEntity,
|
||||
String.class);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
@@ -122,15 +138,31 @@ public class PushController {
|
||||
* @throws NoSuchAlgorithmException
|
||||
*/
|
||||
@PostMapping("/unbindingAlias")
|
||||
public Result<Object> unbindingAlias(@RequestBody Map<String, Object> param) throws IOException, NoSuchAlgorithmException {
|
||||
public Result<Object> unbindingAlias(@RequestBody Map<String, Object> param,HttpServletRequest httpServletRequest) throws IOException, NoSuchAlgorithmException {
|
||||
|
||||
UserApp userApp = userAppService.queryUserAppByToken();
|
||||
|
||||
String uid = userApp.getUserId().toString();
|
||||
String cid = param.get("cid").toString();
|
||||
|
||||
MobV2PushUtil mobV2PushUtil = new MobV2PushUtil();
|
||||
String token = mobV2PushUtil.getToken();
|
||||
if (cid.isEmpty()){
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
String deviceType = httpServletRequest.getHeader("type");
|
||||
|
||||
String token = "";
|
||||
String aliasUrl = "";
|
||||
|
||||
if (deviceType.equals("1")) {
|
||||
MobV2PushUtilAndroid mobV2PushUtil = new MobV2PushUtilAndroid();
|
||||
token = mobV2PushUtil.getToken();
|
||||
aliasUrl = "https://restapi.getui.com/v2/" + MobV2PushUtilAndroid.appId + "/user/alias";
|
||||
|
||||
} else if (deviceType.equals("2")) {
|
||||
MobV2PushUtilIOS mobV2PushUtilIOS = new MobV2PushUtilIOS();
|
||||
token = mobV2PushUtilIOS.getToken();
|
||||
aliasUrl = "https://restapi.getui.com/v2/" + MobV2PushUtilIOS.appId + "/user/alias";
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
@@ -155,7 +187,7 @@ public class PushController {
|
||||
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
||||
|
||||
// delete, entity直接设为null即可
|
||||
ResponseEntity<Map> resultEntity = restTemplate.exchange("https://restapi.getui.com/v2/" + MobV2PushUtil.appId + "/user/alias",
|
||||
ResponseEntity<Map> resultEntity = restTemplate.exchange(aliasUrl,
|
||||
HttpMethod.DELETE,
|
||||
httpEntity,
|
||||
Map.class);
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -259,8 +260,14 @@ public class UserAppController {
|
||||
}
|
||||
)
|
||||
public Result<Object> realNameAudit(
|
||||
@RequestBody @Valid CertificationDTO certificationDTO
|
||||
) {
|
||||
@RequestBody @Valid CertificationDTO certificationDTO) {
|
||||
if (Pattern.matches("^[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]$",
|
||||
certificationDTO.getCertnum())){
|
||||
System.out.println("身份证无误");
|
||||
} else {
|
||||
System.out.println("身份证有误");
|
||||
return ResultGenerator.genFailResult("身份证号码错误");
|
||||
}
|
||||
try {
|
||||
accountService.realNameAudit(certificationDTO);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
|
||||
@@ -229,6 +229,17 @@ public class UserInfoController {
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版登录
|
||||
* @param userInfo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public Result<Map<String, Object>> detail(@RequestBody UserInfo userInfo) {
|
||||
Map<String, Object> login = userInfoNewService.login(userInfo.getLoginName(), userInfo.getPassword());
|
||||
return ResultGenerator.genSuccessResult(login);
|
||||
}
|
||||
|
||||
@GetMapping("/{loginName}/{password}")
|
||||
@ApiOperation(tags = {"页面-登录", "页面-切换商户"}, value = "登录", notes = "登录接口", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@@ -265,6 +276,19 @@ public class UserInfoController {
|
||||
return ResultGenerator.genSuccessResult("保存安全密码成功", null);
|
||||
}
|
||||
|
||||
@PostMapping("/checkPayPassword")
|
||||
public Result<Object> checkPayPassword(@RequestBody UserInfo userInfo){
|
||||
if (userInfo.getId() == null){
|
||||
return ResultGenerator.genFailResult("无ID");
|
||||
}
|
||||
UserInfo payPassword = userInfoNewService.queryUserInfo(userInfo);
|
||||
if (payPassword.getPayPassword() == null){
|
||||
return ResultGenerator.genSuccessResult("无支付密码","0");
|
||||
}else {
|
||||
return ResultGenerator.genSuccessResult("ok","1");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/verifyPayPassword")
|
||||
public Result<Object> verifyPayPassword(@RequestBody Map<String, Object> param) {
|
||||
String payPassword = param.get("payPassword").toString();
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
package cn.pluss.platform.controller.access;
|
||||
|
||||
import cn.pluss.platform.access.AccessService;
|
||||
import cn.pluss.platform.access.domain.CodeEnum;
|
||||
import cn.pluss.platform.access.domain.ReqEntity;
|
||||
import cn.pluss.platform.access.domain.RespEntity;
|
||||
import cn.pluss.platform.access.exception.AccessException;
|
||||
import cn.pluss.platform.access.service.AccessBizService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RequestMapping("/access")
|
||||
@RestController
|
||||
public class AccessController {
|
||||
|
||||
@Autowired
|
||||
private AccessService accessService;
|
||||
|
||||
@Autowired
|
||||
private AccessBizService accessBizService;
|
||||
|
||||
@PostMapping("/storeInfoByDeviceNo")
|
||||
public RespEntity machineStoreInfo(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Object bizResult = accessBizService.machineStoreInfo(deviceNo);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/scanPay")
|
||||
public RespEntity scanPay(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.scanPay(reqData);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/orderStatus")
|
||||
public RespEntity orderStatus(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
String orderNumber = reqData.getString("orderNumber");
|
||||
String mercOrderNo = reqData.getString("mercOrderNo");
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.orderStatus(orderNumber, mercOrderNo);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/orderRefund")
|
||||
public RespEntity orderRefund(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.refund(reqData);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/orderRefundList")
|
||||
public RespEntity orderRefundList(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.refundList(reqData);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/orderList")
|
||||
public RespEntity orderList(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.orderList(reqData);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/dataAnalysis")
|
||||
public RespEntity dataAnalysis(@RequestBody ReqEntity reqEntity) {
|
||||
String requestId = reqEntity.getRequestId();
|
||||
JSONObject reqData = reqEntity.initJSONData();
|
||||
RespEntity result;
|
||||
|
||||
String deviceNo = reqData.getString("deviceNo");
|
||||
if (deviceNo == null) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.PARAM_ERROR, null, requestId);
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
Object bizResult = accessBizService.dataAnalysis(reqData);
|
||||
result = new RespEntity(reqEntity.getOrgId(), CodeEnum.SUCCESS, bizResult, requestId);
|
||||
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
} catch (AccessException e) {
|
||||
result = new RespEntity(reqEntity.getOrgId(), e.getCode(), null, requestId, e.getMessage());
|
||||
accessService.addSign(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,11 +64,11 @@ public class UserAddressController {
|
||||
|
||||
@RequestMapping(value = "/delete")
|
||||
@ApiOperation(tags = {"页面-设备管理-地址管理"}, value = "删除收货地址", notes = "删除收货地址", httpMethod = "GET")
|
||||
public Result<Object> delete(@RequestParam("ids[]") Long[] ids) {
|
||||
if(ids == null || ids.length == 0){
|
||||
public Result<Object> delete(Integer id) {
|
||||
if(id == null || id== 0){
|
||||
return ResultGenerator.genSuccessResult("缺失ids参数",null);
|
||||
}
|
||||
userAddressService.removeByIds(Arrays.asList(ids));
|
||||
userAddressService.removeByIds(Arrays.asList(id));
|
||||
return ResultGenerator.genSuccessResult("删除成功",null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.channel.ys.impl.YSAuditServiceV3;
|
||||
import cn.pluss.platform.entity.SubMerchantApplyOrder;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.SubMerchantApplyOrderMapper;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.wx.WxCommonService;
|
||||
import cn.pluss.platform.ys.impl.v20220527.ReqMethod;
|
||||
import cn.pluss.platform.ys.impl.v20220527.YsServiceV3;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.pluss.platform.util.WechatSignUtil.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@@ -17,6 +32,15 @@ import java.io.IOException;
|
||||
public class WxController {
|
||||
|
||||
private final SubMerchantApplyOrderMapper subMerchantApplyOrderMapper;
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
@Resource
|
||||
private YsServiceV3 ysServiceV3;
|
||||
@Resource
|
||||
private YSAuditServiceV3 ysAuditServiceV3;
|
||||
@Resource
|
||||
private WxCommonService wxCommonService;
|
||||
|
||||
|
||||
/**
|
||||
* 跳转到微信商户认证图片
|
||||
@@ -68,4 +92,134 @@ public class WxController {
|
||||
response.setHeader("content-type", "text/html;charset=UTF-8");
|
||||
response.getWriter().write("<img src='" + subMerchantApplyOrder.getInfoQrcode() + "' />");
|
||||
}
|
||||
// @PostMapping("/authorisation")
|
||||
// public void authorisation(){
|
||||
//// MerchantBaseInfo merchantBaseInfoByUserId = merchantBaseInfoService.getMerchantBaseInfoByUserId(userId);
|
||||
// JSONObject bizContentMap = new JSONObject();
|
||||
//// Map<String,Object> bizContentMap = new HashMap<>();
|
||||
// //交易报备渠道编号 CUPS_WECHAT-银联微信;CUPS_ALIPAY-银联支付宝;NUCC_WECHAT-网联微信;NUCC_ALIPAY-网联支付宝
|
||||
// bizContentMap.put("channelCode","CUPS_WECHAT");
|
||||
// //商户号
|
||||
// bizContentMap.put("mercId","QRY230510383416");
|
||||
// //商户信息-营业执照营业执照复印件(盖公章)
|
||||
// bizContentMap.put("linencePhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/7228fde116c14c6380fce592c97e8998.png?Expires=1998984528&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=klQgxxm4MgTR1JuJTLW5NZJ9C%2BE%3D");
|
||||
// //商户信息-法人身份证复印件(盖私章,签字)/原件扫描件
|
||||
// bizContentMap.put("indentityPhoto","");
|
||||
// //商户信息-服务协议复印件(盖公章)/原件扫描件
|
||||
// bizContentMap.put("protocolPhoto","");
|
||||
// //商户信息-组织机构代码证(盖公章)/原件扫描件
|
||||
// bizContentMap.put("cocc","");
|
||||
// //商户信息-法人身份证正面照
|
||||
// bizContentMap.put("sfzFrontPhoto","");
|
||||
// //商户信息-法人身份证反面照
|
||||
// bizContentMap.put("sfzBackPhoto","");
|
||||
// //商户信息法人身份证号码
|
||||
// bizContentMap.put("idcarNo","");
|
||||
// //商户信息-银盛商户类型
|
||||
// bizContentMap.put("mccSubCd","5814");
|
||||
// //业务类型0-微信 1-支付宝
|
||||
// bizContentMap.put("busiType","0");
|
||||
// //商户信息-商户简称
|
||||
// bizContentMap.put("mercShortName","会飞的土豆");
|
||||
// //商户信息-商户归属省
|
||||
// bizContentMap.put("mercProv","7900");
|
||||
// //商户信息-商户归属市
|
||||
// bizContentMap.put("mercCity","7910");
|
||||
// //商户信息-商户归属区
|
||||
// bizContentMap.put("mercArea","8081");
|
||||
// //商户信息-营业地址(联系地址)
|
||||
// bizContentMap.put("busAddr","荣民国际");
|
||||
// //商户信息-联系人姓名
|
||||
// bizContentMap.put("contactsName","李雯");
|
||||
// //商户信息-联系人手机号
|
||||
// bizContentMap.put("contactsTel","18710449883");
|
||||
// //商户信息-联系人邮箱
|
||||
// bizContentMap.put("contactsEmail","1657953836@qq.com");
|
||||
// //商户信息-法人姓名
|
||||
// bizContentMap.put("crpNm","李雯");
|
||||
// //商户信息-法人证件号
|
||||
// bizContentMap.put("certNo","610323199812250941");
|
||||
// //商户信息-代理商名称
|
||||
// bizContentMap.put("agentName","陕西超掌柜科技有限公司");
|
||||
// //商户信息-代理商编号
|
||||
// bizContentMap.put("agtMercId","801521000002WJW");
|
||||
// //商户信息-开户行行别
|
||||
// bizContentMap.put("bankType","1051000");
|
||||
// //商户信息-开户行名称
|
||||
// bizContentMap.put("bankName","中国建设银行陕西省分行");
|
||||
// //商户信息-账户类型
|
||||
// bizContentMap.put("accountType","11");
|
||||
// //商户信息-账户名称
|
||||
// bizContentMap.put("accountName","李雯");
|
||||
// //商户信息-账户账号
|
||||
// bizContentMap.put("accountNo","QRY230510383416");
|
||||
// //商户信息-客户号
|
||||
// bizContentMap.put("custId","2023051028630896");
|
||||
// //商户信息-报备行业类型
|
||||
// bizContentMap.put("mchType","139");
|
||||
// bizContentMap.put("mercName","");
|
||||
// bizContentMap.put("reportName","");
|
||||
// //商户信息-商户类别 0或null:普通企业商户,1:小微商户,2:个体商户,3:事业单位,4:社会组织(原其他组织), 5:政府机关
|
||||
// bizContentMap.put("mercType","1");
|
||||
// bizContentMap.put("certType","");
|
||||
// bizContentMap.put("pId","");
|
||||
// bizContentMap.put("shopPhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/f2804e6991474b4691bda17d8a644f41.png?Expires=1998984700&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=aW28so6wOxOfdJpU7sgA4gr1%2FeE%3D");
|
||||
// bizContentMap.put("storeEnvirPhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/a71a293015d44006b7db02a911f54775.png?Expires=1998984731&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=lkhJ%2F0Rg2%2BA9fd1fQId382g0CO8%3D");
|
||||
// bizContentMap.put("idImgHand", "https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/7228fde116c14c6380fce592c97e8998.png?Expires=1998984528&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=klQgxxm4MgTR1JuJTLW5NZJ9C%2BE%3D");
|
||||
// bizContentMap.put("bankCardImg","");
|
||||
// bizContentMap.put("bdShopPhoto","");
|
||||
// bizContentMap.put("bdPosterPhoto","");
|
||||
// bizContentMap.put("wxPlatform","");
|
||||
// bizContentMap.put("idValidDateBegin","");
|
||||
// bizContentMap.put("idValidDateEnd","");
|
||||
// bizContentMap.put("busLincenceBegin","");
|
||||
// bizContentMap.put("busLincenceEnd","");
|
||||
// bizContentMap.put("managementType","");
|
||||
// bizContentMap.put("storeName","");
|
||||
// bizContentMap.put("wechatCheckStandPhoto","");
|
||||
// bizContentMap.put("alipayCheckStandPhoto","");
|
||||
// bizContentMap.put("aliPayStoreCashierPhoto","");
|
||||
// bizContentMap.put("bookType","");
|
||||
// bizContentMap.put("unitPhoto","");
|
||||
// bizContentMap.put("hotLine","");
|
||||
// //商户信息-证照类型 0:营业执照;1:事业单位法人证书;2:小微商户负责人身份证;3:社会信用等级证书
|
||||
// bizContentMap.put("businessLicenseType","2");
|
||||
// //商户信息-证件编号
|
||||
// bizContentMap.put("businessLicense","610323199812250941");
|
||||
// bizContentMap.put("appletAppId","wxc2bb94c0ddda1032");
|
||||
// bizContentMap.put("appId1","");
|
||||
// bizContentMap.put("appId2","");
|
||||
// bizContentMap.put("appId3","");
|
||||
// bizContentMap.put("appId4","");
|
||||
// bizContentMap.put("applyServices","01;02");
|
||||
// bizContentMap.put("picType","2");
|
||||
// //商户信息-商户归属机构
|
||||
// bizContentMap.put("orgNo","3520000064");
|
||||
// ysServiceV3.req(ReqMethod.Reporting, bizContentMap);
|
||||
// }
|
||||
//
|
||||
@PostMapping("/appIdAddOrUpdate")
|
||||
public void appIdAddOrUpdate(){
|
||||
JSONObject bizContentMap = new JSONObject();
|
||||
bizContentMap.put("channelId", "CUPS_WECHAT");
|
||||
bizContentMap.put("mercId", "QRY230511483159");
|
||||
bizContentMap.put("appletId", "wxc2bb94c0ddda1032");
|
||||
ysServiceV3.req(ReqMethod.appIdAddOrUpdate, bizContentMap);
|
||||
}
|
||||
|
||||
@PostMapping("/auditResult")
|
||||
public void test(String sysFlowId){
|
||||
ysAuditServiceV3.result(sysFlowId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公众号权限
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/permissions")
|
||||
public JSONObject appletPermissions(@RequestBody JSONObject url){
|
||||
JSONObject jsApiConfigParam = wxCommonService.getJsApiConfigParam(url.getString("url"));
|
||||
return jsApiConfigParam;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.crypto.symmetric.DES;
|
||||
import cn.pluss.platform.channel.MerchantAuditService;
|
||||
import cn.pluss.platform.channel.ys.YSAuditServiceV3;
|
||||
import cn.pluss.platform.entity.RyxAccessModel;
|
||||
import cn.pluss.platform.klk.service.impl.LaKalaInterfaceImpl;
|
||||
import cn.pluss.platform.ryx.RyxService;
|
||||
import cn.pluss.platform.ys.impl.v20210929.YsConfigV2;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -14,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -139,5 +141,11 @@ public class AuditCallbackController {
|
||||
return ryxMerchantAuditService.editMerchantCallback(result);
|
||||
}
|
||||
|
||||
|
||||
@Resource
|
||||
LaKalaInterfaceImpl laKalaInterface;
|
||||
@PostMapping("lklCallBack")
|
||||
public String lklCallBack(@RequestBody Map<String, Object> map) throws Exception {
|
||||
String str ="data -> hplFXwPU1gbHYwraQM/fKEcoIkBfHD07VSH99OnKTZk9HJRFAvZyOm9nsdeSi8t/UdGPn+LXldrjZ7wiY+F5MzGlIdEma7agKZyHJ+UO6CrDJfYFMwlPUOgO+Pq5ljg6QOdZBxBLEHkRMkQnC/CTv9vQnPDqeCv4MvAbHJspADGRRPvmjxtzf0J4OQgP3hj9+ZqH+btsuX+W+YZRXRMYL+uOQkSJhMUv31hc9MAC/1Sp0C9cBcHKxr+idS+0CCjvD8WzLbXv2QuOSQccIKQw+Je8RMeuKs8f64MibCkf+RkilTCVCEd5apL1MkhYJZoUVzqPXmDBLjaJgr987X1wBAzQMS8+F34Vl/BonKPuJ4RRwdE/M3WJ+ZfM2WiLawpU7ZqUQdVY2bwJO801TcmFCswLoz2qxHHsBsjXtQPqMOj3pw3Kvz3WH3oWmcFRZjHKIbDSy9Jh2STEFRbvVWarjksBVjXkcbletDtOtY0T8XCdiiNoQNlVNj5kH5QkAWmt";
|
||||
return laKalaInterface.tuoKeCallBack(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.pluss.platform.controller.store;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.device.MercOrderDetailService;
|
||||
import cn.pluss.platform.device.MercOrderExpressService;
|
||||
import cn.pluss.platform.dto.MercOrderDetailDTO;
|
||||
import cn.pluss.platform.entity.MercOrderDetail;
|
||||
import cn.pluss.platform.vo.MercOrderExpressVO;
|
||||
@@ -26,6 +27,8 @@ public class MercOrderDetailController {
|
||||
|
||||
@Resource
|
||||
private MercOrderDetailService modService;
|
||||
@Resource
|
||||
private MercOrderExpressService mercOrderExpressService;
|
||||
|
||||
/**
|
||||
* 订单分页查询接口
|
||||
@@ -114,6 +117,18 @@ public class MercOrderDetailController {
|
||||
String msg = express == null ? "暂无物流信息" : "获取成功";
|
||||
return ResultGenerator.genSuccessResult(msg,express);
|
||||
}
|
||||
/**
|
||||
* 查看物流信息(快递鸟)
|
||||
*/
|
||||
@GetMapping("/logistic")
|
||||
public Result<Object> logistic(@RequestParam String expressNo)throws Exception{
|
||||
JSONObject expressInfo = mercOrderExpressService.getExpressInfo(expressNo);
|
||||
if (expressInfo.isEmpty()){
|
||||
return ResultGenerator.genFailResult("无法查询快递信息");
|
||||
}else {
|
||||
return ResultGenerator.genSuccessResult(expressInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.pluss.platform.interceptor;
|
||||
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.util.Emoji;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
public class EmojiInterceptor extends HandlerInterceptorAdapter {
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
BufferedReader reader = request.getReader();
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
String body = sb.toString();
|
||||
boolean emoji = Emoji.containsEmoji(body);
|
||||
if (emoji) {
|
||||
throw new MsgException("请正确输入");//这里是我自己封装了一个异常,根据自己需要写自己的异常
|
||||
}
|
||||
return super.preHandle(request, response, handler);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package cn.pluss.platform.interceptor;
|
||||
|
||||
import cn.pluss.platform.access.AccessService;
|
||||
import cn.pluss.platform.access.domain.CodeEnum;
|
||||
import cn.pluss.platform.access.domain.ReqEntity;
|
||||
import cn.pluss.platform.access.domain.RespEntity;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultCode;
|
||||
import cn.pluss.platform.constants.CommonError;
|
||||
@@ -10,14 +14,20 @@ import cn.pluss.platform.merchant.MerchantStaffConnService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.ComUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,6 +45,9 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
@Resource
|
||||
private MerchantStaffConnService staffConnService;
|
||||
|
||||
@Autowired
|
||||
private AccessService accessService;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
String requestUri = request.getRequestURI();
|
||||
@@ -57,6 +70,16 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
limitUri.add("/api/index.html");
|
||||
limitUri.add("/api/merchantOrder/posScanPay");
|
||||
limitUri.add("/api/merchantOrder/pos/tradeQuery");
|
||||
limitUri.add("/api/merchantOrder/returnOrder");
|
||||
limitUri.add("/api/memberOrder");
|
||||
limitUri.add("/api/merchantMenber/info");
|
||||
limitUri.add("/api/merchantBaseInfo/queryMerchantActivityApplet");
|
||||
limitUri.add("/api/deviceGoods/goodListSimple");
|
||||
limitUri.add("/api/deviceGoods/tagList");
|
||||
limitUri.add("/api/deviceGoods/deviceDetail/");
|
||||
limitUri.add("/api/questionsAnswers");
|
||||
limitUri.add("/api/helpVideo");
|
||||
limitUri.add("/api/systemConfig/updateSystemVersion");
|
||||
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
|
||||
if (passFlag) {
|
||||
return true;
|
||||
@@ -65,6 +88,46 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
String contentType = request.getContentType();
|
||||
|
||||
|
||||
if (contentType != null
|
||||
&& contentType.contains("application/json")
|
||||
&& requestUri.startsWith("/api/access")) {
|
||||
StringBuilder responseStrBuilder = new StringBuilder();
|
||||
InputStream is = request.getInputStream();
|
||||
BufferedReader streamReader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
|
||||
String inputStr;
|
||||
while ((inputStr = streamReader.readLine()) != null) {
|
||||
responseStrBuilder.append(inputStr);
|
||||
}
|
||||
|
||||
ReqEntity reqEntity;
|
||||
try {
|
||||
reqEntity = JSON.toJavaObject(JSON.parseObject(responseStrBuilder.toString()), ReqEntity.class);
|
||||
} catch (Exception e) {
|
||||
RespEntity entity = new RespEntity(null, CodeEnum.PARAM_ERROR, null, null);
|
||||
ComUtil.responseResult(response, entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (reqEntity == null || reqEntity.getOrgId() == null) {
|
||||
RespEntity entity = new RespEntity(null, CodeEnum.ORG_ID_NOT_FOUND, null, null);
|
||||
ComUtil.responseResult(response, entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean signCheck = accessService.checkSign(reqEntity);
|
||||
|
||||
// 操作
|
||||
if (signCheck) {
|
||||
return true;
|
||||
} else {
|
||||
RespEntity entity = new RespEntity(reqEntity.getOrgId(), CodeEnum.SIGN_ERROR, null, reqEntity.getRequestId());
|
||||
accessService.addSign(entity);
|
||||
ComUtil.responseResult(response, entity);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
synchronized (this) {
|
||||
String requestToken = request.getHeader("token");
|
||||
// 登录账号
|
||||
@@ -79,7 +142,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
if (StringUtils.isEmpty(myLoginName) || StringUtils.isEmpty(requestToken)) {
|
||||
Result<Object> result = new Result<>();
|
||||
result.setCode(ResultCode.NOT_TOKEN).setMessage("非法请求");
|
||||
result.setCode(ResultCode.NOT_TOKEN).setMessage("请先登录");
|
||||
ComUtil.responseResult(response, result);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
spring:
|
||||
# datasource:
|
||||
# url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
# username: root
|
||||
# password: CZGmysqlroot@123
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
datasource:
|
||||
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: CZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: prodCZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
parameter:
|
||||
### 这个根据自己的情况配置
|
||||
domain: https://ky.sxczgkj.cn
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: prodCZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
|
||||
@@ -89,11 +89,24 @@ public class ParameterConfig {
|
||||
*/
|
||||
@Value("${parameter.APPLETS_APPID}")
|
||||
public String APPLETS_APPID;
|
||||
@Value("${parameter.APPLETS_SECRET}")
|
||||
public String APPLETS_SECRET;
|
||||
/**
|
||||
* AppSecret
|
||||
*/
|
||||
@Value("${parameter.APPSECRET}")
|
||||
public String APPSECRET;
|
||||
|
||||
/**
|
||||
* IOS公众号ID
|
||||
*/
|
||||
@Value("${parameter.APPID_IOS}")
|
||||
public String APPID_IOS;
|
||||
/**
|
||||
* IOS公众号密钥
|
||||
*/
|
||||
@Value("${parameter.APP_SECRET_IOS}")
|
||||
public String APP_SECRET_IOS;
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
@@ -263,6 +276,14 @@ public class ParameterConfig {
|
||||
@Value("${parameter.SJ_APPSECRET}")
|
||||
public String SJ_APPSECRET;
|
||||
|
||||
/**
|
||||
* 快递相关(快递鸟)
|
||||
*/
|
||||
@Value("${express.USERID}")
|
||||
public String USERID;
|
||||
@Value("${express.APIKEY}")
|
||||
public String APIKEY;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
ParametersUtil.upload_save_path = upload_save_path;
|
||||
@@ -272,7 +293,10 @@ public class ParameterConfig {
|
||||
ParametersUtil.WECHAT_RATE = WECHAT_RATE;
|
||||
ParametersUtil.APPID = APPID;
|
||||
ParametersUtil.APPLETS_APPID = APPLETS_APPID;
|
||||
ParametersUtil.APPLETS_SECRET = APPLETS_SECRET;
|
||||
ParametersUtil.APPSECRET = APPSECRET;
|
||||
ParametersUtil.APPID_IOS = APPID_IOS;
|
||||
ParametersUtil.APP_SECRET_IOS = APP_SECRET_IOS;
|
||||
ParametersUtil.PID = PID;
|
||||
ParametersUtil.KEY = KEY;
|
||||
ParametersUtil.wechatCallback = wechatCallback;
|
||||
@@ -306,6 +330,8 @@ public class ParameterConfig {
|
||||
ParametersUtil.LESHUA_API=LESHUA_API;
|
||||
ParametersUtil.SJ_APPID = SJ_APPID;
|
||||
ParametersUtil.SJ_APPSECRET = SJ_APPSECRET;
|
||||
ParametersUtil.USERID = USERID;
|
||||
ParametersUtil.APIKEY = APIKEY;
|
||||
|
||||
SxfConfg.init(sxfDomain, publicKey, orgId);
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ public class Constant {
|
||||
/**
|
||||
* 默认收款商户号
|
||||
*/
|
||||
public static final String DEFUALT_CASHIER_MERCHANT = "M80020220111357490";
|
||||
public static final String DEFUALT_CASHIER_MERCHANT = "M800202207078584958";
|
||||
|
||||
/**
|
||||
* 默认收款商户属性key
|
||||
@@ -161,12 +161,12 @@ public class Constant {
|
||||
/**
|
||||
* 默认通道
|
||||
*/
|
||||
public static final Integer DEFAULT_CHANNEL = 4;
|
||||
public static final Integer DEFAULT_CHANNEL = 1;
|
||||
|
||||
/**
|
||||
* 支付宝H5支付前缀
|
||||
*/
|
||||
public static final String ALIPAY_H5_PAY_URL_PRIFIX = "alipays://platformapi/startapp?appId=20000067&url=";
|
||||
public static final String ALIPAY_H5_PAY_URL_PRIFIX = "alipays://platformapi/startapp?appId=2021003175619219&url=";
|
||||
|
||||
/**
|
||||
* 收款通道类型
|
||||
@@ -192,6 +192,19 @@ public class Constant {
|
||||
* 积分商城用户同步URL
|
||||
*/
|
||||
public static final String JF_SHOP_USER_SYNC_URL = "http://jf.shouyinbei.com/addons/shopro/syb_merchant/sysnmerchant";
|
||||
/**
|
||||
* 会员活动(充值活动)
|
||||
*/
|
||||
public static final String MEMBER_RECHARGE_ACTIVITY = "http://192.168.1.116/javaApi/java-api/get-vip-sdata";
|
||||
|
||||
/**
|
||||
* 会员活动(消费活动)
|
||||
*/
|
||||
public static final String MEMBER_CONSUME_ACTIVITY = "http://192.168.1.116/javaApi/java-api/get-vip-xfdata";
|
||||
/**
|
||||
* 会员活动(激活送)
|
||||
*/
|
||||
public static final String MEMBER_ACTIVATION_ACTIVITY = "http://192.168.1.116/javaApi/java-api/get-vip-jhdata";
|
||||
|
||||
/**
|
||||
* 生活圈会员卡默认过期时间 5(单位分钟)
|
||||
|
||||
@@ -139,7 +139,7 @@ public class ComUtil {
|
||||
public static boolean equalsIgnoreCase(String str1, String str2) {
|
||||
return str1 != null ? str1.equalsIgnoreCase(str2) : str2 == null;
|
||||
}
|
||||
|
||||
|
||||
public static String getIpAddress(HttpServletRequest request) {
|
||||
String ip = request.getHeader("x-forwarded-for");
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
@@ -165,7 +165,7 @@ public class ComUtil {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public static void responseResult(HttpServletResponse response, Result result) {
|
||||
public static void responseResult(HttpServletResponse response, Object result) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8");
|
||||
response.setStatus(200);
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class Emoji {
|
||||
/**
|
||||
* @Description: 是否有表情判断
|
||||
* @author zhaopeng
|
||||
* @email zp152527@163.com
|
||||
* @date 2018/8/24 18:27
|
||||
*/
|
||||
public static boolean containsEmoji(String source) {
|
||||
int len = source.length();
|
||||
boolean isEmoji = false;
|
||||
for (int i = 0; i < len; i++) {
|
||||
char hs = source.charAt(i);
|
||||
if (0xd800 <= hs && hs <= 0xdbff) {
|
||||
if (source.length() > 1) {
|
||||
char ls = source.charAt(i + 1);
|
||||
int uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
|
||||
if (0x1d000 <= uc && uc <= 0x1f77f) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// non surrogate
|
||||
if (0x2100 <= hs && hs <= 0x27ff && hs != 0x263b) {
|
||||
return true;
|
||||
} else if (0x2B05 <= hs && hs <= 0x2b07) {
|
||||
return true;
|
||||
} else if (0x2934 <= hs && hs <= 0x2935) {
|
||||
return true;
|
||||
} else if (0x3297 <= hs && hs <= 0x3299) {
|
||||
return true;
|
||||
} else if (hs == 0xa9 || hs == 0xae || hs == 0x303d
|
||||
|| hs == 0x3030 || hs == 0x2b55 || hs == 0x2b1c
|
||||
|| hs == 0x2b1b || hs == 0x2b50 || hs == 0x231a) {
|
||||
return true;
|
||||
}
|
||||
if (!isEmoji && source.length() > 1 && i < source.length() - 1) {
|
||||
char ls = source.charAt(i + 1);
|
||||
if (ls == 0x20e3) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return isEmoji;
|
||||
}
|
||||
|
||||
private static boolean isEmojiCharacter(char codePoint) {
|
||||
return (codePoint == 0x0) || (codePoint == 0x9) || (codePoint == 0xA)
|
||||
|| (codePoint == 0xD)
|
||||
|| ((codePoint >= 0x20) && (codePoint <= 0xD7FF))
|
||||
|| ((codePoint >= 0xE000) && (codePoint <= 0xFFFD))
|
||||
|| ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 过滤emoji 或者 其他非文字类型的字符
|
||||
* @author zhaopeng
|
||||
* @email zp152527@163.com
|
||||
* @date 2018/8/24 18:27
|
||||
*/
|
||||
public static String filterEmoji(String source) {
|
||||
if (StringUtils.isBlank(source)) {
|
||||
return source;
|
||||
}
|
||||
StringBuilder buf = null;
|
||||
int len = source.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
char codePoint = source.charAt(i);
|
||||
if (isEmojiCharacter(codePoint)) {
|
||||
if (buf == null) {
|
||||
buf = new StringBuilder(source.length());
|
||||
}
|
||||
buf.append(codePoint);
|
||||
}
|
||||
}
|
||||
if (buf == null) {
|
||||
return source;
|
||||
} else {
|
||||
if (buf.length() == len) {
|
||||
buf = null;
|
||||
return source;
|
||||
} else {
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class MobV2PushUtil {
|
||||
public class MobV2PushUtilAndroid {
|
||||
|
||||
public static final String appKey = "9f5Nw6Bvb982HvsN3sG1y5";
|
||||
public static final String appId = "jzSkfM0Wsk8uSDL2zwGu07";
|
||||
@@ -143,7 +143,7 @@ public class MobV2PushUtil {
|
||||
pushChannel.setAndroid(androidDTO);
|
||||
|
||||
//ios离线apn通道推送的消息体
|
||||
Alert alert = new Alert();
|
||||
/* Alert alert = new Alert();
|
||||
alert.setTitle(title);
|
||||
alert.setBody(content);
|
||||
Aps aps = new Aps();
|
||||
@@ -153,7 +153,8 @@ public class MobV2PushUtil {
|
||||
IosDTO iosDTO = new IosDTO();
|
||||
iosDTO.setAps(aps);
|
||||
iosDTO.setType("notify");
|
||||
pushChannel.setIos(iosDTO);
|
||||
pushChannel.setIos(iosDTO);*/
|
||||
|
||||
pushDTO.setPushChannel(pushChannel);
|
||||
|
||||
pushBatchDTO.addPushDTO(pushDTO);
|
||||
@@ -0,0 +1,196 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.getui.push.v2.sdk.ApiHelper;
|
||||
import com.getui.push.v2.sdk.GtApiConfiguration;
|
||||
import com.getui.push.v2.sdk.api.PushApi;
|
||||
import com.getui.push.v2.sdk.common.ApiResult;
|
||||
import com.getui.push.v2.sdk.dto.req.Audience;
|
||||
import com.getui.push.v2.sdk.dto.req.Settings;
|
||||
import com.getui.push.v2.sdk.dto.req.message.PushBatchDTO;
|
||||
import com.getui.push.v2.sdk.dto.req.message.PushChannel;
|
||||
import com.getui.push.v2.sdk.dto.req.message.PushDTO;
|
||||
import com.getui.push.v2.sdk.dto.req.message.PushMessage;
|
||||
import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO;
|
||||
import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification;
|
||||
import com.getui.push.v2.sdk.dto.req.message.android.Ups;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.Alert;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.Aps;
|
||||
import com.getui.push.v2.sdk.dto.req.message.ios.IosDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class MobV2PushUtilIOS {
|
||||
|
||||
public static final String appKey = "QwyHsKpc0I9BQMk9Xysx74";
|
||||
public static final String appId = "yuBG87yWEt6SXrwBSSvjy1 ";
|
||||
public static final String masterSecret = "PpidsIbMSs7EQddDMHAh81";
|
||||
|
||||
public String getToken() throws IOException, NoSuchAlgorithmException {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Long timestamp = new Date().getTime();
|
||||
|
||||
String content = appKey + timestamp + masterSecret;
|
||||
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
||||
messageDigest.update(content.getBytes("UTF-8"));
|
||||
String sign = byte2Hex(messageDigest.digest());
|
||||
|
||||
map.put("sign", sign);
|
||||
map.put("timestamp", timestamp);
|
||||
map.put("appkey", appKey);
|
||||
|
||||
String json = new ObjectMapper().writeValueAsString(map);
|
||||
|
||||
HttpHeaders header = new HttpHeaders();
|
||||
header.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
HttpEntity<String> httpEntity = new HttpEntity<>(json, header);
|
||||
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
// 设置为UTF8编码
|
||||
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
||||
|
||||
String tokenInfo = restTemplate.postForObject(
|
||||
"https://restapi.getui.com/v2/" + appId + "/auth", httpEntity,
|
||||
String.class);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode jsonNode = mapper.readTree(tokenInfo);
|
||||
JsonNode code = jsonNode.get("code");
|
||||
if (code.asText().equals("0")) {
|
||||
return jsonNode.get("data").get("token").asText();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void sendSingleByAlias(List<String> alias, String title, String content, String ext) {
|
||||
|
||||
GtApiConfiguration apiConfiguration = new GtApiConfiguration();
|
||||
//填写应用配置,参数在“Uni Push”下的“应用配置”页面中获取
|
||||
apiConfiguration.setAppId(appId);
|
||||
apiConfiguration.setAppKey(appKey);
|
||||
apiConfiguration.setMasterSecret(masterSecret);
|
||||
apiConfiguration.setDomain("https://restapi.getui.com/v2/");
|
||||
// 实例化ApiHelper对象,用于创建接口对象
|
||||
ApiHelper apiHelper = ApiHelper.build(apiConfiguration);
|
||||
|
||||
// 创建对象,建议复用。目前有PushApi、StatisticApi、UserApi
|
||||
PushApi pushApi = apiHelper.creatApi(PushApi.class);
|
||||
|
||||
|
||||
PushBatchDTO pushBatchDTO = new PushBatchDTO();
|
||||
|
||||
for (String value : alias) {
|
||||
//根据cid进行单推
|
||||
PushDTO<Audience> pushDTO = new PushDTO<Audience>();
|
||||
// 设置推送参数,requestid需要每次变化唯一
|
||||
pushDTO.setRequestId(System.currentTimeMillis() + "");
|
||||
Settings settings = new Settings();
|
||||
pushDTO.setSettings(settings);
|
||||
//消息有效期,走厂商消息必须设置该值
|
||||
settings.setTtl(3600000);
|
||||
|
||||
//在线走个推通道时推送的消息体
|
||||
PushMessage pushMessage = new PushMessage();
|
||||
pushDTO.setPushMessage(pushMessage);
|
||||
//此格式的透传消息由 unipush 做了特殊处理,会自动展示通知栏。开发者也可自定义其它格式,在客户端自己处理。
|
||||
//pushMessage.setTransmission(" {title:\"标题\",content:\"内容\",payload:\"快银到账1万元\"}");
|
||||
|
||||
//pushMessage.setTransmission("{title:" + title + ", content:" + content + ext);
|
||||
|
||||
pushMessage.setTransmission("{title:\"" + title + "\",content:\"" + content + "\"," + ext);
|
||||
|
||||
// 设置接收人信息
|
||||
Audience audience = new Audience();
|
||||
//audience.addAlias("244");
|
||||
audience.addAlias(value);
|
||||
pushDTO.setAudience(audience);
|
||||
|
||||
|
||||
//设置离线推送时的消息体
|
||||
PushChannel pushChannel = new PushChannel();
|
||||
//安卓离线厂商通道推送的消息体
|
||||
/* AndroidDTO androidDTO = new AndroidDTO();
|
||||
Ups ups = new Ups();
|
||||
ThirdNotification thirdNotification = new ThirdNotification();
|
||||
ups.setNotification(thirdNotification);
|
||||
thirdNotification.setTitle(title);
|
||||
thirdNotification.setBody(content);
|
||||
thirdNotification.setClickType("intent");
|
||||
//注意:intent参数必须按下方文档(特殊参数说明)要求的固定格式传值,intent错误会导致客户端无法收到消息
|
||||
thirdNotification.setIntent("intent://io.dcloud.unipush/?#Intent;scheme=unipush;launchFlags=0x4000000;component=io.dcloud.HBuilder/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title=测试标题;S.content=测试内容;S.payload=test;end");
|
||||
androidDTO.setUps(ups);
|
||||
pushChannel.setAndroid(androidDTO);*/
|
||||
|
||||
//ios离线apn通道推送的消息体
|
||||
Alert alert = new Alert();
|
||||
alert.setTitle(title);
|
||||
alert.setBody(content);
|
||||
Aps aps = new Aps();
|
||||
aps.setContentAvailable(0);
|
||||
aps.setSound("default");
|
||||
aps.setAlert(alert);
|
||||
IosDTO iosDTO = new IosDTO();
|
||||
iosDTO.setAps(aps);
|
||||
iosDTO.setType("notify");
|
||||
pushChannel.setIos(iosDTO);
|
||||
|
||||
pushDTO.setPushChannel(pushChannel);
|
||||
|
||||
pushBatchDTO.addPushDTO(pushDTO);
|
||||
}
|
||||
|
||||
|
||||
ApiResult<Map<String, Map<String, String>>> apiResult = pushApi.pushBatchByAlias(pushBatchDTO);
|
||||
|
||||
log.info("[uni推送]PushResult result is {}", apiResult.getData());
|
||||
|
||||
if (apiResult.isSuccess()) {
|
||||
// success
|
||||
System.out.println(apiResult.getData());
|
||||
} else {
|
||||
// failed
|
||||
System.out.println("code:" + apiResult.getCode() + ", msg: " + apiResult.getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte转为16进制
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
private static String byte2Hex(byte[] bytes) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
String temp = null;
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
temp = Integer.toHexString(bytes[i] & 0xFF);
|
||||
if (temp.length() == 1) {
|
||||
// 1得到一位的进行补0操作
|
||||
stringBuffer.append("0");
|
||||
}
|
||||
stringBuffer.append(temp);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -45,10 +45,23 @@ public class ParametersUtil {
|
||||
* 小程序付款的appid
|
||||
*/
|
||||
public static String APPLETS_APPID;
|
||||
/**
|
||||
* 小程序密钥
|
||||
*/
|
||||
public static String APPLETS_SECRET;
|
||||
/**
|
||||
* AppSecret
|
||||
*/
|
||||
public static String APPSECRET;
|
||||
/**
|
||||
* IOS公众号ID
|
||||
*/
|
||||
public static String APPID_IOS;
|
||||
/**
|
||||
* IOS公众号密钥
|
||||
*/
|
||||
public static String APP_SECRET_IOS;
|
||||
|
||||
/**
|
||||
*商户号
|
||||
*/
|
||||
@@ -186,5 +199,11 @@ public class ParametersUtil {
|
||||
* @date: 2021/9/23 10:27
|
||||
*/
|
||||
public static String SJ_APPSECRET;
|
||||
|
||||
/**
|
||||
* 快递相关(快递鸟)
|
||||
*/
|
||||
public static String USERID;
|
||||
public static String APIKEY;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class RSAUtils {
|
||||
|
||||
public static PrivateKey getPrivateKey(String key) throws Exception {
|
||||
byte[] keyBytes;
|
||||
keyBytes = Base64.getDecoder().decode(key);
|
||||
keyBytes = Base64.getMimeDecoder().decode(key);
|
||||
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA);
|
||||
return keyFactory.generatePrivate(keySpec);
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.Key;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.Security;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import org.bouncycastle.crypto.CryptoException;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.bouncycastle.util.encoders.Base64;
|
||||
|
||||
import static org.bouncycastle.util.encoders.Base64.toBase64String;
|
||||
|
||||
//import com.lakala.zf.idry.yzt.exception.CryptoException;
|
||||
|
||||
|
||||
public class SM4Util {
|
||||
|
||||
public static final String ALGORITHM_NAME = "SM4";
|
||||
public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding";
|
||||
|
||||
// SM4算法目前只支持128位(即密钥16字节)
|
||||
public static final int DEFAULT_KEY_SIZE = 128;
|
||||
|
||||
public static final String ENCODING = "UTF-8";
|
||||
|
||||
|
||||
static {
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64编码的密钥
|
||||
*
|
||||
* @return Base64编码的密钥
|
||||
* @throws CryptoException
|
||||
*/
|
||||
public static String generateKeyToBase64() throws CryptoException {
|
||||
return toBase64String(generateKey());
|
||||
}
|
||||
|
||||
public static byte[] generateKey() throws CryptoException {
|
||||
return generateKey(DEFAULT_KEY_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Base64编码的密钥
|
||||
*
|
||||
* @param keySize 密钥长度 单位为bit
|
||||
* @return Base64编码的密钥
|
||||
* @throws CryptoException
|
||||
*/
|
||||
public static String generateKeyToBase64(int keySize) throws CryptoException {
|
||||
return toBase64String(generateKey(keySize));
|
||||
}
|
||||
|
||||
public static byte[] generateKey(int keySize) throws CryptoException {
|
||||
KeyGenerator kg = null;
|
||||
try {
|
||||
kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME);
|
||||
} catch (Exception e) {
|
||||
throw new CryptoException("SM4Util generateKey error:", e);
|
||||
}
|
||||
kg.init(keySize, new SecureRandom());
|
||||
return kg.generateKey().getEncoded();
|
||||
}
|
||||
|
||||
|
||||
public static byte[] encrypt_ECB_Padding(byte[] key, byte[] data) throws CryptoException {
|
||||
try {
|
||||
Cipher cipher = generateECBCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key);
|
||||
return cipher.doFinal(data);
|
||||
} catch (Exception e) {
|
||||
throw new CryptoException("SM4Util encrypt_ECB_Padding error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ECB_PKCS5Padding 加密,返回Base64编码后的密文
|
||||
*
|
||||
* @param key base64
|
||||
* @param data 正常明文数据
|
||||
* @return
|
||||
* @throws MsgException
|
||||
*/
|
||||
public static String encrypt(String key, String data) throws CryptoException {
|
||||
try {
|
||||
Cipher cipher = generateECBCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, Base64.decode(key));
|
||||
byte[] enData =cipher.doFinal(data.getBytes(ENCODING));
|
||||
return Base64.toBase64String(enData);
|
||||
} catch (Exception e) {
|
||||
throw new CryptoException("SM4Util encrypt_ECB_Padding error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ECB_PKCS5Padding 解密 ,返回正常明文数据
|
||||
*
|
||||
* @param key base64
|
||||
* @param cipherText 返回Base64编码后的密文
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String decrypt(String key, String cipherText) throws CryptoException {
|
||||
try {
|
||||
Cipher cipher = generateECBCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, Base64.decode(key));
|
||||
byte[] data =cipher.doFinal(Base64.decode(cipherText));
|
||||
return new String(data,ENCODING);
|
||||
} catch (Exception e) {
|
||||
throw new CryptoException("SM4Util decrypt_ECB_Padding error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static byte[] decrypt_ECB_Padding(byte[] key, byte[] cipherText) throws CryptoException {
|
||||
try {
|
||||
Cipher cipher = generateECBCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key);
|
||||
return cipher.doFinal(cipherText);
|
||||
} catch (Exception e) {
|
||||
throw new CryptoException("SM4Util decrypt_ECB_Padding error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Cipher generateECBCipher(String algorithmName, int mode, byte[] key)
|
||||
throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException,
|
||||
InvalidKeyException {
|
||||
Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME);
|
||||
Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME);
|
||||
cipher.init(mode, sm4Key);
|
||||
return cipher;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
String key = "dRzPaYd7z6vYn9sL/JTZ3A==";
|
||||
|
||||
String data = "阿萨德哈的哦已我居然挤公交大幅度AAAADDF";
|
||||
|
||||
String cipherText = encrypt(key, data);
|
||||
|
||||
System.out.println("cipherText " + cipherText);
|
||||
|
||||
String deData = decrypt(key, cipherText);
|
||||
|
||||
System.out.println("deData " + deData);
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class WechatSignUtil {
|
||||
|
||||
|
||||
@@ -95,4 +89,30 @@ public class WechatSignUtil {
|
||||
signParam.append("&key=").append(payKey);
|
||||
return signParam.toString();
|
||||
}
|
||||
/**
|
||||
* 加密模式
|
||||
* @return
|
||||
*/
|
||||
public static String createNonceStr() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
* @return
|
||||
*/
|
||||
public static String createTimestamp() {
|
||||
return Long.toString(System.currentTimeMillis() / 1000);
|
||||
}
|
||||
public static String byteToHex(final byte[] hash) {
|
||||
Formatter formatter = new Formatter();
|
||||
for (byte b : hash)
|
||||
{
|
||||
formatter.format("%02x", b);
|
||||
}
|
||||
String result = formatter.toString();
|
||||
formatter.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -84,17 +84,17 @@ public class WxConstants {
|
||||
|
||||
public static final Integer RESULT_SUCCESS_CODE = 0;
|
||||
|
||||
public static final Integer QR_EXPIRE_SECONDS = 2592000;
|
||||
public static final Integer QR_EXPIRE_SECONDS = 25920000;
|
||||
|
||||
/**
|
||||
* 微信会员开卡通知模板ID
|
||||
* @date: 2021/12/9 18:17
|
||||
*/
|
||||
public static final String VIP_CARD_SUCCESS_TEMPLATE_ID = "Hf_WLVwVAc0HD4KV2_zLD0vTgiw4jpZ-OkcN4lIffUA";
|
||||
public static final String VIP_CARD_SUCCESS_TEMPLATE_ID = "xCnkmNFUTVmlqn3njTW-qiET6s_6nOVc5k3gb-xW7A0";
|
||||
|
||||
/**
|
||||
* 会员卡余额变动通知模板ID
|
||||
* @date: 2021/12/9 18:19
|
||||
*/
|
||||
public static final String VIP_BALANCE_CHANGE_TEMPLATE_ID = "GNwluamISkPhGQU-NC1uBH-ftb7z28rknYe7hZyDKyI";
|
||||
public static final String VIP_BALANCE_CHANGE_TEMPLATE_ID = "QNYK59v0h1Q4yQ2lIIrJGE0Fk0JnizhJ-_Gz1cA8_5Q";
|
||||
}
|
||||
|
||||
@@ -132,11 +132,11 @@ public class YtCreateOrder implements Serializable {
|
||||
|
||||
|
||||
public YtCreateOrder() {
|
||||
this.senderName = "收银呗客服部";
|
||||
this.senderProvinceName = "湖北省";
|
||||
this.senderCityName = "武汉市";
|
||||
this.senderCountyName = "洪山区";
|
||||
this.senderAddress = "九台别墅42栋";
|
||||
this.senderMobile = "18062761507";
|
||||
this.senderName = "快银收银客服部";
|
||||
this.senderProvinceName = "陕西省";
|
||||
this.senderCityName = "西安市";
|
||||
this.senderCountyName = "未央区";
|
||||
this.senderAddress = "荣民中央国际";
|
||||
this.senderMobile = "19191701028";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,13 @@ parameter:
|
||||
# wxfffc7bff64c7a11e
|
||||
#小程序付款APPID
|
||||
APPLETS_APPID: wxc2bb94c0ddda1032
|
||||
APPSECRET: 4e00bbf3fc75a1ff68ce866fd13f2bcc
|
||||
#小程序密钥
|
||||
APPLETS_SECRET: 625cbce8772629312e42e8278a8d6889
|
||||
APPSECRET: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
# b84ee0efaa0d9a649746ac65525f8e10
|
||||
#IOS端公众号
|
||||
APPID_IOS: wx212769170d2c6b2a
|
||||
APP_SECRET_IOS: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
KEY: 微信原生加密用的KEY
|
||||
LESHUALIU: 乐刷、未接入可不管
|
||||
LESHUA_API:
|
||||
@@ -151,3 +156,11 @@ sxf:
|
||||
getui:
|
||||
domain: https://restapi.getui.com/v2/${getui.appId}
|
||||
appId: jzSkfM0Wsk8uSDL2zwGu07
|
||||
|
||||
#快递(快递鸟)
|
||||
express:
|
||||
USERID: 1778214
|
||||
APIKEY: 63e75d64-e8fd-4dcc-93fa-17dc710cdf04
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
lkl:
|
||||
private_key: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvDBZyHUDndAGxrIcsCV2njhNO3vCEZotTaWYSYwtDvkcAb1EjsBFabXZaKigpqFXk5XXNI3NIHP9M8XKzIgGvc65NpLAfRjVql8JiTvLyYd1gIUcOXMInabu+oX7dQSI1mS8XzqaoVRhDZQWhXcJW9bxMulgnzvk0Ggw07AjGF7si+hP/Va8SJmN7EJwfQq6TpSxR+WdIHpbWdhZ+NHwitnQwAJTLBFvfk28INM39G7XOsXdVLfsooFdglVTOHpNuRiQAj9gShCCNrpGsNQxDiJIxE43qRsNsRwigyo6DPJk/klgDJa417E2wgP8VrwiXparO4FMzOGK15quuoD7DAgMBAAECggEBANhmWOt1EAx3OBFf3f4/fEjylQgRSiqRqg8Ymw6KGuh4mE4Md6eW/B6geUOmZjVP7nIIR1wte28M0REWgn8nid8LGf+v1sB5DmIwgAf+8G/7qCwd8/VMg3aqgQtRp0ckb5OV2Mv0h2pbnltkWHR8LDIMwymyh5uCApbn/aTrCAZKNXcPOyAn9tM8Bu3FHk3Pf24Er3SN+bnGxgpzDrFjsDSHjDFT9UMIc2WdA3tuMv9X3DDn0bRCsHnsIw3WrwY6HQ8mumdbURk+2Ey3eRFfMYxyS96kOgBC2hqZOlDwVPAKTPtS4hoq+cQ0sRaJQ4T0UALJrBVHa+EESgRaTvrXqAECgYEA+WKmy9hcvp6IWZlk9Q1JZ+dgIVxrO65zylK2FnD1/vcTx2JMn73WKtQb6vdvTuk+Ruv9hY9PEsf7S8gHSTTmzHOUgo5x0F8yCxXFnfji2juoUnDdpkjtQK5KySDcpQb5kcCJWEVi9v+zObM0Zr1Nu5/NreE8EqUl3+7MtHOu1TMCgYEA9WM9P6m4frHPW7h4gs/GISA9LuOdtjLvAtgCK4cW2mhtGNAMttD8zOBQrRuafcbFAyU9de6nhGwetOhkW9YSV+xRNa7HWTeIRgXJuJBrluq5e1QGTIwZU/GujpNaR4Qiu0B8TodM/FME7htsyxjmCwEfT6SDYlkeMzTbMa9Q0DECgYBqsR/2+dvD2YMwAgZFKKgNAdoIq8dcwyfamUQ5mZ5EtGQL2yw48zibHh/LiIxgUD1Kjk/qQgNsX45NP4iOc0mCkrgomtRqdy+rumbPTNmQ0BEVJCBPscd+8pIgNiTvnWpMRvj7gMP0NDTzLI3wnnCRIq8WAtR2jZ0Ejt+ZHBziLQKBgQDibEe/zqNmhDuJrpXEXmO7fTv3YB/OVwEj5p1Z/LSho2nHU3Hn3r7lbLYEhUvwctCnLl2fzC7Wic1rsGOqOcWDS5NDrZpUQGGF+yE/JEOiZcPwgH+vcjaMtp0TAfRzuQEzNzV8YGwxB4mtC7E/ViIuVULHAk4ZGZI8PbFkDxjKgQKBgG8jEuLTI1tsP3kyaF3jAylnw7SkBc4gfe9knsYlw44YlrDSKr8AOp/zSgwvMYvqT+fygaJ3yf9uIBdrIilqCHKXccZ9uA/bT5JfIi6jbg3EoE9YhB0+1aGAS1O2dBvUiD8tJ+BjAT4OB0UDpmM6QsFLQgFyXgvDnzr/o+hQJelW
|
||||
appid: OP00000462 #接入方唯一编号
|
||||
mchSerialNo: 00dfba8194c41b84cf #证书序列号
|
||||
merchantNo: 8221210594300JY #商户号
|
||||
vposId: 491612871013605376 #vpos_id
|
||||
termNo: A0073841 #终端号
|
||||
apiUrl: https://test.wsmsd.cn/
|
||||
privateKeyPath: "classpath:lakalaConf/OP00000003_private_key.pem"
|
||||
certificatePath: "classpath:lakalaConf/OP00000003_cert"
|
||||
|
||||
@@ -10,12 +10,12 @@ ys:
|
||||
## 其他网关接口
|
||||
otherDomain: https://commonapi.ysepay.com/gateway.do
|
||||
## 代理商编号
|
||||
agentNo:
|
||||
## 交易发起方编号 武汉融商创赢科技有限公司
|
||||
srcMerchantNo: 826521673920090
|
||||
agentNo: 801521000002WJW
|
||||
## 交易发起方编号 武汉融商创银科技有限公司
|
||||
srcMerchantNo: 826521773920170
|
||||
|
||||
## 私钥用于签名,对应的公钥给到银盛
|
||||
priKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD2J82Gg79Tk8HZ9Zl7EOeLwvUn41c4ktUg6jveIhYLhT/PW5hpPAtgKXd9BvhtpfXhzbK6U9UURKhBgFIkQ+oIJQNfbB/F2jdVK9ke3IYi0/TXHMnY63x43qxciLeAOt+LxdhHn6ZImV4MsRkPjF/zLsaJrPOPWbc2m4T1yvinfzkrxhZaWn1dj4+IdyO3tA/juXCjydQqKR2kSqJlo6gdT9N3RIJ+ETda2UUahZyYXBfjyxFQEaOXthm6krZH1zBHs510Og6bQJQHjMmTskkslWvj38qPDfsuC4tq0Hgbu3LcyiX9vGYzQoGOaGhDEiNPObdDlOuh5gn0slRmg+PxAgMBAAECggEAJRvrCBRki50C5HD6Kmtp/M/vVYwYYhcAum2ViO9qk2ILNJ+CYpsCvASEVvzuBtm2L8xq3Vw2C1AubXGC8KSsa33o/EG4qIM1REnP+a8VKbr6dlOIuoMFyNMI+QpDX7mAafnxmRqgXuGAJDmupYFsFaU/mRHRxhKoZDsd2FA5HEbuDI9SJp86keE72NHsxyqfDIZyIk3Z8k7HZY2wg3FW+YaOKQBHVA9JYvhfZMeaQ1ymrA0IAqWpUqjLkqAa2Qa6xUsbj+QhvrkBCE48i8duamXKDSOaLfkqTb8IyxOM9eTsFwLVGEuZQrkhrLxdrg5aBPvu81pIJME6SgrquJJ84QKBgQD/MAFLiWU0wDJ4Hqf2jKa5vgrBmCqOsANBc079s8gDXM4zbsG/TjMHPDmiOGZxtDG8937twjYzRv9XpnqyITMArlhWWMhTOJ3r3CTVr/OISgeZKPGjfp+MbeDsOK4OggTVKZmNLx3nKiuc94IlTDOcz5qArVBTxKadWg56f1UGswKBgQD28G+haXxneMhRZozoHPjcfdgtDoZJaVa8XTXw8nvQala5ioU9yesbIAdtD/VR/eWwuMtO4rK1IFxtNZQ/MtSXwqlnKLf1xDJQPuj3kY5mC7H7sn4HGeFDP50VFnPgIaUnB5VwgyYFm8l19AW06OBjlnoBv0dnl1s5u+DgpzQcywKBgQCfeWSVzBtPR/1CTAYzcdqPoVAfg/S0jxK5yFHJAp0wXMMQKVszLq99CgoKcqyyyiV7LkBIXWJ50RipsgRjZZP2DP5vl7Q5LdyjFUR/tiG/PmRZNtkrj2ot3Ez/0rwTnPVgMUsgjB1n5Va0FYljvadTi/nGCIl2kCJ/m1QJAaIlOQKBgGV8TwRxS9ViiEEb+lDyhzxm488wpvPIvQLQ8/hAT65J5bZ/PV81etA9C5BA/Ltjs2A7siKLfJJ/6DxhxrlqdICiWeixjVkN9vePw0LrqTA7IjylELJuamuu2yntflXgvfUaYspIu/mWGufFEAtXodCL6TyKlhf21mEV28e4L+ydAoGAItgCUGbot95QNT1z+9QFN+18AvMnWCNvqanrC4qsk0phjYX9FFwfSCqWVeVm0Q0+2tUrRNcUEcbmlbQToBZq/hSu0nPcZIPvnNxLfW/NY7eVCXIcI5eNPjUIgbRCVMc6w5ukYMxPidOBuRXIt1iq2+iV20/FMbA58sY7AgOiaMw=
|
||||
priKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDky8v1JlxCfZM0e0p7rkZq/hpa3yHjsF3aJaE5rBt0+x5G7MnHX1AIgi9jJzG3Z8QnEPUVutVClVbRZ3k9hZChlm6T9Miv4IhyvE4kPGJEXRi2q2r7nHyUeGve3TC4jXvELy0muS30BWRyczM/f2x13/uzjxeCM1eMnI5+jxfdg8aaYS2NpCydgObtEvKQRpx6YoF+F7eIF8DNvbYyoRNzM/+NsmquDmgK7Ad1qNK7gqYSmfXHUys7F97Sd/NxfegaiBMapepruUvQSlcQkYXJprM9cBGQuWx/iK8kQ+yYfmOI0OWX8pBwYWut7rR/ritujAdKtIpg14XVxRLnop6dAgMBAAECggEASjJA6TZQcwuQIlPdOrCwi1/uIgv8TH9UYDsVxsMmgFAzaGK/qNUi+i9luKzsNYMEHHsmT66wHBCb//qjWa0n0w8auwaF0mtpNHQWjy+52luqeQqr/f6oc+l9ad+nPiI7wcpexREGcv0QrwDm3K+w96T0Vi2QPRvzR1k56Jb08VN+kpAXb3g7X++il0Ql2lKFM8NySI0utnHAFMH7erJqNc4KeKmr2fJYw23ldBUOxmU6oWEIGwO+KiysfNlmzu3JspYE/eQfKX5aaEKaDbPVGF5Dje5e1SlJ1x9sTAfhOPeh83canoRN61aAI5mEKu04li5LLscBZfW6li2sVVJi7QKBgQD6qPgPc9NOusBvYP02NPdARBswCoafA86QHftPtWpyza67/M2c3X7dd+EnOU1Q+9p2Wj+L64M2KnC1JB+RUrVDBhs4e+yZ3Gly8rD+OUt1kWdJTaK3hJyKAnKtbL9yE90CEwMxLEH0XnYTmC8GhYYXGbOS2ZsqzQJaGUaYel3kTwKBgQDpq5Z00hb8EcPF6l34aL+FL9nAxlASXbYJql/UkD8PdhIkoxezkox/UI5jeF+RXbQ+VfuZQa6HfUrBQOcHTmp9o4cInDqoN/DSjvqV3v8Cnjs/PuF+kxFMDJdYPsjkps4IqR24l8nypPCdPHRjCaRnyfOyc1AteB1jYxDxkUmXUwKBgDOu7V76SeKc3RraC7vGlgiZQmXYdcOJ3GiY1f2scWN0h4fZa2fhv8vYcQNObGO7WmM23o1yJR7hB1ZCOYQUYq2ML8aovrNG4DNEWTxCAg4eygYyTM+8Ny65rH2Xw6247MQFuY3FC2BgrcYChge5NlnDAeTQm47qsIZ1WboM2Rk/AoGBAIuT1kSjtd0OE34mV8lpcHVzNsQi8XN3DKTLY4DKRRDMO1wtG5xFPq1SBiu+nH9tlJvjqm1KQaFnIv868IV5vrybsK5g+9y9xZlQlLhvQq5irAtEWVfNK3jc0I6CumdyiAG+WyWHbbcF9UBG+1KpUM46YNpIbS0r4Yobg+R4H5hHAoGBAOCZOg2VFPiluOPWzIcILb6nYvZyPhZP4pzz7WyzBht2SoHcD70cduCQpcuAXbj5JY59gUfNxURCDxQDNW2x8cQs6Hxme1kVg5kZNJAaclfb7Jx+ZqsYk4ua0NqxOtyfhRmYXVaTVKDFNt8CmwoiKYse4VDC/E3yKgha0UdcE+co
|
||||
## 签名公钥,由银盛提供
|
||||
pubKey:
|
||||
## 付款验签公钥,由银盛提供
|
||||
@@ -24,13 +24,13 @@ ys:
|
||||
## 进件URL前缀v2
|
||||
auditDomainV2: https://ouser.ysepay.com:6443/
|
||||
## 机构号ID
|
||||
src: 3520000052
|
||||
src: 3520000064
|
||||
## 代理商编号
|
||||
agentNoV2: 801521000002UUS
|
||||
agentNoV2: 801521000002WJW
|
||||
## 进件私钥v2
|
||||
priKeyV2: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD2J82Gg79Tk8HZ9Zl7EOeLwvUn41c4ktUg6jveIhYLhT/PW5hpPAtgKXd9BvhtpfXhzbK6U9UURKhBgFIkQ+oIJQNfbB/F2jdVK9ke3IYi0/TXHMnY63x43qxciLeAOt+LxdhHn6ZImV4MsRkPjF/zLsaJrPOPWbc2m4T1yvinfzkrxhZaWn1dj4+IdyO3tA/juXCjydQqKR2kSqJlo6gdT9N3RIJ+ETda2UUahZyYXBfjyxFQEaOXthm6krZH1zBHs510Og6bQJQHjMmTskkslWvj38qPDfsuC4tq0Hgbu3LcyiX9vGYzQoGOaGhDEiNPObdDlOuh5gn0slRmg+PxAgMBAAECggEAJRvrCBRki50C5HD6Kmtp/M/vVYwYYhcAum2ViO9qk2ILNJ+CYpsCvASEVvzuBtm2L8xq3Vw2C1AubXGC8KSsa33o/EG4qIM1REnP+a8VKbr6dlOIuoMFyNMI+QpDX7mAafnxmRqgXuGAJDmupYFsFaU/mRHRxhKoZDsd2FA5HEbuDI9SJp86keE72NHsxyqfDIZyIk3Z8k7HZY2wg3FW+YaOKQBHVA9JYvhfZMeaQ1ymrA0IAqWpUqjLkqAa2Qa6xUsbj+QhvrkBCE48i8duamXKDSOaLfkqTb8IyxOM9eTsFwLVGEuZQrkhrLxdrg5aBPvu81pIJME6SgrquJJ84QKBgQD/MAFLiWU0wDJ4Hqf2jKa5vgrBmCqOsANBc079s8gDXM4zbsG/TjMHPDmiOGZxtDG8937twjYzRv9XpnqyITMArlhWWMhTOJ3r3CTVr/OISgeZKPGjfp+MbeDsOK4OggTVKZmNLx3nKiuc94IlTDOcz5qArVBTxKadWg56f1UGswKBgQD28G+haXxneMhRZozoHPjcfdgtDoZJaVa8XTXw8nvQala5ioU9yesbIAdtD/VR/eWwuMtO4rK1IFxtNZQ/MtSXwqlnKLf1xDJQPuj3kY5mC7H7sn4HGeFDP50VFnPgIaUnB5VwgyYFm8l19AW06OBjlnoBv0dnl1s5u+DgpzQcywKBgQCfeWSVzBtPR/1CTAYzcdqPoVAfg/S0jxK5yFHJAp0wXMMQKVszLq99CgoKcqyyyiV7LkBIXWJ50RipsgRjZZP2DP5vl7Q5LdyjFUR/tiG/PmRZNtkrj2ot3Ez/0rwTnPVgMUsgjB1n5Va0FYljvadTi/nGCIl2kCJ/m1QJAaIlOQKBgGV8TwRxS9ViiEEb+lDyhzxm488wpvPIvQLQ8/hAT65J5bZ/PV81etA9C5BA/Ltjs2A7siKLfJJ/6DxhxrlqdICiWeixjVkN9vePw0LrqTA7IjylELJuamuu2yntflXgvfUaYspIu/mWGufFEAtXodCL6TyKlhf21mEV28e4L+ydAoGAItgCUGbot95QNT1z+9QFN+18AvMnWCNvqanrC4qsk0phjYX9FFwfSCqWVeVm0Q0+2tUrRNcUEcbmlbQToBZq/hSu0nPcZIPvnNxLfW/NY7eVCXIcI5eNPjUIgbRCVMc6w5ukYMxPidOBuRXIt1iq2+iV20/FMbA58sY7AgOiaMw=
|
||||
priKeyV2: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDky8v1JlxCfZM0e0p7rkZq/hpa3yHjsF3aJaE5rBt0+x5G7MnHX1AIgi9jJzG3Z8QnEPUVutVClVbRZ3k9hZChlm6T9Miv4IhyvE4kPGJEXRi2q2r7nHyUeGve3TC4jXvELy0muS30BWRyczM/f2x13/uzjxeCM1eMnI5+jxfdg8aaYS2NpCydgObtEvKQRpx6YoF+F7eIF8DNvbYyoRNzM/+NsmquDmgK7Ad1qNK7gqYSmfXHUys7F97Sd/NxfegaiBMapepruUvQSlcQkYXJprM9cBGQuWx/iK8kQ+yYfmOI0OWX8pBwYWut7rR/ritujAdKtIpg14XVxRLnop6dAgMBAAECggEASjJA6TZQcwuQIlPdOrCwi1/uIgv8TH9UYDsVxsMmgFAzaGK/qNUi+i9luKzsNYMEHHsmT66wHBCb//qjWa0n0w8auwaF0mtpNHQWjy+52luqeQqr/f6oc+l9ad+nPiI7wcpexREGcv0QrwDm3K+w96T0Vi2QPRvzR1k56Jb08VN+kpAXb3g7X++il0Ql2lKFM8NySI0utnHAFMH7erJqNc4KeKmr2fJYw23ldBUOxmU6oWEIGwO+KiysfNlmzu3JspYE/eQfKX5aaEKaDbPVGF5Dje5e1SlJ1x9sTAfhOPeh83canoRN61aAI5mEKu04li5LLscBZfW6li2sVVJi7QKBgQD6qPgPc9NOusBvYP02NPdARBswCoafA86QHftPtWpyza67/M2c3X7dd+EnOU1Q+9p2Wj+L64M2KnC1JB+RUrVDBhs4e+yZ3Gly8rD+OUt1kWdJTaK3hJyKAnKtbL9yE90CEwMxLEH0XnYTmC8GhYYXGbOS2ZsqzQJaGUaYel3kTwKBgQDpq5Z00hb8EcPF6l34aL+FL9nAxlASXbYJql/UkD8PdhIkoxezkox/UI5jeF+RXbQ+VfuZQa6HfUrBQOcHTmp9o4cInDqoN/DSjvqV3v8Cnjs/PuF+kxFMDJdYPsjkps4IqR24l8nypPCdPHRjCaRnyfOyc1AteB1jYxDxkUmXUwKBgDOu7V76SeKc3RraC7vGlgiZQmXYdcOJ3GiY1f2scWN0h4fZa2fhv8vYcQNObGO7WmM23o1yJR7hB1ZCOYQUYq2ML8aovrNG4DNEWTxCAg4eygYyTM+8Ny65rH2Xw6247MQFuY3FC2BgrcYChge5NlnDAeTQm47qsIZ1WboM2Rk/AoGBAIuT1kSjtd0OE34mV8lpcHVzNsQi8XN3DKTLY4DKRRDMO1wtG5xFPq1SBiu+nH9tlJvjqm1KQaFnIv868IV5vrybsK5g+9y9xZlQlLhvQq5irAtEWVfNK3jc0I6CumdyiAG+WyWHbbcF9UBG+1KpUM46YNpIbS0r4Yobg+R4H5hHAoGBAOCZOg2VFPiluOPWzIcILb6nYvZyPhZP4pzz7WyzBht2SoHcD70cduCQpcuAXbj5JY59gUfNxURCDxQDNW2x8cQs6Hxme1kVg5kZNJAaclfb7Jx+ZqsYk4ua0NqxOtyfhRmYXVaTVKDFNt8CmwoiKYse4VDC/E3yKgha0UdcE+co
|
||||
## 进件公钥v2
|
||||
pubKeyV2: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7SPkmIUf2auwkgbVchMyfeCDgICuA1GKrSwRbDI24UMVhzDgcIxCUmFG5/DfcPJz0d3oV9Ggkd4/7NmteRvmNnOOGNOnmR6AGEKafDpL1mAdpndmpkAZ0f6OVo3Py5JDg2wt8d+u3dF0AFWwd2rrrqscWvxJVB55DnuZfXl2CyQIDAQAB
|
||||
pubKeyV2: MIGfMA0GCSGqSIb3DQEBAQUAA4GNADCBiQKBgQC7SPkmIUf2auwkgbVchMyfeCDgICuA1GKrSwRbDI24UMVhzDgcIxCUmFG5/DfcPJz0d3oV9Ggkd4/7NmteRvmNnOOGNOnmR6AGEKafDpL1mAdpndmpkAZ0f6OVo3Py5JDg2wt8d+u3dF0AFWwd2rrrqscWvxJVB55DnuZfXl2CyQIDAQAB
|
||||
## 加密密钥
|
||||
encryptPwd: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD2J82Gg79Tk8HZ9Zl7EOeLwvUn41c4ktUg6jveIhYLhT
|
||||
oldPayV2:
|
||||
@@ -49,7 +49,7 @@ ys-extension:
|
||||
## 机构号ID
|
||||
src:
|
||||
## 代理商编号
|
||||
agentNoV2:
|
||||
agentNoV2: 801521000002WJW
|
||||
## 进件私钥v2
|
||||
priKeyV2:
|
||||
## 进件公钥v2
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDYTCCAkmgAwIBAgIJAN+6gZTEG4TPMA0GCSqGSIb3DQEBCwUAMEkxCzAJBgNV
|
||||
BAYTAlVTMREwDwYDVQQIEwhzaGFuZ2hhaTERMA8GA1UEBxMIc2hhbmdoYWkxFDAS
|
||||
BgNVBAMUC2xha2FsYV8yMDIxMB4XDTIxMDYxODA3MjEzNFoXDTMxMDYxOTA3MjEz
|
||||
NFowSTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCHNoYW5naGFpMREwDwYDVQQHEwhz
|
||||
aGFuZ2hhaTEUMBIGA1UEAxQLbGFrYWxhXzIwMjEwggEiMA0GCSqGSIb3DQEBAQUA
|
||||
A4IBDwAwggEKAoIBAQDvDBZyHUDndAGxrIcsCV2njhNO3vCEZotTaWYSYwtDvkcA
|
||||
b1EjsBFabXZaKigpqFXk5XXNI3NIHP9M8XKzIgGvc65NpLAfRjVql8JiTvLyYd1g
|
||||
IUcOXMInabu+oX7dQSI1mS8XzqaoVRhDZQWhXcJW9bxMulgnzvk0Ggw07AjGF7si
|
||||
+hP/Va8SJmN7EJwfQq6TpSxR+WdIHpbWdhZ+NHwitnQwAJTLBFvfk28INM39G7XO
|
||||
sXdVLfsooFdglVTOHpNuRiQAj9gShCCNrpGsNQxDiJIxE43qRsNsRwigyo6DPJk/
|
||||
klgDJa417E2wgP8VrwiXparO4FMzOGK15quuoD7DAgMBAAGjTDBKMAkGA1UdEwQC
|
||||
MAAwEQYJYIZIAYb4QgEBBAQDAgTwMAsGA1UdDwQEAwIFoDAdBgNVHSUEFjAUBggr
|
||||
BgEFBQcDAgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBAI21YYAlH+Pc1ISv
|
||||
nbQrGqL8suGL0Hh/8hGaFfrJEJEKr9OeC8jElUhck2MTmfu/Y1lB7r8RBrhGPXi4
|
||||
kTXmB6ADs/9+ezNW3WXyFj7fhs3JcZ3mo33T9wyQySDKd//JrEtrTsc/s2PZ602y
|
||||
qNmPomXSzjrlugaMyC7LI9sR44mc7sQnchjHoxrQFD5/usTFW72UQfYCORsQWYMt
|
||||
0KKEyAcpRL51RE3xbX1WDtduFYGP62PbwLAn2nCL/j1wlF5hltWj7sditWqKgso5
|
||||
F8BTffn2Bb0RdsNxqwMy1cTPrWLeXVOqMDu3ge7hvoav8lZKTjk5Kmqhs7wNAQXK
|
||||
mg9qSwo=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvDBZyHUDndAGx
|
||||
rIcsCV2njhNO3vCEZotTaWYSYwtDvkcAb1EjsBFabXZaKigpqFXk5XXNI3NIHP9M
|
||||
8XKzIgGvc65NpLAfRjVql8JiTvLyYd1gIUcOXMInabu+oX7dQSI1mS8XzqaoVRhD
|
||||
ZQWhXcJW9bxMulgnzvk0Ggw07AjGF7si+hP/Va8SJmN7EJwfQq6TpSxR+WdIHpbW
|
||||
dhZ+NHwitnQwAJTLBFvfk28INM39G7XOsXdVLfsooFdglVTOHpNuRiQAj9gShCCN
|
||||
rpGsNQxDiJIxE43qRsNsRwigyo6DPJk/klgDJa417E2wgP8VrwiXparO4FMzOGK1
|
||||
5quuoD7DAgMBAAECggEBANhmWOt1EAx3OBFf3f4/fEjylQgRSiqRqg8Ymw6KGuh4
|
||||
mE4Md6eW/B6geUOmZjVP7nIIR1wte28M0REWgn8nid8LGf+v1sB5DmIwgAf+8G/7
|
||||
qCwd8/VMg3aqgQtRp0ckb5OV2Mv0h2pbnltkWHR8LDIMwymyh5uCApbn/aTrCAZK
|
||||
NXcPOyAn9tM8Bu3FHk3Pf24Er3SN+bnGxgpzDrFjsDSHjDFT9UMIc2WdA3tuMv9X
|
||||
3DDn0bRCsHnsIw3WrwY6HQ8mumdbURk+2Ey3eRFfMYxyS96kOgBC2hqZOlDwVPAK
|
||||
TPtS4hoq+cQ0sRaJQ4T0UALJrBVHa+EESgRaTvrXqAECgYEA+WKmy9hcvp6IWZlk
|
||||
9Q1JZ+dgIVxrO65zylK2FnD1/vcTx2JMn73WKtQb6vdvTuk+Ruv9hY9PEsf7S8gH
|
||||
STTmzHOUgo5x0F8yCxXFnfji2juoUnDdpkjtQK5KySDcpQb5kcCJWEVi9v+zObM0
|
||||
Zr1Nu5/NreE8EqUl3+7MtHOu1TMCgYEA9WM9P6m4frHPW7h4gs/GISA9LuOdtjLv
|
||||
AtgCK4cW2mhtGNAMttD8zOBQrRuafcbFAyU9de6nhGwetOhkW9YSV+xRNa7HWTeI
|
||||
RgXJuJBrluq5e1QGTIwZU/GujpNaR4Qiu0B8TodM/FME7htsyxjmCwEfT6SDYlke
|
||||
MzTbMa9Q0DECgYBqsR/2+dvD2YMwAgZFKKgNAdoIq8dcwyfamUQ5mZ5EtGQL2yw4
|
||||
8zibHh/LiIxgUD1Kjk/qQgNsX45NP4iOc0mCkrgomtRqdy+rumbPTNmQ0BEVJCBP
|
||||
scd+8pIgNiTvnWpMRvj7gMP0NDTzLI3wnnCRIq8WAtR2jZ0Ejt+ZHBziLQKBgQDi
|
||||
bEe/zqNmhDuJrpXEXmO7fTv3YB/OVwEj5p1Z/LSho2nHU3Hn3r7lbLYEhUvwctCn
|
||||
Ll2fzC7Wic1rsGOqOcWDS5NDrZpUQGGF+yE/JEOiZcPwgH+vcjaMtp0TAfRzuQEz
|
||||
NzV8YGwxB4mtC7E/ViIuVULHAk4ZGZI8PbFkDxjKgQKBgG8jEuLTI1tsP3kyaF3j
|
||||
Aylnw7SkBc4gfe9knsYlw44YlrDSKr8AOp/zSgwvMYvqT+fygaJ3yf9uIBdrIilq
|
||||
CHKXccZ9uA/bT5JfIi6jbg3EoE9YhB0+1aGAS1O2dBvUiD8tJ+BjAT4OB0UDpmM6
|
||||
QsFLQgFyXgvDnzr/o+hQJelW
|
||||
-----END PRIVATE KEY-----
|
||||
@@ -0,0 +1,16 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import cn.pluss.platform.entity.AccessChannelCipherCode;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
public interface AccessChannelCipherCodeMapper extends BaseMapper<AccessChannelCipherCode> {
|
||||
|
||||
default AccessChannelCipherCode selectAllByOrgId(String orgId) {
|
||||
LambdaQueryWrapper<AccessChannelCipherCode> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(AccessChannelCipherCode::getOrgId, orgId);
|
||||
|
||||
return selectOne(qWrapper);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import cn.pluss.platform.entity.UserProfit;
|
||||
import cn.pluss.platform.vo.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -22,6 +23,14 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
|
||||
@Select("SELECT SUM(mro.refundAmt) refundFee FROM tb_pluss_merchant_order mo LEFT JOIN \n" +
|
||||
"tb_pluss_merchant_refund_order mro ON (mo.orderNumber = mro.orderNumber OR mo.orderNumber = mro.refundNo)\n" +
|
||||
"WHERE mo.snNo = #{snNo} AND mo.`status` = '1' AND mro.`status` = '1' " +
|
||||
"AND mo.merchantCode = #{merchantCode} AND mro.refundTime LIKE CONCAT(#{date}, '%')")
|
||||
BigDecimal selectRefundAmt(@Param("merchantCode") String merchantCode, @Param("snNo") String snNo, @Param("date") String date);
|
||||
|
||||
Page<MerchantOrder> page(IPage<MerchantOrder> page, @Param("map") Map<String, Object> map, @Param("statusList") List<String> statusList);
|
||||
|
||||
/**
|
||||
* 统计一些数值的合计值
|
||||
* @return .
|
||||
@@ -37,43 +46,43 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
Integer queryMerchantOrderPageCount(Map map);
|
||||
|
||||
void saveMerchantOrderBatch(List<MerchantOrder> merchantOrderList);
|
||||
|
||||
|
||||
/**
|
||||
* 可提现总金额(提现规则 超过一个月的时间)推广
|
||||
* @param
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
Double sumMerchantAllowCashMoney(@Param(value = "memberCode") String memberCode);
|
||||
|
||||
|
||||
/**
|
||||
* 不可提现总金额(提现规则 不超过一个月)推广
|
||||
* @param
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
Double sumMerchantNotAllowCashMoney(@Param(value = "memberCode") String memberCode);
|
||||
|
||||
|
||||
/**
|
||||
* 今日分润 推广
|
||||
* @param merchantCode
|
||||
* @return
|
||||
*/
|
||||
Double sumNowDayShareMoney(@Param(value = "memberCode") String merchantCode);
|
||||
|
||||
|
||||
/**
|
||||
* 累计总分润 推广
|
||||
* @return
|
||||
*/
|
||||
Double sumAllShareMoney(@Param(value = "memberCode") String memberCode);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 供 商户推广- 交易明细 接口使用
|
||||
* 供 商户推广- 交易明细 接口使用
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
List<MerchantOrder> queryMerchantOrderPageApp(Map map);
|
||||
|
||||
|
||||
/**
|
||||
* 供 商户推广- 交易明细 接口使用
|
||||
* @param map
|
||||
@@ -82,23 +91,23 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
Integer queryMerchantOrderPageCountApp(Map map);
|
||||
|
||||
Integer queryMerchantOrderPageCountByTime(Map map);
|
||||
|
||||
|
||||
Double queryMerchantOrdeFeeByTime(Map map);
|
||||
|
||||
List<MerchantOrder> queryMerchantOrderPageByTime(Map map);
|
||||
|
||||
|
||||
/**
|
||||
* 汇总流水(manage)
|
||||
*/
|
||||
SummaryOfWaterVO querySummaryOfWater(Map map);
|
||||
|
||||
|
||||
/**
|
||||
* 订单退款信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
List<MerchantOrder> queryMerchantOrderRefundPage(Map map);
|
||||
|
||||
|
||||
/**
|
||||
* 订单退款统计
|
||||
* @param map
|
||||
@@ -107,111 +116,111 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
Integer queryMerchantOrderRefundPageCount(Map map);
|
||||
|
||||
Double queryMerchantOrderShareMoney(Map map);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* queryOrderTask:(给wap端的定时任务使用的 暂定查3天内状态为5待支付的订单). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* queryOrderTask:(给wap端的定时任务使用的 暂定查3天内状态为5待支付的订单). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param merchantOrder
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
List<MerchantOrder> queryOrderTask(MerchantOrder merchantOrder);
|
||||
|
||||
|
||||
/**
|
||||
* 7日交易数统计
|
||||
* @param s
|
||||
* @param s
|
||||
*/
|
||||
List<OrderStatisticsVO> queryOrderStatistics(MerchantOrder s);
|
||||
|
||||
|
||||
/**
|
||||
* 支付通道统计
|
||||
* @param s
|
||||
* @param s
|
||||
*/
|
||||
List<PayTypeStatisticsVO> queryPayTypeStatistics(MerchantOrder s);
|
||||
|
||||
|
||||
|
||||
|
||||
Double queryMerchantOrderEnterFeeByTime(Map map);
|
||||
|
||||
|
||||
Double queryMerchantOrderShareMoneyByTime(Map map);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* queryMerchantOrderPageShuju:(最新统计订单方法). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* queryMerchantOrderPageShuju:(最新统计订单方法). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param map
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
List<MerchantMangeOrderVO> queryMerchantOrderPageShuju(Map<String, Object> map);
|
||||
|
||||
// List<MerchantMangeOrderVO> queryMerchantOrderNoPageShuju(Map<String, Object> map);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* queryMerchantOrderPageCountShuju:(最新统计订单方法). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* queryMerchantOrderPageCountShuju:(最新统计订单方法). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param map
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
Integer queryMerchantOrderPageCountShuju(Map<String, Object> map);
|
||||
|
||||
// Integer queryMerchantOrderNoPageCountShuju(Map<String, Object> map);
|
||||
/**
|
||||
*
|
||||
* querySumEarnings:(统计总的收益 根据时间). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* querySumEarnings:(统计总的收益 根据时间). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param map
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
List<MerchantMangeOrderVO> querySumEarnings(Map<String, Object> map);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* promoterSumCash:(推广员退关分润余额信息统计). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* promoterSumCash:(推广员退关分润余额信息统计). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param userId
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
PromoterSumVO promoterSumCash(@Param(value = "userId") Long userId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* PlatformSum:(统计平台大屏的门店数量 商户数量 交易总额 交易笔数 会员数量 推广员数量 推广分润总额 粉丝奖励总额 收益总计). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @return
|
||||
*
|
||||
* PlatformSum:(统计平台大屏的门店数量 商户数量 交易总额 交易笔数 会员数量 推广员数量 推广分润总额 粉丝奖励总额 收益总计). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
PlatformSumVO PlatformSum(@Param(value = "timeStatus") String timeStatus);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* sumConsumeFeebystoreId:(查询门店的今日流水 跟总流水). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
* sumConsumeFeebystoreId:(查询门店的今日流水 跟总流水). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @param storeId
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
StoreVO sumConsumeFeebystoreId(String storeId);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* sumConsumeFeebystoreId:(查询商户的今日流水 跟总流水). <br/>
|
||||
*
|
||||
*
|
||||
* sumConsumeFeebystoreId:(查询商户的今日流水 跟总流水). <br/>
|
||||
*
|
||||
* @author Administrator
|
||||
* @return
|
||||
* @return
|
||||
* @since JDK 1.8
|
||||
*/
|
||||
StoreVO sumConsumeFeebymerchantCode(String merchantCode);
|
||||
@@ -222,7 +231,7 @@ public interface MerchantOrderMapper extends BaseMapper<MerchantOrder> {
|
||||
* @return
|
||||
*/
|
||||
Double getOrderFeeSum1(Map<String, Object> orderMap);
|
||||
|
||||
|
||||
Double getToDayTransSum1(Map<String, Object> orderMap);
|
||||
|
||||
@Select("SELECT SUM(consumeFee) fee, status FROM tb_pluss_merchant_order ${ew.customSqlSegment}")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.PlussMerchantLklEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface PlussMerchantLklDao extends BaseMapper<PlussMerchantLklEntity> {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
import cn.pluss.platform.entity.TbLklRegionBankInfoEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface TbLklRegionBankInfoDao extends BaseMapper<TbLklRegionBankInfoEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.TbPlussBankBranchLklEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbPlussBankBranchLklMapper extends BaseMapper<TbPlussBankBranchLklEntity> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.TbPlussBankRegionLklEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbPlussBankRegionLklMapper extends BaseMapper<TbPlussBankRegionLklEntity> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.TbPlussBusinessSmallLklEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbPlussBusinessSmallLklDao extends BaseMapper<TbPlussBusinessSmallLklEntity> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.TbPlussRegionLklEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbPlussRegionLklMapper extends BaseMapper<TbPlussRegionLklEntity> {
|
||||
}
|
||||
@@ -31,12 +31,20 @@
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- <select id="selectListWithStockWithNoDetail" resultType="cn.pluss.platform.entity.DeviceDetail">-->
|
||||
<!-- SELECT dd.id, dd.code, dd.venderCode, dd.deviceLogo, dd.venderName, dd.venderModel,-->
|
||||
<!-- dd.aisleModel, dd.type, dd.groupNo, dd.size, dd.seq, dd.status, dd.createDt, dd.unitPrice,-->
|
||||
<!-- dd.wholesalePrice, dd.wholesaleMinNum, dd.introDesc, ds.specName typeDesc-->
|
||||
<!-- FROM tb_pluss_device_detail dd-->
|
||||
<!-- LEFT JOIN tb_pluss_device_spec ds ON dd.type = ds.spec AND dd.`code` = ds.`code`-->
|
||||
<!-- ${ew.customSqlSegment}-->
|
||||
<!-- </select>-->
|
||||
<select id="selectListWithStockWithNoDetail" resultType="cn.pluss.platform.entity.DeviceDetail">
|
||||
SELECT dd.id, dd.code, dd.venderCode, dd.deviceLogo, dd.venderName, dd.venderModel,
|
||||
dd.aisleModel, dd.type, dd.groupNo, dd.size, dd.seq, dd.status, dd.createDt, dd.unitPrice,
|
||||
dd.wholesalePrice, dd.wholesaleMinNum, dd.introDesc, ds.specName typeDesc
|
||||
FROM tb_pluss_device_detail dd
|
||||
LEFT JOIN tb_pluss_device_spec ds ON dd.type = ds.spec AND dd.`code` = ds.`code`
|
||||
LEFT JOIN tb_pluss_device_spec ds ON dd.`code` = ds.`code`
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -15,6 +15,51 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="page" resultType="cn.pluss.platform.entity.MerchantOrder">
|
||||
SELECT
|
||||
IFNULL(mro.orderNumber, mo.orderNumber) orderNumber, mo.merchantCode, mo.merchantName, mo.payTypeCode,
|
||||
mo.thirdTransNo, mo.consumeFee, mo.createDt, mo.transDt, mo.staffCode, mo.staffName, mo.`status`,
|
||||
mo.enterFee, mo.remark, mo.updateTime, mo.rate, mo.mercOrderNo, mo.isRecharge, mo.snNo, mo.cashPlaceId,
|
||||
mo.settlementType, mo.drType, mro.refundAmt, mro.refundTime
|
||||
FROM
|
||||
tb_pluss_merchant_order mo
|
||||
LEFT JOIN tb_pluss_merchant_refund_order mro ON mo.merchantCode = mro.merchantCode
|
||||
AND (mo.orderNumber = mro.orderNumber OR mo.orderNumber = mro.refundNo) AND mo.`status` = '2'
|
||||
<where>
|
||||
<if test="map.merchantCode != null and map.merchantCode != ''">
|
||||
AND mo.merchantCode = #{map.merchantCode}
|
||||
</if>
|
||||
<if test="map.snNo != null and map.snNo != ''">
|
||||
AND mo.snNo = #{map.snNo}
|
||||
</if>
|
||||
<if test="map.createDate != null">
|
||||
AND (
|
||||
(mo.createDate LIKE CONCAT(#{map.createDate}, '%') AND mo.status = '1')
|
||||
OR (mro.refundTime LIKE CONCAT(#{map.createDate}, '%') AND mo.status IN ('2', '6'))
|
||||
)
|
||||
</if>
|
||||
<if test="map.startTime != null">
|
||||
AND (
|
||||
(mo.transTime > #{map.startTime} AND mo.status = '1')
|
||||
OR (mro.refundTime > #{map.startTime} AND mo.status IN ('2', '6'))
|
||||
)
|
||||
</if>
|
||||
<if test="map.endTime != null">
|
||||
AND (
|
||||
(mo.transTime < #{map.endTime} AND mo.status = '1')
|
||||
OR (mro.refundTime < #{map.endTime} AND mo.status IN ('2', '6'))
|
||||
)
|
||||
</if>
|
||||
<if test="statusList != null and statusList.size > 0">
|
||||
AND mo.`status` IN
|
||||
<foreach collection="statusList" item="item" close=")" separator="," open="(">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mo.updateTime
|
||||
</select>
|
||||
|
||||
<select id="queryMerchantOrder"
|
||||
parameterType="cn.pluss.platform.entity.MerchantOrder"
|
||||
resultType="cn.pluss.platform.entity.MerchantOrder">
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
@@ -187,6 +188,7 @@ public class ActivityActivateController extends BaseNoModelController {
|
||||
@RequestMapping(value = "/saveActivityActivate", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveActivityActivate(ActivityActivate activityActivate) {
|
||||
|
||||
Map<String, Object> result = new HashMap<String, Object>(16);
|
||||
// 通过merchantCode查商户信息
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
|
||||
@@ -38,6 +38,7 @@ public class MercOrderDetailController extends BaseModelController<MercOrderDeta
|
||||
@Resource
|
||||
private DeviceTypeMapper deviceTypeMapper;
|
||||
|
||||
|
||||
@GetMapping("/index")
|
||||
public String list(HttpServletRequest request) {
|
||||
List<String> codeList = deviceTypeMapper.selectListCodeByShowFlag();
|
||||
|
||||
@@ -6,9 +6,11 @@ import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.base.BaseModelController;
|
||||
import cn.pluss.platform.device.DeviceGoodTagService;
|
||||
import cn.pluss.platform.device.DeviceSpecService;
|
||||
import cn.pluss.platform.device.DeviceTypeService;
|
||||
import cn.pluss.platform.entity.DeviceGoodTag;
|
||||
import cn.pluss.platform.entity.DeviceGoods;
|
||||
import cn.pluss.platform.entity.DeviceSpec;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import cn.pluss.platform.util.OssOperatUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -20,6 +22,7 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -70,7 +73,8 @@ public class DeviceGoodsController extends BaseModelController<DeviceGoodsServic
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Resource
|
||||
DeviceSpecService deviceSpecService;
|
||||
/**
|
||||
* 数据回显
|
||||
*/
|
||||
@@ -82,6 +86,9 @@ public class DeviceGoodsController extends BaseModelController<DeviceGoodsServic
|
||||
List<DeviceGoodTag> list = deviceGoodTagService.list();
|
||||
model.addAttribute("deviceGoodTagList", list);
|
||||
|
||||
List<DeviceSpec> list1 = deviceSpecService.list();
|
||||
model.addAttribute("list1", list1);
|
||||
|
||||
Map<String, String> uploadParam = OssOperatUtil.getUploadParam();
|
||||
model.addAttribute("uploadParam",uploadParam);
|
||||
if (id != null) {
|
||||
|
||||
@@ -3,7 +3,10 @@ package cn.pluss.platform.controller.home;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.device.DeviceSpecService;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
import cn.pluss.platform.entity.DeviceSpec;
|
||||
import cn.pluss.platform.entity.DeviceType;
|
||||
import cn.pluss.platform.entity.MerchantChannelStatus;
|
||||
import cn.pluss.platform.entity.PlatformData;
|
||||
import cn.pluss.platform.home.HomeService;
|
||||
@@ -17,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -77,11 +81,24 @@ public class HomeController extends BaseNoModelController {
|
||||
BigDecimal yestDayNowTransAmt = merchantOrderService.getPlatformAmtYestNowData(date,yestStartDate,yestEndDate);
|
||||
BigDecimal toDayTransCount = orderData.get("toDayTransCount") == null ? BigDecimal.ZERO :BigDecimal.valueOf((double)orderData.get("toDayTransCount"));
|
||||
BigDecimal subtract = toDayTransCount.subtract(yestDayNowTransAmt);
|
||||
BigDecimal scale = subtract.divide(yestDayNowTransAmt,4,BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
BigDecimal scale;
|
||||
if((BigDecimal.ZERO).compareTo(yestDayNowTransAmt) == 0){
|
||||
scale = new BigDecimal("0.00");
|
||||
}else {
|
||||
scale = subtract.divide(yestDayNowTransAmt,4,BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
result.putAll(orderData);
|
||||
result.putAll(refundData);
|
||||
result.putAll(otherData);
|
||||
result.putAll(amtData);
|
||||
if(amtData == null){
|
||||
HashMap<String, Object> amtDataMap = new HashMap<>(16);
|
||||
amtDataMap.put("toDayProfitCount", 0.00);
|
||||
amtDataMap.put("toDayShareCount", 0.00);
|
||||
amtDataMap.put("toDayFansCount", 0.00);
|
||||
result.putAll(amtDataMap);
|
||||
} else {
|
||||
result.putAll(amtData);
|
||||
}
|
||||
result.putAll(transData);
|
||||
PlatformData yesterDayData = platformDataService.censusPlatformData();
|
||||
result.put("yesterDay",yesterDayData);
|
||||
@@ -121,6 +138,14 @@ public class HomeController extends BaseNoModelController {
|
||||
return ResultGenerator.genSuccessResult("获取成功",result);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||
objectObjectHashMap.put("toDayProfitCount", "0.00");
|
||||
objectObjectHashMap.put("toDayShareCount", "0.00");
|
||||
objectObjectHashMap.put("toDayFansCount", "0.00");
|
||||
System.out.println(objectObjectHashMap);
|
||||
|
||||
}
|
||||
@PostMapping("/logout")
|
||||
@ResponseBody
|
||||
public Map<String, Object> login(HttpServletRequest request) {
|
||||
@@ -145,7 +170,6 @@ public class HomeController extends BaseNoModelController {
|
||||
result.put("loginName", loginName);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/getAuditData")
|
||||
@ResponseBody
|
||||
public Result<Object> getAuditData() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.pluss.platform.annotation.PassToken;
|
||||
import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.channel.MerchantAuditService;
|
||||
import cn.pluss.platform.channel.ys.YSAuditServiceV3;
|
||||
import cn.pluss.platform.common.CommonRemarkService;
|
||||
import cn.pluss.platform.controller.BaseNoModelController;
|
||||
import cn.pluss.platform.entitiy.ShiroUser;
|
||||
@@ -85,6 +86,8 @@ public class MerchantStoreController extends BaseNoModelController {
|
||||
|
||||
@Setter(onMethod_ = {@Autowired, @Qualifier("ysAuditServiceV2")})
|
||||
private MerchantAuditService ysAuditServiceV2;
|
||||
@Resource
|
||||
private YSAuditServiceV3 ysAuditServiceV3;
|
||||
|
||||
|
||||
/**
|
||||
@@ -462,8 +465,8 @@ public class MerchantStoreController extends BaseNoModelController {
|
||||
try {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("userId", ua.getUserId() + "");
|
||||
ysAuditServiceV2.merchantAudit(ua.getUserId() + "", false);
|
||||
// userAppService.merchantAudit(params, "4");
|
||||
//ysAuditServiceV2.merchantAudit(ua.getUserId() + "", false);
|
||||
ysAuditServiceV3.merchantAuditV3(String.valueOf(ua.getUserId()), false); // userAppService.merchantAudit(params, "4");
|
||||
result.put("code", "1");
|
||||
result.put("msg", "发起进件成功, 稍后查看进件状态");
|
||||
return result;
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
spring:
|
||||
# datasource:
|
||||
# druid:
|
||||
# url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
|
||||
# username: root
|
||||
# password: CZGmysqlroot@123
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
datasource:
|
||||
druid:
|
||||
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: CZGmysqlroot@123
|
||||
password: prodCZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
logging:
|
||||
config: classpath:log4j2-dev.xml
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
spring:
|
||||
# datasource:
|
||||
# druid:
|
||||
# url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
|
||||
# username: root
|
||||
# password: prodCZGmysqlroot@123
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
datasource:
|
||||
druid:
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: prodCZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: prodCZGmysqlroot@123
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
|
||||
scheduling:
|
||||
enabled: true
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
<option value="3" <c:if test="${agreement.discern == 3}">selected</c:if>>隐私协议</option>
|
||||
<option value="5" <c:if test="${agreement.discern == 5}">selected</c:if>>应用权限说明</option>
|
||||
<option value="6" <c:if test="${agreement.discern == 6}">selected</c:if>>第三方SDK说明</option>
|
||||
</select>
|
||||
<option value="7" <c:if test="${agreement.discern == 7}">selected</c:if>>会员协议</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="layui-form-item">--%>
|
||||
<%-- <div class="layui-inline">--%>
|
||||
<%-- <label class="layui-form-label">规格选择:</label>--%>
|
||||
|
||||
<%-- <div class="layui-input-inline">--%>
|
||||
<%-- <select lay-filter="typeSelect1" id="typeSelect1" class="layui-select" autocomplete="off">--%>
|
||||
<%-- <option value="">请选择</option>--%>
|
||||
<%-- <c:forEach items="${list1}" var="item">--%>
|
||||
<%--<%– <option value="${dict.code}" ${dict.code == entity.code ? 'selected' : ''}>${dict.name}</option>–%>--%>
|
||||
<%-- <option value="${item.id}" ${item.id == entity.id ? 'selected' : ''}>${item.specName}</option>--%>
|
||||
<%-- </c:forEach>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="layui-form-mid layui-word-aux">--%>
|
||||
<%-- <span style="color: red">* 若需添加规格的商品,可以在编码和名称中自定义</span>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">分类标签:</label>
|
||||
<div class="layui-input-inline">
|
||||
@@ -328,6 +349,17 @@
|
||||
} else {
|
||||
$("input[name = 'codeName']").val("");
|
||||
}
|
||||
});
|
||||
form.on("select(typeSelect1)", function(data) {
|
||||
console.log("aaaaa");
|
||||
console.log(data.othis);
|
||||
console.log(data.value);
|
||||
$("input[name = 'code']").val(data.value);
|
||||
if (data.value != "") {
|
||||
$("input[name = 'codeName']").val(data.elem[data.elem.selectedIndex].text);
|
||||
} else {
|
||||
$("input[name = 'codeName']").val("");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public class DeviceMerchantBuyDTO {
|
||||
|
||||
public Map<String, String> convert(String orderNo) {
|
||||
Map<String, String> result = new HashMap<String, String>(16);
|
||||
result.put("body", "收银呗商品订单支付");
|
||||
result.put("subject", "收银呗商品订单支付");
|
||||
result.put("body", "快银收银商品订单支付");
|
||||
result.put("subject", "快银收银商品订单支付");
|
||||
result.put("outTradeNo", orderNo);
|
||||
result.put("totalAmount", orderAmount + "");
|
||||
return result;
|
||||
|
||||
@@ -88,6 +88,7 @@ public class MerChantOrderDTO {
|
||||
|
||||
|
||||
private MerchantMemberCode mercMenberCode;
|
||||
private String MercOrderNo;
|
||||
|
||||
/**
|
||||
* 参数转换
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* CREATE TABLE `tb_pluss_access_channel_cipher_code` (
|
||||
* `id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
* `orgId` varchar(50) DEFAULT NULL COMMENT '机构号id',
|
||||
* `priKey` longtext COMMENT '私钥,用于返回(回调)数据签名;以及渠道数据解密',
|
||||
* `pubKey` longtext COMMENT '公钥加密,给到渠道接口数据加密',
|
||||
* `orgPubKey` longtext COMMENT '机构公钥',
|
||||
* `orgPriKey` longtext COMMENT '机构私钥,测试使用字段',
|
||||
* `createTime` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
* PRIMARY KEY (`id`) USING BTREE,
|
||||
* KEY `uniq` (`orgId`) USING BTREE
|
||||
* ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='接入渠道秘钥表';
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class AccessChannelCipherCode {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 平台私钥
|
||||
*/
|
||||
private String priKey;
|
||||
|
||||
/**
|
||||
* 平台公钥
|
||||
*/
|
||||
private String pubKey;
|
||||
|
||||
/**
|
||||
* 机构公钥
|
||||
*/
|
||||
private String orgPubKey;
|
||||
|
||||
/**
|
||||
* 机构私钥
|
||||
*/
|
||||
private String orgPriKey;
|
||||
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -225,6 +225,8 @@ public class MerchantOrder {
|
||||
*/
|
||||
private BigDecimal mercFee;
|
||||
|
||||
private String thirdSendNo;
|
||||
|
||||
/**
|
||||
* 节约金额
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@TableName("tb_pluss_merchant_lkl")
|
||||
@Data
|
||||
public class PlussMerchantLklEntity {
|
||||
@TableField("merchantId")
|
||||
private String merchantId;
|
||||
@TableField("merchantlkl")
|
||||
private String merchantlkl;
|
||||
@TableField("type")
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@TableName("tb_lkl_region_bank_info")
|
||||
@Data
|
||||
public class TbLklRegionBankInfoEntity {
|
||||
@TableField("s_code")
|
||||
private String sCode;
|
||||
@TableField("s_name")
|
||||
private String sName;
|
||||
@TableField("r_code")
|
||||
private String rCode;
|
||||
@TableField("r_name")
|
||||
private String rName;
|
||||
@TableField("clear_no")
|
||||
private String clearNo;
|
||||
@TableField("area_code")
|
||||
private String areaCode;
|
||||
@TableField("branch_bank_no")
|
||||
private String branchBankNo;
|
||||
@TableField("branch_bank_name")
|
||||
private String branchBankName;
|
||||
@TableField("bank_no")
|
||||
private String bankNo;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("tb_pluss_bank_branch_lkl")
|
||||
public class TbPlussBankBranchLklEntity {
|
||||
@TableField("id")
|
||||
private String id;
|
||||
@TableField("create_time")
|
||||
private String createTime;
|
||||
@TableField("optimistic")
|
||||
private String optimistic;
|
||||
@TableField("update_time")
|
||||
private String updateTime;
|
||||
@TableField("area_code")
|
||||
private String areaCode;
|
||||
@TableField("bank_no")
|
||||
private String bankNo;
|
||||
@TableField("branch_bank_name")
|
||||
private String branchBankName;
|
||||
@TableField("branch_bank_no")
|
||||
private String branchBankNo;
|
||||
@TableField("clear_no")
|
||||
private String clearNo;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("tb_pluss_bank_region_lkl")
|
||||
public class TbPlussBankRegionLklEntity {
|
||||
@TableField("id")
|
||||
private String id;
|
||||
@TableField("create_time")
|
||||
private String createTime;
|
||||
@TableField("optimistic")
|
||||
private String optimistic;
|
||||
@TableField("update_time")
|
||||
private String updateTime;
|
||||
@TableField("code")
|
||||
private String code;
|
||||
@TableField("name")
|
||||
private String name;
|
||||
@TableField("parent_code")
|
||||
private String parentCode;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@TableName("tb_pluss_business_small_lkl")
|
||||
@Data
|
||||
public class TbPlussBusinessSmallLklEntity {
|
||||
@TableField("id")
|
||||
private String id;
|
||||
@TableField("create_time")
|
||||
private String createTime;
|
||||
@TableField("optimistic")
|
||||
private String optimistic;
|
||||
@TableField("update_time")
|
||||
private String updateTime;
|
||||
@TableField("code")
|
||||
private String code;
|
||||
@TableField("name")
|
||||
private String name;
|
||||
@TableField("parent_code")
|
||||
private String parentCode;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("tb_pluss_region_lkl")
|
||||
public class TbPlussRegionLklEntity {
|
||||
@TableField("id")
|
||||
private String id;
|
||||
@TableField("create_time")
|
||||
private String createTime;
|
||||
@TableField("optimistic")
|
||||
private String optimistic;
|
||||
@TableField("update_time")
|
||||
private String updateTime;
|
||||
@TableField("code")
|
||||
private String code;
|
||||
@TableField("name")
|
||||
private String name;
|
||||
@TableField("parent_code")
|
||||
private String parentCode;
|
||||
}
|
||||
@@ -13,8 +13,9 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum LogisticProvider {
|
||||
|
||||
YTO("YTO","圆通快递");
|
||||
|
||||
YTO("YTO","圆通快递"),
|
||||
STO("STO", "申通快递"),
|
||||
HTKY("HTKY", "百世快递");
|
||||
private String code;
|
||||
|
||||
private String desc;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DeviceOperateInfoVO extends DeviceOperateInfo {
|
||||
public String getDesc() {
|
||||
String type = this.getType();
|
||||
if(DeviceOperateType.IN.getCode().equals(type)){
|
||||
this.desc = "收银呗设备入库";
|
||||
this.desc = "快银收银设备入库";
|
||||
}
|
||||
if(DeviceOperateType.TRANSFER.getCode().equals(type)){
|
||||
this.desc = this.getRemark();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DeviceTransferVO extends DeviceTransfer {
|
||||
|
||||
public String getUserName() {
|
||||
if(StringUtil.isEmpty(this.userName)){
|
||||
this.userName = "收银呗";
|
||||
this.userName = "快银收银";
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.pluss.platform.vo;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class MerchantOrderPosVO {
|
||||
/**
|
||||
* sxfPay0 支付宝支付, sxfPay1 微信支付
|
||||
*/
|
||||
private String payTypeCode;
|
||||
/**
|
||||
* 消费金额
|
||||
*/
|
||||
private Double consumeFee;
|
||||
/**
|
||||
* 交易状态 0:交易失败 1:交易成功 2:退款成功 3:退款失败 4:退款中 5:待付款 6部分退款 7:待确认
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.dto.BankInfoDTO;
|
||||
import cn.pluss.platform.entity.BankCard;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:25+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class BankCardConverterImpl implements BankCardConverter {
|
||||
|
||||
@Override
|
||||
public BankCard dto2Domain(BankInfoDTO bankInfoDTO) {
|
||||
if ( bankInfoDTO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BankCard bankCard = new BankCard();
|
||||
|
||||
bankCard.setUserId( bankInfoDTO.getUserId() );
|
||||
bankCard.setBankCardNo( bankInfoDTO.getBankCardNo() );
|
||||
bankCard.setBankName( bankInfoDTO.getBankName() );
|
||||
bankCard.setBranchName( bankInfoDTO.getBranchName() );
|
||||
bankCard.setAccountType( bankInfoDTO.getAccountType() );
|
||||
bankCard.setContactLine( bankInfoDTO.getContactLine() );
|
||||
bankCard.setBranchProvince( bankInfoDTO.getBranchProvince() );
|
||||
bankCard.setBranchCity( bankInfoDTO.getBranchCity() );
|
||||
bankCard.setBranchArea( bankInfoDTO.getBranchArea() );
|
||||
bankCard.setBankAddressNo( bankInfoDTO.getBankAddressNo() );
|
||||
bankCard.setPhone( bankInfoDTO.getPhone() );
|
||||
bankCard.setImgUrl( bankInfoDTO.getImgUrl() );
|
||||
|
||||
return bankCard;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.entity.MerchantImage;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:25+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class ImgConverterImpl implements ImgConverter {
|
||||
|
||||
@Override
|
||||
public MerchantImage imgCopy(MerchantImage merchantImage) {
|
||||
if ( merchantImage == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantImage merchantImage1 = new MerchantImage();
|
||||
|
||||
merchantImage1.setId( merchantImage.getId() );
|
||||
merchantImage1.setMerchantCode( merchantImage.getMerchantCode() );
|
||||
merchantImage1.setPhotoType( merchantImage.getPhotoType() );
|
||||
merchantImage1.setPhotoUrl( merchantImage.getPhotoUrl() );
|
||||
merchantImage1.setPicUrl( merchantImage.getPicUrl() );
|
||||
merchantImage1.setPicUrl1( merchantImage.getPicUrl1() );
|
||||
merchantImage1.setPicUrl2( merchantImage.getPicUrl2() );
|
||||
merchantImage1.setPicUrl3( merchantImage.getPicUrl3() );
|
||||
merchantImage1.setPicUrl6( merchantImage.getPicUrl6() );
|
||||
merchantImage1.setPicUrl7( merchantImage.getPicUrl7() );
|
||||
merchantImage1.setPicUrl8( merchantImage.getPicUrl8() );
|
||||
merchantImage1.setPicUrl9( merchantImage.getPicUrl9() );
|
||||
merchantImage1.setPicUrl999( merchantImage.getPicUrl999() );
|
||||
merchantImage1.setPicUrl101( merchantImage.getPicUrl101() );
|
||||
merchantImage1.setPicUrl102( merchantImage.getPicUrl102() );
|
||||
merchantImage1.setPicUrl11( merchantImage.getPicUrl11() );
|
||||
merchantImage1.setCreateDt( merchantImage.getCreateDt() );
|
||||
merchantImage1.setUpdateDt( merchantImage.getUpdateDt() );
|
||||
merchantImage1.setAisleSwitch( merchantImage.getAisleSwitch() );
|
||||
|
||||
return merchantImage1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.dto.MerchantBaseInfoDTO;
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.vo.MerchantBaseInfoVO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:26+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class MerchantBaseInfoConverterImpl implements MerchantBaseInfoConverter {
|
||||
|
||||
@Override
|
||||
public MerchantBaseInfoDTO domain2dto(MerchantBaseInfo entity) {
|
||||
if ( entity == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantBaseInfoDTO merchantBaseInfoDTO = new MerchantBaseInfoDTO();
|
||||
|
||||
merchantBaseInfoDTO.setId( entity.getId() );
|
||||
merchantBaseInfoDTO.setUserId( entity.getUserId() );
|
||||
merchantBaseInfoDTO.setMerchantName( entity.getMerchantName() );
|
||||
merchantBaseInfoDTO.setMerchantType( entity.getMerchantType() );
|
||||
merchantBaseInfoDTO.setAlias( entity.getAlias() );
|
||||
merchantBaseInfoDTO.setMcc( entity.getMcc() );
|
||||
merchantBaseInfoDTO.setMccName( entity.getMccName() );
|
||||
merchantBaseInfoDTO.setAliAccount( entity.getAliAccount() );
|
||||
merchantBaseInfoDTO.setProductDesc( entity.getProductDesc() );
|
||||
merchantBaseInfoDTO.setAddressNo( entity.getAddressNo() );
|
||||
merchantBaseInfoDTO.setMerchantAddress( entity.getMerchantAddress() );
|
||||
merchantBaseInfoDTO.setAddress( entity.getAddress() );
|
||||
merchantBaseInfoDTO.setContactMobile( entity.getContactMobile() );
|
||||
merchantBaseInfoDTO.setContactName( entity.getContactName() );
|
||||
merchantBaseInfoDTO.setEmail( entity.getEmail() );
|
||||
merchantBaseInfoDTO.setStoreHeadPic( entity.getStoreHeadPic() );
|
||||
merchantBaseInfoDTO.setStoreInsidePic( entity.getStoreInsidePic() );
|
||||
merchantBaseInfoDTO.setCashPic( entity.getCashPic() );
|
||||
merchantBaseInfoDTO.setUserPhone( entity.getUserPhone() );
|
||||
|
||||
return merchantBaseInfoDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantBaseInfoVO domain2VO(MerchantBaseInfo entity) {
|
||||
if ( entity == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantBaseInfoVO merchantBaseInfoVO = new MerchantBaseInfoVO();
|
||||
|
||||
merchantBaseInfoVO.setId( entity.getId() );
|
||||
merchantBaseInfoVO.setBindingCode( entity.getBindingCode() );
|
||||
merchantBaseInfoVO.setUserId( entity.getUserId() );
|
||||
merchantBaseInfoVO.setAliAccount( entity.getAliAccount() );
|
||||
merchantBaseInfoVO.setMerchantCode( entity.getMerchantCode() );
|
||||
merchantBaseInfoVO.setMerchantName( entity.getMerchantName() );
|
||||
merchantBaseInfoVO.setMerchantType( entity.getMerchantType() );
|
||||
merchantBaseInfoVO.setProductDesc( entity.getProductDesc() );
|
||||
merchantBaseInfoVO.setAliMcc( entity.getAliMcc() );
|
||||
merchantBaseInfoVO.setMcc( entity.getMcc() );
|
||||
merchantBaseInfoVO.setMccName( entity.getMccName() );
|
||||
merchantBaseInfoVO.setAlias( entity.getAlias() );
|
||||
merchantBaseInfoVO.setContactMobile( entity.getContactMobile() );
|
||||
merchantBaseInfoVO.setContactName( entity.getContactName() );
|
||||
merchantBaseInfoVO.setAddressNo( entity.getAddressNo() );
|
||||
merchantBaseInfoVO.setProvince( entity.getProvince() );
|
||||
merchantBaseInfoVO.setCity( entity.getCity() );
|
||||
merchantBaseInfoVO.setDistrict( entity.getDistrict() );
|
||||
merchantBaseInfoVO.setAddress( entity.getAddress() );
|
||||
merchantBaseInfoVO.setEmail( entity.getEmail() );
|
||||
merchantBaseInfoVO.setPrincipalMobile( entity.getPrincipalMobile() );
|
||||
merchantBaseInfoVO.setPrincipalCertType( entity.getPrincipalCertType() );
|
||||
merchantBaseInfoVO.setPrincipalCertNo( entity.getPrincipalCertNo() );
|
||||
merchantBaseInfoVO.setPrincipalPerson( entity.getPrincipalPerson() );
|
||||
merchantBaseInfoVO.setBussAuthName( entity.getBussAuthName() );
|
||||
merchantBaseInfoVO.setBussAuthNum( entity.getBussAuthNum() );
|
||||
merchantBaseInfoVO.setBussAuthAddress( entity.getBussAuthAddress() );
|
||||
merchantBaseInfoVO.setBussAuthStartTime( entity.getBussAuthStartTime() );
|
||||
merchantBaseInfoVO.setBussAuthEndTime( entity.getBussAuthEndTime() );
|
||||
merchantBaseInfoVO.setAllowBankLarge( entity.getAllowBankLarge() );
|
||||
merchantBaseInfoVO.setWxCertStatus( entity.getWxCertStatus() );
|
||||
merchantBaseInfoVO.setCreateDt( entity.getCreateDt() );
|
||||
merchantBaseInfoVO.setUpdateDt( entity.getUpdateDt() );
|
||||
merchantBaseInfoVO.setBuslicType( entity.getBuslicType() );
|
||||
merchantBaseInfoVO.setIsVoice( entity.getIsVoice() );
|
||||
merchantBaseInfoVO.setIsPushWxMessage( entity.getIsPushWxMessage() );
|
||||
merchantBaseInfoVO.setIsUnionPay( entity.getIsUnionPay() );
|
||||
merchantBaseInfoVO.setMd5Key( entity.getMd5Key() );
|
||||
merchantBaseInfoVO.setLimitPay( entity.getLimitPay() );
|
||||
merchantBaseInfoVO.setSubAppId( entity.getSubAppId() );
|
||||
merchantBaseInfoVO.setAppid( entity.getAppid() );
|
||||
merchantBaseInfoVO.setStatus( entity.getStatus() );
|
||||
merchantBaseInfoVO.setMerchantAddress( entity.getMerchantAddress() );
|
||||
merchantBaseInfoVO.setStoreHeadPic( entity.getStoreHeadPic() );
|
||||
merchantBaseInfoVO.setStoreInsidePic( entity.getStoreInsidePic() );
|
||||
merchantBaseInfoVO.setCashPic( entity.getCashPic() );
|
||||
merchantBaseInfoVO.setLiteralPic( entity.getLiteralPic() );
|
||||
merchantBaseInfoVO.setWarrantyPic( entity.getWarrantyPic() );
|
||||
merchantBaseInfoVO.setDealPic( entity.getDealPic() );
|
||||
merchantBaseInfoVO.setAffilatePic( entity.getAffilatePic() );
|
||||
merchantBaseInfoVO.setHandPic( entity.getHandPic() );
|
||||
merchantBaseInfoVO.setMerchantAuditStatus( entity.getMerchantAuditStatus() );
|
||||
merchantBaseInfoVO.setStartTime( entity.getStartTime() );
|
||||
merchantBaseInfoVO.setEndTime( entity.getEndTime() );
|
||||
merchantBaseInfoVO.setImgUrl( entity.getImgUrl() );
|
||||
merchantBaseInfoVO.setLoginName( entity.getLoginName() );
|
||||
merchantBaseInfoVO.setPassword( entity.getPassword() );
|
||||
merchantBaseInfoVO.setLogo( entity.getLogo() );
|
||||
merchantBaseInfoVO.setUserPhone( entity.getUserPhone() );
|
||||
merchantBaseInfoVO.setUserName( entity.getUserName() );
|
||||
merchantBaseInfoVO.setBusinessLicensePic( entity.getBusinessLicensePic() );
|
||||
merchantBaseInfoVO.setLocation( entity.getLocation() );
|
||||
merchantBaseInfoVO.setFirstTradeTime( entity.getFirstTradeTime() );
|
||||
merchantBaseInfoVO.setLastTradeTime( entity.getLastTradeTime() );
|
||||
merchantBaseInfoVO.setSplitFlag( entity.getSplitFlag() );
|
||||
merchantBaseInfoVO.setValidFlag( entity.getValidFlag() );
|
||||
|
||||
return merchantBaseInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantBaseInfo vo2domain(MerchantBaseInfoVO entity) {
|
||||
if ( entity == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
|
||||
merchantBaseInfo.setId( entity.getId() );
|
||||
merchantBaseInfo.setBindingCode( entity.getBindingCode() );
|
||||
merchantBaseInfo.setUserId( entity.getUserId() );
|
||||
merchantBaseInfo.setAliAccount( entity.getAliAccount() );
|
||||
merchantBaseInfo.setMerchantCode( entity.getMerchantCode() );
|
||||
merchantBaseInfo.setMerchantName( entity.getMerchantName() );
|
||||
merchantBaseInfo.setMerchantType( entity.getMerchantType() );
|
||||
merchantBaseInfo.setProductDesc( entity.getProductDesc() );
|
||||
merchantBaseInfo.setAliMcc( entity.getAliMcc() );
|
||||
merchantBaseInfo.setMcc( entity.getMcc() );
|
||||
merchantBaseInfo.setMccName( entity.getMccName() );
|
||||
merchantBaseInfo.setAlias( entity.getAlias() );
|
||||
merchantBaseInfo.setContactMobile( entity.getContactMobile() );
|
||||
merchantBaseInfo.setContactName( entity.getContactName() );
|
||||
merchantBaseInfo.setAddressNo( entity.getAddressNo() );
|
||||
merchantBaseInfo.setProvince( entity.getProvince() );
|
||||
merchantBaseInfo.setCity( entity.getCity() );
|
||||
merchantBaseInfo.setDistrict( entity.getDistrict() );
|
||||
merchantBaseInfo.setAddress( entity.getAddress() );
|
||||
merchantBaseInfo.setEmail( entity.getEmail() );
|
||||
merchantBaseInfo.setPrincipalMobile( entity.getPrincipalMobile() );
|
||||
merchantBaseInfo.setPrincipalCertType( entity.getPrincipalCertType() );
|
||||
merchantBaseInfo.setPrincipalCertNo( entity.getPrincipalCertNo() );
|
||||
merchantBaseInfo.setPrincipalPerson( entity.getPrincipalPerson() );
|
||||
merchantBaseInfo.setBussAuthName( entity.getBussAuthName() );
|
||||
merchantBaseInfo.setBussAuthNum( entity.getBussAuthNum() );
|
||||
merchantBaseInfo.setBussAuthAddress( entity.getBussAuthAddress() );
|
||||
merchantBaseInfo.setBussAuthStartTime( entity.getBussAuthStartTime() );
|
||||
merchantBaseInfo.setBussAuthEndTime( entity.getBussAuthEndTime() );
|
||||
merchantBaseInfo.setAllowBankLarge( entity.getAllowBankLarge() );
|
||||
merchantBaseInfo.setWxCertStatus( entity.getWxCertStatus() );
|
||||
merchantBaseInfo.setCreateDt( entity.getCreateDt() );
|
||||
merchantBaseInfo.setUpdateDt( entity.getUpdateDt() );
|
||||
merchantBaseInfo.setBuslicType( entity.getBuslicType() );
|
||||
merchantBaseInfo.setIsVoice( entity.getIsVoice() );
|
||||
merchantBaseInfo.setIsPushWxMessage( entity.getIsPushWxMessage() );
|
||||
merchantBaseInfo.setIsUnionPay( entity.getIsUnionPay() );
|
||||
merchantBaseInfo.setMd5Key( entity.getMd5Key() );
|
||||
merchantBaseInfo.setLimitPay( entity.getLimitPay() );
|
||||
merchantBaseInfo.setSubAppId( entity.getSubAppId() );
|
||||
merchantBaseInfo.setAppid( entity.getAppid() );
|
||||
merchantBaseInfo.setStatus( entity.getStatus() );
|
||||
merchantBaseInfo.setMerchantAddress( entity.getMerchantAddress() );
|
||||
merchantBaseInfo.setStoreHeadPic( entity.getStoreHeadPic() );
|
||||
merchantBaseInfo.setStoreInsidePic( entity.getStoreInsidePic() );
|
||||
merchantBaseInfo.setCashPic( entity.getCashPic() );
|
||||
merchantBaseInfo.setLiteralPic( entity.getLiteralPic() );
|
||||
merchantBaseInfo.setWarrantyPic( entity.getWarrantyPic() );
|
||||
merchantBaseInfo.setDealPic( entity.getDealPic() );
|
||||
merchantBaseInfo.setAffilatePic( entity.getAffilatePic() );
|
||||
merchantBaseInfo.setHandPic( entity.getHandPic() );
|
||||
merchantBaseInfo.setMerchantAuditStatus( entity.getMerchantAuditStatus() );
|
||||
merchantBaseInfo.setStartTime( entity.getStartTime() );
|
||||
merchantBaseInfo.setEndTime( entity.getEndTime() );
|
||||
merchantBaseInfo.setImgUrl( entity.getImgUrl() );
|
||||
merchantBaseInfo.setLoginName( entity.getLoginName() );
|
||||
merchantBaseInfo.setPassword( entity.getPassword() );
|
||||
merchantBaseInfo.setLogo( entity.getLogo() );
|
||||
merchantBaseInfo.setUserPhone( entity.getUserPhone() );
|
||||
merchantBaseInfo.setUserName( entity.getUserName() );
|
||||
merchantBaseInfo.setBusinessLicensePic( entity.getBusinessLicensePic() );
|
||||
merchantBaseInfo.setLocation( entity.getLocation() );
|
||||
merchantBaseInfo.setFirstTradeTime( entity.getFirstTradeTime() );
|
||||
merchantBaseInfo.setLastTradeTime( entity.getLastTradeTime() );
|
||||
merchantBaseInfo.setSplitFlag( entity.getSplitFlag() );
|
||||
merchantBaseInfo.setValidFlag( entity.getValidFlag() );
|
||||
|
||||
return merchantBaseInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantBaseInfo dto2Domain(MerchantBaseInfoDTO dto) {
|
||||
if ( dto == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
|
||||
|
||||
merchantBaseInfo.setId( dto.getId() );
|
||||
merchantBaseInfo.setUserId( dto.getUserId() );
|
||||
merchantBaseInfo.setAliAccount( dto.getAliAccount() );
|
||||
merchantBaseInfo.setMerchantName( dto.getMerchantName() );
|
||||
merchantBaseInfo.setMerchantType( dto.getMerchantType() );
|
||||
merchantBaseInfo.setProductDesc( dto.getProductDesc() );
|
||||
merchantBaseInfo.setMcc( dto.getMcc() );
|
||||
merchantBaseInfo.setMccName( dto.getMccName() );
|
||||
merchantBaseInfo.setAlias( dto.getAlias() );
|
||||
merchantBaseInfo.setContactMobile( dto.getContactMobile() );
|
||||
merchantBaseInfo.setContactName( dto.getContactName() );
|
||||
merchantBaseInfo.setAddressNo( dto.getAddressNo() );
|
||||
merchantBaseInfo.setAddress( dto.getAddress() );
|
||||
merchantBaseInfo.setEmail( dto.getEmail() );
|
||||
merchantBaseInfo.setMerchantAddress( dto.getMerchantAddress() );
|
||||
merchantBaseInfo.setStoreHeadPic( dto.getStoreHeadPic() );
|
||||
merchantBaseInfo.setStoreInsidePic( dto.getStoreInsidePic() );
|
||||
merchantBaseInfo.setCashPic( dto.getCashPic() );
|
||||
merchantBaseInfo.setUserPhone( dto.getUserPhone() );
|
||||
|
||||
return merchantBaseInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantStore baseInfo2StoreInfo(MerchantBaseInfo entity) {
|
||||
if ( entity == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
|
||||
merchantStore.setStoreName( entity.getAlias() );
|
||||
merchantStore.setMerchantName( entity.getAlias() );
|
||||
if ( entity.getId() != null ) {
|
||||
merchantStore.setId( entity.getId().intValue() );
|
||||
}
|
||||
merchantStore.setMerchantCode( entity.getMerchantCode() );
|
||||
merchantStore.setCreateDt( entity.getCreateDt() );
|
||||
merchantStore.setStatus( entity.getStatus() );
|
||||
merchantStore.setEmail( entity.getEmail() );
|
||||
merchantStore.setStoreHeadPic( entity.getStoreHeadPic() );
|
||||
merchantStore.setStoreInsidePic( entity.getStoreInsidePic() );
|
||||
merchantStore.setCashPic( entity.getCashPic() );
|
||||
merchantStore.setProductDesc( entity.getProductDesc() );
|
||||
merchantStore.setMerchantType( entity.getMerchantType() );
|
||||
merchantStore.setStartTime( entity.getStartTime() );
|
||||
merchantStore.setEndTime( entity.getEndTime() );
|
||||
merchantStore.setAlias( entity.getAlias() );
|
||||
|
||||
return merchantStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApp baseInfo2UserApp(MerchantBaseInfo entity) {
|
||||
if ( entity == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UserApp userApp = new UserApp();
|
||||
|
||||
userApp.setId( entity.getId() );
|
||||
userApp.setLoginName( entity.getLoginName() );
|
||||
if ( entity.getUserId() != null ) {
|
||||
userApp.setUserId( Long.parseLong( entity.getUserId() ) );
|
||||
}
|
||||
userApp.setUserName( entity.getUserName() );
|
||||
userApp.setLogo( entity.getLogo() );
|
||||
userApp.setCreateDt( entity.getCreateDt() );
|
||||
userApp.setUpdateDt( entity.getUpdateDt() );
|
||||
if ( entity.getStatus() != null ) {
|
||||
userApp.setStatus( Integer.parseInt( entity.getStatus() ) );
|
||||
}
|
||||
userApp.setMerchantCode( entity.getMerchantCode() );
|
||||
userApp.setMerchantName( entity.getMerchantName() );
|
||||
userApp.setContactName( entity.getContactName() );
|
||||
userApp.setProductDesc( entity.getProductDesc() );
|
||||
userApp.setBussAuthNum( entity.getBussAuthNum() );
|
||||
userApp.setIsVoice( entity.getIsVoice() );
|
||||
userApp.setIsUnionPay( entity.getIsUnionPay() );
|
||||
userApp.setPassword( entity.getPassword() );
|
||||
userApp.setMerchantType( entity.getMerchantType() );
|
||||
userApp.setAlias( entity.getAlias() );
|
||||
userApp.setMerchantAuditStatus( entity.getMerchantAuditStatus() );
|
||||
|
||||
return userApp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MerchantBaseInfoDTO> domain2dto(List<MerchantBaseInfo> entityList) {
|
||||
if ( entityList == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<MerchantBaseInfoDTO> list = new ArrayList<MerchantBaseInfoDTO>( entityList.size() );
|
||||
for ( MerchantBaseInfo merchantBaseInfo : entityList ) {
|
||||
list.add( domain2dto( merchantBaseInfo ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.entity.MerchantCashPlace;
|
||||
import cn.pluss.platform.vo.MerchantCashPlaceVO;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:25+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class MerchantCashPlaceConverterImpl implements MerchantCashPlaceConverter {
|
||||
|
||||
@Override
|
||||
public MerchantCashPlaceVO entity2VO(MerchantCashPlace merchantCashPlace) {
|
||||
if ( merchantCashPlace == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MerchantCashPlaceVO merchantCashPlaceVO = new MerchantCashPlaceVO();
|
||||
|
||||
merchantCashPlaceVO.setId( merchantCashPlace.getId() );
|
||||
merchantCashPlaceVO.setUserId( merchantCashPlace.getUserId() );
|
||||
merchantCashPlaceVO.setName( merchantCashPlace.getName() );
|
||||
merchantCashPlaceVO.setCode( merchantCashPlace.getCode() );
|
||||
merchantCashPlaceVO.setAddress( merchantCashPlace.getAddress() );
|
||||
merchantCashPlaceVO.setRemark( merchantCashPlace.getRemark() );
|
||||
merchantCashPlaceVO.setCreateTime( merchantCashPlace.getCreateTime() );
|
||||
merchantCashPlaceVO.setUpdateTime( merchantCashPlace.getUpdateTime() );
|
||||
|
||||
return merchantCashPlaceVO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.dto.MerchantStaffDTO;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:25+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class MerchantStaffConverterImpl implements MerchantStaffConverter {
|
||||
|
||||
@Override
|
||||
public UserInfo toUserInfo(MerchantStaffDTO merchantStaffDTO) {
|
||||
if ( merchantStaffDTO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UserInfo userInfo = new UserInfo();
|
||||
|
||||
userInfo.setId( merchantStaffDTO.getUserId() );
|
||||
userInfo.setLoginName( merchantStaffDTO.getLoginName() );
|
||||
userInfo.setPhone( merchantStaffDTO.getPhone() );
|
||||
userInfo.setPassword( merchantStaffDTO.getPassword() );
|
||||
userInfo.setMerchantCode( merchantStaffDTO.getMerchantCode() );
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package cn.pluss.platform.converter;
|
||||
|
||||
import cn.pluss.platform.entity.MerchantBaseInfo;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.UserInfo;
|
||||
import java.text.SimpleDateFormat;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2023-05-04T16:00:25+0800",
|
||||
comments = "version: 1.4.2.Final, compiler: javac, environment: Java 1.8.0_191 (Oracle Corporation)"
|
||||
)
|
||||
public class UserAppConverterImpl implements UserAppConverter {
|
||||
|
||||
@Override
|
||||
public void copyProperties(MerchantStore merchantStore, UserApp userApp) {
|
||||
if ( merchantStore == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( merchantStore.getId() != null ) {
|
||||
userApp.setStoreId2( String.valueOf( merchantStore.getId() ) );
|
||||
}
|
||||
if ( merchantStore.getCreateDt() != null ) {
|
||||
userApp.setCreateDt( merchantStore.getCreateDt() );
|
||||
}
|
||||
if ( merchantStore.getMerchantCode() != null ) {
|
||||
userApp.setMerchantCode( merchantStore.getMerchantCode() );
|
||||
}
|
||||
if ( merchantStore.getMerchantName() != null ) {
|
||||
userApp.setMerchantName( merchantStore.getMerchantName() );
|
||||
}
|
||||
if ( merchantStore.getStoreName() != null ) {
|
||||
userApp.setStoreName( merchantStore.getStoreName() );
|
||||
}
|
||||
if ( merchantStore.getStoreId() != null ) {
|
||||
userApp.setStoreId( merchantStore.getStoreId() );
|
||||
}
|
||||
if ( merchantStore.getProductDesc() != null ) {
|
||||
userApp.setProductDesc( merchantStore.getProductDesc() );
|
||||
}
|
||||
if ( merchantStore.getPayEcdemicSwitch() != null ) {
|
||||
userApp.setPayEcdemicSwitch( merchantStore.getPayEcdemicSwitch() );
|
||||
}
|
||||
if ( merchantStore.getIsMarket() != null ) {
|
||||
userApp.setIsMarket( merchantStore.getIsMarket() );
|
||||
}
|
||||
if ( merchantStore.getMerchantType() != null ) {
|
||||
userApp.setMerchantType( merchantStore.getMerchantType() );
|
||||
}
|
||||
if ( merchantStore.getAlias() != null ) {
|
||||
userApp.setAlias( merchantStore.getAlias() );
|
||||
}
|
||||
if ( merchantStore.getMcsStatus() != null ) {
|
||||
userApp.setMcsStatus( merchantStore.getMcsStatus() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyProperties(MerchantBaseInfo merchantBaseInfo, UserApp userApp) {
|
||||
if ( merchantBaseInfo == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( merchantBaseInfo.getAlias() != null ) {
|
||||
userApp.setMerchantName( merchantBaseInfo.getAlias() );
|
||||
}
|
||||
if ( merchantBaseInfo.getId() != null ) {
|
||||
userApp.setMercId( merchantBaseInfo.getId() );
|
||||
}
|
||||
if ( merchantBaseInfo.getLoginName() != null ) {
|
||||
userApp.setLoginName( merchantBaseInfo.getLoginName() );
|
||||
}
|
||||
if ( merchantBaseInfo.getUserId() != null ) {
|
||||
userApp.setUserId( Long.parseLong( merchantBaseInfo.getUserId() ) );
|
||||
}
|
||||
if ( merchantBaseInfo.getUserName() != null ) {
|
||||
userApp.setUserName( merchantBaseInfo.getUserName() );
|
||||
}
|
||||
if ( merchantBaseInfo.getLogo() != null ) {
|
||||
userApp.setLogo( merchantBaseInfo.getLogo() );
|
||||
}
|
||||
if ( merchantBaseInfo.getCreateDt() != null ) {
|
||||
userApp.setCreateDt( merchantBaseInfo.getCreateDt() );
|
||||
}
|
||||
if ( merchantBaseInfo.getUpdateDt() != null ) {
|
||||
userApp.setUpdateDt( merchantBaseInfo.getUpdateDt() );
|
||||
}
|
||||
if ( merchantBaseInfo.getMerchantCode() != null ) {
|
||||
userApp.setMerchantCode( merchantBaseInfo.getMerchantCode() );
|
||||
}
|
||||
if ( merchantBaseInfo.getContactName() != null ) {
|
||||
userApp.setContactName( merchantBaseInfo.getContactName() );
|
||||
}
|
||||
if ( merchantBaseInfo.getProductDesc() != null ) {
|
||||
userApp.setProductDesc( merchantBaseInfo.getProductDesc() );
|
||||
}
|
||||
if ( merchantBaseInfo.getBussAuthNum() != null ) {
|
||||
userApp.setBussAuthNum( merchantBaseInfo.getBussAuthNum() );
|
||||
}
|
||||
if ( merchantBaseInfo.getIsVoice() != null ) {
|
||||
userApp.setIsVoice( merchantBaseInfo.getIsVoice() );
|
||||
}
|
||||
if ( merchantBaseInfo.getIsUnionPay() != null ) {
|
||||
userApp.setIsUnionPay( merchantBaseInfo.getIsUnionPay() );
|
||||
}
|
||||
if ( merchantBaseInfo.getPassword() != null ) {
|
||||
userApp.setPassword( merchantBaseInfo.getPassword() );
|
||||
}
|
||||
if ( merchantBaseInfo.getMerchantType() != null ) {
|
||||
userApp.setMerchantType( merchantBaseInfo.getMerchantType() );
|
||||
}
|
||||
if ( merchantBaseInfo.getAlias() != null ) {
|
||||
userApp.setAlias( merchantBaseInfo.getAlias() );
|
||||
}
|
||||
if ( merchantBaseInfo.getMerchantAuditStatus() != null ) {
|
||||
userApp.setMerchantAuditStatus( merchantBaseInfo.getMerchantAuditStatus() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserApp toUserApp(UserInfo userInfo) {
|
||||
if ( userInfo == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UserApp userApp = new UserApp();
|
||||
|
||||
userApp.setCreateDt( userInfo.getCreateTime() );
|
||||
userApp.setUserId( userInfo.getId() );
|
||||
userApp.setLoginName( userInfo.getLoginName() );
|
||||
userApp.setStatus( userInfo.getStatus() );
|
||||
if ( userInfo.getParentId() != null ) {
|
||||
userApp.setParentId( userInfo.getParentId().longValue() );
|
||||
}
|
||||
userApp.setPhone( userInfo.getPhone() );
|
||||
userApp.setMerchantCode( userInfo.getMerchantCode() );
|
||||
userApp.setStoreId( userInfo.getStoreId() );
|
||||
userApp.setPassword( userInfo.getPassword() );
|
||||
if ( userInfo.getUpdateTime() != null ) {
|
||||
userApp.setUpdateTime( new SimpleDateFormat().format( userInfo.getUpdateTime() ) );
|
||||
}
|
||||
userApp.setPayPassword( userInfo.getPayPassword() );
|
||||
userApp.setFaceCert( userInfo.getFaceCert() );
|
||||
userApp.setFaceCompare( userInfo.getFaceCompare() );
|
||||
|
||||
return userApp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.pluss.platform.access;
|
||||
|
||||
|
||||
import cn.pluss.platform.access.domain.ReqEntity;
|
||||
import cn.pluss.platform.access.domain.RespEntity;
|
||||
|
||||
public interface AccessService {
|
||||
|
||||
boolean checkSign(ReqEntity reqEntity);
|
||||
|
||||
void addSign(RespEntity respEntity);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.pluss.platform.access.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CodeEnum {
|
||||
|
||||
SUCCESS("0000", "操作成功"),
|
||||
|
||||
PARAM_ERROR("0001", "参数不正确"),
|
||||
|
||||
SIGN_ERROR("0002", "签名校验异常"),
|
||||
|
||||
ORG_ID_NOT_FOUND("0003", "缺少机构ID"),
|
||||
|
||||
STORE_NOT_FOUND("1001", "未找到机具"),
|
||||
|
||||
ORDER_NOT_FOUND("2001", "未找到订单"),
|
||||
|
||||
ORDER_REFUND_ERROR("2002", "订单退款异常"),
|
||||
|
||||
REFUND_ORDER_NOT_FOUND("2003", "未找到退款订单"),
|
||||
|
||||
PASSWORD_NOT_INIT("2011", "安全密码未初始化,请前往收银呗APP进行初始化"),
|
||||
PASSWORD_ERROR("2021", "安全密码错误,若忘记密码,可前往收银呗APP进行重置"),
|
||||
;
|
||||
|
||||
private final String val;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.pluss.platform.access.domain;
|
||||
|
||||
import cn.pluss.platform.access.exception.AccessException;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ReqEntity {
|
||||
|
||||
private String orgId;
|
||||
|
||||
private String requestId;
|
||||
|
||||
private String version;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
private String reqData;
|
||||
|
||||
public JSONObject initJSONData() {
|
||||
if (reqData == null) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR);
|
||||
}
|
||||
return JSON.parseObject(reqData);
|
||||
}
|
||||
|
||||
private String signType;
|
||||
|
||||
private String sign;
|
||||
|
||||
public static String getSignContent(ReqEntity entity) {
|
||||
return "orgId=" + entity.getOrgId() + "&" +
|
||||
"reqData=" + entity.getReqData() + "&" +
|
||||
"requestId=" + entity.getRequestId() + "&" +
|
||||
"signType=" + entity.getSignType() + "&" +
|
||||
"timestamp=" + entity.getTimestamp() + "&" +
|
||||
"version=" + entity.getVersion();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package cn.pluss.platform.access.domain;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.ValueFilter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class RespEntity {
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private String respData;
|
||||
|
||||
private String sign;
|
||||
|
||||
private String signType;
|
||||
|
||||
private String orgId;
|
||||
|
||||
private String requestId;
|
||||
|
||||
public RespEntity(String orgId, CodeEnum codeEnum, Object respData, String requestId) {
|
||||
this(orgId, codeEnum, respData, requestId, null);
|
||||
}
|
||||
|
||||
public RespEntity(String orgId, String code, Object respData, String requestId) {
|
||||
this(orgId, code, respData, requestId, null);
|
||||
}
|
||||
|
||||
public RespEntity(String orgId, CodeEnum codeEnum, Object respData, String requestId, String msg) {
|
||||
this.code = codeEnum.getVal();
|
||||
this.requestId = requestId;
|
||||
if (!ObjectUtils.isEmpty(msg)) {
|
||||
this.msg = msg;
|
||||
} else {
|
||||
this.msg = codeEnum.getDesc();
|
||||
}
|
||||
|
||||
this.signType = "RSA";
|
||||
this.respData = JSON.toJSONString(respData, (ValueFilter) (object, name, value) -> {
|
||||
if (value instanceof BigDecimal) {
|
||||
return ((BigDecimal) value).toPlainString();
|
||||
}
|
||||
|
||||
if (value instanceof Double || value instanceof Float) {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
});
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public RespEntity(String orgId, String code, Object respData, String requestId, String msg) {
|
||||
this.code = code;
|
||||
this.requestId = requestId;
|
||||
this.msg = msg;
|
||||
this.signType = "RSA";
|
||||
this.respData = JSON.toJSONString(respData, (ValueFilter) (object, name, value) -> {
|
||||
if (value instanceof BigDecimal) {
|
||||
return ((BigDecimal) value).toPlainString();
|
||||
}
|
||||
|
||||
if (value instanceof Double || value instanceof Float) {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
});
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public static String getSignContent(RespEntity entity) {
|
||||
String signContent = "code=" + entity.getCode() + "&"
|
||||
+ "msg=" + entity.getMsg() + "&"
|
||||
+ "orgId=" + entity.getOrgId() + "&"
|
||||
+ "requestId=" + entity.getRequestId() + "&";
|
||||
|
||||
if (entity.getRespData() != null) {
|
||||
signContent += "respData=" + entity.getRespData() + "&";
|
||||
}
|
||||
|
||||
signContent += "signType=" + entity.getSignType();
|
||||
|
||||
return signContent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.pluss.platform.access.exception;
|
||||
|
||||
import cn.pluss.platform.access.domain.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class AccessException extends RuntimeException {
|
||||
|
||||
private String code;
|
||||
|
||||
public AccessException(CodeEnum codeEnum, String msg) {
|
||||
super(ObjectUtils.isEmpty(msg)? codeEnum.getDesc(): msg);
|
||||
this.code = codeEnum.getVal();
|
||||
}
|
||||
|
||||
public AccessException(CodeEnum codeEnum) {
|
||||
this(codeEnum, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.pluss.platform.access.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AccessBizService {
|
||||
|
||||
Object machineStoreInfo(String snNo);
|
||||
|
||||
Object scanPay(JSONObject param);
|
||||
|
||||
Object orderStatus(String orderNum, String mercOrderNo);
|
||||
|
||||
Object refund(JSONObject param);
|
||||
|
||||
<T> List<T> refundList(JSONObject param);
|
||||
|
||||
Page<Object> orderList(JSONObject param);
|
||||
|
||||
Object dataAnalysis(JSONObject param);
|
||||
}
|
||||
@@ -0,0 +1,504 @@
|
||||
package cn.pluss.platform.access.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.pluss.platform.access.domain.CodeEnum;
|
||||
import cn.pluss.platform.access.exception.AccessException;
|
||||
import cn.pluss.platform.access.service.AccessBizService;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.deviceStock.DeviceStockService;
|
||||
import cn.pluss.platform.dto.MerChantOrderDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.mapper.MerchantChannelStatusMapper;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.pay.ApiPayService;
|
||||
import cn.pluss.platform.pay.PayService;
|
||||
import cn.pluss.platform.refundOrder.MerchantRefundOrderService;
|
||||
import cn.pluss.platform.ryx.pay.RyxPayService;
|
||||
import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class AccessBizServiceImpl implements AccessBizService {
|
||||
|
||||
@Autowired
|
||||
private DeviceStockService deviceStockService;
|
||||
|
||||
@Autowired
|
||||
private MerchantBaseInfoService mbiService;
|
||||
|
||||
@Autowired
|
||||
private MerchantOrderService orderService;
|
||||
|
||||
@Autowired
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Resource
|
||||
private MerchantChannelStatusMapper mcsMapper;
|
||||
|
||||
@Autowired
|
||||
private SxfPayService sxfPayService;
|
||||
|
||||
@Autowired
|
||||
private RyxPayService ryxPayService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("ysPayOldService")
|
||||
private PayService ysPayOldService;
|
||||
|
||||
@Autowired
|
||||
private ApiPayService apiPayService;
|
||||
|
||||
@Autowired
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
private MerchantRefundOrderService refundOrderService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
private MerchantBaseInfo getByDeviceNo(String deviceNo) {
|
||||
DeviceStock deviceStock = deviceStockService.getDevicebyNo(deviceNo);
|
||||
if (deviceStock == null) {
|
||||
deviceStock = deviceStockService.getDeviceBySnNo(deviceNo);
|
||||
}
|
||||
|
||||
if (deviceStock == null || !"3".equals(deviceStock.getStatus())) {
|
||||
throw new AccessException(CodeEnum.STORE_NOT_FOUND);
|
||||
}
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getById(deviceStock.getActMercId());
|
||||
|
||||
if (mbi == null) {
|
||||
throw new AccessException(CodeEnum.STORE_NOT_FOUND);
|
||||
}
|
||||
|
||||
return mbi;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object machineStoreInfo(String deviceNo) {
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
DeviceStock deviceStock = deviceStockService.getDevicebyNo(deviceNo);
|
||||
if (deviceStock == null) {
|
||||
deviceStock = deviceStockService.getDeviceBySnNo(deviceNo);
|
||||
}
|
||||
|
||||
// 未入库
|
||||
result.put("status", "-3");
|
||||
result.put("remark", "机具未入库");
|
||||
|
||||
if (deviceStock == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 未绑定商户
|
||||
result.put("status", "-2");
|
||||
result.put("remark", "未绑定商户");
|
||||
|
||||
if (!"3".equals(deviceStock.getStatus())) {
|
||||
return result;
|
||||
} else {
|
||||
result.put("status", "-1");
|
||||
result.put("remark", "未获取到商户信息");
|
||||
}
|
||||
|
||||
String actMercId = deviceStock.getActMercId();
|
||||
if (ObjectUtils.isEmpty(actMercId)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getById(actMercId);
|
||||
|
||||
if (mbi == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 已绑定商户
|
||||
result.put("status", "1");
|
||||
result.put("remark", "商户信息获取成功");
|
||||
result.put("merchantName", mbi.getMerchantName());
|
||||
result.put("alias", mbi.getAlias());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object scanPay(JSONObject param) {
|
||||
String authCode = param.getString("authCode");
|
||||
BigDecimal consumeFee = param.getBigDecimal("consumeFee");
|
||||
String type = param.getString("type");
|
||||
String deviceNo = param.getString("deviceNo");
|
||||
String remark = param.getString("remark");
|
||||
String mercOrderNo = param.getString("mercOrderNo");
|
||||
|
||||
// 必传参数
|
||||
if (ObjectUtils.isEmpty(authCode)
|
||||
|| ObjectUtils.isEmpty(consumeFee)
|
||||
|| ObjectUtils.isEmpty(type)
|
||||
|| ObjectUtils.isEmpty(deviceNo)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR);
|
||||
}
|
||||
|
||||
MerchantBaseInfo mbi = getByDeviceNo(deviceNo);
|
||||
MerchantStore merchantStore = merchantStoreService.getStoreByMerchantCode(mbi.getMerchantCode());
|
||||
|
||||
MerChantOrderDTO dto = new MerChantOrderDTO();
|
||||
dto.setType(type);
|
||||
dto.setConsumeFee(consumeFee.doubleValue());
|
||||
dto.setAuthCode(authCode);
|
||||
dto.setUserId(mbi.getUserId());
|
||||
dto.setDeviceNo(deviceNo);
|
||||
dto.setStoreId(merchantStore.getStoreId());
|
||||
dto.setMerchantCode(mbi.getMerchantCode());
|
||||
dto.setRemark(remark);
|
||||
dto.setMercOrderNo(mercOrderNo);
|
||||
|
||||
return orderService.toActivePayV2(dto, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object orderStatus(String orderNum, String mercOrderNo) {
|
||||
// 校验参数是否完整
|
||||
if (ObjectUtils.isEmpty(orderNum) && ObjectUtils.isEmpty(mercOrderNo)) {
|
||||
return ResultGenerator.genFailResult("订单号不能为空");
|
||||
}
|
||||
|
||||
QueryWrapper<MerchantOrder> queryWrapper = new QueryWrapper<MerchantOrder>()
|
||||
.eq(!ObjectUtils.isEmpty(orderNum), "orderNumber", orderNum)
|
||||
.eq(!ObjectUtils.isEmpty(mercOrderNo), "mercOrderNo", mercOrderNo);
|
||||
|
||||
MerchantOrder order = orderService.getOne(queryWrapper);
|
||||
if (order == null) {
|
||||
throw new AccessException(CodeEnum.ORDER_NOT_FOUND);
|
||||
}
|
||||
//支付成功
|
||||
if ("1".equals(order.getStatus())) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "1");
|
||||
result.put("orderNumber", order.getOrderNumber());
|
||||
result.put("mercOrderNo", order.getMercOrderNo());
|
||||
result.put("transTime", DateUtil.format(order.getCreateDt(), DatePattern.NORM_DATETIME_FORMAT));
|
||||
result.put("consumeFee", order.getConsumeFee());
|
||||
result.put("payType", order.getPayTypeCode());
|
||||
|
||||
return result;
|
||||
}
|
||||
String aisleSwitch = order.getAisleSwitch();
|
||||
MerchantChannelStatus channel = null;
|
||||
switch (aisleSwitch) {
|
||||
case "2":
|
||||
channel = mcsMapper.getByMerchantCode(order.getMerchantCode(), 1);
|
||||
break;
|
||||
default:
|
||||
channel = mcsMapper.getByMerchantCode(order.getMerchantCode(), Integer.valueOf(aisleSwitch));
|
||||
break;
|
||||
}
|
||||
if (channel != null) {
|
||||
JSONObject result = null;
|
||||
switch (channel.getChannel()) {
|
||||
case 1:
|
||||
result = sxfPayService.tradeQuery(order, channel.getMerchantId());
|
||||
break;
|
||||
case 3:
|
||||
result = ryxPayService.tradeQuery(order, channel.getMerchantId());
|
||||
break;
|
||||
case 4:
|
||||
result = ysPayOldService.tradeQuery(order, channel.getMerchantId());
|
||||
break;
|
||||
}
|
||||
if (result != null) {
|
||||
orderService.updateOrderStatus(result, order);
|
||||
String status = result.getString("payStatus");
|
||||
if ("1".equals(status)) {
|
||||
order.setStatus("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", order.getStatus());
|
||||
result.put("orderNumber", order.getOrderNumber());
|
||||
result.put("mercOrderNo", order.getMercOrderNo());
|
||||
result.put("transTime", DateUtil.format(order.getCreateDt(), DatePattern.NORM_DATETIME_FORMAT));
|
||||
result.put("consumeFee", order.getConsumeFee());
|
||||
result.put("payType", order.getPayTypeCode());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object refund(JSONObject param) {
|
||||
String deviceNo = param.getString("deviceNo");
|
||||
String orderNumber = param.getString("orderNumber");
|
||||
param.put("thirdSendNo", param.getString("channelTransNo"));
|
||||
BigDecimal refundAmt = param.getBigDecimal("refundAmt");
|
||||
String refundFlag = param.getString("refundFlag");
|
||||
// String pwd = param.getString("pwd");
|
||||
|
||||
MerchantBaseInfo mbi = getByDeviceNo(deviceNo);
|
||||
// UserInfo userInfo = userInfoService.getById(mbi.getUserId());
|
||||
|
||||
// if (ObjectUtils.isEmpty(pwd)) {
|
||||
// throw new AccessException(CodeEnum.PARAM_ERROR, "安全密码不能为空");
|
||||
// }
|
||||
|
||||
// String payPassword = userInfo.getPayPassword();
|
||||
// if (payPassword == null) {
|
||||
// throw new AccessException(CodeEnum.PASSWORD_NOT_INIT);
|
||||
// }
|
||||
//
|
||||
// if (!payPassword.equalsIgnoreCase(MD5Util.MD5Encode(pwd, "utf-8"))) {
|
||||
// throw new AccessException(CodeEnum.PASSWORD_ERROR);
|
||||
// }
|
||||
|
||||
param.put("merchant", mbi);
|
||||
|
||||
if (!"1".equals(refundFlag)) {
|
||||
if (ObjectUtils.isEmpty(refundAmt)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "未选择全额退款时,退款金额不能为空");
|
||||
}
|
||||
|
||||
if (!StringUtil.isNumber(param.getString("refundAmt"))) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "退款金额格式有误,小数点保留后两位");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject jsonObject = apiPayService.apiRefundPay(param);
|
||||
jsonObject.remove("sign");
|
||||
return jsonObject;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new AccessException(CodeEnum.ORDER_REFUND_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> refundList(JSONObject param) {
|
||||
String deviceNo = param.getString("deviceNo");
|
||||
|
||||
String orderNumber = param.getString("orderNumber");
|
||||
String mercOrderNo = param.getString("mercOrderNo");
|
||||
String thirdTransNo = param.getString("thirdTransNo");
|
||||
String channelTransNo = param.getString("channelTransNo");
|
||||
|
||||
String refundNo = param.getString("refundNo");
|
||||
String mercRefundNo = param.getString("mercRefundNo");
|
||||
|
||||
if (ObjectUtils.isEmpty(deviceNo)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "缺少设备编号");
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(orderNumber)
|
||||
&& ObjectUtils.isEmpty(mercOrderNo)
|
||||
&& ObjectUtils.isEmpty(thirdTransNo)
|
||||
&& ObjectUtils.isEmpty(channelTransNo)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "缺少原交易订单号");
|
||||
}
|
||||
|
||||
MerchantBaseInfo mbi = getByDeviceNo(deviceNo);
|
||||
LambdaQueryWrapper<MerchantRefundOrder> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(!ObjectUtils.isEmpty(orderNumber), MerchantRefundOrder::getOrderNumber, orderNumber);
|
||||
qWrapper.eq(!ObjectUtils.isEmpty(refundNo), MerchantRefundOrder::getRefundNo, refundNo);
|
||||
qWrapper.eq(MerchantRefundOrder::getMerchantCode, mbi.getMerchantCode());
|
||||
qWrapper.eq(!ObjectUtils.isEmpty(mercRefundNo), MerchantRefundOrder::getMercRefundNo, mercRefundNo);
|
||||
qWrapper.orderByDesc(MerchantRefundOrder::getRefundTime);
|
||||
|
||||
List<MerchantRefundOrder> refundOrderList = refundOrderService.list(qWrapper);
|
||||
|
||||
if (CollectionUtil.isEmpty(refundOrderList)) {
|
||||
throw new AccessException(CodeEnum.REFUND_ORDER_NOT_FOUND);
|
||||
}
|
||||
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
|
||||
for (MerchantRefundOrder item : refundOrderList) {
|
||||
JSONObject jsonItem = new JSONObject();
|
||||
jsonItem.put("orderNumber", item.getOrderNumber());
|
||||
jsonItem.put("refundNo", item.getRefundNo());
|
||||
jsonItem.put("mercRefundNo", item.getMercRefundNo());
|
||||
jsonItem.put("refundTime", DateUtil.format(item.getRefundTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
jsonItem.put("status", item.getStatus());
|
||||
jsonItem.put("oPayAmt", item.getPayAmt());
|
||||
jsonItem.put("refundAmt", item.getRefundAmt());
|
||||
jsonItem.put("payType", item.getPayTypeCode());
|
||||
|
||||
result.add(jsonItem);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<Object> orderList(JSONObject param) {
|
||||
String deviceNo = param.getString("deviceNo");
|
||||
Integer page = param.getInteger("page");
|
||||
Integer size = param.getInteger("size");
|
||||
String date = param.getString("date");
|
||||
// 1: 日; 2: 月
|
||||
String type = param.getString("type");
|
||||
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
condition.put("createDate", date);
|
||||
condition.put("snNo", deviceNo);
|
||||
|
||||
List<String> statusList = CollectionUtil.list(false, "1", "2", "6");
|
||||
|
||||
IPage<MerchantOrder> pageInfo = new Page<>(page, size);
|
||||
|
||||
if (ObjectUtils.isEmpty(type)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "类型不能为空");
|
||||
}
|
||||
|
||||
if (!ArrayUtil.contains(new String[]{"1", "2"}, type)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "类型只能为1(日)或者2(月)");
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(date)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "日期不能为空");
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(page)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "页码不能为空");
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(size)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "页长不能为空");
|
||||
}
|
||||
|
||||
if (size > 1000) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "查询单次不能超过1000条");
|
||||
}
|
||||
|
||||
MerchantBaseInfo mbi = getByDeviceNo(deviceNo);
|
||||
|
||||
condition.put("merchantCode", mbi.getMerchantCode());
|
||||
orderService.pageData(pageInfo, condition, statusList);
|
||||
|
||||
Page<Object> resultPage = new Page<>(page, size);
|
||||
resultPage.setTotal(pageInfo.getTotal());
|
||||
List<Object> result = new ArrayList<>();
|
||||
for (MerchantOrder item : pageInfo.getRecords()) {
|
||||
JSONObject orderItem = new JSONObject();
|
||||
orderItem.put("orderNumber", item.getOrderNumber());
|
||||
orderItem.put("consumeFee", item.getConsumeFee());
|
||||
orderItem.put("status", item.getStatus());
|
||||
orderItem.put("alias", item.getMerchantName());
|
||||
orderItem.put("channelTransNo", item.getThirdSendNo());
|
||||
orderItem.put("thirdTransNo", item.getThirdTransNo());
|
||||
orderItem.put("transTime", DateUtil.format(item.getTransDt(), DatePattern.NORM_DATETIME_FORMAT));
|
||||
if (item.getStatus().equals("2")) {
|
||||
orderItem.put("refundAmt", item.getRefundAmt());
|
||||
orderItem.put("refundTime", DateUtil.format(item.getUpdateTime(), DatePattern.NORM_DATETIME_FORMAT));
|
||||
}
|
||||
orderItem.put("payType", item.getPayTypeCode());
|
||||
|
||||
result.add(orderItem);
|
||||
}
|
||||
|
||||
resultPage.setPages(pageInfo.getPages());
|
||||
resultPage.setRecords(result);
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object dataAnalysis(JSONObject param) {
|
||||
String deviceNo = param.getString("deviceNo");
|
||||
MerchantBaseInfo mbi = getByDeviceNo(deviceNo);
|
||||
String type = param.getString("type");
|
||||
String date = param.getString("date");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
if (ObjectUtils.isEmpty(type)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "类型不能为空");
|
||||
}
|
||||
|
||||
if (!ArrayUtil.contains(new String[]{"1", "2"}, type)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "类型只能为1(日)或者2(月)");
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(date)) {
|
||||
throw new AccessException(CodeEnum.PARAM_ERROR, "日期不能为空");
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<MerchantOrder> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.likeRight(MerchantOrder::getCreateDate, date)
|
||||
.eq(MerchantOrder::getMerchantCode, mbi.getMerchantCode())
|
||||
.eq(MerchantOrder::getSnNo, deviceNo)
|
||||
.eq(MerchantOrder::getStatus, "1");
|
||||
|
||||
int transCount = orderService.count(qWrapper);
|
||||
result.put("transCount", transCount);
|
||||
|
||||
qWrapper.clear();
|
||||
qWrapper.likeRight(MerchantOrder::getCreateDate, date)
|
||||
.eq(MerchantOrder::getMerchantCode, mbi.getMerchantCode())
|
||||
.eq(MerchantOrder::getSnNo, deviceNo)
|
||||
.eq(MerchantOrder::getStatus, "2");
|
||||
|
||||
int refundCount = orderService.count(qWrapper);
|
||||
result.put("refundCount", refundCount);
|
||||
|
||||
QueryWrapper<MerchantOrder> qWrapper2 = Wrappers.query();
|
||||
qWrapper2.likeRight("createDate", date)
|
||||
.eq("merchantCode", mbi.getMerchantCode())
|
||||
.eq("snNo", deviceNo)
|
||||
.eq("status", "1")
|
||||
.select("SUM(consumeFee) transFee");
|
||||
|
||||
BigDecimal transFee = orderService.getObj(qWrapper2, (SFunction<Object, BigDecimal>) o -> {
|
||||
if (o == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
if (o instanceof BigDecimal) {
|
||||
return (BigDecimal) o;
|
||||
}
|
||||
|
||||
return new BigDecimal(o.toString());
|
||||
});
|
||||
|
||||
if (transFee == null) {
|
||||
transFee = BigDecimal.ZERO;
|
||||
}
|
||||
result.put("transFee", transFee);
|
||||
|
||||
BigDecimal refundFee = orderService.getRefundAmt(mbi.getMerchantCode(), deviceNo, date);
|
||||
if (refundFee == null) {
|
||||
refundFee = BigDecimal.ZERO;
|
||||
}
|
||||
result.put("refundFee", refundFee);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.pluss.platform.access.service.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.crypto.SignUtil;
|
||||
import cn.hutool.crypto.asymmetric.Sign;
|
||||
import cn.hutool.crypto.asymmetric.SignAlgorithm;
|
||||
import cn.pluss.platform.access.AccessService;
|
||||
import cn.pluss.platform.access.domain.ReqEntity;
|
||||
import cn.pluss.platform.access.domain.RespEntity;
|
||||
import cn.pluss.platform.entity.AccessChannelCipherCode;
|
||||
import cn.pluss.platform.mapper.AccessChannelCipherCodeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Service
|
||||
public class AccessServiceImpl implements AccessService {
|
||||
|
||||
@Resource
|
||||
private AccessChannelCipherCodeMapper acccMapper;
|
||||
|
||||
@Override
|
||||
public boolean checkSign(ReqEntity reqEntity) {
|
||||
AccessChannelCipherCode accc = acccMapper.selectAllByOrgId(reqEntity.getOrgId());
|
||||
String orgPubKey = accc.getOrgPubKey();
|
||||
|
||||
Sign sign = SignUtil.sign(SignAlgorithm.SHA256withRSA, null, orgPubKey);
|
||||
String signContent = ReqEntity.getSignContent(reqEntity);
|
||||
return sign.verify(signContent.getBytes(StandardCharsets.UTF_8), Base64.decode(reqEntity.getSign()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSign(RespEntity respEntity) {
|
||||
String signContent = RespEntity.getSignContent(respEntity);
|
||||
|
||||
AccessChannelCipherCode accc = acccMapper.selectAllByOrgId(respEntity.getOrgId());
|
||||
Sign sign = SignUtil.sign(SignAlgorithm.SHA256withRSA, accc.getPriKey(), null);
|
||||
byte[] signBytes = sign.sign(signContent);
|
||||
respEntity.setSign(Base64.encode(signBytes));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -65,6 +66,9 @@ public class AliScanCodeDeviceServiceImpl implements AliDeviceService {
|
||||
@Resource
|
||||
private MerchantChannelStatusService channelService;
|
||||
|
||||
@Resource
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Override
|
||||
public RespDeviceEntity getDeviceStatusV1(String deviceNo) {
|
||||
if(StringUtil.isEmpty(deviceNo)){
|
||||
@@ -139,7 +143,7 @@ public class AliScanCodeDeviceServiceImpl implements AliDeviceService {
|
||||
dto.setDeviceNo(entity.getCode());
|
||||
dto.setRemark(entity.getRemark());
|
||||
try {
|
||||
Result<Object> mapResult = merchantOrderService.toActivePay(dto);
|
||||
Result<Object> mapResult = merchantOrderService.toActivePay(dto, request);
|
||||
Object data = mapResult.getData();
|
||||
if (ResultCode.TRANSUNKNOW.code() == mapResult.getCode()) {
|
||||
return RespDeviceEntity.await(mapResult.getMessage(),((Map)data).get("orderNumber"));
|
||||
|
||||
@@ -92,7 +92,7 @@ public class CashServiceImpl extends ServiceImpl<CashMapper, Cash> implements Ca
|
||||
RiskBlacklist entity = rbService.getOne(new QueryWrapper<>(condition));
|
||||
|
||||
if (entity != null) {
|
||||
throw new MsgException("该账户存在重大违规行为,暂不支持提现,请联系收银呗客服申诉");
|
||||
throw new MsgException("该账户存在重大违规行为,暂不支持提现,请联系快银收银客服申诉");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ public class CashServiceImpl extends ServiceImpl<CashMapper, Cash> implements Ca
|
||||
|
||||
alipayService.remit(accountNo, accountName, cash.getVirRealCashAmt().toString());
|
||||
// 发送分润打款通知
|
||||
generalPushUtil.sendAllPlatByAlias(Collections.singletonList(cash.getUserId() + ""), "收银呗分润到账通知", "您的分润已结算至支付宝,快去查看哦!", "1");
|
||||
generalPushUtil.sendAllPlatByAlias(Collections.singletonList(cash.getUserId() + ""), "快银收银分润到账通知", "您的分润已结算至支付宝,快去查看哦!", "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -119,7 +119,7 @@ public class MercAuditListenerImpl implements MercAuditListener {
|
||||
public void onFail(String userId, MerchantChannelStatus mcs, String msg) {
|
||||
MerchantBaseInfo mbi = mbiMapper.queryByMerchantCode(mcs.getMerchantCode());
|
||||
|
||||
String title2 = "收银呗审核通知";
|
||||
String title2 = "快银收银审核通知";
|
||||
|
||||
String msg2;
|
||||
|
||||
@@ -141,7 +141,7 @@ public class MercAuditListenerImpl implements MercAuditListener {
|
||||
public void onSuccess(String userId, MerchantChannelStatus mcs) {
|
||||
MerchantBaseInfo mbi = mbiMapper.queryByMerchantCode(mcs.getMerchantCode() + "");
|
||||
|
||||
String title = "收银呗审核通知";
|
||||
String title = "快银收银审核通知";
|
||||
String msg;
|
||||
if (Objects.equals(mcs.getChannel(), 4)) {
|
||||
msg = "商户D0进件通过,完成支付宝及微信认证后即可支持相应渠道收款";
|
||||
|
||||
@@ -24,4 +24,9 @@ public interface YSAuditServiceV3 {
|
||||
void auditResult(String userId);
|
||||
|
||||
void openOnlinePay(MerchantChannelStatus mcs);
|
||||
|
||||
void report(MerchantChannelStatus mcs);
|
||||
|
||||
void reportAgain(MerchantChannelStatus mcs);
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -285,7 +285,7 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
if ("403".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
throw new MsgException("24小时内重复查询相同信息超过10次,已锁定,请在12小时后重试。");
|
||||
}
|
||||
if ("428".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
if ("428".equals(verifyBankElementResponse.getBody().getCode()) || "437".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
throw new MsgException("请正确输入相关信息");
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.pluss.platform.device;
|
||||
|
||||
import cn.pluss.platform.entity.MercOrderExpress;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface MercOrderExpressService extends IService<MercOrderExpress> {
|
||||
@@ -8,4 +9,6 @@ public interface MercOrderExpressService extends IService<MercOrderExpress> {
|
||||
MercOrderExpress getByLogistNo(String logistNo);
|
||||
|
||||
MercOrderExpress getByExpressNo(String expressNo);
|
||||
|
||||
JSONObject getExpressInfo(String expressNo) throws Exception;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import cn.pluss.platform.mapper.*;
|
||||
import cn.pluss.platform.openAccount.OpenAccountRecordService;
|
||||
import cn.pluss.platform.pay.PayService;
|
||||
import cn.pluss.platform.phoneValidateCode.PhoneValidateCodeService;
|
||||
import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.util.ValidateCodeUtil;
|
||||
@@ -25,6 +26,9 @@ import cn.pluss.platform.yt.YtLogistHandler;
|
||||
import cn.pluss.platform.yt.YtStatusEnum;
|
||||
import cn.pluss.platform.yt.constant.YtConstant;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.dysmsapi20170525.Client;
|
||||
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||
import com.aliyun.teaopenapi.models.Config;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -35,6 +39,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -91,30 +96,46 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
@Resource
|
||||
private OpenAccountRecordService openAccountRecordService;
|
||||
|
||||
@Resource
|
||||
private SxfPayService sxfPayService;
|
||||
|
||||
|
||||
/**
|
||||
* 阿里云key
|
||||
*/
|
||||
@Value("${aliyun.keyid}")
|
||||
private String ACCESSKEYID;
|
||||
/**
|
||||
* 阿里云secret
|
||||
*/
|
||||
@Value("${aliyun.keysecret}")
|
||||
private String ACCESSKEYSECRET;
|
||||
|
||||
@Override
|
||||
public void receiving(Long id) {
|
||||
MercOrderDetail detail = baseMapper.selectById(id);
|
||||
MsgException.checkNull(detail,"订单数据异常");
|
||||
MsgException.checkNull(detail, "订单数据异常");
|
||||
detail.setStatus(DeviceOrderStatus.COMPLETED.getStatus());
|
||||
baseMapper.updateById(detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看物流信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MercOrderExpressVO getOrderExpressInfo(Long id) {
|
||||
MercOrderDetail detail = baseMapper.selectById(id);
|
||||
MsgException.checkNull(detail,"订单详情数据异常");
|
||||
MsgException.checkNull(detail, "订单详情数据异常");
|
||||
MercOrderExpressVO vo = moeMapper.getByExpressNo(detail.getExpressNo());
|
||||
|
||||
if(vo != null){
|
||||
if (vo != null) {
|
||||
vo.setServiceTelephone(YtConstant.YT_CUSTOMER_TELEPHONE);
|
||||
List<MercOrderExpressDetail> list = moedMapper.getByExpressNo(detail.getExpressNo());
|
||||
vo.setExpressDetailList(list);
|
||||
if(!list.isEmpty()){
|
||||
if (!list.isEmpty()) {
|
||||
vo.setLogisticProvider(list.get(0).getLogisticProvider());
|
||||
}
|
||||
}
|
||||
@@ -123,23 +144,24 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
|
||||
/**
|
||||
* 根据订单号查询订单详情
|
||||
*
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MercOrderDetail> getDetailByOrderNo(String orderNo,String status) {
|
||||
public List<MercOrderDetail> getDetailByOrderNo(String orderNo, String status) {
|
||||
QueryWrapper<MercOrderDetail> queryWrapper = new QueryWrapper<MercOrderDetail>()
|
||||
.eq("orderNo",orderNo).orderByDesc("id");
|
||||
if(StringUtil.isNotEmpty(status) && !"-1".equals(status)){
|
||||
switch (status){
|
||||
.eq("orderNo", orderNo).orderByDesc("id");
|
||||
if (StringUtil.isNotEmpty(status) && !"-1".equals(status)) {
|
||||
switch (status) {
|
||||
case "1":
|
||||
queryWrapper.eq("status",DeviceOrderStatus.COMPLETED.getStatus());
|
||||
queryWrapper.eq("status", DeviceOrderStatus.COMPLETED.getStatus());
|
||||
break;
|
||||
case "2":
|
||||
queryWrapper.eq("status",DeviceOrderStatus.RECEIV_ING.getStatus());
|
||||
queryWrapper.eq("status", DeviceOrderStatus.RECEIV_ING.getStatus());
|
||||
break;
|
||||
case "3":
|
||||
queryWrapper.in("status",DeviceOrderStatus.REFUND_ING.getStatus(),DeviceOrderStatus.REFUND_SUCC.getStatus(),DeviceOrderStatus.REFUND_FAIL.getStatus());
|
||||
queryWrapper.in("status", DeviceOrderStatus.REFUND_ING.getStatus(), DeviceOrderStatus.REFUND_SUCC.getStatus(), DeviceOrderStatus.REFUND_FAIL.getStatus());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -148,40 +170,41 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
|
||||
/**
|
||||
* 设备订单退款
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void refund(MercOrderDetailDTO dto) {
|
||||
MsgException.checkNull(dto.getId(),"退款详情订单ID为空");
|
||||
MsgException.checkNull(dto.getRefundAmt(),"退款金额不能为空");
|
||||
MsgException.checkBlank(dto.getRefundReason(),"退款原因不能为空");
|
||||
if(dto.getPicList() == null || dto.getPicList().size() == 0){
|
||||
MsgException.checkNull(dto.getId(), "退款详情订单ID为空");
|
||||
MsgException.checkNull(dto.getRefundAmt(), "退款金额不能为空");
|
||||
MsgException.checkBlank(dto.getRefundReason(), "退款原因不能为空");
|
||||
if (dto.getPicList() == null || dto.getPicList().size() == 0) {
|
||||
MsgException.throwException("请先上传图片");
|
||||
}
|
||||
MercOrderDetail detail = baseMapper.selectById(dto.getId());
|
||||
MsgException.checkNull(detail,"订单数据异常");
|
||||
MsgException.checkNull(detail, "订单数据异常");
|
||||
//暂无物流信息 可以直接退款
|
||||
BigDecimal totalAmt = detail.getPrice().multiply(BigDecimal.valueOf(detail.getNum()));
|
||||
if(StringUtil.isEmpty(detail.getExpressNo())){
|
||||
if (StringUtil.isEmpty(detail.getExpressNo())) {
|
||||
totalAmt = totalAmt.add(detail.getPostage());
|
||||
}else{
|
||||
} else {
|
||||
MercOrderExpressVO express = moeMapper.getByExpressNo(detail.getExpressNo());
|
||||
if(express == null){
|
||||
if (express == null) {
|
||||
totalAmt = totalAmt.add(detail.getPostage());
|
||||
}else{
|
||||
if(YtStatusEnum.ACCEPT.getValue().equals(express.getStatus()) || YtStatusEnum.WAIT.getValue().equals(express.getStatus())){
|
||||
} else {
|
||||
if (YtStatusEnum.ACCEPT.getValue().equals(express.getStatus()) || YtStatusEnum.WAIT.getValue().equals(express.getStatus())) {
|
||||
totalAmt = totalAmt.add(detail.getPostage());
|
||||
}
|
||||
}
|
||||
}
|
||||
MsgException.check(dto.getRefundAmt().compareTo(totalAmt) > 0,"退款金额超出商品金额");
|
||||
if(DeviceOrderStatus.SUCC_PAY.getStatus().equals(detail.getStatus())
|
||||
MsgException.check(dto.getRefundAmt().compareTo(totalAmt) > 0, "退款金额超出商品金额");
|
||||
if (DeviceOrderStatus.SUCC_PAY.getStatus().equals(detail.getStatus())
|
||||
|| DeviceOrderStatus.RECEIV_ING.getStatus().equals(detail.getStatus())
|
||||
|| DeviceOrderStatus.REFUND_FAIL.getStatus().equals(detail.getStatus())
|
||||
|| DeviceOrderStatus.COMPLETED.getStatus().equals(detail.getStatus())){
|
||||
|| DeviceOrderStatus.COMPLETED.getStatus().equals(detail.getStatus())) {
|
||||
List<MercDeviceRefundImage> list = new ArrayList<>(16);
|
||||
for (String picUrl:dto.getPicList()) {
|
||||
MercDeviceRefundImage image = new MercDeviceRefundImage(detail,picUrl);
|
||||
for (String picUrl : dto.getPicList()) {
|
||||
MercDeviceRefundImage image = new MercDeviceRefundImage(detail, picUrl);
|
||||
list.add(image);
|
||||
}
|
||||
mdriService.saveBatch(list);
|
||||
@@ -198,72 +221,78 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
|
||||
/**
|
||||
* 设置退款单号
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void setRefundExpressNo(MercOrderDetailDTO dto) {
|
||||
MsgException.checkNull(dto.getId(),"退款详情订单ID为空");
|
||||
MsgException.checkBlank(dto.getRefundExpressNo(),"退款物流单号不能为空");
|
||||
MsgException.checkNull(dto.getId(), "退款详情订单ID为空");
|
||||
MsgException.checkBlank(dto.getRefundExpressNo(), "退款物流单号不能为空");
|
||||
dto.setStatus(MercOrderDetail.STATUS_REFUND_AGREE);
|
||||
baseMapper.updateById(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核退款
|
||||
*
|
||||
* @param orderDetail
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result<Object> auditRefund(MercOrderDetail orderDetail) {
|
||||
MsgException.checkNull(orderDetail.getId(),"退款详情订单ID为空");
|
||||
MsgException.checkBlank(orderDetail.getStatus(),"状态不能为空");
|
||||
MsgException.checkNull(orderDetail.getRefundAmt(),"退款金额不能为空");
|
||||
if(MercOrderDetail.STATUS_REFUND_FAIL.equals(orderDetail.getStatus())){
|
||||
MsgException.checkBlank(orderDetail.getRejectRemark(),"退款驳回,驳回原因不能为空!");
|
||||
MsgException.checkNull(orderDetail.getId(), "退款详情订单ID为空");
|
||||
MsgException.checkBlank(orderDetail.getStatus(), "状态不能为空");
|
||||
MsgException.checkNull(orderDetail.getRefundAmt(), "退款金额不能为空");
|
||||
if (MercOrderDetail.STATUS_REFUND_FAIL.equals(orderDetail.getStatus())) {
|
||||
MsgException.checkBlank(orderDetail.getRejectRemark(), "退款驳回,驳回原因不能为空!");
|
||||
}
|
||||
MercOrderDetail detail = baseMapper.selectById(orderDetail.getId());
|
||||
MsgException.checkNull(detail,"退款详情ID有误!");
|
||||
MsgException.checkNull(detail, "退款详情ID有误!");
|
||||
// MsgException.check(!MercOrderDetail.STATUS_REFUND_AGREE.equals(detail.getStatus()),"只能处理退货退款中的订单!");
|
||||
BigDecimal useRefundAmt = baseMapper.getUseRefundAmtByOrderNo(detail.getOrderNo());
|
||||
BigDecimal totalOrderAmt = detail.getPrice().multiply(BigDecimal.valueOf(detail.getNum())).add(detail.getPostage());
|
||||
if(orderDetail.getRefundAmt().add(useRefundAmt).compareTo(totalOrderAmt) > 0){
|
||||
if (orderDetail.getRefundAmt().add(useRefundAmt).compareTo(totalOrderAmt) > 0) {
|
||||
MsgException.throwException("退款金额超出当前订单可退款总额");
|
||||
}
|
||||
if(MercOrderDetail.STATUS_REFUND_SUCCESS.equals(orderDetail.getStatus())){
|
||||
phoneValidateCodeService.checkSmsVerifyCode(orderDetail.getPhone(),orderDetail.getVerifyCode());
|
||||
if (MercOrderDetail.STATUS_REFUND_SUCCESS.equals(orderDetail.getStatus())) {
|
||||
phoneValidateCodeService.checkSmsVerifyCode(orderDetail.getPhone(), orderDetail.getVerifyCode());
|
||||
MercOrderNew orderByNo = mercOrderNewMapper.getOrderByNo(detail.getOrderNo());
|
||||
MsgException.checkNull(orderByNo,"订单有误!");
|
||||
MsgException.checkNull(orderByNo, "订单有误!");
|
||||
Integer channel = orderByNo.getChannel();
|
||||
MsgException.checkNull(channel,"通道未知,退款失败");
|
||||
MsgException.checkNull(channel, "通道未知,退款失败");
|
||||
Map<String, Object> result = null;
|
||||
MerchantOrder order = new MerchantOrder();
|
||||
order.convert(orderByNo,orderDetail.getRefundAmt(), SettleTypeEnum.D1.getValue(), detail.getRefundReason());
|
||||
switch (channel){
|
||||
order.convert(orderByNo, orderDetail.getRefundAmt(), SettleTypeEnum.D1.getValue(), detail.getRefundReason());
|
||||
switch (channel) {
|
||||
case 1:
|
||||
MerchantChannelStatus channelInfo = merchantChannelStatusMapper.getByMerchantCode(orderByNo.getMerchantCode(), 1);
|
||||
MsgException.checkNull(channelInfo, "收款商户通道信息异常!");
|
||||
result = sxfPayService.refundPay(order, channelInfo.getMerchantId());
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
MsgException.throwException("当前订单所属通道不支持退款");
|
||||
break;
|
||||
case 4:
|
||||
//银盛退款
|
||||
/* //银盛退款
|
||||
MerchantChannelStatus channelInfo = merchantChannelStatusMapper.getByMerchantCode(orderByNo.getMerchantCode(), 4);
|
||||
MsgException.checkNull(channelInfo,"收款商户通道信息异常!");
|
||||
MsgException.checkNull(channelInfo, "收款商户通道信息异常!");
|
||||
result = ysPayOldService.refundPay(order, channelInfo.getMerchantId());
|
||||
break;
|
||||
break;*/
|
||||
case 5:
|
||||
//原生通道退款 TODO 不支持微信支付 因为微信支付走对公账户 所以这里加一个验证
|
||||
MsgException.check(!Constant.PAY_TYPE_ALIPAY.equals(orderByNo.getPayType()),"当前订单支付方式不支持退款!");
|
||||
MsgException.check(!Constant.PAY_TYPE_ALIPAY.equals(orderByNo.getPayType()), "当前订单支付方式不支持退款!");
|
||||
result = aliService.refundV2(detail);
|
||||
break;
|
||||
default:
|
||||
MsgException.throwException("未知通道");
|
||||
break;
|
||||
}
|
||||
int code = (int)result.get("code");
|
||||
int code = (int) result.get("code");
|
||||
String msg = (String) result.get("msg");
|
||||
String refundNo = (String) result.get("refundNo");
|
||||
if(code != ResultCode.SUCCESS.code()){
|
||||
if (code != ResultCode.SUCCESS.code()) {
|
||||
return ResultGenerator.genFailResult(msg);
|
||||
}
|
||||
detail.setRefundTime(DateUtils.currentDate());
|
||||
@@ -277,74 +306,111 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
detail.setStatus(orderDetail.getStatus());
|
||||
detail.setRejectRemark(orderDetail.getRejectRemark());
|
||||
baseMapper.updateById(detail);
|
||||
return ResultGenerator.genSuccessResult("处理成功",null);
|
||||
return ResultGenerator.genSuccessResult("处理成功", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Object> getVerifyCode(PhoneValidateCode phoneValidateCode) {
|
||||
MsgException.checkBlank(phoneValidateCode.getPhone(),"获取失败,手机号为空");
|
||||
String checkCode = StringUtil.random(4);
|
||||
MsgException.checkBlank(phoneValidateCode.getPhone(), "获取失败,手机号为空");
|
||||
String checkCode = StringUtil.random(6);
|
||||
phoneValidateCode.setCode(checkCode);
|
||||
JSONObject result = validateCodeUtil.requestManageValidateCode(phoneValidateCode.getPhone(),checkCode);
|
||||
if(result.getIntValue("code") != ResultCode.SUCCESS.code()){
|
||||
//JSONObject result = validateCodeUtil.requestManageValidateCode(phoneValidateCode.getPhone(), checkCode);
|
||||
/*if (result.getIntValue("code") != ResultCode.SUCCESS.code()) {
|
||||
return ResultGenerator.genFailResult(result.getString("msg"));
|
||||
}*/
|
||||
|
||||
Client client = null;
|
||||
try {
|
||||
|
||||
client = createClient();
|
||||
// 1.发送短信
|
||||
com.aliyun.dysmsapi20170525.models.SendSmsRequest sendSmsRequest = new com.aliyun.dysmsapi20170525.models.SendSmsRequest()
|
||||
.setSignName("超掌柜")
|
||||
.setTemplateCode("SMS_244665149")
|
||||
.setTemplateParam("{\"code\":" + "'" + checkCode + "'" + "}")
|
||||
.setPhoneNumbers(phoneValidateCode.getPhone());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime);
|
||||
|
||||
if (sendSmsResponse.getStatusCode() != 200) {
|
||||
return ResultGenerator.genFailResult(sendSmsResponse.getBody().getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
phoneValidateCode.setSendDt(DateUtils.currentDate());
|
||||
phoneValidateCode.setStatus("1");
|
||||
phoneValidateCodeService.savePhoneValidateCode(phoneValidateCode);
|
||||
return ResultGenerator.genSuccessResult("获取成功",null);
|
||||
return ResultGenerator.genSuccessResult("获取成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信(阿里云)
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Client createClient() throws Exception {
|
||||
Config config = new Config();
|
||||
config.accessKeyId = ACCESSKEYID;
|
||||
config.accessKeySecret = ACCESSKEYSECRET;
|
||||
return new com.aliyun.dysmsapi20170525.Client(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送物流信息
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Result<Object> printLogistInfo(List<Long> ids) {
|
||||
MsgException.check(ids.isEmpty(),"未选中订单数据!");
|
||||
MsgException.check(ids.isEmpty(), "未选中订单数据!");
|
||||
List<MercOrderDetail> list = baseMapper.selectBatchIds(ids);
|
||||
MsgException.check(list.isEmpty(),"订单数据异常!");
|
||||
MsgException.check(list.isEmpty(), "订单数据异常!");
|
||||
boolean flag = false;
|
||||
for (MercOrderDetail detail:list) {
|
||||
if(!MercOrderDetail.STATUS_PAYED.equals(detail.getStatus())){
|
||||
for (MercOrderDetail detail : list) {
|
||||
if (!MercOrderDetail.STATUS_PAYED.equals(detail.getStatus())) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
MsgException.check(flag,"只能处理已支付的订单!");
|
||||
MsgException.check(flag, "只能处理已支付的订单!");
|
||||
MercOrderDetail detail = list.get(0);
|
||||
MercOrderNew order = mercOrderNewMapper.getOrderByNo(detail.getOrderNo());
|
||||
MsgException.checkNull(order,"订单数据异常!");
|
||||
JSONObject result = ytLogistHandler.createYtOrderV2(list,order);
|
||||
if(result.getIntValue("code") != ResultCode.SUCCESS.code()){
|
||||
MsgException.checkNull(order, "订单数据异常!");
|
||||
JSONObject result = ytLogistHandler.createYtOrderV2(list, order);
|
||||
if (result.getIntValue("code") != ResultCode.SUCCESS.code()) {
|
||||
MsgException.throwException(result.getString("message"));
|
||||
}
|
||||
JSONObject data = result.getJSONObject("data");
|
||||
UpdateWrapper<MercOrderDetail> updateWrapper = new UpdateWrapper<MercOrderDetail>().in("id",ids)
|
||||
.set("logistNo",data.getString("logistNo")).set("expressNo",data.getString("expressNo"))
|
||||
.set("status",MercOrderDetail.STATUS_UN_RECEIVED);
|
||||
UpdateWrapper<MercOrderDetail> updateWrapper = new UpdateWrapper<MercOrderDetail>().in("id", ids)
|
||||
.set("logistNo", data.getString("logistNo")).set("expressNo", data.getString("expressNo"))
|
||||
.set("status", MercOrderDetail.STATUS_UN_RECEIVED);
|
||||
update(updateWrapper);
|
||||
MercOrderExpress orderExpress = new MercOrderExpress();
|
||||
MercOrderExpress orderExpress = new MercOrderExpress();
|
||||
orderExpress.setOrderNo(order.getOrderNo());
|
||||
orderExpress.setLogistNo(data.getString("logistNo"));
|
||||
orderExpress.setExpressNo(data.getString("expressNo"));
|
||||
orderExpress.setType(MercOrderExpress.EXPRESS_TYPE_HAIR);
|
||||
orderExpress.setStatus(YtStatusEnum.ACCEPT.getValue());
|
||||
mercOrderExpressService.save(orderExpress);
|
||||
return ResultGenerator.genSuccessResult("处理成功",null);
|
||||
return ResultGenerator.genSuccessResult("处理成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<MercOrderDetail> pageInfo(Page<MercOrderDetail> page, MercOrderDetail condition) {
|
||||
return baseMapper.pageInfo(page,condition);
|
||||
return baseMapper.pageInfo(page, condition);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -364,22 +430,23 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
|
||||
/**
|
||||
* 填写快递单号
|
||||
*
|
||||
* @param id
|
||||
* @param expressNo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<Object> inputExpressNo(Long id, String expressNo) {
|
||||
MsgException.checkNull(id,"订单ID不能为空!");
|
||||
MsgException.checkBlank(expressNo,"快递单号不能为空!");
|
||||
MsgException.checkNull(id, "订单ID不能为空!");
|
||||
MsgException.checkBlank(expressNo, "快递单号不能为空!");
|
||||
MercOrderDetail detail = baseMapper.selectById(id);
|
||||
MsgException.checkNull(detail,"订单数据异常!");
|
||||
MsgException.check(!MercOrderDetail.STATUS_PAYED.equals(detail.getStatus()),"只能处理已支付的订单数据");
|
||||
MsgException.check(StringUtil.isNotEmpty(detail.getExpressNo()),"当前订单已存在物流单号,请勿重复填写");
|
||||
MsgException.checkNull(detail, "订单数据异常!");
|
||||
MsgException.check(!MercOrderDetail.STATUS_PAYED.equals(detail.getStatus()), "只能处理已支付的订单数据");
|
||||
MsgException.check(StringUtil.isNotEmpty(detail.getExpressNo()), "当前订单已存在物流单号,请勿重复填写");
|
||||
detail.setStatus(MercOrderDetail.STATUS_UN_RECEIVED);
|
||||
detail.setExpressNo(expressNo);
|
||||
MercOrderExpress express = mercOrderExpressService.getByExpressNo(expressNo);
|
||||
if(express == null){
|
||||
if (express == null) {
|
||||
express = new MercOrderExpress();
|
||||
express.setLogistNo(detail.getLogistNo());
|
||||
express.setOrderNo(detail.getOrderNo());
|
||||
@@ -389,17 +456,18 @@ public class MercOrderDetailServiceImpl extends ServiceImpl<MercOrderDetailMappe
|
||||
mercOrderExpressService.save(express);
|
||||
}
|
||||
baseMapper.updateById(detail);
|
||||
return ResultGenerator.genSuccessResult("操作成功",null);
|
||||
return ResultGenerator.genSuccessResult("操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号和code查询订单信息
|
||||
*
|
||||
* @param orderNo
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MercOrderDetail> listByOrderNoAndCode(String orderNo, String code) {
|
||||
return baseMapper.listByOrderNoAndCode(orderNo,code);
|
||||
return baseMapper.listByOrderNoAndCode(orderNo, code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,26 @@ package cn.pluss.platform.device.impl;
|
||||
|
||||
import cn.pluss.platform.device.MercOrderExpressService;
|
||||
import cn.pluss.platform.entity.MercOrderExpress;
|
||||
import cn.pluss.platform.enums.LogisticProvider;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.MercOrderExpressMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import cn.pluss.platform.util.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MercOrderExpressServiceImpl extends ServiceImpl<MercOrderExpressMapper, MercOrderExpress> implements MercOrderExpressService {
|
||||
|
||||
public static final String CHECK_Express = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx";
|
||||
/**
|
||||
* 根据上送物流单号查询商户单号
|
||||
* @param logistNo
|
||||
@@ -24,4 +36,57 @@ public class MercOrderExpressServiceImpl extends ServiceImpl<MercOrderExpressMap
|
||||
public MercOrderExpress getByExpressNo(String expressNo) {
|
||||
return baseMapper.getByExpressNo(expressNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getExpressInfo(String expressNo) throws Exception {
|
||||
if (expressNo.isEmpty()){
|
||||
throw new MsgException("暂无相应的快递单号");
|
||||
}
|
||||
JSONObject reqData = new JSONObject();
|
||||
String subThree = expressNo.substring(0, 3);
|
||||
if ("268".equals(subThree) || "368".equals(subThree) || "468".equals(subThree)|| "334".equals(subThree)
|
||||
|| "888".equals(subThree) || "77".equals(expressNo.substring(0,2))){
|
||||
reqData.put("ShipperCode", LogisticProvider.STO.getCode());
|
||||
} else if ("YT".equals(expressNo.substring(0,2))){
|
||||
reqData.put("ShipperCode", LogisticProvider.YTO.getCode());
|
||||
} else if ("55".equals(expressNo.substring(0,2))){
|
||||
reqData.put("ShipperCode", LogisticProvider.HTKY.getCode());
|
||||
}else {
|
||||
return new JSONObject();
|
||||
}
|
||||
reqData.put("LogisticCode", expressNo);
|
||||
|
||||
JSONObject jsonObject = reqJsonData(reqData);
|
||||
if (!(Boolean) jsonObject.get("Success")){
|
||||
log.info("快递查询错误===========>",jsonObject.get("Reason"));
|
||||
throw new MsgException("快递查询失败");
|
||||
}
|
||||
return jsonObject;
|
||||
|
||||
}
|
||||
public JSONObject reqJsonData(JSONObject requestData)throws Exception{
|
||||
|
||||
Map<String, Object> hashMap = new HashMap<>(16);
|
||||
hashMap.put("RequestData", requestData);
|
||||
hashMap.put("EBusinessID", ParametersUtil.USERID);
|
||||
hashMap.put("RequestType", "1002");
|
||||
hashMap.put("DataSign", dataSign(requestData));
|
||||
hashMap.put("DataType", "2");
|
||||
|
||||
HttpResult httpResult = HttpUtil.doPost(CHECK_Express, hashMap);
|
||||
JSONObject jsonObject = JSON.parseObject(httpResult.getBody());
|
||||
return jsonObject;
|
||||
}
|
||||
private String dataSign(JSONObject requestData)throws Exception{
|
||||
String sign = requestData.toString()+ParametersUtil.APIKEY;
|
||||
//首先再进行MD5
|
||||
String lowerMD5 = MD5Util.md5(sign).toLowerCase();
|
||||
//然后再进行Base64
|
||||
final byte[] lowerMD5Bytes = lowerMD5.getBytes(StandardCharsets.UTF_8);
|
||||
String base64= Base64.getEncoder().encodeToString(lowerMD5Bytes);
|
||||
//再进行base64URL编码
|
||||
return URLEncoder.encode(base64, "UTF-8");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import cn.pluss.platform.mapper.*;
|
||||
import cn.pluss.platform.openAccount.OpenAccountRecordService;
|
||||
import cn.pluss.platform.pay.PayService;
|
||||
import cn.pluss.platform.postageConfig.PostageConfigService;
|
||||
import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import cn.pluss.platform.userAddress.UserAddressService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
@@ -108,6 +109,9 @@ public class MercOrderNewServiceImpl extends ServiceImpl<MercOrderNewMapper, Mer
|
||||
@Resource
|
||||
private MerchantStoreMapper merchantStoreMapper;
|
||||
|
||||
@Resource
|
||||
private SxfPayService sxfPayService;
|
||||
|
||||
/**
|
||||
* 设备订单分页查询
|
||||
*
|
||||
@@ -446,13 +450,13 @@ public class MercOrderNewServiceImpl extends ServiceImpl<MercOrderNewMapper, Mer
|
||||
Integer channel = order.getChannel();
|
||||
MsgException.checkNull(channel, "未知通道");
|
||||
switch (channel) {
|
||||
case 4:
|
||||
case 1:
|
||||
//银盛通道
|
||||
MerchantChannelStatus channelStatus = mcsMapper.getByMerchantCode(order.getMerchantCode(), channel);
|
||||
MsgException.checkNull(channelStatus, "当前通道信息异常!");
|
||||
MerchantOrder mo = new MerchantOrder();
|
||||
order.convert(mo, null);
|
||||
JSONObject resp = ysPayOldService.tradeQuery(mo, channelStatus.getMerchantId());
|
||||
JSONObject resp = sxfPayService.tradeQuery(mo, channelStatus.getMerchantId());
|
||||
if (ResultCode.FAIL.code() == resp.getIntValue("code")) {
|
||||
MsgException.throwException("查询失败:失败原因:" + resp.getString("msg"));
|
||||
}
|
||||
|
||||
@@ -101,4 +101,6 @@ public interface DeviceStockService extends IService<DeviceStock> {
|
||||
void bindDevcieV2(DeviceStockDTO dto);
|
||||
|
||||
DeviceStock checkBind(String sn);
|
||||
|
||||
DeviceStock getDeviceBySnNo(String sn);
|
||||
}
|
||||
|
||||
@@ -399,6 +399,14 @@ public class DeviceStockServiceImpl extends ServiceImpl<DeviceStockMapper, Devic
|
||||
return deviceBySnNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStock getDeviceBySnNo(String sn) {
|
||||
MsgException.checkBlank(sn,"缺失设备SN号");
|
||||
DeviceStock deviceBySnNo = baseMapper.getDeviceBySnNo(sn);
|
||||
MsgException.checkBlank(deviceBySnNo.getActMercId(),"未绑定扫码pos");
|
||||
return deviceBySnNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E extends IPage<DeviceStock>> E page(E page, Wrapper<DeviceStock> queryWrapper) {
|
||||
DeviceStock deviceStock = queryWrapper.getEntity();
|
||||
|
||||
@@ -46,13 +46,13 @@ public class PushServiceImpl extends ServiceImpl<PushAllMapper, PushAll> impleme
|
||||
|
||||
switch (type) {
|
||||
case MAKE_ORDER:
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "收银呗", "收银呗线上店订单来了请及时处理", "3");
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "快银收银", "快银收银线上店订单来了请及时处理", "3");
|
||||
break;
|
||||
case URGE_ORDER:
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "收银呗", "您有一笔催单请及时处理", "3");
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "快银收银", "您有一笔催单请及时处理", "3");
|
||||
break;
|
||||
case REQUEST_SERVICE:
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "收银呗", "您有一个新的呼叫服务请及时处理", "3");
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "快银收银", "您有一个新的呼叫服务请及时处理", "3");
|
||||
break;
|
||||
case REFUND_ORDER:
|
||||
generalPushUtil.sendAllPlatByAlias(alias, "收银呗", "您有一笔未接单的线上店订单,客户已申请退款。", "2");
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 收银呗缴费通收款单 服务类
|
||||
* 快银收银缴费通收款单 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author crystal
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.pluss.platform.klk;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
public class LaKaLaUtility {
|
||||
// static String pubKey ="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7\n" +
|
||||
// "ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1\n" +
|
||||
// "/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB";
|
||||
//测试公钥
|
||||
private static String pubKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvO9EN9W6OG7y72VUWZili4m8DlD+TMofgIl96OPX9fRBS7Icg3oIqxmU20xFbiswJ2cCU6I1gbE7GDM14CihLQd26xW5T/8TmHCaVFFy1b9AWHNK7sW3aNd2KK1PI3h4gS38ND8jqvdr/8YZSCNF2KOoOe3F17FqVecBdq+1VZQIDAQAB";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String data="TOykml1JtGtrNL8rS+Aj/FOaq87eERTCUt9uZJk/ObFvuX5TRstQSl9fP3J2UTjSPO0b/p3Sh8Sxi1w9a6YuDQL9rrZ9orpWpEU+vg8H99fVZnvFjozB4HJf7NE5S9z7Mah93zW7TY1TFS55pIDv4go/fOtGTUcReUY0uFpZQote41m9KHvcjv5HiyCKaT/4cOoSMzHrsRiThwsU+rCDTzI4C32obwrXDOiaMd45wU4GL9/YMfHSpPOqgcsRZIWSBi2Pgt4nJX/s4uxVLzzKG00A8Jxa+yo0JZEgWRuHkOgcrV2Mxg8WmnXug8KeZBSeqYyvPXG9hy32q2phEwd1c6AYEOAKRu3QVhXEyDWjXkn86nvPimn8aohxYaAjky4E66LTnNIPNKOkwC5KVG27H9Fv27ZgqpDzRpYvaRExBT3RjJxXssLBRQ/eejOf7uuq0RgDUqFfwqOICqIUb8qbos6qu+QIsY2tvkbsMB1ZmD3s1SviHmvxWisD0VE/ZTDVQwDLUiORTwaMExirkc0s5bcB51FHHs2TFDa1raa/kSQwL/ADS0yAWNctiQGQtymErEmiD9iFdGXMvgjbqJ7KsDTAotKuYh9VzIA/RuAy+lpajvCIG6NOy428VHHin+RcXe/Ztx1UUHVk3xrHWNYG2aI4yyTLcz0EbG7rcOgWFwI=";
|
||||
// String data ="hplFXwPU1gbHYwraQM/fKEcoIkBfHD07VSH99OnKTZk9HJRFAvZyOm9nsdeSi8t/UdGPn+LXldrjZ7wiY+F5MzGlIdEma7agKZyHJ+UO6CrDJfYFMwlPUOgO+Pq5ljg6QOdZBxBLEHkRMkQnC/CTv9vQnPDqeCv4MvAbHJspADGRRPvmjxtzf0J4OQgP3hj9+ZqH+btsuX+W+YZRXRMYL+uOQkSJhMUv31hc9MAC/1Sp0C9cBcHKxr+idS+0CCjvD8WzLbXv2QuOSQccIKQw+Je8RMeuKs8f64MibCkf+RkilTCVCEd5apL1MkhYJZoUVzqPXmDBLjaJgr987X1wBAzQMS8+F34Vl/BonKPuJ4RRwdE/M3WJ+ZfM2WiLawpU7ZqUQdVY2bwJO801TcmFCswLoz2qxHHsBsjXtQPqMOj3pw3Kvz3WH3oWmcFRZjHKIbDSy9Jh2STEFRbvVWarjksBVjXkcbletDtOtY0T8XCdiiNoQNlVNj5kH5QkAWmt";
|
||||
String decrypt = LaKaLaUtility.decrypt(data);
|
||||
System.out.println("解密结果:" + decrypt);
|
||||
}
|
||||
/**
|
||||
* 公钥解密
|
||||
* @param
|
||||
* @param data Base64 数据
|
||||
* @return 解密字符串
|
||||
* @throws Exception 解密异常
|
||||
*/
|
||||
public static String decrypt(String data){
|
||||
try {
|
||||
Base64.Decoder decoder = Base64.getDecoder();
|
||||
byte[] keyBytes = decoder.decode(pubKey.getBytes());
|
||||
byte[] dataBytes = decoder.decode(data.getBytes());
|
||||
Cipher cipher = Cipher.getInstance("RSA");
|
||||
cipher.init(Cipher.DECRYPT_MODE,
|
||||
KeyFactory.getInstance("RSA").generatePublic(new
|
||||
X509EncodedKeySpec(keyBytes)));
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
byte[] cache;
|
||||
for (int i = 0, offset = 0, length = dataBytes.length; length -
|
||||
offset > 0; i++, offset = i * 128) {
|
||||
if (length - offset > 128) {
|
||||
cache = cipher.doFinal(dataBytes, offset, 128);
|
||||
} else {
|
||||
cache = cipher.doFinal(dataBytes, offset, length - offset);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
}
|
||||
return out.toString();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
196
pluss-service-bundle/src/main/java/cn/pluss/platform/klk/cache/MemoryCache.java
vendored
Normal file
196
pluss-service-bundle/src/main/java/cn/pluss/platform/klk/cache/MemoryCache.java
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
package cn.pluss.platform.klk.cache;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.*;
|
||||
/**
|
||||
* 暂时用jdk的缓存
|
||||
* */
|
||||
public class MemoryCache {
|
||||
//键值对集合
|
||||
private final static Map<String, Entity> map = new HashMap<>();
|
||||
//定时器线程池,用于清除过期缓存
|
||||
private final static ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
|
||||
/**
|
||||
* 添加缓存
|
||||
* 可用 synchronized 加锁
|
||||
* @param key 键
|
||||
* @param data 值
|
||||
*/
|
||||
public static void put(String key, Object data) {
|
||||
MemoryCache.put(key, data, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加缓存
|
||||
* 可用 synchronized 加锁
|
||||
* @param key 键
|
||||
* @param data 值
|
||||
* @param expire 过期时间,单位:毫秒, 0表示无限长
|
||||
*/
|
||||
public static void put(String key, Object data, long expire) {
|
||||
//清除原键值对
|
||||
MemoryCache.remove(key);
|
||||
//设置过期时间
|
||||
if (expire > 0) {
|
||||
Future future = executor.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//过期后清除该键值对
|
||||
synchronized (MemoryCache.class) {
|
||||
map.remove(key);
|
||||
}
|
||||
}
|
||||
}, expire, TimeUnit.MILLISECONDS);
|
||||
map.put(key, new Entity(data, future));
|
||||
} else {
|
||||
//不设置过期时间
|
||||
map.put(key, new Entity(data, null));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取缓存
|
||||
* 可用 synchronized 加锁
|
||||
* @param key 键
|
||||
* @return
|
||||
*/
|
||||
public static Object get(String key) {
|
||||
Entity entity = map.get(key);
|
||||
return entity == null ? null : entity.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取缓存
|
||||
* 可用 synchronized 加锁
|
||||
* @param key 键
|
||||
* @param clazz 值类型
|
||||
* @return
|
||||
*/
|
||||
public static <T> T get(String key, Class<T> clazz) {
|
||||
return clazz.cast(MemoryCache.get(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
* 可用 synchronized 加锁
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public static Object remove(String key) {
|
||||
//清除原缓存数据
|
||||
Entity entity = map.remove(key);
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
//清除原键值对定时器
|
||||
Future future = entity.getFuture();
|
||||
if (future != null) {
|
||||
future.cancel(true);
|
||||
}
|
||||
return entity.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前缓存的键值对数量
|
||||
* 可用 synchronized 加锁
|
||||
* @return
|
||||
*/
|
||||
public static int size() {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存实体类
|
||||
*/
|
||||
private static class Entity {
|
||||
//键值对的value
|
||||
private Object value;
|
||||
//定时器Future
|
||||
private Future future;
|
||||
|
||||
public Entity(Object value, Future future) {
|
||||
this.value = value;
|
||||
this.future = future;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取值
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Future对象
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Future getFuture() {
|
||||
return future;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
||||
String key = "id";
|
||||
//不设置过期时间
|
||||
System.out.println("***********不设置过期时间**********");
|
||||
MemoryCache.put(key, 123);
|
||||
System.out.println("key:" + key + ", value:" + MemoryCache.get(key));
|
||||
System.out.println("key:" + key + ", value:" + MemoryCache.remove(key));
|
||||
System.out.println("key:" + key + ", value:" + MemoryCache.get(key));
|
||||
|
||||
//设置过期时间
|
||||
System.out.println("\n***********设置过期时间**********");
|
||||
MemoryCache.put(key, "123456", 1000);
|
||||
System.out.println("key:" + key + ", value:" + MemoryCache.get(key));
|
||||
TimeUnit.MILLISECONDS.sleep(1500);
|
||||
System.out.println("key:" + key + ", value:" + MemoryCache.get(key));
|
||||
|
||||
/******************并发性能测试************/
|
||||
System.out.println("\n***********并发性能测试************");
|
||||
//创建有10个线程的线程池,将1000000次操作分10次添加到线程池
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(10);
|
||||
Future[] futures = new Future[10];
|
||||
/********添加********/
|
||||
{
|
||||
long start = System.currentTimeMillis();
|
||||
for (int j = 0; j < 10; j++) {
|
||||
futures[j] = executorService.submit(() -> {
|
||||
for (int i = 0; i < 100000; i++) {
|
||||
MemoryCache.put(Thread.currentThread().getId() + key + i, i, 300000);
|
||||
}
|
||||
});
|
||||
}
|
||||
//等待全部线程执行完成,打印执行时间
|
||||
for (Future future : futures) {
|
||||
future.get();
|
||||
}
|
||||
System.out.printf("添加耗时:%dms\n", System.currentTimeMillis() - start);
|
||||
}
|
||||
|
||||
/********查询********/
|
||||
{
|
||||
long start = System.currentTimeMillis();
|
||||
for (int j = 0; j < 10; j++) {
|
||||
futures[j] = executorService.submit(() -> {
|
||||
for (int i = 0; i < 100000; i++) {
|
||||
Object obj = MemoryCache.get(Thread.currentThread().getId() + key + i);
|
||||
System.out.println("cacheObj:" + obj);
|
||||
}
|
||||
});
|
||||
}
|
||||
//等待全部线程执行完成,打印执行时间
|
||||
for (Future future : futures) {
|
||||
future.get();
|
||||
}
|
||||
System.out.printf("查询耗时:%dms\n", System.currentTimeMillis() - start);
|
||||
}
|
||||
|
||||
System.out.println("当前缓存容量:" + MemoryCache.size());
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user