integrated_traffic/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityCustomerMana...

77 lines
3.1 KiB
Java
Raw Normal View History

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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String customermanagement_id = this.get32UUID();
pd.put("CREATOR", Jurisdiction.getUSER_ID()); // 创建人id
pd.put("TRANSPORTATIONCOMPANY", Jurisdiction.getCORPINFO_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<String, Object> map = new HashMap<String, Object>();
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<PageData> varList = customerManagementService.listForSecurityCustomerManagement(page);
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
}