首页>代码>spring3+spring mvc3+hibernate4开发通用网站后台管理系统>/my-forestry/src/com/forestry/controller/sys/AttachmentController.java
package com.forestry.controller.sys;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.forestry.core.ForestryBaseController;
import com.forestry.model.sys.Attachment;
import com.forestry.service.sys.AttachmentService;

/**
 * @author Yang Tian
 * @email 1298588579@qq.com
 */
@Controller
@RequestMapping("/sys/attachment")
public class AttachmentController extends ForestryBaseController<Attachment> {

	@Resource
	private AttachmentService attachmentService;

	@RequestMapping("/getFlower")
	public String getFlower(HttpServletRequest request, HttpServletResponse response) throws IOException {
		String epcId = request.getParameter("epcId");
		List<Object[]> flowerList = attachmentService.queryFlowerList(epcId);
		Attachment attachment = null;
		List<Attachment> attachmentList = new ArrayList<Attachment>();
		for (int i = 0; i < flowerList.size(); i++) {
			attachment = new Attachment();
			attachment.setFileName(String.valueOf(flowerList.get(i)[0]));
			attachment.setFilePath(String.valueOf(flowerList.get(i)[1]));
			attachment.setDescription(String.valueOf(flowerList.get(i)[2]));
			attachment.setEpcId(String.valueOf(flowerList.get(i)[3]));
			attachmentList.add(attachment);
		}
		writeJSON(response, attachmentList);
		return null;
	}

}
最近下载更多
AAA孚盟软件售前刘美鲸  LV3 2021年10月20日
love8309287  LV4 2021年5月9日
有法说可能  LV4 2020年6月5日
ssy552  LV10 2020年5月7日
labelA  LV5 2020年2月12日
garin_lau  LV9 2019年7月29日
huasir2018  LV14 2019年7月22日
yyyyyyyyyyyyyyyyyyy  LV16 2019年7月4日
xk9587  LV16 2019年4月30日
17614099410  LV2 2019年4月26日
最近浏览更多
lyq6666666  LV5 2023年10月25日
45436683  LV8 2023年9月20日
what_the_fo  LV5 2023年4月6日
xxx520520  LV6 2023年1月31日
暂无贡献等级
adnawda 2022年11月27日
暂无贡献等级
cdjiangyang 2022年8月23日
暂无贡献等级
zhaoyangwfd  LV17 2022年6月24日
无名氏111  LV32 2022年1月30日
不会写代码的小姚  LV3 2021年11月20日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友