Commit ae035ce7 by 李小惠

修改人员模块

parent 79d33d7c
......@@ -169,7 +169,7 @@ public class BusFormDto {
* 报废类型(1销毁出库,2移入报废区)
*/
private Integer type;
/**
* 单据使用次数(forbidden禁止使用,outgoing 仅出库使用,incoming仅入库使用,bothuseing出入库都可以使用一次)
*/
......
......@@ -27,10 +27,8 @@ public class PolicemanDto {
private String tel;
private String phone;
//单警柜编号
private String cabinetNum;
//单警柜主柜名
private String cabinetName;
//单警柜
private CabinetDto cabinetInfo;
//组织机构名称
private String orgName;
//组织机构id
......@@ -49,10 +47,12 @@ public class PolicemanDto {
//用户名
private String account;
/**
* 角色id列表
*/
// /**
// * 角色id列表
// */
private List<Long> rolesList;
private String rolesName;
// private List<SysUserRoleDto> rolesList;
/**
* 0警员,1辅警
*/
......@@ -66,4 +66,9 @@ public class PolicemanDto {
* 指纹照片list
*/
private List<String> fingerList;
/**
* 海康人脸机
*/
private Integer hkFaceDevice;
}
\ No newline at end of file
package com.junmp.jyzb.api.bean.dto;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@Data
public class SysUserRoleDto {
private Long userId;
private Long roleId;
private String roleName;
private String roleCode;
private Integer roleSort;
private Integer dataScopeType;
private Integer statusFlag;
private String remark;
private Integer delFlag;
private Integer roleSysFlag;
private String roleTypeCode;
}
......@@ -21,7 +21,7 @@ public class PolicemanReq extends BaseRequest {
@NotBlank(message = "箱门id不能为空", groups = {edit.class, delete.class})
private String cabinetBoxId;
@NotNull(message = "组织机构id不能为空",groups = {add.class})
@NotNull(message = "组织机构id不能为空",groups = {add.class,page.class})
private Long orgId;
private Long departmentId;
......
......@@ -80,5 +80,6 @@ public class UpdatePolicemanReq extends BaseRequest {
* 指纹照片list
*/
private List<String> fingerList;
private Long userId;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -105,7 +105,7 @@ public class PoliceController {
//根据组条件查询,只查询本级,不包含下级(page)--可以根据组织机构查询
@PostMapping("/ShowPolicePage")
@ApiOperation("根据条件查询所有警员信息(page)")
public ApiRes<PageResult<PolicemanDto>> GetAllPolicemanPage(@RequestBody PolicemanReq req){
public ApiRes<PageResult<PolicemanDto>> GetAllPolicemanPage(@RequestBody @Validated(ValidationApi.page.class) PolicemanReq req){
PageResult<PolicemanDto> policemanDtoPageResult = policemanService.GetAllPolicemanPage(req);
return ApiRes.success(policemanDtoPageResult);
}
......
......@@ -84,5 +84,11 @@ public class Policeman implements Serializable {
@TableField(value = "identity")
private Integer identity;
/**
* 海康人脸机
*/
@TableField(value = "hk_face_device")
private Integer hkFaceDevice;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junmp.jyzb.api.bean.dto.PolicemanDto;
import com.junmp.jyzb.api.bean.dto.SysUserRoleDto;
import com.junmp.jyzb.api.bean.dto.UserRoleDto;
import com.junmp.jyzb.entity.CabinetBox;
import com.junmp.jyzb.entity.InventorySummary;
......@@ -38,4 +40,9 @@ public interface PolicemanMapper extends BaseMapper<Policeman> {
void updateBatchUserIdByAccountList(@Param("userIdList") List<Long> userIdList, @Param("accountList") List<String> accountList);
List<UserRoleDto> ShowUserRole(@Param("req") SysUserReq req,@Param("numRoles") Integer numRoles);
List<SysUserRoleDto> selectUserRoleInfo(@Param("userId") Long userId);
List<PolicemanDto> selectUserBypoliceIds(Long orgId, String account, String name, String policeCode, String phone, long l, Long pageSize);
}
\ No newline at end of file
......@@ -13,10 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.junmp.junmpProcess.dto.StartProcessInstanceDTO;
import com.junmp.junmpProcess.exception.WorkFlowException;
import com.junmp.junmpProcess.service.IFlowInstanceService;
import com.junmp.jyzb.api.bean.dto.PoliceFingerDto;
import com.junmp.jyzb.api.bean.dto.PolicemanDto;
import com.junmp.jyzb.api.bean.dto.ReassignmentDto;
import com.junmp.jyzb.api.bean.dto.UserRoleDto;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.CabinetReq;
import com.junmp.jyzb.api.bean.query.PolicemanReq;
import com.junmp.jyzb.api.bean.query.QueryReassignmentReq;
......@@ -55,6 +52,7 @@ import liquibase.pro.packaged.O;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.User;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -237,7 +235,15 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
@Override
public PolicemanDto GetOnePolice(PolicemanReq req) {
Policeman one = PoliceExist(req.getId());
PubOrg pubOrg = pubOrgService.PubOrgExist(one.getOrgId());
PolicemanDto policemanDto = new PolicemanDto();
if (ObjectUtil.isNotNull(one.getCabinetBoxId())){
String cabinetId = cabinetBoxService.getById(one.getCabinetBoxId()).getCabinetId();
Cabinet cabinet = cabinetService.getById(cabinetId);
CabinetDto cabinetDto = new CabinetDto();
BeanPlusUtil.copyProperties(cabinet,cabinetDto);
policemanDto.setCabinetInfo(cabinetDto);
}
BeanPlusUtil.copyProperties(one, policemanDto);
//将警员的指纹信息查询出来
List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
......@@ -252,13 +258,19 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//将账号名称返回
policemanDto.setAccount(sysUserService.getById(policemanDto.getUserId()).getAccount());
//通过警员信息将该警员的角色id返回
List<SysUserRole> list = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>()
.eq(SysUserRole::getUserId, policemanDto.getUserId()));
List<Long> collect = list.stream().map(sysUserRole -> {
Long roleId = sysUserRole.getRoleId();
return roleId;
}).collect(Collectors.toList());
policemanDto.setRolesList(collect);
List<SysUserRoleDto> sysUserRoleDtos = policemanMapper.selectUserRoleInfo(policemanDto.getUserId());
List<Long> roleIds=new ArrayList<>();
String roleNames="";
for (SysUserRoleDto sysUserRoleDto:sysUserRoleDtos) {
roleIds.add(sysUserRoleDto.getRoleId());
roleNames+=sysUserRoleDto.getRoleName()+",";
}
// 删除最后一个逗号
if (!roleNames.isEmpty()) {
roleNames = roleNames.substring(0, roleNames.length() - 1);
}
policemanDto.setRolesList(roleIds);
policemanDto.setRolesName(roleNames);
List<PoliceFace> paceList = policeFaceService.list(new LambdaQueryWrapper<PoliceFace>()
.eq(PoliceFace::getPoliceId, req.getId()));
List<String> faceList=new ArrayList<>();
......@@ -266,11 +278,13 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
faceList.add(policeFace.getFaceInfo());
}
policemanDto.setFaceInfoList(faceList);
policemanDto.setOrgName(pubOrg.getOrgName());
return policemanDto;
}
/**
* 删除警员信息
*
......@@ -304,6 +318,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean UpdatePolice(UpdatePolicemanReq req) {
Policeman policeman = new Policeman();
......@@ -326,7 +341,16 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
cabinetBoxService.CabinetBoxExist(req.getCabinetBoxId());
}
policeman.setUpdateTime(DateTimeUtil.getCurrentDateTime());
//修改角色
sysUserRoleService.removeBatchByIds(req.getRolesList());
List<SysUserRole> collect = req.getRolesList().stream().map(s -> {
SysUserRole sysUserRole = new SysUserRole();
sysUserRole.setUserId(req.getUserId());
sysUserRole.setRoleId(s);
sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
return sysUserRole;
}).collect(Collectors.toList());
sysUserRoleService.saveBatch(collect);
return updateById(policeman);
}
......@@ -420,19 +444,11 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//查询传入的组织机构id是否存在
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
//查询出组织机构下的所有警员信息
LambdaQueryWrapper<Policeman> eq = new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(req.getOrgId()), Policeman::getOrgId, req.getOrgId())
.like(ObjectUtil.isNotEmpty(req.getName()), Policeman::getName, req.getName())
.like(ObjectUtil.isNotEmpty(req.getPoliceCode()), Policeman::getPoliceCode, req.getPoliceCode())
.eq(ObjectUtil.isNotEmpty(req.getState()), Policeman::getState, req.getState());
long size = list(eq).size();
Page<Policeman> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), eq);
List<Policeman> records = page.getRecords();
List<PolicemanDto> policeList = new ArrayList<>();
//查询出警员信息下的指纹列表信息
for (Policeman p : records) {
PolicemanDto policemanDto = new PolicemanDto();
BeanPlusUtil.copyProperties(p, policemanDto);
Long pageNo = req.getPageNo();
Long pageSize = req.getPageSize();
List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds(req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(),req.getPhone(),(pageNo-1),pageSize);
// 查询出警员信息下的指纹列表信息
for (PolicemanDto p : policemanDtos) {
List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
.eq(ObjectUtil.isNotNull(p.getId()), PoliceFinger::getPoliceId, p.getId()));
List<PoliceFingerDto> policeFingerDtoList = new ArrayList<>();
......@@ -441,18 +457,54 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
BeanPlusUtil.copyProperties(policeFinger, policeFingerDto);
policeFingerDtoList.add(policeFingerDto);
}
policemanDto.setFingersList(policeFingerDtoList);
policemanDto.setOrgName(pubOrg.getOrgName());
policeList.add(policemanDto);
p.setFingersList(policeFingerDtoList);
p.setOrgName(pubOrg.getOrgName());
}
Page<PolicemanDto> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
page1.setRecords(policeList);
page1.setTotal(size);
// page1.setRecords(policemanDtos);
// page1.setTotal(size);
return PageResultFactory.createPageResult(page1);
}
public PageResult<PolicemanDto> GetAllPolicemanPage1(PolicemanReq req) {
//查询传入的组织机构id是否存在
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
//查询出组织机构下的所有警员信息
LambdaQueryWrapper<Policeman> eq = new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(req.getOrgId()), Policeman::getOrgId, req.getOrgId())
.like(ObjectUtil.isNotEmpty(req.getName()), Policeman::getName, req.getName())
.like(ObjectUtil.isNotEmpty(req.getPoliceCode()), Policeman::getPoliceCode, req.getPoliceCode())
.like(ObjectUtil.isNotEmpty(req.getPhone()),Policeman::getPhone,req.getPhone())
.eq(ObjectUtil.isNotEmpty(req.getState()), Policeman::getState, req.getState());
long size = list(eq).size();
Page<Policeman> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), eq);
List<Policeman> records = page.getRecords();
List<Long> collect = records.stream().map(Policeman::getUserId).collect(Collectors.toList());
// List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds(collect);
//// 查询出警员信息下的指纹列表信息
// for (PolicemanDto p : policemanDtos) {
// List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
// .eq(ObjectUtil.isNotNull(p.getId()), PoliceFinger::getPoliceId, p.getId()));
// List<PoliceFingerDto> policeFingerDtoList = new ArrayList<>();
// for (PoliceFinger policeFinger : list1) {
// PoliceFingerDto policeFingerDto = new PoliceFingerDto();
// BeanPlusUtil.copyProperties(policeFinger, policeFingerDto);
// policeFingerDtoList.add(policeFingerDto);
// }
// p.setFingersList(policeFingerDtoList);
// p.setOrgName(pubOrg.getOrgName());
//
// }
Page<PolicemanDto> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
// page1.setRecords(policemanDtos);
page1.setTotal(size);
return PageResultFactory.createPageResult(page1);
}
//根据单警柜id查询警员信息(list)
@Override
public List<PolicemanDto> GetPoliceData(CabinetReq req) {
......@@ -476,8 +528,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
fingerDtoList.add(policeFingerDto);
}
policemanDto.setFingersList(fingerDtoList);
policemanDto.setCabinetNum(cabinet.getCabinetNum());
policemanDto.setCabinetName(cabinet.getName());
policemanDto.setOrgName(pubOrg.getOrgName());
list.add(policemanDto);
}
......@@ -497,6 +547,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
long size = policemanMapper.SearchPoliceSize(req.getId());
IPage<Policeman> policemenList = policemanMapper.SearchPolicePage(page,req.getId());
List<PolicemanDto> list = new ArrayList<>();
CabinetDto cabinetDto = new CabinetDto();
BeanPlusUtil.copyProperties(cabinet,cabinetDto);
for (Policeman policeman : policemenList.getRecords()) {
PolicemanDto policemanDto = new PolicemanDto();
BeanPlusUtil.copyProperties(policeman, policemanDto);
......@@ -510,8 +562,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
fingerDtoList.add(policeFingerDto);
}
policemanDto.setFingersList(fingerDtoList);
policemanDto.setCabinetNum(cabinet.getCabinetNum());
policemanDto.setCabinetName(cabinet.getName());
policemanDto.setCabinetInfo(cabinetDto);
policemanDto.setOrgName(pubOrg.getOrgName());
list.add(policemanDto);
}
......@@ -867,6 +918,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
delFaceInfoList.add(face);
}
}
}else {
delFaceInfoList.addAll(faceList);
}
}else {
if (faceInfoList.size()>0){
......@@ -888,6 +941,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
b=policeFaceService.removeByIds(delFaceInfoList);
}
//指纹
List<PoliceFinger> addFingerList=new ArrayList<>();
List<PoliceFinger> delFingerList=new ArrayList<>();
//库中存储的指纹信息
......@@ -914,6 +968,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
delFingerList.add(finger);
}
}
}else {
delFingerList.addAll(fingerList);
}
}else {
if (fingerInfoList.size()>0){
......
......@@ -242,5 +242,13 @@ WHERE o.org_id IN
order by s1.create_time desc
</where>
</select>
<select id="selectUserRoleInfo" resultType="com.junmp.jyzb.api.bean.dto.SysUserRoleDto">
select su.user_id as user_id,sr.* FROM sys_user su
join sys_user_role sur on sur.user_id=su.user_id
join sys_role sr on sur.role_id=sr.role_id
WHERE su.user_id=#{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.junmp.junmpProcess.dto.StartProcessInstanceDTO;
import com.junmp.v2.common.bean.response.ApiRes;
import org.flowable.engine.history.HistoricProcessInstance;
import java.util.List;
import java.util.Map;
public interface IFlowInstanceService {
......
......@@ -207,6 +207,10 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
//手动完成第一个任务
}
// 递归获取异常信息的方法
private String getFullErrorMessage(Throwable throwable) {
StringBuilder errorMessage = new StringBuilder();
......
......@@ -204,7 +204,7 @@ public class BpmnConvert {
multiInstanceLoopCharacteristics.setElementVariable("assigneeName");
// 串行
multiInstanceLoopCharacteristics.setSequential(false);
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfCompletedInstances/nrOfInstances > 0}");
multiInstanceLoopCharacteristics.setCompletionCondition("${nrOfCompletedInstances/nrOfInstances >=1}");
userTask.setAssignee("${assigneeName}");
// 设置多实例属性
userTask.setLoopCharacteristics(multiInstanceLoopCharacteristics);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论