yang_shj
11 months ago
1 changed files with 0 additions and 41 deletions
@ -1,41 +0,0 @@ |
|||||||
package com.hnac.hzims.operational.access.wrapper; |
|
||||||
|
|
||||||
import com.hnac.hzims.operational.access.constants.DictConstant; |
|
||||||
import com.hnac.hzims.operational.access.entity.OperAccessPlanEntity; |
|
||||||
import com.hnac.hzims.operational.access.entity.OperConstructionEntity; |
|
||||||
import com.hnac.hzims.operational.access.vo.ConstructionVo; |
|
||||||
import com.hnac.hzims.operational.access.vo.OperAccessPlanVO; |
|
||||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
|
||||||
import org.springblade.core.tool.utils.BeanUtil; |
|
||||||
import org.springblade.system.cache.DictCache; |
|
||||||
import org.springblade.system.user.cache.UserCache; |
|
||||||
import org.springblade.system.user.entity.User; |
|
||||||
|
|
||||||
import java.util.Optional; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ysj |
|
||||||
*/ |
|
||||||
public class ConstructionWrapper extends BaseEntityWrapper<OperConstructionEntity, ConstructionVo> { |
|
||||||
|
|
||||||
public static ConstructionWrapper build() { |
|
||||||
return new ConstructionWrapper(); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public ConstructionVo entityVO(OperConstructionEntity entity) { |
|
||||||
ConstructionVo vo = BeanUtil.copy(entity, ConstructionVo.class); |
|
||||||
User create = UserCache.getUser(entity.getCreateUser()); |
|
||||||
User update = UserCache.getUser(entity.getUpdateUser()); |
|
||||||
User head = UserCache.getUser(entity.getOverhaulHead()); |
|
||||||
User recorder = UserCache.getUser(entity.getRecorder()); |
|
||||||
User reviewer = UserCache.getUser(entity.getReviewer()); |
|
||||||
vo.setCreateUserName(Optional.ofNullable(create).map(User :: getName).orElse(null)); |
|
||||||
vo.setUpdateUserName(Optional.ofNullable(update).map(User :: getName).orElse(null)); |
|
||||||
vo.setOverhaulHeadName(Optional.ofNullable(head).map(User :: getName).orElse(null)); |
|
||||||
vo.setRecorderName(Optional.ofNullable(recorder).map(User :: getName).orElse(null)); |
|
||||||
vo.setReviewerName(Optional.ofNullable(reviewer).map(User :: getName).orElse(null)); |
|
||||||
return vo; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
Loading…
Reference in new issue