|
@@ -81,30 +81,36 @@ public class YbService {
|
|
|
response = new ResultVo(-1, "追溯码不能为空");
|
|
|
return response;
|
|
|
}
|
|
|
- String drugTracCodg = drugTracCodgList.get(0).getDrugTracCodg();
|
|
|
- String result = taobaoService.sendGet("/queryCodeDetail?codes=" + drugTracCodg);
|
|
|
- JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
- Integer code = resultJson.getInteger("code");
|
|
|
- if (code == 200) {
|
|
|
- JSONObject data = resultJson.getJSONObject("data");
|
|
|
- Integer dataCode = data.getInteger("code");
|
|
|
- if (dataCode == 0) {
|
|
|
- JSONArray content = data.getJSONArray("data");
|
|
|
- if(content != null && content.size() > 0) {
|
|
|
- JSONObject item = content.getJSONObject(0);
|
|
|
- JSONArray produceInfoList = item.getJSONObject("codeProduceInfoDTO").getJSONArray("produceInfoList");
|
|
|
- JSONObject drugEntBase = item.getJSONObject("drugEntBaseDTO");
|
|
|
- if(drugEntBase != null) {
|
|
|
- selInfo.setFixmedinsHilistName(drugEntBase.getString("physicName"));
|
|
|
- }
|
|
|
- if(produceInfoList != null && produceInfoList.size() > 0) {
|
|
|
- JSONObject produceInfo = produceInfoList.getJSONObject(0);
|
|
|
- selInfo.setManuLotnum(produceInfo.getString("batchNo"));
|
|
|
- selInfo.setManuDate(produceInfo.getString("produceDateStr"));
|
|
|
+
|
|
|
+ for(int i = 0;i < drugTracCodgList.size();i++) {
|
|
|
+ String drugTracCodg = drugTracCodgList.get(i).getDrugTracCodg();
|
|
|
+ String result = taobaoService.sendGet("/queryCodeDetail?codes=" + drugTracCodg);
|
|
|
+ JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
+ log.info("queryCodeDetail, result={}", result);
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
+ if (code == 200) {
|
|
|
+ JSONObject data = resultJson.getJSONObject("data");
|
|
|
+ Integer dataCode = data.getInteger("code");
|
|
|
+ if (dataCode == 0) {
|
|
|
+ JSONArray content = data.getJSONArray("data");
|
|
|
+ if(content != null && content.size() > 0) {
|
|
|
+ JSONObject item = content.getJSONObject(0);
|
|
|
+ JSONArray produceInfoList = item.getJSONObject("codeProduceInfoDTO").getJSONArray("produceInfoList");
|
|
|
+ JSONObject drugEntBase = item.getJSONObject("drugEntBaseDTO");
|
|
|
+ if(drugEntBase != null) {
|
|
|
+ selInfo.setFixmedinsHilistName(drugEntBase.getString("physicName"));
|
|
|
+ }
|
|
|
+ if(produceInfoList != null && produceInfoList.size() > 0) {
|
|
|
+ JSONObject produceInfo = produceInfoList.getJSONObject(0);
|
|
|
+ selInfo.setManuLotnum(produceInfo.getString("batchNo"));
|
|
|
+ selInfo.setManuDate(produceInfo.getString("produceDateStr"));
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
int randomNumber = new Random().nextInt(90) + 10;
|
|
|
String rtalDocno = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
|
|
String mdtrtId = zyActpatientMapper.selectMdtrtId(selInfo.getPatientId(), selInfo.getTimes());
|