public String getSweepInfo(){
String cropsProductionId = "";
String productId = "";
try {
cropsProductionId = paymentService.findProductIdByTraceCode(traceCode);
} catch (Exception e) {
e.printStackTrace();
}
List<AttachReference> list= new ArrayList<AttachReference>();
if(StringUtils.isNotBlank(cropsProductionId)){
cropsProduction = cropsProductionService.get(cropsProductionId);
productId = cropsProduction.getProductId();
if(StringUtils.isNotBlank(productId)){
basicProduct = basicProductService.get(productId);
list = attachReferenceService.referenceAttachment(productId, "basicProduct.img");
}
}
String [] infoarrays = new String [3];
infoarrays[0] = list.get(0).getAttachment().getPath();
infoarrays[1] = cropsProduction.getName();
infoarrays[2] = basicProduct.getGoodsDemo();
String [] otherMessage = new String [4];
otherMessage[0] = cropsProduction.getId();
otherMessage[1] = cropsProduction.getBatchNo();
otherMessage[2]= traceCode;
otherMessage[3] = isSign;
Map<String, Object[]> map = new LinkedHashMap();
map.put("info", infoarrays);
map.put("otherMessage", otherMessage);
try {
this.response.setContentType("application/json");
this.response.setCharacterEncoding("utf-8");
this.response.getWriter().print(new Gson().toJson(map));
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
接口返回json串
最新推荐文章于 2024-06-06 00:21:13 发布