Commit b5e73b45 by 赵剑炜

警员上报添加密码

parent 0944b317
......@@ -19,6 +19,8 @@ public class PoliceListReq {
private String name;
private String finger;
private String password;
// /**
// * 角色id列表
// */
......
......@@ -356,6 +356,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
BeanPlusUtil.copyProperties(req,sysUser);
sysUser.setAccount(accountSet);
sysUser.setNickName(req.getName());
sysUser.setPassword(req.getPassword());
sysUser.setRealName(req.getName());
SysUserCreateFactory.fillAddSysUser(sysUser);
sysUser.setAvatar(FileConstant.DEFAULT_AVATAR_FILE_ID);
......@@ -706,14 +707,14 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
// 处理新增和修改
for (PoliceListReq reqPolice : policeReqList) {
Policeman dbPolice = findPoliceById(policeList, reqPolice.getPoliceID());
SysUser user= sysUserService.getById(dbPolice.getUserId());
if (dbPolice == null) {
// 新增数据
Policeman newPolice = convertToPoliceman(reqPolice, orgList.getOrgId());
toAdd.add(newPolice);
} else {
// 修改数据
Policeman updatedPolice = updatePoliceman(dbPolice, reqPolice, orgInfo, cabinetOrg);
Policeman updatedPolice = updatePoliceman(user,dbPolice, reqPolice, orgInfo, cabinetOrg);
toUpdate.add(updatedPolice);
}
}
......@@ -805,14 +806,14 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
}
// 辅助方法:更新 Policeman 对象的属性
private Policeman updatePoliceman(Policeman dbPolice, PoliceListReq reqPolice, PubOrg org, Cabinet cabinet) {
private Policeman updatePoliceman(SysUser user, Policeman dbPolice, PoliceListReq reqPolice, PubOrg org, Cabinet cabinet) {
CabinetBox cb = cabinetBoxService.getById(reqPolice.getCabinetBoxId());
if (cb.getBoxName() == null) {
cb.setBoxName("");
}
// 判断警员是否存在
// 判断传入的修改的警员编号与本身编号一致,如果一致则无所谓,如果不一致则需要判断修改的警员编号是否已经存在
user.setPassword(reqPolice.getPassword());
dbPolice.setUpdateTime(DateTimeUtil.getCurrentDateTime());
List<PoliceEquipment> policeEqsList = policeEquipmentService.list(new LambdaQueryWrapper<PoliceEquipment>()
.eq(PoliceEquipment::getPoliceId, dbPolice.getId()));
......@@ -961,6 +962,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
dbPolice.setOrgId(Long.valueOf(org.getOrgId()));
dbPolice.setState(1);
BeanPlusUtil.copyProperties(reqPolice, dbPolice);
sysUserService.updateById(user);
return dbPolice;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论