人员,出入场,黑名单管理
This commit is contained in:
parent
be94f6056b
commit
d09997620c
|
|
@ -0,0 +1,55 @@
|
|||
package com.bonus.base.basic.controller;
|
||||
|
||||
import com.bonus.base.basic.domain.TtPersonnelBlackReqVo;
|
||||
import com.bonus.base.basic.domain.TtSysUserReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelBlackVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
||||
import com.bonus.base.basic.service.TtPersonnelBlackService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员黑名单
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/ttPersonnelBlack")
|
||||
public class TtPersonnelBlackController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private TtPersonnelBlackService ttPersonnelBlackService;
|
||||
|
||||
@ApiOperation(value = "查询人员黑名单列表")
|
||||
@PostMapping("/getTtPersonnelBlackList")
|
||||
public TableDataInfo getTtPersonnelBlackList(@RequestBody TtPersonnelBlackReqVo ttPersonnelBlackReqVo) {
|
||||
try {
|
||||
startPage();
|
||||
List<TtPersonnelBlackVo> ttPersonnelBlackList = ttPersonnelBlackService.getTtPersonnelBlackList(ttPersonnelBlackReqVo);
|
||||
return getDataTable(ttPersonnelBlackList);
|
||||
}catch (Exception e){
|
||||
return getDataTableError(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询人员黑名单详情")
|
||||
@PostMapping("/getTtPersonnelBlackById")
|
||||
public AjaxResult getTtPersonnelBlackById(@RequestBody TtPersonnelBlackReqVo ttPersonnelBlackReqVo) {
|
||||
try {
|
||||
|
||||
TtPersonnelBlackVo ttPersonnelBlack = ttPersonnelBlackService.getTtPersonnelBlackById(ttPersonnelBlackReqVo);
|
||||
return success(ttPersonnelBlack);
|
||||
}catch (Exception e){
|
||||
return error("获取详情失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.bonus.base.basic.controller;
|
||||
|
||||
|
||||
import com.bonus.base.basic.domain.TtSysUserReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysTeamVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
||||
import com.bonus.base.basic.service.TtSysUserService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员管理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/ttSysUser")
|
||||
public class TtSysUserController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private TtSysUserService ttSysUserService;
|
||||
|
||||
@ApiOperation(value = "查询人员列表")
|
||||
@PostMapping("/getTtSysUserList")
|
||||
public TableDataInfo getTtSysUserList(@RequestBody TtSysUserReqVo ttSysUserReqVo) {
|
||||
try {
|
||||
startPage();
|
||||
List<TtSysUserVo> ttSysUserVoList = ttSysUserService.getTtSysUserList(ttSysUserReqVo);
|
||||
return getDataTable(ttSysUserVoList);
|
||||
}catch (Exception e){
|
||||
|
||||
return getDataTableError(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取人员详情")
|
||||
@PostMapping("/getTtSysUserById")
|
||||
public AjaxResult getTtSysUserById(@RequestBody TtSysUserReqVo ttSysUserReqVo) {
|
||||
try {
|
||||
TtSysUserVo ttSysUserVo = ttSysUserService.getTtSysUserById(ttSysUserReqVo);
|
||||
return success(ttSysUserVo);
|
||||
}catch (Exception e){
|
||||
return error("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增人员")
|
||||
@PostMapping("/addTtSysUser")
|
||||
public AjaxResult addTtSysUser(@RequestBody TtSysUserVo ttSysUserVo) {
|
||||
try {
|
||||
ttSysUserService.addTtSysUser(ttSysUserVo);
|
||||
return success("新增成功");
|
||||
}catch (Exception e){
|
||||
return error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改人员信息")
|
||||
@PostMapping("/updateTtSysUser")
|
||||
public AjaxResult updateTtSysUser(@RequestBody TtSysUserVo ttSysUserVo) {
|
||||
try {
|
||||
ttSysUserService.updateTtSysUser(ttSysUserVo);
|
||||
return success("修改成功");
|
||||
}catch (Exception e){
|
||||
return error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改人员状态")
|
||||
@PostMapping("/updateTtSysUserStatus")
|
||||
public AjaxResult updateTtSysUserStatus(@RequestBody TtSysUserVo ttSysUserVo) {
|
||||
try {
|
||||
ttSysUserService.updateTtSysUserStatus(ttSysUserVo);
|
||||
return success("修改成功");
|
||||
}catch (Exception e){
|
||||
return error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除人员")
|
||||
@PostMapping("/deleteTtSysUser")
|
||||
public AjaxResult deleteTtSysUser(@RequestBody TtSysUserVo ttSysUserVo) {
|
||||
try {
|
||||
ttSysUserService.deleteTtSysUser(ttSysUserVo);
|
||||
return success("删除成功");
|
||||
}catch (Exception e){
|
||||
return error("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.base.basic.domain;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TtPersonnelBlackReqVo {
|
||||
|
||||
|
||||
/**
|
||||
*主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 执行状态(0.执行中,1已解除)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.base.basic.domain;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TtSysUserReqVo {
|
||||
|
||||
/**
|
||||
*主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
*班组长
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*班组类型
|
||||
*/
|
||||
private String teamType;
|
||||
|
||||
/**
|
||||
*参建单位
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.base.basic.domain.vo;
|
||||
|
||||
|
||||
import com.bonus.base.basic.domain.BmFileInfo;
|
||||
import jdk.internal.dynalink.linker.LinkerServices;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TtPersonnelBlackVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCode;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Long lotId;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private String post;
|
||||
|
||||
/**
|
||||
* 事件
|
||||
*/
|
||||
private String event;
|
||||
|
||||
/**
|
||||
* 起止时间
|
||||
*/
|
||||
private String startAndEndTime;
|
||||
|
||||
/**
|
||||
* 执行状态(0.执行中,1已解除)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 所属公司
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
private List<BmFileInfo> bmFileInfoList;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.bonus.base.basic.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TtPersonnelEntryExitVo {
|
||||
|
||||
/**
|
||||
*主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*人员Id
|
||||
*/
|
||||
private Long personnelId;
|
||||
|
||||
/**
|
||||
*工种
|
||||
*/
|
||||
private String workType;
|
||||
|
||||
/**
|
||||
*工程id
|
||||
*/
|
||||
private Long lotId;
|
||||
|
||||
/**
|
||||
*入场时间
|
||||
*/
|
||||
private Date entryDate;
|
||||
|
||||
/**
|
||||
*出场时间
|
||||
*/
|
||||
private Date exitDate;
|
||||
|
||||
/**
|
||||
*状态(0.在场,1.离场)
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -3,10 +3,16 @@ package com.bonus.base.basic.domain.vo;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TtSysUserVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*用户名称
|
||||
*/
|
||||
|
|
@ -96,4 +102,14 @@ public class TtSysUserVo {
|
|||
*近期照片
|
||||
*/
|
||||
private String photos;
|
||||
|
||||
/**
|
||||
*人员状态(0.在场,1.休息,2.离场)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 出入场信息
|
||||
*/
|
||||
List<TtPersonnelEntryExitVo> ttPersonnelEntryExitVoList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.base.basic.mapper;
|
||||
|
||||
import com.bonus.base.basic.domain.TtPersonnelBlackReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelBlackVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TtPersonnelBlackMapper {
|
||||
List<TtPersonnelBlackVo> getTtPersonnelBlackList(TtPersonnelBlackReqVo ttPersonnelBlackReqVo);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.base.basic.mapper;
|
||||
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelEntryExitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TtPersonnelEntryExitMapper {
|
||||
List<TtPersonnelEntryExitVo> getTtPersonnelEntryExitByUserId(String personnelId);
|
||||
|
||||
void addTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo);
|
||||
|
||||
void updateTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo);
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.base.basic.mapper;
|
||||
|
||||
import com.bonus.base.basic.domain.TtSysUserReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -10,4 +11,10 @@ public interface TtSysUserMapper {
|
|||
void updateTtSysUserVoByTeam(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void delTtSysUserByTeam(String teamId);
|
||||
|
||||
List<TtSysUserVo> getTtSysUserList(TtSysUserReqVo ttSysUserReqVo);
|
||||
|
||||
void addTtSysUser(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void updateTtSysUser(TtSysUserVo ttSysUserVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.base.basic.service;
|
||||
|
||||
import com.bonus.base.basic.domain.TtPersonnelBlackReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelBlackVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TtPersonnelBlackService {
|
||||
List<TtPersonnelBlackVo> getTtPersonnelBlackList(TtPersonnelBlackReqVo ttPersonnelBlackReqVo);
|
||||
|
||||
TtPersonnelBlackVo getTtPersonnelBlackById(TtPersonnelBlackReqVo ttPersonnelBlackReqVo);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.base.basic.service;
|
||||
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelEntryExitVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TtPersonnelEntryExitService {
|
||||
|
||||
List<TtPersonnelEntryExitVo> getTtPersonnelEntryExitByUserId(String personnelId);
|
||||
|
||||
void addTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo);
|
||||
|
||||
void updateTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo);
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package com.bonus.base.basic.service;
|
||||
|
||||
import com.bonus.base.basic.domain.TtSysTeamReqVo;
|
||||
import com.bonus.base.basic.domain.TtSysUserReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysTeamVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -10,4 +13,16 @@ public interface TtSysUserService {
|
|||
void updateTtSysUserVoByTeam(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void delTtSysUserByTeam(String teamId);
|
||||
|
||||
List<TtSysUserVo> getTtSysUserList(TtSysUserReqVo ttSysUserReqVo);
|
||||
|
||||
TtSysUserVo getTtSysUserById(TtSysUserReqVo ttSysUserReqVo);
|
||||
|
||||
void addTtSysUser(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void updateTtSysUser(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void updateTtSysUserStatus(TtSysUserVo ttSysUserVo);
|
||||
|
||||
void deleteTtSysUser(TtSysUserVo ttSysUserVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.base.basic.service.impl;
|
||||
|
||||
import com.bonus.base.basic.domain.BmFileInfo;
|
||||
import com.bonus.base.basic.domain.TtPersonnelBlackReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelBlackVo;
|
||||
import com.bonus.base.basic.mapper.TtPersonnelBlackMapper;
|
||||
import com.bonus.base.basic.service.IBmFileInfoService;
|
||||
import com.bonus.base.basic.service.TtPersonnelBlackService;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Log4j
|
||||
@Service
|
||||
public class TtPersonnelBlackServiceImpl implements TtPersonnelBlackService {
|
||||
|
||||
@Resource
|
||||
private TtPersonnelBlackMapper ttPersonnelBlackMapper;
|
||||
|
||||
@Resource
|
||||
private IBmFileInfoService bmFileInfoService;
|
||||
|
||||
@Override
|
||||
public List<TtPersonnelBlackVo> getTtPersonnelBlackList(TtPersonnelBlackReqVo ttPersonnelBlackReqVo) {
|
||||
//获取黑名单列表
|
||||
List<TtPersonnelBlackVo> TtPersonnelBlackList = ttPersonnelBlackMapper.getTtPersonnelBlackList(ttPersonnelBlackReqVo);
|
||||
//获取附件信息
|
||||
for (TtPersonnelBlackVo ttPersonnelBlackVo : TtPersonnelBlackList) {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
bmFileInfo.setTaskId(ttPersonnelBlackVo.getId());
|
||||
List<BmFileInfo> bmFileInfoList = bmFileInfoService.selectBmFileInfoList(bmFileInfo);
|
||||
ttPersonnelBlackVo.setBmFileInfoList(bmFileInfoList);
|
||||
}
|
||||
return TtPersonnelBlackList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TtPersonnelBlackVo getTtPersonnelBlackById(TtPersonnelBlackReqVo ttPersonnelBlackReqVo) {
|
||||
TtPersonnelBlackVo ttPersonnelBlackVo = ttPersonnelBlackMapper.getTtPersonnelBlackList(ttPersonnelBlackReqVo).get(0);
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
bmFileInfo.setTaskId(ttPersonnelBlackVo.getId());
|
||||
List<BmFileInfo> bmFileInfoList = bmFileInfoService.selectBmFileInfoList(bmFileInfo);
|
||||
ttPersonnelBlackVo.setBmFileInfoList(bmFileInfoList);
|
||||
return ttPersonnelBlackVo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.base.basic.service.impl;
|
||||
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelEntryExitVo;
|
||||
import com.bonus.base.basic.mapper.TtPersonnelEntryExitMapper;
|
||||
import com.bonus.base.basic.service.TtPersonnelEntryExitService;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Log4j
|
||||
@Service
|
||||
public class TtPersonnelEntryExitServiceImpl implements TtPersonnelEntryExitService {
|
||||
|
||||
@Resource
|
||||
private TtPersonnelEntryExitMapper ttPersonnelEntryExitMapper;
|
||||
|
||||
@Override
|
||||
public List<TtPersonnelEntryExitVo> getTtPersonnelEntryExitByUserId(String personnelId) {
|
||||
return ttPersonnelEntryExitMapper.getTtPersonnelEntryExitByUserId(personnelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo) {
|
||||
ttPersonnelEntryExitMapper.addTtPersonnelEntryExit(ttPersonnelEntryExitVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTtPersonnelEntryExit(TtPersonnelEntryExitVo ttPersonnelEntryExitVo) {
|
||||
ttPersonnelEntryExitMapper.updateTtPersonnelEntryExit(ttPersonnelEntryExitVo);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import com.bonus.base.basic.service.TtSysTeamService;
|
|||
import com.bonus.base.basic.service.TtSysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -46,6 +47,7 @@ public class TtSysTeamServiceImpl implements TtSysTeamService {
|
|||
* @param ttSysTeamVo
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void addTtSysTeam(TtSysTeamVo ttSysTeamVo) {
|
||||
//保存班组信息
|
||||
ttSysTeamMapper.addTtSysTeam(ttSysTeamVo);
|
||||
|
|
@ -75,6 +77,7 @@ public class TtSysTeamServiceImpl implements TtSysTeamService {
|
|||
* @param ttSysTeamVo
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateTtSysTeam(TtSysTeamVo ttSysTeamVo) {
|
||||
//修改班组信息
|
||||
ttSysTeamMapper.updateTtSysTeam(ttSysTeamVo);
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
package com.bonus.base.basic.service.impl;
|
||||
|
||||
import com.bonus.base.basic.domain.TtSysUserReqVo;
|
||||
import com.bonus.base.basic.domain.vo.TtPersonnelEntryExitVo;
|
||||
import com.bonus.base.basic.domain.vo.TtSysUserVo;
|
||||
import com.bonus.base.basic.mapper.TtSysUserMapper;
|
||||
import com.bonus.base.basic.service.TtPersonnelEntryExitService;
|
||||
import com.bonus.base.basic.service.TtSysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TtSysUserServiceImpl implements TtSysUserService {
|
||||
|
|
@ -17,6 +23,9 @@ public class TtSysUserServiceImpl implements TtSysUserService {
|
|||
@Resource
|
||||
private TtSysUserMapper ttSysUserMapper;
|
||||
|
||||
@Resource
|
||||
private TtPersonnelEntryExitService ttPersonnelEntryExitService;
|
||||
|
||||
/**
|
||||
* 获取班组下的人员信息
|
||||
* @param teamId
|
||||
|
|
@ -45,4 +54,63 @@ public class TtSysUserServiceImpl implements TtSysUserService {
|
|||
public void delTtSysUserByTeam(String teamId) {
|
||||
ttSysUserMapper.delTtSysUserByTeam(teamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TtSysUserVo> getTtSysUserList(TtSysUserReqVo ttSysUserReqVo) {
|
||||
//获取热源列表
|
||||
List<TtSysUserVo> ttSysUserList = ttSysUserMapper.getTtSysUserList(ttSysUserReqVo);
|
||||
//获取人员出入场记录
|
||||
for (TtSysUserVo ttSysUserVo: ttSysUserList) {
|
||||
List<TtPersonnelEntryExitVo> ttPersonnelEntryExitVoList = ttPersonnelEntryExitService.getTtPersonnelEntryExitByUserId(ttSysUserVo.getId());
|
||||
ttSysUserVo.setTtPersonnelEntryExitVoList(ttPersonnelEntryExitVoList);
|
||||
}
|
||||
return ttSysUserList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TtSysUserVo getTtSysUserById(TtSysUserReqVo ttSysUserReqVo) {
|
||||
return ttSysUserMapper.getTtSysUserList(ttSysUserReqVo).get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void addTtSysUser(TtSysUserVo ttSysUserVo) {
|
||||
//保存用户信息
|
||||
ttSysUserMapper.addTtSysUser(ttSysUserVo);
|
||||
//保存出入场信息
|
||||
TtPersonnelEntryExitVo ttPersonnelEntryExitVo = new TtPersonnelEntryExitVo();
|
||||
ttPersonnelEntryExitVo.setPersonnelId(Long.valueOf(ttSysUserVo.getId()));
|
||||
ttPersonnelEntryExitVo.setWorkType(ttSysUserVo.getWorkType());
|
||||
ttPersonnelEntryExitVo.setEntryDate(new Date());
|
||||
ttPersonnelEntryExitVo.setStatus(0);
|
||||
ttPersonnelEntryExitService.addTtPersonnelEntryExit(ttPersonnelEntryExitVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTtSysUser(TtSysUserVo ttSysUserVo) {
|
||||
//修改用户信息
|
||||
ttSysUserMapper.updateTtSysUser(ttSysUserVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateTtSysUserStatus(TtSysUserVo ttSysUserVo) {
|
||||
//修改用户信息
|
||||
ttSysUserMapper.updateTtSysUser(ttSysUserVo);
|
||||
//如果是离场,修改进场记录
|
||||
if (ttSysUserVo.getStatus() ==2){
|
||||
//保存出入场信息
|
||||
TtPersonnelEntryExitVo ttPersonnelEntryExitVo = new TtPersonnelEntryExitVo();
|
||||
ttPersonnelEntryExitVo.setPersonnelId(Long.valueOf(ttSysUserVo.getId()));
|
||||
ttPersonnelEntryExitVo.setExitDate(new Date());
|
||||
ttPersonnelEntryExitVo.setStatus(1);
|
||||
ttPersonnelEntryExitService.updateTtPersonnelEntryExit(ttPersonnelEntryExitVo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTtSysUser(TtSysUserVo ttSysUserVo) {
|
||||
//修改用户信息
|
||||
ttSysUserMapper.updateTtSysUser(ttSysUserVo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?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.bonus.base.basic.mapper.TtPersonnelBlackMapper">
|
||||
|
||||
<select id="getTtPersonnelBlackList" resultType="com.bonus.base.basic.domain.vo.TtPersonnelBlackVo">
|
||||
select id as id,user_name as userName,id_code as idCode, lot_id as lotId, post as post,event as event,
|
||||
start_and_end_time as startAndEndTime,status as status, dept_id as deptId
|
||||
from tt_personnel_black where 1=1
|
||||
<if test="id != '' and id != null"> and id = #{id}</if>
|
||||
<if test="status != '' and status != null"> and status = #{status}</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
post like concat('%', #{keyWord}, '%') or
|
||||
event like concat('%', #{keyWord}, '%') or
|
||||
user_name like concat('%', #{keyWord}, '%') or
|
||||
id_code like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?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.bonus.base.basic.mapper.TtPersonnelEntryExitMapper">
|
||||
<insert id="addTtPersonnelEntryExit">
|
||||
insert into tt_personnel_entry_exit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="personnelId != null and personnelId != ''">personnel_id,</if>
|
||||
<if test="workType != null">work_type,</if>
|
||||
<if test="lotId != null and lotId != ''">lot_id,</if>
|
||||
<if test="entryDate != null">entry_date,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="personnelId != null and personnelId != ''">#{personnelId},</if>
|
||||
<if test="workType != null">#{workType},</if>
|
||||
<if test="lotId != null and lotId != ''">#{lotId},</if>
|
||||
<if test="entryDate != null">#{entryDate},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateTtPersonnelEntryExit">
|
||||
update tt_personnel_entry_exit
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="exitDate != null">exit_date = #{exitDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where personnel_id = #{personnelId} and status = 0
|
||||
</update>
|
||||
|
||||
<select id="getTtPersonnelEntryExitByUserId"
|
||||
resultType="com.bonus.base.basic.domain.vo.TtPersonnelEntryExitVo">
|
||||
select id as id, personnel_id as personnelId, work_type as workType,lot_id as lotId,
|
||||
entry_date as entryDate, exit_date as exitDate, status as status
|
||||
from tt_personnel_entry_exit where personnel_id = #{personnelId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,11 +3,79 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.base.basic.mapper.TtSysUserMapper">
|
||||
<insert id="addTtSysUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tt_sys_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="userPhone != null">user_phone,</if>
|
||||
<if test="idCar != null and idCar != ''">id_car,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="carImage != null and carImage != ''">car_image,</if>
|
||||
<if test="postUnit != null and postUnit != ''">post_unit,</if>
|
||||
<if test="workType != null and workType != ''">work_type,</if>
|
||||
<if test="birthday != null and birthday != ''">birthday,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="nationality != null and nationality != ''">nationality,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="issAuth != null and issAuth != ''">iss_auth,</if>
|
||||
<if test="startTime != null and startTime != ''">start_time,</if>
|
||||
<if test="endTime != null and endTime != ''">end_time,</if>
|
||||
<if test="photos != null and photos != ''">photos,</if>
|
||||
create_time,
|
||||
del_flag,
|
||||
status
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="userPhone != null">#{userPhone},</if>
|
||||
<if test="idCar != null and idCar != ''">#{idCar},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="teamId != null and teamId != ''">#{teamId},</if>
|
||||
<if test="carImage != null and carImage != ''">#{carImage},</if>
|
||||
<if test="postUnit != null and postUnit != ''">#{postUnit},</if>
|
||||
<if test="workType != null and workType != ''">#{workType},</if>
|
||||
<if test="birthday != null and birthday != ''">#{birthday},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="nationality != null and nationality != ''">#{nationality},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="issAuth != null and issAuth != ''">#{issAuth},</if>
|
||||
<if test="startTime != null and startTime != ''">#{startTime},</if>
|
||||
<if test="endTime != null and endTime != ''">#{remark},</if>
|
||||
<if test="photos != null and photos != ''">#{photos},</if>
|
||||
NOW(),
|
||||
1,
|
||||
0
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateTtSysUserVoByTeam">
|
||||
update tt_sys_user set team_id =#{teamId}
|
||||
where id = #{id}
|
||||
|
||||
</update>
|
||||
<update id="updateTtSysUser">
|
||||
update tt_sys_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userPhone != null">user_phone = #{userPhone},</if>
|
||||
<if test="idCar != null">id_car = #{idCar},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="teamId != null">team_id = #{teamId},</if>
|
||||
<if test="carImage != null">car_image = #{carImage},</if>
|
||||
<if test="postUnit != null">post_unit = #{postUnit},</if>
|
||||
<if test="workType != null">work_type = #{workType},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="nationality != null">nationality = #{nationality},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="issAuth != null">iss_auth = #{issAuth},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="photos != null">photos = #{photos},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="delTtSysUserByTeam">
|
||||
update tt_sys_user set team_id = null
|
||||
where team_id =#{teamId}
|
||||
|
|
@ -15,10 +83,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
|
||||
<select id="getTtSysUserVoListByTeamId" resultType="com.bonus.base.basic.domain.vo.TtSysUserVo">
|
||||
select user_name as userName,user_phone as userPhone,id_car as idCar, unit_id as unitId,
|
||||
select id as id,user_name as userName,user_phone as userPhone,id_car as idCar, unit_id as unitId,
|
||||
team_id as teamId,car_image as carImage,post_unit as postUnit,work_type as workType,
|
||||
birthday as birthday,sex as sex,nationality as nationality,address as address,iss_auth as issAuth,
|
||||
start_time as startTime,end_time as endTime,photos as photos
|
||||
start_time as startTime,end_time as endTime,photos as photos,status as status
|
||||
from tt_sys_user where team_id = #{teamId}
|
||||
</select>
|
||||
<select id="getTtSysUserList" resultType="com.bonus.base.basic.domain.vo.TtSysUserVo">
|
||||
select id as id,user_name as userName,user_phone as userPhone,id_car as idCar, unit_id as unitId,
|
||||
team_id as teamId,car_image as carImage,post_unit as postUnit,work_type as workType,
|
||||
birthday as birthday,sex as sex,nationality as nationality,address as address,iss_auth as issAuth,
|
||||
start_time as startTime,end_time as endTime,photos as photos,status as status
|
||||
from tt_sys_user where 1=1
|
||||
<if test="id != '' and id != null"> and id = #{id}</if>
|
||||
<if test="postUnit != '' and postUnit != null"> and post_unit = #{postUnit}</if>
|
||||
<if test="teamId != '' and teamId != null"> and team_id = #{teamId}</if>
|
||||
<if test="sex != '' and sex != null"> and sex = #{sex}</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
userName like concat('%', #{keyWord}, '%') or
|
||||
user_phone like concat('%', #{keyWord}, '%') or
|
||||
address like concat('%', #{keyWord}, '%') or
|
||||
iss_auth like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue