yeguodong 2 月之前
父节点
当前提交
7b40a56861

+ 13 - 0
src/main/java/cn/hnthyy/thmz/entity/yb/Selinfo.java

@@ -0,0 +1,13 @@
+package cn.hnthyy.thmz.entity.yb;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class Selinfo  extends SelinfoSold{
+    /**
+     * 溯源码节点信息
+     * */
+    private List<DrugTracCodg> drugtracinfo;
+}

+ 0 - 4
src/main/java/cn/hnthyy/thmz/entity/yb/SelinfoSelect.java

@@ -1,4 +0,0 @@
-package cn.hnthyy.thmz.entity.yb;
-
-public class SelinfoSelect {
-}

+ 6 - 5
src/main/java/cn/hnthyy/thmz/service/yb/YbService.java

@@ -2,16 +2,14 @@ package cn.hnthyy.thmz.service.yb;
 
 import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.entity.jy.ResultVo;
-import cn.hnthyy.thmz.entity.yb.DrugTracCodg;
-import cn.hnthyy.thmz.entity.yb.SelinfoSold;
-import cn.hnthyy.thmz.entity.yb.SelinfoReturn;
-import cn.hnthyy.thmz.entity.yb.SelinfoSoldTotal;
+import cn.hnthyy.thmz.entity.yb.*;
 import cn.hnthyy.thmz.mapper.his.yb.SelinfoSoldMapper;
 import cn.hnthyy.thmz.service.taobao.TaobaoService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -119,8 +117,11 @@ public class YbService {
         log.info("医保接口 - 关联键: {}", associationKey);
 
         String realUrl = siInventoryServiceUrl + "/saleGoodsItem";
+        Selinfo selinfoParam = new Selinfo();
+        BeanUtils.copyProperties(selInfo, selinfoParam);
+        selinfoParam.setDrugtracinfo(drugTracCodgList);
         try {
-            String jsonString = JSONObject.toJSONString(selInfo, SerializerFeature.WriteNonStringKeyAsString);
+            String jsonString = JSONObject.toJSONString(selinfoParam, SerializerFeature.WriteNonStringKeyAsString);
             String ybResult = HttpUtil.sendHttpPost(realUrl, jsonString, 8000);
             JSONObject ybResultJson = JSONObject.parseObject(ybResult);
             int responseCode = 0;