Merge branch 'test' into prod
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.cache.annotation.CacheEvict;
|
|||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,36 +49,40 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void editStatusByShopIdList(Long mainShopId, Integer isEnable, boolean onyUpValid, String property, String useShopType, List<Long> shopIdList) {
|
public void editStatusByShopIdList(Long mainShopId, Integer isEnable, boolean onyUpValid, String property, String useShopType, List<Long> shopIdList) {
|
||||||
ShopConfig shopConfig = getOne(new QueryWrapper().eq(ShopConfig::getId, mainShopId));
|
ShopConfig shopConfig = getById(mainShopId);
|
||||||
if (shopConfig == null) {
|
if (shopConfig == null) {
|
||||||
shopConfig = new ShopConfig();
|
shopConfig = new ShopConfig();
|
||||||
shopConfig.setId(mainShopId);
|
shopConfig.setId(mainShopId);
|
||||||
save(shopConfig);
|
save(shopConfig);
|
||||||
}
|
}
|
||||||
List<Long> extistList = list(new QueryWrapper().in(ShopConfig::getId, shopIdList).select(ShopConfig::getId)).stream().map(ShopConfig::getId).toList();
|
// 防止报错
|
||||||
|
shopIdList.add(-9999L);
|
||||||
|
List<Long> extistList;
|
||||||
if (!shopIdList.isEmpty()) {
|
if (!shopIdList.isEmpty()) {
|
||||||
|
extistList = list(new QueryWrapper().in(ShopConfig::getId, shopIdList).select(ShopConfig::getId)).stream().map(ShopConfig::getId).toList();
|
||||||
shopIdList.stream().filter(id -> !extistList.contains(id)).forEach(id -> {
|
shopIdList.stream().filter(id -> !extistList.contains(id)).forEach(id -> {
|
||||||
save(new ShopConfig().setId(id).setMainId(mainShopId));
|
save(new ShopConfig().setId(id).setMainId(mainShopId).setIsEnableDiscount(0).setIsProductSuggest(0));
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
extistList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEnable == 0 && !onyUpValid) {
|
if (isEnable == 0 && !onyUpValid) {
|
||||||
updateChain().or(or -> {
|
updateChain().or(or -> {
|
||||||
or.eq(ShopConfig::getMainId, mainShopId);
|
or.eq(ShopConfig::getId, mainShopId);
|
||||||
}).or(or -> {
|
}).or(or -> {
|
||||||
or.in(ShopConfig::getId, shopIdList);
|
or.in(ShopConfig::getId, shopIdList);
|
||||||
}).set(property, 0).update();
|
}).set(property, 0).update();
|
||||||
}else {
|
}else {
|
||||||
if ("all".equals(useShopType)) {
|
if ("all".equals(useShopType)) {
|
||||||
updateChain().or(or -> {
|
updateChain().or(or -> {
|
||||||
or.eq(ShopConfig::getMainId, mainShopId);
|
or.eq(ShopConfig::getId, mainShopId);
|
||||||
}).or(or -> {
|
}).or(or -> {
|
||||||
or.in(ShopConfig::getId, shopIdList);
|
or.in(ShopConfig::getId, shopIdList);
|
||||||
}).set(property, 1).update();
|
}).set(property, 1).update();
|
||||||
}else {
|
}else {
|
||||||
if (shopIdList.isEmpty()) {
|
if (shopIdList.isEmpty()) {
|
||||||
updateChain().eq(ShopConfig::getMainId, mainShopId).set(property, 1).update();
|
updateChain().eq(ShopConfig::getId, mainShopId).set(property, 1).update();
|
||||||
}else {
|
}else {
|
||||||
if (!onyUpValid) {
|
if (!onyUpValid) {
|
||||||
updateChain().notIn(ShopConfig::getId, shopIdList).set(property, 0).update();
|
updateChain().notIn(ShopConfig::getId, shopIdList).set(property, 0).update();
|
||||||
|
|||||||
@@ -31,15 +31,20 @@ public class AppWxServiceImpl extends BaseWx {
|
|||||||
public void init() {
|
public void init() {
|
||||||
// 小程序id
|
// 小程序id
|
||||||
config.appId = paramsService.getSysParamValue("wx_mini_app_id");
|
config.appId = paramsService.getSysParamValue("wx_mini_app_id");
|
||||||
|
log.info("小程序id:{}", config.appId);
|
||||||
// 小程序secrete
|
// 小程序secrete
|
||||||
config.appSecret = paramsService.getSysParamValue("wx_mini_secrete");
|
config.appSecret = paramsService.getSysParamValue("wx_mini_secrete");
|
||||||
|
log.info("小程序secrete:{}", config.appSecret);
|
||||||
config.certPath = "";
|
config.certPath = "";
|
||||||
// 微信支付公钥
|
// 微信支付公钥
|
||||||
config.pubKey = paramsService.getSysParamValue("wx_pub_key");
|
config.pubKey = paramsService.getSysParamValue("wx_pub_key");
|
||||||
|
log.info("微信支付公钥:{}", config.pubKey);
|
||||||
// api支付证书私钥
|
// api支付证书私钥
|
||||||
config.apiCertKey = paramsService.getSysParamValue("wx_apiclient_key");
|
config.apiCertKey = paramsService.getSysParamValue("wx_apiclient_key");
|
||||||
|
log.info("api支付证书私钥:{}", config.apiCertKey);
|
||||||
// api支付证书公钥
|
// api支付证书公钥
|
||||||
config.apiCert = paramsService.getSysParamValue("wx_apiclient_cert");
|
config.apiCert = paramsService.getSysParamValue("wx_apiclient_cert");
|
||||||
|
log.info("api支付证书公钥:{}", config.apiCert);
|
||||||
try {
|
try {
|
||||||
config.privateKey = RsaKit.loadPrivateKey(config.apiCertKey);
|
config.privateKey = RsaKit.loadPrivateKey(config.apiCertKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -51,13 +56,17 @@ public class AppWxServiceImpl extends BaseWx {
|
|||||||
config.platformCertNo = "";
|
config.platformCertNo = "";
|
||||||
// 商户号
|
// 商户号
|
||||||
config.mchId = paramsService.getSysParamValue("wx_mch_id");
|
config.mchId = paramsService.getSysParamValue("wx_mch_id");
|
||||||
|
log.info("商户号:{}", config.mchId);
|
||||||
// v3密钥
|
// v3密钥
|
||||||
config.apiV3Key = paramsService.getSysParamValue("wx_v3_key");
|
config.apiV3Key = paramsService.getSysParamValue("wx_v3_key");
|
||||||
|
log.info("v3密钥:{}", config.apiV3Key);
|
||||||
config.apiV2Key = "";
|
config.apiV2Key = "";
|
||||||
// 回调地址
|
// 回调地址
|
||||||
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
config.notifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/pay";
|
||||||
|
log.info("回调地址:{}", config.notifyUrl);
|
||||||
config.refundNotifyUrl = "";
|
config.refundNotifyUrl = "";
|
||||||
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
config.transferNotifyUrl = paramsService.getSysParamValue("native_notify_url") + "/wx/transfer";
|
||||||
|
log.info("转账回调地址:{}", config.transferNotifyUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseWx getAppService() {
|
public BaseWx getAppService() {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
|
|||||||
memberConfig.setMemberPriceShopIdList(JSONObject.toJSONString(memberDTO.getMemberPriceShopIdList()));
|
memberConfig.setMemberPriceShopIdList(JSONObject.toJSONString(memberDTO.getMemberPriceShopIdList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
shopConfigService.editStatusByShopIdList(memberConfig.getShopId(), memberConfig.getIsOpen().intValue() == 1 && memberConfig.getIsMemberPrice() == 1 ? 1 : 0,false, "is_account_ay",
|
shopConfigService.editStatusByShopIdList(memberConfig.getShopId(), memberConfig.getIsOpen().intValue() == 1 && memberConfig.getIsMemberPrice() == 1 ? 1 : 0,false, "is_member_price",
|
||||||
"ALL".equals(memberConfig.getMemberPriceShopType()) ? "all" : "part",
|
"ALL".equals(memberConfig.getMemberPriceShopType()) ? "all" : "part",
|
||||||
StrUtil.isNotBlank(memberConfig.getMemberPriceShopIdList()) ? JSONArray.parseArray(memberConfig.getMemberPriceShopIdList()).toList(Long.class) : new ArrayList<>());
|
StrUtil.isNotBlank(memberConfig.getMemberPriceShopIdList()) ? JSONArray.parseArray(memberConfig.getMemberPriceShopIdList()).toList(Long.class) : new ArrayList<>());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user