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

138 lines
4.6 KiB
Java
Raw Normal View History

2024-03-20 17:02:31 +08:00
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;
}
}