集成wms服务模块
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.mhd.wms.util;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface FillableEntity {
|
||||
void setOrganizationId(Long organizationId);
|
||||
void setTopOrganizationId(Long topOrganizationId);
|
||||
void setOrganizationName(String organizationName);
|
||||
void setCreateBy(Long createBy);
|
||||
void setCreateByName(String createByName);
|
||||
void setCreateTime(Date createTime);
|
||||
void setUpdateBy(Long updateBy);
|
||||
void setUpdateByName(String updateByName);
|
||||
void setUpdateTime(Date updateTime);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mhd.wms.util;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 封装通用对象赋值当前登陆信息
|
||||
* @Version: 1.0
|
||||
* @Date: 2023/8/1 16:01
|
||||
* @Author: liyc
|
||||
*/
|
||||
public class UtilloginUserAssemble {
|
||||
|
||||
// 假设SecurityUtils类已正确实现且无安全漏洞
|
||||
public <T extends FillableEntity> void fillCommonProperties(T entity, LoginUser loginUser) {
|
||||
UserPo userPo = loginUser.getUserPo();
|
||||
entity.setOrganizationId(userPo.getOrganizationId());
|
||||
entity.setTopOrganizationId(userPo.getTopOrganizationId());
|
||||
entity.setOrganizationName(userPo.getOrganizationName());
|
||||
entity.setCreateBy(loginUser.getUserid());
|
||||
entity.setCreateByName(loginUser.getUsername());
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setUpdateBy(loginUser.getUserid());
|
||||
entity.setUpdateByName(loginUser.getUsername());
|
||||
entity.setUpdateTime(new Date());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user