forked from integrated_whb/integrated_whb
138 lines
4.6 KiB
Java
138 lines
4.6 KiB
Java
|
package com.zcloud.controller.comprehensive;
|
||
|
|
||
|
import com.zcloud.controller.base.BaseController;
|
||
|
import com.zcloud.entity.Page;
|
||
|
import com.zcloud.entity.PageData;
|
||
|
import com.zcloud.logs.LogAnno;
|
||
|
import com.zcloud.service.comprehensive.TrafficDrivingCommitmentService;
|
||
|
import com.zcloud.util.*;
|
||
|
import org.apache.commons.lang.StringUtils;
|
||
|
import org.apache.shiro.SecurityUtils;
|
||
|
import org.apache.shiro.crypto.hash.SimpleHash;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.stereotype.Controller;
|
||
|
import org.springframework.transaction.annotation.Transactional;
|
||
|
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("/drivingcommitment")
|
||
|
public class TrafficDrivingCommitmentController extends BaseController {
|
||
|
@Autowired
|
||
|
private TrafficDrivingCommitmentService trafficDrivingCommitmentService;
|
||
|
|
||
|
|
||
|
|
||
|
/**新增
|
||
|
* @param
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
@RequestMapping(value="/add")
|
||
|
@ResponseBody
|
||
|
@Transactional
|
||
|
public Object add() throws Exception{
|
||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||
|
String errInfo = "success";
|
||
|
PageData pd = new PageData();
|
||
|
pd = this.getPageData();
|
||
|
pd.put("DRIVINGCOMMITMENT_ID", this.get32UUID());
|
||
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //主键
|
||
|
pd.put("ISDELETE", "0"); //是否删除
|
||
|
pd.put("INQUIRYCONCLUSION","正常");
|
||
|
pd.put("CREATORNAME", Jurisdiction.getUsername()); //是否发送短信0不发1发
|
||
|
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //创建人
|
||
|
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||
|
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //操作人
|
||
|
pd.put("OPERATORNAME", Jurisdiction.getUsername()); //操作人
|
||
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间
|
||
|
trafficDrivingCommitmentService.save(pd);
|
||
|
|
||
|
map.put("pd",pd);
|
||
|
map.put("result", errInfo);
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
/**修改
|
||
|
* @param
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
@RequestMapping(value="/edit")
|
||
|
@ResponseBody
|
||
|
public Object edit() throws Exception{
|
||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||
|
String errInfo = "success";
|
||
|
PageData pd = new PageData();
|
||
|
pd = this.getPageData();
|
||
|
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //操作人
|
||
|
pd.put("OPERATORNAME", Jurisdiction.getUsername()); //操作人
|
||
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间
|
||
|
trafficDrivingCommitmentService.edit(pd);
|
||
|
|
||
|
map.put("pd",pd);
|
||
|
map.put("result", errInfo);
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//列表
|
||
|
@RequestMapping(value = "/listForSafetyDrivingCommitment")
|
||
|
@ResponseBody
|
||
|
public Object listForSecurityNotice(Page page) throws Exception {
|
||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||
|
String errInfo = "success";
|
||
|
PageData pd = new PageData();
|
||
|
pd = this.getPageData();
|
||
|
|
||
|
page.setPd(pd);
|
||
|
List<PageData> varList = trafficDrivingCommitmentService.listForDrivingCommitment(page);
|
||
|
map.put("varList", varList);
|
||
|
map.put("page", page);
|
||
|
map.put("result", errInfo);
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
/**删除
|
||
|
* @param
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
@RequestMapping(value="/delete")
|
||
|
@ResponseBody
|
||
|
public Object delete() throws Exception{
|
||
|
Map<String,String> map = new HashMap<String,String>();
|
||
|
String errInfo = "success";
|
||
|
PageData pd = new PageData();
|
||
|
pd = this.getPageData();
|
||
|
pd.put("DELETOR", Jurisdiction.getUSER_ID());//删除人id
|
||
|
pd.put("DELETORNAME", Jurisdiction.getUsername());//删除人姓名
|
||
|
pd.put("DELETETIME", DateUtil.date2Str(new Date()));//删除时间
|
||
|
trafficDrivingCommitmentService.delete(pd);
|
||
|
map.put("result", errInfo);
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查看详情
|
||
|
* @return
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
@RequestMapping(value="/goEdit")
|
||
|
@ResponseBody
|
||
|
public Object goEdit() throws Exception {
|
||
|
Map<String, Object> map = new HashMap<>();
|
||
|
String errInfo = "success";
|
||
|
PageData pd = this.getPageData();
|
||
|
pd = trafficDrivingCommitmentService.findById(pd); // 根据ID读取
|
||
|
map.put("pd", pd);
|
||
|
map.put("result", errInfo);
|
||
|
return map;
|
||
|
}
|
||
|
}
|