|
@@ -6,11 +6,14 @@ import com.emato.biz.domain.OmsUtils;
|
|
|
import com.emato.biz.domain.mall.InventoryDataPushVo;
|
|
|
import com.emato.biz.domain.mall.InventoryDataVo;
|
|
|
import com.emato.biz.domain.mall.NewSystemFormatEntiy;
|
|
|
+import com.emato.biz.domain.merchant.MerchantSecret;
|
|
|
import com.emato.biz.mapper.mall.InventoryDataMapper;
|
|
|
import com.emato.biz.mapper.mall.MallMngChangeMapper;
|
|
|
+import com.emato.biz.mapper.merchant.MerchantSecretMapper;
|
|
|
import com.emato.biz.service.mall.ISalesDetaiServicel;
|
|
|
import com.emato.common.core.Result;
|
|
|
import com.emato.common.utils.DateUtils;
|
|
|
+import com.emato.common.utils.StringUtils;
|
|
|
import com.emato.common.utils.sign.Md5Utils;
|
|
|
import com.emato.system.mapper.SysConfigMapper;
|
|
|
import org.slf4j.Logger;
|
|
@@ -42,6 +45,8 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
|
|
|
@Autowired
|
|
|
private SysConfigMapper configMapper;
|
|
|
@Autowired
|
|
|
+ private MerchantSecretMapper merchantSecretMapper;
|
|
|
+ @Autowired
|
|
|
private OmsUtils omsUtils;
|
|
|
|
|
|
/**
|
|
@@ -69,13 +74,33 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
|
|
|
String strSign = weChatMapSalesMsg.get("sign").toString().trim();
|
|
|
String merchId = weChatMapSalesMsg.get("merchId").toString().trim()==null?"":weChatMapSalesMsg.get("merchId").toString().trim();
|
|
|
String timestamp = weChatMapSalesMsg.get("timestamp").toString().trim()==null?"":weChatMapSalesMsg.get("timestamp").toString().trim();
|
|
|
- String str = configMapper.getConfigValue("salesdetai").trim();;
|
|
|
- if(timestamp.equals("")||merchId.equals("")){
|
|
|
- return Result.error("900051","参数错误");
|
|
|
+
|
|
|
+ // String str = configMapper.getConfigValue("salesdetai").trim();
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(merchId)){
|
|
|
+ return Result.error("900051","merchId为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 改为使用密钥配置
|
|
|
+ MerchantSecret merchantSecret = new MerchantSecret();
|
|
|
+ merchantSecret.setMerchSn(merchId);
|
|
|
+
|
|
|
+ List<MerchantSecret> merchantSecrets = merchantSecretMapper.selectMerchantSecretList(merchantSecret);
|
|
|
+ if (null == merchantSecrets || merchantSecrets.isEmpty()) {
|
|
|
+ return Result.error("900051","merchId参数错误");
|
|
|
}
|
|
|
- if(!strSign.trim().equals(checkType(weChatMapSalesMsg.get("data").toString(),timestamp,str))){
|
|
|
- return Result.error("900052","签名错误");
|
|
|
+
|
|
|
+ MerchantSecret MerchantSecret_2 = merchantSecrets.get(0);
|
|
|
+ String str = MerchantSecret_2.getMd5Salt();
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(timestamp)){
|
|
|
+ return Result.error("900051","timestamp为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!strSign.trim().equals(checkType(weChatMapSalesMsg.get("data").toString(), timestamp, str))) {
|
|
|
+ return Result.error("900052", "签名错误");
|
|
|
}
|
|
|
+
|
|
|
Map<String, Object> weSalesMsg = JSONObject.toJavaObject(JSON.parseObject(weChatMapSalesMsg.get("data").toString()), Map.class);
|
|
|
|
|
|
String starTime = (String) weSalesMsg.get("starTime");
|
|
@@ -168,13 +193,35 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
|
|
|
String strSign = weChatMapMsg.get("sign").toString().trim();
|
|
|
String merchId = weChatMapMsg.get("merchId").toString().trim()==null?"":weChatMapMsg.get("merchId").toString().trim();
|
|
|
String timestamp = weChatMapMsg.get("timestamp").toString().trim()==null?"":weChatMapMsg.get("timestamp").toString().trim();
|
|
|
- String str = configMapper.getConfigValue("inventory");;
|
|
|
- if(timestamp.equals("")||merchId.equals("")){
|
|
|
- return Result.error("900001","参数错误");
|
|
|
+
|
|
|
+
|
|
|
+ // String str = configMapper.getConfigValue("inventory");
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(merchId)){
|
|
|
+ return Result.error("900051","merchId为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 改为使用密钥配置
|
|
|
+ MerchantSecret merchantSecret = new MerchantSecret();
|
|
|
+ merchantSecret.setMerchSn(merchId);
|
|
|
+
|
|
|
+ List<MerchantSecret> merchantSecrets = merchantSecretMapper.selectMerchantSecretList(merchantSecret);
|
|
|
+ if (null == merchantSecrets || merchantSecrets.isEmpty()) {
|
|
|
+ return Result.error("900051","merchId参数错误");
|
|
|
}
|
|
|
- if(!strSign.trim().equals(checkType(weChatMapMsg.get("data").toString(),timestamp,str))){
|
|
|
- return Result.error("900002","签名错误");
|
|
|
+
|
|
|
+ MerchantSecret MerchantSecret_2 = merchantSecrets.get(0);
|
|
|
+ String str = MerchantSecret_2.getMd5Salt();
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(timestamp)){
|
|
|
+ return Result.error("900051","timestamp为空");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!strSign.trim().equals(checkType(weChatMapMsg.get("data").toString(), timestamp, str))) {
|
|
|
+ return Result.error("900002", "签名错误");
|
|
|
}
|
|
|
+
|
|
|
Map<String, Object> weDtilMsg = JSONObject.toJavaObject(JSON.parseObject(weChatMapMsg.get("data").toString()), Map.class);
|
|
|
Integer pageIndex = Integer.parseInt(weDtilMsg.get("pageIndex")+"");
|
|
|
Integer pageSize = Integer.parseInt(weDtilMsg.get("pageSize")+"");
|