|
|
|
|
@ -1,25 +1,22 @@
|
|
|
|
|
package com.ruoyi.szxc.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
|
|
import com.ruoyi.szxc.domain.SzxcVisitRecard;
|
|
|
|
|
import com.ruoyi.szxc.service.ISzxcVisitRecardService;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 走访记录Controller
|
|
|
|
|
@ -33,7 +30,8 @@ public class SzxcVisitRecardController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISzxcVisitRecardService szxcVisitRecardService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ISysDeptService deptService;
|
|
|
|
|
/**
|
|
|
|
|
* 查询走访记录列表
|
|
|
|
|
*/
|
|
|
|
|
@ -77,6 +75,16 @@ public class SzxcVisitRecardController extends BaseController
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@RequestBody SzxcVisitRecard szxcVisitRecard)
|
|
|
|
|
{
|
|
|
|
|
//根据前端传递过来的部门存储,如果没传则存储当前用户的部门
|
|
|
|
|
if(szxcVisitRecard.getDeptId()==null){
|
|
|
|
|
szxcVisitRecard.setDeptId(getDeptId());
|
|
|
|
|
}
|
|
|
|
|
szxcVisitRecard.setUserId(getUserId());
|
|
|
|
|
//根据DeptId存储上级为默认审核部门及id
|
|
|
|
|
SysDept sysDept = deptService.selectDeptById(szxcVisitRecard.getDeptId());
|
|
|
|
|
SysDept parentDept = deptService.selectDeptById(sysDept.getParentId());
|
|
|
|
|
szxcVisitRecard.setAuditDeptid(parentDept.getDeptId());
|
|
|
|
|
szxcVisitRecard.setAuditName(parentDept.getDeptName());
|
|
|
|
|
return toAjax(szxcVisitRecardService.insertSzxcVisitRecard(szxcVisitRecard));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|