parent
							
								
									7901443ff3
								
							
						
					
					
						commit
						1c6a50561e
					
				
											
												Binary file not shown.
											
										
									
								| @ -0,0 +1,133 @@ | ||||
| package com.platform.controller; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| 
 | ||||
| import org.apache.log4j.Logger; | ||||
| import org.springframework.stereotype.Controller; | ||||
| import org.springframework.ui.ModelMap; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RequestParam; | ||||
| import org.springframework.web.bind.annotation.ResponseBody; | ||||
| 
 | ||||
| import com.base.BaseController; | ||||
| import com.platform.entities.CheckoutEntity; | ||||
| import com.platform.entities.PreDataInfo; | ||||
| import com.platform.service.ICheckoutService; | ||||
| import com.platform.utils.Configs; | ||||
| 
 | ||||
| /** 信息系统--校验 | ||||
|  * @author chen | ||||
|  * | ||||
|  */ | ||||
| @Controller | ||||
| @RequestMapping("/checkout") | ||||
| public class CheckoutController extends BaseController { | ||||
| 	@SuppressWarnings("static-access") | ||||
| 	public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(CheckoutController.class); | ||||
| 	 | ||||
| 	@Resource(name = "checkoutService") | ||||
| 	private ICheckoutService checkoutService; | ||||
| 	 | ||||
| 	/** | ||||
| 	 * 查看所有系统的 标准表情况 | ||||
| 	 * @return | ||||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	@ResponseBody | ||||
| 	@RequestMapping("/findAll") | ||||
| 	public ModelMap findAll() throws Exception { | ||||
| 		log.info("---------/findAll--- "); | ||||
| 		ModelMap modelMap = new ModelMap(); | ||||
| 		List<CheckoutEntity> result = checkoutService.findAll(); | ||||
| 		modelMap.addAttribute("data", result); | ||||
| 		modelMap.addAttribute("length", result.size()); | ||||
| 		return modelMap; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * 查看所有系统的 标准表情况 | ||||
| 	 * @return | ||||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	@ResponseBody | ||||
| 	@RequestMapping("/findByCity") | ||||
| 	public ModelMap findByCity(@RequestBody String cityName, HttpServletRequest req, HttpServletResponse res) throws Exception { | ||||
| 		log.info("---------/findByCity--- "+cityName); | ||||
| 		ModelMap modelMap = new ModelMap(); | ||||
| 		List<CheckoutEntity> result = checkoutService.findByCity(cityName); | ||||
| 		modelMap.addAttribute("data", result); | ||||
| 		modelMap.addAttribute("length", result.size()); | ||||
| 		return modelMap; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * 校验勾选的数据 | ||||
| 	 * @return | ||||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	@ResponseBody | ||||
| 	@RequestMapping("/checkList") | ||||
| 	public ModelMap checkList(@RequestBody List<CheckoutEntity> form, HttpServletRequest req, HttpServletResponse res) throws Exception { | ||||
| 		ModelMap modelMap = new ModelMap(); | ||||
| 		if (null != form) { | ||||
| 			log.info("---------/checkList--- "+ form.size()); | ||||
| 			List<CheckoutEntity> result = checkoutService.checkAll(form); | ||||
| 			List<CheckoutEntity> data = new ArrayList<CheckoutEntity>(); | ||||
| 			modelMap.addAttribute("data", result); | ||||
| 			modelMap.addAttribute("length", result.size()); | ||||
| 		} | ||||
| 		else { | ||||
| 			log.info("---------/checkList--- "+ form); | ||||
| 		} | ||||
| 		return modelMap; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 查看单条数据的修改详情 | ||||
| 	 * @return | ||||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	@ResponseBody | ||||
| 	@RequestMapping("/findDetails") | ||||
| 	public ModelMap findDetails(@RequestBody CheckoutEntity form, HttpServletRequest req, HttpServletResponse res) throws Exception { | ||||
| 		ModelMap modelMap = new ModelMap(); | ||||
| 		if (null != form) { | ||||
| 			log.info("---------/findDetails--- "+ form); | ||||
| 			 | ||||
| 			Map<String, PreDataInfo> result = checkoutService.findDetail(form); | ||||
| 			modelMap.addAllAttributes(result); | ||||
| 		} | ||||
| 		else { | ||||
| 			log.info("---------/findDetails--- "+ form); | ||||
| 		} | ||||
| 		return modelMap; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * 查看单条数据的修改详情 | ||||
| 	 * @return | ||||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	@ResponseBody | ||||
| 	@RequestMapping("/update") | ||||
| 	public void update(@RequestBody PreDataInfo form, HttpServletRequest req, HttpServletResponse res) throws Exception { | ||||
| 		if (null != form) { | ||||
| 			log.info("---------/update--- "+ form); | ||||
| 			int result = checkoutService.updateStandardInfo(form); | ||||
| 			if (result == 0) { | ||||
| 				res.setStatus(500); | ||||
| 			} | ||||
| 		} | ||||
| 		else { | ||||
| 			log.info("---------/update--- "+ form); | ||||
| 			res.setStatus(500); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -1,13 +0,0 @@ | ||||
| package com.platform.service; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.platform.entities.PreDataInfo; | ||||
| 
 | ||||
| public interface CheckoutService { | ||||
| 	 | ||||
| 	public List<PreDataInfo> findAll() throws Exception; | ||||
| 	 | ||||
| 	public void checkAll()  throws Exception; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,20 @@ | ||||
| package com.platform.service; | ||||
| 
 | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.platform.entities.CheckoutEntity; | ||||
| import com.platform.entities.PreDataInfo; | ||||
| 
 | ||||
| public interface ICheckoutService { | ||||
| 	 | ||||
| 	public List<CheckoutEntity> findAll() throws Exception; | ||||
| 	 | ||||
| 	public List<CheckoutEntity> checkAll(List<CheckoutEntity> list)  throws Exception; | ||||
| 	 | ||||
| 	public int updateStandardInfo(PreDataInfo ck)  throws Exception; | ||||
| 	 | ||||
| 	public Map<String, PreDataInfo> findDetail(CheckoutEntity ck)  throws Exception; | ||||
| 	 | ||||
| 	public List<CheckoutEntity> findByCity(String city)  throws Exception; | ||||
| } | ||||
					Loading…
					
					
				
		Reference in new issue