|
@ -17,6 +17,7 @@ import com.yihu.wlyy.service.third.ylz.PayLogService;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.BindCard;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.Charge;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.service.OnePayService;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
|
|
|
import com.ylzinfo.onepay.sdk.domain.RequestParams;
|
|
@ -28,11 +29,14 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.BooleanUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@ -51,10 +55,7 @@ import java.io.StringWriter;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by hzp on 2017/05/23.
|
|
@ -84,6 +85,12 @@ public class OnePayController extends WeixinBaseController {
|
|
|
ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
JdbcTemplate jdbcTemplate;
|
|
|
@Value("${doctorAssistant.api}")
|
|
|
private String doctorAssistant;
|
|
|
@Value("${doctorAssistant.target_url}")
|
|
|
private String targetUrl;
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
|
|
|
@RequestMapping(value = "bindCard", method = RequestMethod.POST)
|
|
|
@ApiOperation("查询绑卡信息")
|
|
@ -758,12 +765,29 @@ public class OnePayController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String cleaData() throws IOException, PayException {
|
|
|
try {
|
|
|
String sql = "SELECT t.code FROM wlyy_charge t WHERE (t.need_upload != '0' OR t.need_upload is null) AND (t.trade_status = '0' OR t.trade_status = '1')";
|
|
|
/*String sql = "SELECT t.code FROM wlyy_charge t WHERE (t.need_upload != '0' OR t.need_upload is null) AND (t.trade_status = '0' OR t.trade_status = '1')";
|
|
|
List<Map<String, Object>> codes = jdbcTemplate.queryForList(sql);
|
|
|
for (Map<String, Object> code :codes) {
|
|
|
String outChargeNo = code.get("code").toString();
|
|
|
pay.chargeQuery(outChargeNo,getAccessToken());
|
|
|
}
|
|
|
}*/
|
|
|
String url = doctorAssistant + "/wllyy/feldsher/sendDoctorTemplates";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("type", "5"));
|
|
|
params.add(new BasicNameValuePair("openId", "orrOgwATDaljVunlAq_Tdx3imhYg"));
|
|
|
params.add(new BasicNameValuePair("url", targetUrl));
|
|
|
params.add(new BasicNameValuePair("first", "wjj" + "医生您好,你有一条新的签约申请待处理"));
|
|
|
params.add(new BasicNameValuePair("remark", "请尽快使用厦门i健康APP处理居民的签约申请"));
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
|
|
|
String date = format.format(new Date());
|
|
|
String keywords = date + "," + "wjj";
|
|
|
params.add(new BasicNameValuePair("keywords", keywords));
|
|
|
LOGGER.info("==========================================");
|
|
|
LOGGER.info("url ==>"+url);
|
|
|
LOGGER.info("targetUrl ==>"+targetUrl);
|
|
|
LOGGER.info("==========================================");
|
|
|
httpClientUtil.post(url, params, "UTF-8");
|
|
|
LOGGER.info("*********************************************");
|
|
|
return write(200, "数据整理成功!");
|
|
|
} catch (Exception e) {
|
|
|
return write(-1, "数据整理成功失败!");
|