|
@ -6,9 +6,11 @@ import com.yihu.jw.entity.a1entity.MediicineDrugsNumber;
|
|
import com.yihu.jw.entity.a1entity.Mediicinedrugs;
|
|
import com.yihu.jw.entity.a1entity.Mediicinedrugs;
|
|
import com.yihu.jw.entity.a1entity.Mediicineorder;
|
|
import com.yihu.jw.entity.a1entity.Mediicineorder;
|
|
import com.yihu.jw.entity.hospital.DmHospitalDO;
|
|
import com.yihu.jw.entity.hospital.DmHospitalDO;
|
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRecharge;
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
import com.yihu.jw.entity.wlyyinfo.OauthWlyyConfigDO;
|
|
import com.yihu.jw.entity.wlyyinfo.OauthWlyyConfigDO;
|
|
import com.yihu.jw.hospital.HospitalDao;
|
|
import com.yihu.jw.hospital.HospitalDao;
|
|
|
|
import com.yihu.jw.hospital.healthCare.YlzMedicalRechargeDao;
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
|
|
|
|
import com.yihu.jw.repository.job.MediicinedrugsDao;
|
|
import com.yihu.jw.repository.job.MediicinedrugsDao;
|
|
@ -26,12 +28,11 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class MedicineService {
|
|
public class MedicineService {
|
|
@ -54,6 +55,10 @@ public class MedicineService {
|
|
private MediicinedrugsNumberDao mediicinedrugsNumberDao;
|
|
private MediicinedrugsNumberDao mediicinedrugsNumberDao;
|
|
@Value("${spring.profiles}")
|
|
@Value("${spring.profiles}")
|
|
private String springProfiles;
|
|
private String springProfiles;
|
|
|
|
@Autowired
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
@Autowired
|
|
|
|
private YlzMedicalRechargeDao ylzMedicalRechargeDao;
|
|
|
|
|
|
|
|
|
|
public void getOrgPhysicDict(String orgCode, String name, String orgName, String physicCode) {
|
|
public void getOrgPhysicDict(String orgCode, String name, String orgName, String physicCode) {
|
|
@ -375,4 +380,44 @@ public class MedicineService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void updateYjjResult() {
|
|
|
|
Date now = new Date();
|
|
|
|
String nowTime = com.yihu.jw.util.DateUtil.dateToStrLong(now);
|
|
|
|
List<YlzMedicalRecharge> chargeList = ylzMedicalRechargeDao.findByChargeResult("ing");
|
|
|
|
for (YlzMedicalRecharge tmp : chargeList) {
|
|
|
|
Map<String, String> param = new HashMap<>();
|
|
|
|
param.put("orgCode", tmp.getOrgCode());
|
|
|
|
param.put("equ_num", tmp.getEquNum());
|
|
|
|
param.put("tradeType", "hop.trade.recharge");
|
|
|
|
param.put("outTradeNo", tmp.getOutChargeNo());
|
|
|
|
JSONObject res = wlyyHttpService.sendWlyyMes("hlwyyQueryDetail_OUT", null, param);
|
|
|
|
if (res.getString("status").equalsIgnoreCase("200")) {//i健康返回值
|
|
|
|
JSONObject responseData = res.getJSONObject("data");
|
|
|
|
JSONObject queryDetailParam = responseData.getJSONObject("param");
|
|
|
|
String result = queryDetailParam.getString("result");
|
|
|
|
String resultName = queryDetailParam.getString("resultDesc");
|
|
|
|
if ("exp".equals(result)) {
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if ("succ".equals(result)) {//交易成功 (微信/支付宝成功,HIS成功)
|
|
|
|
String url = "http://127.0.0.1:10020/baseOrder/open/hlwyyRechargeNotify";
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
JSONObject paramTmp = new JSONObject();
|
|
|
|
paramTmp.put("outChargeNo",tmp.getOutChargeNo());
|
|
|
|
JSONObject paramTmpObj = new JSONObject();
|
|
|
|
paramTmpObj.put("param",paramTmp);
|
|
|
|
params.add(new BasicNameValuePair("responsStr",paramTmpObj.toJSONString()));
|
|
|
|
String ret = httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String mins = com.yihu.jw.util.DateUtil.dateToStr(now,"mm");
|
|
|
|
Integer minsInt = Integer.parseInt(mins);
|
|
|
|
if (minsInt % 5 == 0) {
|
|
|
|
String prTime = com.yihu.jw.util.DateUtil.getPreTime(nowTime, "-5");
|
|
|
|
String sql = " update base_ylz_medical_recharge set charge_result='overTime',charge_result_name='支付超时' where charge_result='ing' and create_time<='" + prTime + "' ";
|
|
|
|
jdbcTemplate.execute(sql);
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|