WMS盘点管理创建人修改
This commit is contained in:
+13
-3
@@ -338,6 +338,15 @@ public class InvestigationManageImpl extends ServiceImpl<InvestigationManageMapp
|
||||
.eq(InvestigetionManageDetail::getInvestigationNumber, investigationManage.getInvestigationNumber())
|
||||
.eq(InvestigetionManageDetail::getDelFlag, 1)
|
||||
.ne(InvestigetionManageDetail::getInvestigationResult, 4));
|
||||
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||
final String userRealName =
|
||||
(loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||
&& !loginUser.getUserPo().getUserName().trim().isEmpty())
|
||||
? loginUser.getUserPo().getUserName()
|
||||
: (loginUser.getRealname() != null && !loginUser.getRealname().trim().isEmpty())
|
||||
? loginUser.getRealname()
|
||||
: loginUser.getUsername();
|
||||
|
||||
String differentNumber = null;
|
||||
if (count > 0){
|
||||
//存在差异 生成差异单
|
||||
@@ -373,10 +382,11 @@ public class InvestigationManageImpl extends ServiceImpl<InvestigationManageMapp
|
||||
differentManage.setOrganizationName(userPo.getOrganizationName());
|
||||
differentManage.setCreateBy(loginUser.getUserid());
|
||||
differentManage.setCreateTime(new Date());
|
||||
differentManage.setCreateByName(loginUser.getUsername());
|
||||
// 差异单创建人/修改人使用用户姓名而不是账号
|
||||
differentManage.setCreateByName(userRealName);
|
||||
differentManage.setUpdateBy(loginUser.getUserid());
|
||||
differentManage.setUpdateTime(new Date());
|
||||
differentManage.setUpdateByName(loginUser.getUsername());
|
||||
differentManage.setUpdateByName(userRealName);
|
||||
iDifferentManageService.insert(differentManage);
|
||||
}
|
||||
//生成盘点追溯记录
|
||||
@@ -386,7 +396,7 @@ public class InvestigationManageImpl extends ServiceImpl<InvestigationManageMapp
|
||||
investigationManageUpdate.setInvestigationStatus(4); // 盘点完成
|
||||
investigationManageUpdate.setUpdateBy(loginUser.getUserid());
|
||||
investigationManageUpdate.setUpdateTime(new Date());
|
||||
investigationManageUpdate.setUpdateByName(loginUser.getUsername());
|
||||
investigationManageUpdate.setUpdateByName(userRealName);
|
||||
investigationManageUpdate.setDifferentNumber(differentNumber);
|
||||
return this.updateById(investigationManageUpdate);
|
||||
}
|
||||
|
||||
+11
-1
@@ -22,7 +22,8 @@ import java.util.Date;
|
||||
public class DifferentManageAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
* 新增/编辑差异单时使用的转换实体方法
|
||||
* 注意:会自动填充创建人/修改人等审计字段,不适合查询列表时使用
|
||||
*/
|
||||
public DifferentManageDO toDO(DifferentManageDTO differentManageDTO) {
|
||||
//DifferentManageDO differentManageDO = new DifferentManageDO();
|
||||
@@ -71,4 +72,13 @@ public class DifferentManageAssembler {
|
||||
return differentManageDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询差异单列表时使用的转换方法
|
||||
* 只做简单属性拷贝,不自动填充 createBy/createByName/updateBy/updateByName,避免把当前登录人带入为查询条件
|
||||
*/
|
||||
public DifferentManageDO toDOForList(DifferentManageDTO differentManageDTO) {
|
||||
// 这里不处理登录用户信息,只保留前端传入的查询条件
|
||||
return JSONUtil.toBean(JSONUtil.toJsonStr(differentManageDTO), DifferentManageDO.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ public class DifferentManageApi extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DifferentManageDTO differentManageDTO) {
|
||||
//转换实体
|
||||
DifferentManageDO differentManageDO = differentManageAssembler.toDO(differentManageDTO);
|
||||
// 注意:列表查询不应自动填充创建人/修改人,否则会把当前登录人当作查询条件
|
||||
DifferentManageDO differentManageDO = differentManageAssembler.toDOForList(differentManageDTO);
|
||||
startPage();
|
||||
List<DifferentManagePO> list = differentManageApplicationService.queryList(differentManageDO);
|
||||
return getDataTable(list);
|
||||
|
||||
Reference in New Issue
Block a user