提交代码

dev_xds
姜玉琦 2023-10-23 01:34:55 +08:00
parent c52ea9d74e
commit 31bb5ef630
15 changed files with 1096 additions and 10 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询文件访问用户列表
export function listWorkUser(query) {
return request({
url: '/work/workUser/list',
method: 'get',
params: query
})
}
// 查询文件访问用户详细
export function getWorkUser(id) {
return request({
url: '/work/workUser/' + id,
method: 'get'
})
}
// 新增文件访问用户
export function addWorkUser(data) {
return request({
url: '/work/workUser',
method: 'post',
data: data
})
}
// 修改文件访问用户
export function updateWorkUser(data) {
return request({
url: '/work/workUser',
method: 'put',
data: data
})
}
// 删除文件访问用户
export function delWorkUser(id) {
return request({
url: '/work/workUser/' + id,
method: 'delete'
})
}

View File

@ -123,16 +123,20 @@
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="阅读人数" align="center" prop="readNum" >
<template slot-scope="scope">
<a href="#">{{ scope.row.readNum}}</a>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['work:workFile:edit']"
>修改</el-button> -->
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['work:workFile:query']"
>查看</el-button>
<el-button
size="mini"
type="text"
@ -194,14 +198,19 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<indexViewDrawer ref="indexViewDrawer"/>
</div>
</template>
<script>
import { listWorkFile, getWorkFile, delWorkFile, addWorkFile, updateWorkFile } from "@/api/work/workFile";
import indexViewDrawer from '@/views/work/workFile/indexViewDrawer'
export default {
name: "WorkFile",
components: {
indexViewDrawer,
},
dicts: ['work_file_belong','sys_common_isdel'],
data() {
return {
@ -335,6 +344,9 @@ export default {
this.title = "修改文件传达";
});
},
handleView(row){
this.$refs.indexViewDrawer.show(row);
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {

View File

@ -0,0 +1,167 @@
<template>
<div class="projectect-attendance-drawer">
<el-drawer
v-if="isOpen"
:visible.sync="isOpen"
direction="rtl"
size="50%"
>
<template slot="title">
<div>{{ drawerTitle + " 【阅读详情】" }}</div>
</template>
<el-tabs
v-model="activeName"
style="margin-left: 20px; margin-right: 20px"
@tab-click="getList"
>
<el-tab-pane label="全部" name="-1" key="-1" ></el-tab-pane>
<el-tab-pane label="发展集团" name="1" key="1" ></el-tab-pane>
<el-tab-pane label="子公司" name="11" key="11" ></el-tab-pane>
<el-tab-pane label="监理单位" name="4" key="4" ></el-tab-pane>
<el-tab-pane label="总包公司" name="2" key="2" ></el-tab-pane>
<el-tab-pane label="分包公司" name="3" key="3" ></el-tab-pane>
</el-tabs>
<el-table
v-loading="loading"
style="margin-left: 20px; margin-right: 20px"
:data="dataList" stripe
>
<el-table-column
label="单位类型"
align="center"
prop="deptTypeName"
width="150"
show-overflow-tooltip
/>
<el-table-column
label="单位名称"
align="center"
prop="deptName"
width="200"
>
<template slot-scope="scope">
<span v-if="scope.row.deptType!=1 && scope.row.deptType!=11">{{ scope.row.deptName }}</span>
<span v-if="scope.row.deptType==1"></span>
<span v-if="scope.row.deptType==11">
{{getDeptName(scope.row.ancestors)}}
</span>
</template>
</el-table-column>
<el-table-column label="人员姓名" align="center" prop="nickName"/>
<el-table-column
label="联系方式"
align="center"
prop="userName"
show-overflow-tooltip
/>
<el-table-column label="阅读时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['work:workFile:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-drawer>
</div>
</template>
<script>
import { listWorkUser, delWorkUser } from "@/api/work/workUser";
export default {
name: "workFileUser",
data() {
return {
//
loading: true,
//
total: 0,
//
dataList: [],
//
drawerTitle: "",
//
queryParams: {
pageNum: 1,
pageSize: 15,
fileId:null,
deptType: null,
},
isOpen: false,
activeName:"-1",
};
},
created() {},
methods: {
show(workFile) {
this.drawerTitle = workFile.fileName;
this.queryParams.fileId = workFile.id;
this.isOpen = true;
this.getList();
},
/** 查询视频配置列表 */
getList() {
this.loading = true;
if(this.activeName=="-1"){
this.queryParams.deptType=null;
}else{
this.queryParams.deptType=this.activeName;
}
listWorkUser(this.queryParams).then((response) => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getDeptName(ancestors){
if(ancestors.indexOf(111)>-1){
return "产发城投";
}else if(ancestors.indexOf(112)>-1){
return "产发置业";
}else if(ancestors.indexOf(113)>-1){
return "产发投资";
}else if(ancestors.indexOf(114)>-1){
return "产发绿能";
}else if(ancestors.indexOf(115)>-1){
return "产发智能";
}else{
return "产发医疗";
}
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id;
this.$modal
.confirm('是否确认删除用户文件阅读编号为"' + ids + '"的数据项?')
.then(function () {
return delWorkUser(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
},
};
</script>

View File

@ -7,6 +7,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.yanzhu.jh.work.domain.WorkFile;
import com.yanzhu.jh.work.service.IWorkFileService;
import com.yanzhu.jh.work.service.IWorkFileUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -44,13 +45,11 @@ public class BgWorkFileController extends BaseController {
}
/**
*
* @param fileId
*
* @return
*/
@GetMapping("/workFileRead")
public AjaxResult workFileRead(Long fileId){
return success();
return success(workFileService.openWorkFile(fileId));
}
}

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.SecurityUtils;
@ -43,4 +44,5 @@ public class BgWorkTrainController extends BaseController {
}
return getDataTable(workTrainService.selectBgscreenWorkTrainListv2(workTrain));
}
}

View File

@ -0,0 +1,104 @@
package com.yanzhu.jh.work.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.enums.BusinessType;
import com.yanzhu.jh.work.domain.WorkFileUser;
import com.yanzhu.jh.work.service.IWorkFileUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 访Controller
*
* @author JiangYuQi
* @date 2023-10-22
*/
@RestController
@RequestMapping("/work/workUser")
public class WorkFileUserController extends BaseController
{
@Autowired
private IWorkFileUserService workFileUserService;
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workFile:list')")
@GetMapping("/list")
public TableDataInfo list(WorkFileUser workFileUser)
{
startPage();
List<WorkFileUser> list = workFileUserService.selectWorkFileUserList(workFileUser);
return getDataTable(list);
}
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workUser:export')")
@Log(title = "文件访问用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WorkFileUser workFileUser)
{
List<WorkFileUser> list = workFileUserService.selectWorkFileUserList(workFileUser);
ExcelUtil<WorkFileUser> util = new ExcelUtil<WorkFileUser>(WorkFileUser.class);
util.exportExcel(response, list, "文件访问用户数据");
}
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workUser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(workFileUserService.selectWorkFileUserById(id));
}
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workUser:add')")
@Log(title = "文件访问用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WorkFileUser workFileUser)
{
return toAjax(workFileUserService.insertWorkFileUser(workFileUser));
}
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workUser:edit')")
@Log(title = "文件访问用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WorkFileUser workFileUser)
{
return toAjax(workFileUserService.updateWorkFileUser(workFileUser));
}
/**
* 访
*/
@PreAuthorize("@ss.hasPermi('work:workFile:remove')")
@Log(title = "文件访问用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(workFileUserService.deleteWorkFileUserByIds(ids));
}
}

View File

@ -0,0 +1,191 @@
package com.yanzhu.jh.work.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 访 work_file_user
*
* @author JiangYuQi
* @date 2023-10-22
*/
public class WorkFileUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 文件主键 */
@Excel(name = "文件主键")
private Long fileId;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 部门主键 */
@Excel(name = "部门主键")
private Long deptId;
/** 用户主键 */
@Excel(name = "用户主键")
private Long userId;
/** 数据状态 */
@Excel(name = "数据状态")
private String isDel;
private String deptType;
private String deptTypeName;
private String deptName;
private String nickName;
private String userName;
private String ancestors;
private Integer num;
/** 文件访问用户记录信息 */
private List<WorkFileUserLog> workFileUserLogList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFileId(Long fileId)
{
this.fileId = fileId;
}
public Long getFileId()
{
return fileId;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public List<WorkFileUserLog> getWorkFileUserLogList()
{
return workFileUserLogList;
}
public void setWorkFileUserLogList(List<WorkFileUserLog> workFileUserLogList)
{
this.workFileUserLogList = workFileUserLogList;
}
public String getDeptType() {
return deptType;
}
public void setDeptType(String deptType) {
this.deptType = deptType;
}
public String getDeptTypeName() {
return deptTypeName;
}
public void setDeptTypeName(String deptTypeName) {
this.deptTypeName = deptTypeName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fileId", getFileId())
.append("projectId", getProjectId())
.append("deptId", getDeptId())
.append("userId", getUserId())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("workFileUserLogList", getWorkFileUserLogList())
.toString();
}
}

View File

@ -0,0 +1,82 @@
package com.yanzhu.jh.work.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 访 work_file_user_log
*
* @author JiangYuQi
* @date 2023-10-22
*/
public class WorkFileUserLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 用户访问文件主键 */
@Excel(name = "用户访问文件主键")
private Long fileUserId;
/** 访问时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time;
/** 数据状态 */
@Excel(name = "数据状态")
private String isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFileUserId(Long fileUserId)
{
this.fileUserId = fileUserId;
}
public Long getFileUserId()
{
return fileUserId;
}
public void setTime(Date time)
{
this.time = time;
}
public Date getTime()
{
return time;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fileUserId", getFileUserId())
.append("time", getTime())
.append("isDel", getIsDel())
.toString();
}
}

View File

@ -0,0 +1,87 @@
package com.yanzhu.jh.work.mapper;
import java.util.List;
import com.yanzhu.jh.work.domain.WorkFileUser;
import com.yanzhu.jh.work.domain.WorkFileUserLog;
/**
* 访Mapper
*
* @author JiangYuQi
* @date 2023-10-22
*/
public interface WorkFileUserMapper
{
/**
* 访
*
* @param id 访
* @return 访
*/
public WorkFileUser selectWorkFileUserById(Long id);
/**
* 访
*
* @param workFileUser 访
* @return 访
*/
public List<WorkFileUser> selectWorkFileUserList(WorkFileUser workFileUser);
/**
* 访
*
* @param workFileUser 访
* @return
*/
public int insertWorkFileUser(WorkFileUser workFileUser);
/**
* 访
*
* @param workFileUser 访
* @return
*/
public int updateWorkFileUser(WorkFileUser workFileUser);
/**
* 访
*
* @param id 访
* @return
*/
public int deleteWorkFileUserById(Long id);
/**
* 访
*
* @param ids
* @return
*/
public int deleteWorkFileUserByIds(Long[] ids);
/**
* 访
*
* @param ids
* @return
*/
public int deleteWorkFileUserLogByFileUserIds(Long[] ids);
/**
* 访
*
* @param workFileUserLogList 访
* @return
*/
public int batchWorkFileUserLog(List<WorkFileUserLog> workFileUserLogList);
/**
* 访访
*
* @param id 访ID
* @return
*/
public int deleteWorkFileUserLogByFileUserId(Long id);
}

View File

@ -44,6 +44,14 @@ public interface IWorkFileService
*/
public int insertWorkFile(WorkFile workFile);
/**
*
*
* @param fileId
* @return
*/
public WorkFile openWorkFile(Long fileId);
/**
*
*

View File

@ -0,0 +1,61 @@
package com.yanzhu.jh.work.service;
import java.util.List;
import com.yanzhu.jh.work.domain.WorkFileUser;
/**
* 访Service
*
* @author JiangYuQi
* @date 2023-10-22
*/
public interface IWorkFileUserService
{
/**
* 访
*
* @param id 访
* @return 访
*/
public WorkFileUser selectWorkFileUserById(Long id);
/**
* 访
*
* @param workFileUser 访
* @return 访
*/
public List<WorkFileUser> selectWorkFileUserList(WorkFileUser workFileUser);
/**
* 访
*
* @param workFileUser 访
* @return
*/
public int insertWorkFileUser(WorkFileUser workFileUser);
/**
* 访
*
* @param workFileUser 访
* @return
*/
public int updateWorkFileUser(WorkFileUser workFileUser);
/**
* 访
*
* @param ids 访
* @return
*/
public int deleteWorkFileUserByIds(Long[] ids);
/**
* 访
*
* @param id 访
* @return
*/
public int deleteWorkFileUserById(Long id);
}

View File

@ -1,17 +1,23 @@
package com.yanzhu.jh.work.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.PublicStateEnum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.yanzhu.jh.work.domain.WorkFile;
import com.yanzhu.jh.work.domain.WorkFileUser;
import com.yanzhu.jh.work.domain.WorkFileUserLog;
import com.yanzhu.jh.work.mapper.WorkFileMapper;
import com.yanzhu.jh.work.mapper.WorkFileUserMapper;
import com.yanzhu.jh.work.service.IWorkFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -27,6 +33,9 @@ public class WorkFileServiceImpl implements IWorkFileService
@Autowired
private WorkFileMapper workFileMapper;
@Autowired
private WorkFileUserMapper workFileUserMapper;
/**
*
*
@ -51,6 +60,48 @@ public class WorkFileServiceImpl implements IWorkFileService
return workFileMapper.selectWorkFileList(workFile);
}
/**
*
*
* @param fileId
* @return
*/
@Override
@Transactional
public WorkFile openWorkFile(Long fileId){
WorkFile workFile = workFileMapper.selectWorkFileById(fileId);
WorkFileUser workFileUser = new WorkFileUser();
workFileUser.setFileId(fileId);
workFileUser.setUserId(SecurityUtils.getUserId());
List<WorkFileUser> list = workFileUserMapper.selectWorkFileUserList(workFileUser);
List<WorkFileUserLog> logList = new ArrayList<>();
if(list==null || list.size()==0){
workFileUser.setIsDel(PublicStateEnum.OK.getCode());
workFileUser.setDeptId(SecurityUtils.getDeptId());
workFileUser.setCreateBy(SecurityUtils.getUsername());
workFileUser.setCreateTime(new Date());
workFileUserMapper.insertWorkFileUser(workFileUser);
WorkFileUserLog workFileUserLog = new WorkFileUserLog();
workFileUserLog.setFileUserId(workFileUser.getId());
workFileUserLog.setTime(new Date());
workFileUserLog.setIsDel(PublicStateEnum.OK.getCode());
logList.add(workFileUserLog);
workFileUserMapper.batchWorkFileUserLog(logList);
workFile.setReadNum(workFile.getReadNum()+1);
workFileMapper.updateWorkFile(workFile);
}else{
WorkFileUserLog workFileUserLog = new WorkFileUserLog();
workFileUserLog.setFileUserId(workFileUser.getId());
workFileUserLog.setTime(new Date());
workFileUserLog.setIsDel(PublicStateEnum.OK.getCode());
logList.add(workFileUserLog);
workFileUserMapper.batchWorkFileUserLog(logList);
}
return workFile;
}
/**
*
*

View File

@ -0,0 +1,136 @@
package com.yanzhu.jh.work.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.yanzhu.jh.work.domain.WorkFileUserLog;
import com.yanzhu.jh.work.mapper.WorkFileUserMapper;
import com.yanzhu.jh.work.domain.WorkFileUser;
import com.yanzhu.jh.work.service.IWorkFileUserService;
import com.ruoyi.common.utils.SecurityUtils;
/**
* 访Service
*
* @author JiangYuQi
* @date 2023-10-22
*/
@Service
public class WorkFileUserServiceImpl implements IWorkFileUserService
{
@Autowired
private WorkFileUserMapper workFileUserMapper;
/**
* 访
*
* @param id 访
* @return 访
*/
@Override
public WorkFileUser selectWorkFileUserById(Long id)
{
return workFileUserMapper.selectWorkFileUserById(id);
}
/**
* 访
*
* @param workFileUser 访
* @return 访
*/
@Override
public List<WorkFileUser> selectWorkFileUserList(WorkFileUser workFileUser)
{
return workFileUserMapper.selectWorkFileUserList(workFileUser);
}
/**
* 访
*
* @param workFileUser 访
* @return
*/
@Transactional
@Override
public int insertWorkFileUser(WorkFileUser workFileUser)
{
workFileUser.setCreateBy(SecurityUtils.getUsername());
workFileUser.setCreateTime(DateUtils.getNowDate());
int rows = workFileUserMapper.insertWorkFileUser(workFileUser);
insertWorkFileUserLog(workFileUser);
return rows;
}
/**
* 访
*
* @param workFileUser 访
* @return
*/
@Transactional
@Override
public int updateWorkFileUser(WorkFileUser workFileUser)
{
workFileUser.setUpdateBy(SecurityUtils.getUsername());
workFileUser.setUpdateTime(DateUtils.getNowDate());
workFileUserMapper.deleteWorkFileUserLogByFileUserId(workFileUser.getId());
insertWorkFileUserLog(workFileUser);
return workFileUserMapper.updateWorkFileUser(workFileUser);
}
/**
* 访
*
* @param ids 访
* @return
*/
@Transactional
@Override
public int deleteWorkFileUserByIds(Long[] ids)
{
workFileUserMapper.deleteWorkFileUserLogByFileUserIds(ids);
return workFileUserMapper.deleteWorkFileUserByIds(ids);
}
/**
* 访
*
* @param id 访
* @return
*/
@Transactional
@Override
public int deleteWorkFileUserById(Long id)
{
workFileUserMapper.deleteWorkFileUserLogByFileUserId(id);
return workFileUserMapper.deleteWorkFileUserById(id);
}
/**
* 访
*
* @param workFileUser 访
*/
public void insertWorkFileUserLog(WorkFileUser workFileUser)
{
List<WorkFileUserLog> workFileUserLogList = workFileUser.getWorkFileUserLogList();
Long id = workFileUser.getId();
if (StringUtils.isNotNull(workFileUserLogList))
{
List<WorkFileUserLog> list = new ArrayList<WorkFileUserLog>();
for (WorkFileUserLog workFileUserLog : workFileUserLogList)
{
workFileUserLog.setFileUserId(id);
list.add(workFileUserLog);
}
if (list.size() > 0)
{
workFileUserMapper.batchWorkFileUserLog(list);
}
}
}
}

View File

@ -166,6 +166,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--普通整改人是我,复检人是我,抄送人是我,提交人是我的数据-->
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and (ssp.lordSentUser = #{nowUser} or ssp.copySendUser like concat('%', #{nowUser}, '%') or ssp.recheckSendUser = #{nowUser} or ssp.createUser = #{nowUser} )</if>
<if test='activeName == "dzg"'> and ssp.checkState in (0,1,3)</if>
<if test='activeName == "zg"'> and ssp.checkState in (0,3)</if>
<if test='activeName == "fj"'> and ssp.checkState = 1 </if>
<if test='activeName == "ycl"'> and ssp.checkState = 4 </if>
<if test='activeName == "zgcs"'> and (date(NOW())<![CDATA[ > ]]> date(ssp.nickedTime) and (ssp.updateTime is null or date(ssp.updateTime) <![CDATA[ > ]]> date(ssp.nickedTime))) </if>
</where>

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.jh.work.mapper.WorkFileUserMapper">
<resultMap type="WorkFileUser" id="WorkFileUserResult">
<result property="id" column="id" />
<result property="fileId" column="file_id" />
<result property="projectId" column="project_id" />
<result property="deptId" column="dept_id" />
<result property="userId" column="user_id" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="deptType" column="deptType" />
<result property="deptTypeName" column="deptTypeName" />
<result property="deptName" column="deptName" />
<result property="ancestors" column="ancestors" />
<result property="nickName" column="nickName" />
<result property="userName" column="userName" />
<result property="num" column="num" />
</resultMap>
<resultMap id="WorkFileUserWorkFileUserLogResult" type="WorkFileUser" extends="WorkFileUserResult">
<collection property="workFileUserLogList" notNullColumn="sub_id" javaType="java.util.List" resultMap="WorkFileUserLogResult" />
</resultMap>
<resultMap type="WorkFileUserLog" id="WorkFileUserLogResult">
<result property="id" column="sub_id" />
<result property="fileUserId" column="sub_file_user_id" />
<result property="time" column="sub_time" />
<result property="isDel" column="sub_is_del" />
</resultMap>
<sql id="selectWorkFileUserVo">
select id, file_id, project_id, dept_id, user_id, is_del, create_by, create_time, update_by, update_time, remark from work_file_user
</sql>
<select id="selectWorkFileUserList" parameterType="WorkFileUser" resultMap="WorkFileUserResult">
select wfu.id, wfu.file_id, wfu.project_id, wfu.dept_id, sd.type_flag as deptType, sdd.dict_label as deptTypeName, sd.dept_name as deptName, sd.ancestors, su.user_name as userName, su.nick_name as nickName, wfu.user_id, wfu.is_del, wfu.create_by, wfu.create_time, wfu.update_by, wfu.update_time, wfu.remark from work_file_user wfu
left join sys_user su on su.user_id = wfu.user_id
left join sys_dept sd on sd.dept_id = wfu.dept_id
left join sys_dict_data sdd on sdd.dict_type='sys_dept_type' and sdd.dict_value=sd.type_flag
<where>
wfu.is_del=0
<if test="fileId != null "> and wfu.file_id = #{fileId}</if>
<if test="deptType != null "> and sd.type_flag = #{deptType}</if>
<if test="projectId != null "> and wfu.project_id = #{projectId}</if>
<if test="deptId != null "> and wfu.dept_id = #{deptId}</if>
<if test="userId != null "> and wfu.user_id = #{userId}</if>
</where>
order by wfu.create_by desc
</select>
<select id="selectWorkFileUserById" parameterType="Long" resultMap="WorkFileUserWorkFileUserLogResult">
select a.id, a.file_id, a.project_id, a.dept_id, a.user_id, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
b.id as sub_id, b.file_user_id as sub_file_user_id, b.time as sub_time, b.is_del as sub_is_del
from work_file_user a
left join work_file_user_log b on b.file_user_id = a.id
where a.id = #{id}
</select>
<insert id="insertWorkFileUser" parameterType="WorkFileUser" useGeneratedKeys="true" keyProperty="id">
insert into work_file_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="userId != null">user_id,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">#{fileId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="userId != null">#{userId},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWorkFileUser" parameterType="WorkFileUser">
update work_file_user
<trim prefix="SET" suffixOverrides=",">
<if test="fileId != null">file_id = #{fileId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWorkFileUserById" parameterType="Long">
delete from work_file_user where id = #{id}
</delete>
<delete id="deleteWorkFileUserByIds" parameterType="String">
delete from work_file_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteWorkFileUserLogByFileUserIds" parameterType="String">
delete from work_file_user_log where file_user_id in
<foreach item="fileUserId" collection="array" open="(" separator="," close=")">
#{fileUserId}
</foreach>
</delete>
<delete id="deleteWorkFileUserLogByFileUserId" parameterType="Long">
delete from work_file_user_log where file_user_id = #{fileUserId}
</delete>
<insert id="batchWorkFileUserLog">
insert into work_file_user_log( id, file_user_id, time, is_del) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.fileUserId}, #{item.time}, #{item.isDel})
</foreach>
</insert>
</mapper>