Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/hai-server into 2.0-dev

master
胡锐 8 months ago
commit 7c6e737b67
  1. 25
      hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java
  2. 1
      hai-service/src/main/resources/dev/commonConfig.properties
  3. 5
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  4. 5
      hai-service/src/main/resources/prod/commonConfig.properties
  5. 28
      v1/src/main/java/com/v1/controller/WxMsgController.java

@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.PayloService; import com.hai.config.PayloService;
import com.hai.config.PetroConfig; import com.hai.config.PetroConfig;
import com.hai.config.PetroCouponConfig;
import com.hai.entity.ApiCoupon; import com.hai.entity.ApiCoupon;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.openApi.service.ApiBlxCouponService; import com.hai.openApi.service.ApiBlxCouponService;
@ -22,8 +23,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
@Controller @Controller
@RequestMapping(value = "/apiCoupon") @RequestMapping(value = "/apiCoupon")
@ -64,7 +68,24 @@ public class ApiCouponController {
public ResponseData synCouponRule(@RequestParam(name = "type", required = true) Integer type) { public ResponseData synCouponRule(@RequestParam(name = "type", required = true) Integer type) {
try { try {
if (type == 4) {
JSONObject jsonObject = PetroCouponConfig.getCouponList();
JSONArray array = jsonObject.getJSONArray("data");
List<JSONObject> list = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
JSONObject object = array.getJSONObject(i);
object.put("alias" , object.getString("reqCode"));
object.put("title" , object.getString("tplName"));
object.put("qty" , object.getString("ticketBalance"));
object.put("faceValue" , object.getBigDecimal("tplAmount").divide(new BigDecimal(100)));
object.put("bizTypeDesc" , "汽油券");
object.put("validDate" , "180");
list.add(object);
}
return ResponseMsgUtil.success(list);
} else {
PetroConfig.init(type); PetroConfig.init(type);
JSONObject jsonObject = petroConfig.synCouponRule(); JSONObject jsonObject = petroConfig.synCouponRule();
@ -73,7 +94,6 @@ public class ApiCouponController {
String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); String data = PetroConfig.decrypt(jsonObject.getString("jsonResult"));
JSONArray jsonArray = JSONArray.parseArray(data); JSONArray jsonArray = JSONArray.parseArray(data);
System.out.println(jsonArray);
ApiCoupon apiCoupon; ApiCoupon apiCoupon;
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
@ -121,6 +141,9 @@ public class ApiCouponController {
return ResponseMsgUtil.success(jsonArray); return ResponseMsgUtil.success(jsonArray);
} }
}
return ResponseMsgUtil.success("请求失败"); return ResponseMsgUtil.success("请求失败");
} catch (Exception e) { } catch (Exception e) {

@ -179,5 +179,4 @@ NdKey= 5df3f620-e269-458d-9556-87e26d30256a
#Sph #Sph
SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry
SphMerchant = 355920109860 SphMerchant = 355920109860
SphReqCode = z9zhwgk31j2kkk4b
SphSecret = Es9cshhRoDxeFAuGItLZUDi8Qj3PWrje SphSecret = Es9cshhRoDxeFAuGItLZUDi8Qj3PWrje

@ -157,3 +157,8 @@ NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c
wxZxjzAppId=wxc872cb59b56681a7 wxZxjzAppId=wxc872cb59b56681a7
wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a
#Sph
SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry
SphMerchant = 618809656349
SphSecret = xstEWAhjw74GzMkXcPr2Cf7z00aYXaSy

@ -162,3 +162,8 @@ NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c
wxZxjzAppId=wxc872cb59b56681a7 wxZxjzAppId=wxc872cb59b56681a7
wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a
#Sph
SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry
SphMerchant = 618809656349
SphSecret = xstEWAhjw74GzMkXcPr2Cf7z00aYXaSy

@ -595,32 +595,4 @@ public class WxMsgController {
// @RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "微信签名")
// public String verifyWx() {
//
// try {
//
// Map<String, Object> params = new HashMap<>();
// params.put("appid", SysConst.getSysConfig().getWxH5AppId());
// params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
// params.put("grant_type", "client_credential");
//
// JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
//
// Map<String, Object> map = new HashMap<>();
// map.put("noncestr","Wm3WZYTPz0wzccnW");
// map.put("jsapi_ticket",accessTokenObject.getString("ticket"));
// map.put("timestamp","1414587457");
// map.put("url","http://mp.weixin.qq.com?params=value");
//
// return WxUtils.getSHA1(map);
// } catch (Exception e) {
// return null;
// }
//
// }
} }

Loading…
Cancel
Save