|
@@ -16,12 +16,14 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.zskk.shop.controller.bean.PackageBean;
|
|
|
import com.zskk.shop.dao.entry.Appointment;
|
|
|
import com.zskk.shop.dao.entry.BuyOrder;
|
|
|
import com.zskk.shop.dao.entry.FamilyPeople;
|
|
@@ -44,6 +46,11 @@ public class TJCenterService {
|
|
|
@Value("${zskk.myhost}")
|
|
|
private String myhost;
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取详细
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public List<String> getDJDetail(String id) {
|
|
|
String url = tjcenter + "/public/api.php/shop/getPackageDetail?id=" + id;
|
|
|
try {
|
|
@@ -67,6 +74,9 @@ public class TJCenterService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 预约
|
|
|
+ */
|
|
|
public String appointment(FamilyPeople people, BuyOrder order, GoodBase good, String atime, String extend) {
|
|
|
// 调用体检系统 预约
|
|
|
Map<String, String> data = new HashMap<>();
|
|
@@ -94,6 +104,11 @@ public class TJCenterService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 取消预约
|
|
|
+ * @param people
|
|
|
+ * @param appointment
|
|
|
+ */
|
|
|
public void cancelAppointment(FamilyPeople people, Appointment appointment){
|
|
|
Map<String, String> data = new HashMap<>();
|
|
|
data.put("id", appointment.getTjaid());
|
|
@@ -102,6 +117,30 @@ public class TJCenterService {
|
|
|
this.doPost(tjcenter + "public/api.php/shop/cancelSubscribe", data);
|
|
|
}
|
|
|
|
|
|
+ public List<PackageBean> getPackages(String search){
|
|
|
+ Map<String, String> data = new HashMap<>();
|
|
|
+ if (StringUtils.isNotBlank(search)){
|
|
|
+ data.put("package_name", search);
|
|
|
+ }
|
|
|
+ String content = this.doPostNoSign(tjcenter + "public/api.php/shop/getPackage", data);
|
|
|
+ JSONObject obj = JSON.parseObject(content);
|
|
|
+ if (obj.containsKey("code") && obj.getInteger("code").equals(1)){
|
|
|
+ return JSON.parseArray(obj.getString("data"), PackageBean.class);
|
|
|
+ }else{
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String doPostNoSign(String url, Map<String, String> data){
|
|
|
+ try{
|
|
|
+ String content = HttpClient.doPost(url, data);
|
|
|
+ return content;
|
|
|
+ }catch (Exception e) {
|
|
|
+ LogUtil.sysError(e.getMessage(), e);
|
|
|
+ throw new ZSKKException(ErrorConstant.NET_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private String doPost(String url, Map<String, String> data){
|
|
|
String main = JSON.toJSONString(data);
|
|
|
String nonce = UUID.randomUUID().toString().replaceAll("-", "");
|