package com.zcloud.controller.comprehensive; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.comprehensive.TrafficSecurityCustomerManagementService; import com.zcloud.service.comprehensive.TrafficSecurityNoticeService; import com.zcloud.util.Const; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @RequestMapping("/securitycustomer") public class TrafficSecurityCustomerManagementController extends BaseController { @Autowired private TrafficSecurityCustomerManagementService customerManagementService; //新增 @RequestMapping(value = "/add") @ResponseBody public Object add(@RequestParam(value="fileList",required=false) MultipartFile file, @RequestParam(value="videoList",required=false) MultipartFile videoFile) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); String customermanagement_id = this.get32UUID(); pd.put("CREATOR", Jurisdiction.getUSER_ID()); // 创建人id pd.put("CREATORNAME", Jurisdiction.getName()); // 创建人姓名 pd.put("CUSTOMERMANAGEMENT_ID", customermanagement_id); // 主键 pd.put("CREATETIME", DateUtil.date2Str(new Date())); // 添加时间 pd.put("ISDELETE", "0"); customerManagementService.save(pd); map.put("result", errInfo); map.put("pd", pd); return map; } @RequestMapping(value = "/listForSecurityCustomerManagement") @ResponseBody public Object listForSecurityCustomerManagement(Page page) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); String CUSTOMERTYPE = pd.getString("CUSTOMERTYPE"); // 关键词检索条件 if (Tools.notEmpty(CUSTOMERTYPE)) pd.put("CUSTOMERTYPE", CUSTOMERTYPE.trim()); String TRANSPORTATIONCOMPANY = pd.getString("TRANSPORTATIONCOMPANY"); // 关键词检索条件 if (Tools.notEmpty(TRANSPORTATIONCOMPANY)) pd.put("REPLYSTTRANSPORTATIONCOMPANYATUS", TRANSPORTATIONCOMPANY.trim()); page.setPd(pd); List varList = customerManagementService.listForSecurityCustomerManagement(page); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; } }