|
@@ -30,6 +30,7 @@ import com.zskk.shop.dao.entry.FamilyPeople;
|
|
|
import com.zskk.shop.dao.entry.GoodBase;
|
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
|
+import com.zskk.shop.service.beans.TjOrder;
|
|
|
import com.zskk.shop.utils.HttpClient;
|
|
|
import com.zskk.shop.utils.LogUtil;
|
|
|
import com.zskk.shop.utils.SecretUtil;
|
|
@@ -45,6 +46,21 @@ public class TJCenterService {
|
|
|
|
|
|
@Value("${zskk.myhost}")
|
|
|
private String myhost;
|
|
|
+
|
|
|
+ public List<TjOrder> getTJOrders(String uid, List<String> phones){
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ data.put("outer_key", uid);
|
|
|
+ data.put("phones", phones);
|
|
|
+
|
|
|
+ String url = tjcenter + "public/api.php/shop/getOrderListByPhones";
|
|
|
+ String content = this.doPost(url, data);
|
|
|
+ JSONObject obj = JSON.parseObject(content);
|
|
|
+ if (obj.containsKey("code") && obj.getInteger("code").equals(1)) {
|
|
|
+ return obj.getJSONObject("data").getJSONArray("orders").toJavaList(TjOrder.class);
|
|
|
+ } else {
|
|
|
+ throw new ZSKKException(ErrorConstant.SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取详细
|
|
@@ -79,7 +95,7 @@ public class TJCenterService {
|
|
|
*/
|
|
|
public String appointment(FamilyPeople people, BuyOrder order, GoodBase good, String atime, String extend) {
|
|
|
// 调用体检系统 预约
|
|
|
- Map<String, String> data = new HashMap<>();
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
data.put("outer_key", people.getId().toString());
|
|
|
data.put("role_name", people.getName());
|
|
|
data.put("cardtype", "身份证");
|
|
@@ -111,7 +127,7 @@ public class TJCenterService {
|
|
|
* @param appointment
|
|
|
*/
|
|
|
public void cancelAppointment(FamilyPeople people, Appointment appointment){
|
|
|
- Map<String, String> data = new HashMap<>();
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
data.put("id", appointment.getTjaid());
|
|
|
data.put("outer_key", people.getId().toString());
|
|
|
|
|
@@ -142,7 +158,7 @@ public class TJCenterService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private String doPost(String url, Map<String, String> data){
|
|
|
+ private String doPost(String url, Map<String, Object> data){
|
|
|
String main = JSON.toJSONString(data);
|
|
|
String nonce = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
String timestamp = ToolUtils.getNow().toString();
|