1.添加User接口能通过版。

This commit is contained in:
sxlong 2024-10-31 16:27:27 +08:00
parent 78e7f6eb48
commit 42d1949371
12 changed files with 362 additions and 40 deletions

View File

@ -20,10 +20,13 @@
</component>
<component name="ChangeListManager">
<list default="true" id="d75a3a91-5d58-44f3-9ee5-41347d560b6a" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/bootstrap/src/main/java/com/electromagnetic/industry/software/data/manage/controller/config/WebMvcConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/bootstrap/src/main/java/com/electromagnetic/industry/software/data/manage/controller/config/WebMvcConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/bootstrap/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/bootstrap/src/main/resources/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/bootstrap/src/main/java/com/electromagnetic/industry/software/data/manage/controller/UserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/bootstrap/src/main/java/com/electromagnetic/industry/software/data/manage/controller/UserController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/parames/UserParams.java" beforeDir="false" afterPath="$PROJECT_DIR$/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/parames/UserParams.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/repository/UserRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/domain/src/main/java/com/electromagnetic/industry/software/data/manage/domain/boardservice/indicator/repository/UserRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/facade/src/main/java/com/electromagnetic/industry/software/data/manage/response/indicator/UserResponse.java" beforeDir="false" afterPath="$PROJECT_DIR$/facade/src/main/java/com/electromagnetic/industry/software/data/manage/response/indicator/UserResponse.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/service/src/main/java/com/electromagnetic/industry/software/data/manage/service/facade/UserFacadelImpl.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/service/target/generated-sources/annotations/com/electromagnetic/industry/software/data/manage/service/mappers/IndicatorCardMappersImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service/target/generated-sources/annotations/com/electromagnetic/industry/software/data/manage/service/mappers/IndicatorCardMappersImpl.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -76,10 +79,11 @@
<recent name="com.electromagnetic.industry.software.data.manage.service.mappers" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.electromagnetic.industry.software.data.manage.repository.dao" />
<recent name="com.electromagnetic.industry.software.data.manage.repository.impl" />
<recent name="com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.impl" />
<recent name="com.electromagnetic.industry.software.data.manage.service.mappers" />
<recent name="com.electromagnetic.industry.software.data.manage.response.indicator" />
<recent name="com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model" />
<recent name="com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.repository" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\projects\electromagnetic-data\bootstrap\src\main\java\com\electromagnetic\industry\software\data\manage\controller" />
@ -110,7 +114,11 @@
<workItem from="1729592594884" duration="1677000" />
<workItem from="1729594541674" duration="744000" />
<workItem from="1730086166510" duration="12260000" />
<workItem from="1730110058862" duration="2544000" />
<workItem from="1730110058862" duration="3127000" />
<workItem from="1730170375131" duration="5193000" />
<workItem from="1730253753807" duration="548000" />
<workItem from="1730254338199" duration="1566000" />
<workItem from="1730255932838" duration="2029000" />
</task>
<servers />
</component>
@ -152,58 +160,70 @@
<screen x="0" y="0" width="1280" height="672" />
</state>
<state x="0" y="0" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/0.0.1280.672@0.0.1280.672" timestamp="1729592809847" />
<state x="842" y="190" key="FileChooserDialogImpl" timestamp="1730105504801">
<state x="842" y="190" key="FileChooserDialogImpl" timestamp="1730254963238">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="842" y="190" key="FileChooserDialogImpl/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730105504801" />
<state x="842" y="190" key="FileChooserDialogImpl/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730254963238" />
<state x="421" y="91" key="FileChooserDialogImpl/0.0.1280.672@0.0.1280.672" timestamp="1729594896548" />
<state width="1237" height="200" key="GridCell.Tab.0.bottom" timestamp="1729595008609">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.0.bottom" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.0.bottom/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.0.bottom/0.0.1280.672@0.0.1280.672" timestamp="1729595008609" />
<state width="1237" height="200" key="GridCell.Tab.0.center" timestamp="1729595008608">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.0.center" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.0.center/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.0.center/0.0.1280.672@0.0.1280.672" timestamp="1729595008608" />
<state width="1237" height="200" key="GridCell.Tab.0.left" timestamp="1729595008608">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.0.left" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.0.left/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.0.left/0.0.1280.672@0.0.1280.672" timestamp="1729595008608" />
<state width="1237" height="200" key="GridCell.Tab.0.right" timestamp="1729595008609">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.0.right" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.0.right/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.0.right/0.0.1280.672@0.0.1280.672" timestamp="1729595008609" />
<state width="1237" height="200" key="GridCell.Tab.1.bottom" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.1.bottom" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.1.bottom/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.1.bottom/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.1.center" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.1.center" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.1.center/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.1.center/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.1.left" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.1.left" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.1.left/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.1.left/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.1.right" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="240" key="GridCell.Tab.1.right" timestamp="1730255920506">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="240" key="GridCell.Tab.1.right/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920506" />
<state width="1237" height="200" key="GridCell.Tab.1.right/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.2.bottom" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="366" key="GridCell.Tab.2.bottom" timestamp="1730255920501">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="366" key="GridCell.Tab.2.bottom/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920501" />
<state width="1237" height="200" key="GridCell.Tab.2.bottom/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.2.center" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="366" key="GridCell.Tab.2.center" timestamp="1730255920501">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="366" key="GridCell.Tab.2.center/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920501" />
<state width="1237" height="200" key="GridCell.Tab.2.center/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.2.left" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="366" key="GridCell.Tab.2.left" timestamp="1730255920501">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="366" key="GridCell.Tab.2.left/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920501" />
<state width="1237" height="200" key="GridCell.Tab.2.left/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state width="1237" height="200" key="GridCell.Tab.2.right" timestamp="1729592564959">
<screen x="0" y="0" width="1280" height="672" />
<state width="1920" height="366" key="GridCell.Tab.2.right" timestamp="1730255920501">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="1920" height="366" key="GridCell.Tab.2.right/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730255920501" />
<state width="1237" height="200" key="GridCell.Tab.2.right/0.0.1280.672@0.0.1280.672" timestamp="1729592564959" />
<state x="339" y="296" key="SettingsEditor" timestamp="1730166699747">
<screen x="0" y="0" width="2560" height="1400" />
@ -218,9 +238,10 @@
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="991" y="256" width="1572" height="833" key="dock-window-1/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730163893500" />
<state x="338" y="39" width="929" height="594" key="find.popup" timestamp="1729595280874">
<screen x="0" y="0" width="1280" height="672" />
<state x="676" y="81" width="1858" height="1238" key="find.popup" timestamp="1730252162153">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="676" y="81" width="1858" height="1238" key="find.popup/-1080.0.1080.1860/0.0.2560.1400@0.0.2560.1400" timestamp="1730252162153" />
<state x="338" y="39" width="929" height="594" key="find.popup/0.0.1280.672@0.0.1280.672" timestamp="1729595280874" />
</component>
</project>

View File

@ -3,6 +3,7 @@ package com.electromagnetic.industry.software.data.manage.controller;
import com.electromagnetic.industry.software.data.manage.facade.UserFacade;
import com.electromagnetic.industry.software.data.manage.request.indicator.UserRequest;
import com.electromagnetic.industry.software.data.manage.response.indicator.UserResponse;
import com.electromagnetic.industry.software.data.manage.response.indicator.UserPageResponse;
import electromagnetic.data.framework.share.model.ElectromagneticResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
@ -21,7 +22,7 @@ public class UserController {
@ApiOperation(value = "获取用户信息列表",notes = "")
@RequestMapping(value = "/getUserList",method = RequestMethod.POST)
public ElectromagneticResult<UserResponse> getUserList(@RequestBody UserRequest request){
public ElectromagneticResult<UserPageResponse> getUserList(@RequestBody UserRequest request){
return userFacade.getUserList(request);
}

View File

@ -1,8 +1,12 @@
package com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
public class UserParams {
@Data
public class UserParams implements Serializable {
private static final long serialVersionUID = -4835122199589863011L;
/**
* 主键ID
@ -40,4 +44,12 @@ public class UserParams {
* 创建时间
*/
private Date gmtCreate;
/**
* 当前页
*/
private Integer pageIndex;
/**
* 每页数据
*/
private Integer pageSize;
}

View File

@ -21,13 +21,13 @@ public interface UserRepository {
* @param parames
* @return
*/
PageInfo<UserExtend> getIndicatorCardListConfig(UserParams parames);
PageInfo<UserExtend> getUserList(UserParams parames);
/**
* 根据indicatorCardNo获取指标卡
* @param indicatorCardNo
* @return
*/
User getIndicatorCard(String userAccount);
User getUser(String userAccount);
}

View File

@ -0,0 +1,57 @@
/**
* Copyright (c) 2004-2024 All Rights Reserved.
*/
package com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.impl;
import com.electromagnetic.industry.software.data.manage.common.ElectromagneticErrorEnum;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.enums.EffectFlagEnum;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.enums.IndicatorCardHomeDisplayEnum;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.enums.IndicatorCardStatusEnum;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.*;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.repository.UserRepository;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.UserService;
import com.github.pagehelper.PageInfo;
import electromagnetic.data.framework.share.enums.ElectromagneticSceneIncidentEnum;
import electromagnetic.data.framework.share.exception.ElectromagneticBizRuntimeException;
import electromagnetic.data.framework.share.exception.LoggerConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author
* @version $Id: IndicatorCardServiceImpl.java, v 0.1 2024-07-26 17:20
*/
@Service
public class UserServiceImpl implements UserService {
private static final Logger LOGGER = LoggerFactory.getLogger(LoggerConstant.DOMAIN_SERVICE);
@Resource
private UserRepository userRepository;
/**
* 获取中支指标配置列表
* @param parames
* @return
*/
@Override
public UserPage getUserList(UserParams parames) {
UserPage userPage=new UserPage();
//数据查询
PageInfo<UserExtend> pageInfo=userRepository.getUserList(parames);
List<String> userStrings=new ArrayList<>();
pageInfo.getList().forEach(e->userStrings.add(e.getUserAccount()));
//查询指标
userPage.setUserExtends(pageInfo);
return userPage;
}
}

View File

@ -1,7 +1,10 @@
package com.electromagnetic.industry.software.data.manage.response.indicator;
import lombok.Data;
import java.util.Date;
@Data
public class UserResponse {
private static final long serialVersionUID = -4835122199589863011L;
/**

View File

@ -0,0 +1,31 @@
package com.electromagnetic.industry.software.data.manage.repository.dao;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.User;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.UserExtend;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UserMapper {
/**
* 插入
* @param record
* @return
*/
int insert(User record);
/**
* 根据indicatorCardNo获取指标卡
* @param indicatorCardNo
* @return
*/
User selectByPrimaryKey(String userNo);
/**
* 获取中支指标配置列表
* @return
*/
List<UserExtend> getUserList(UserParams parames);
}

View File

@ -0,0 +1,50 @@
/**
* Copyright (c) 2004-2024 All Rights Reserved.
*/
package com.electromagnetic.industry.software.data.manage.repository.impl;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.User;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.UserExtend;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.repository.UserRepository;
import com.electromagnetic.industry.software.data.manage.repository.dao.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
/**
* @author
* @version $Id: IndicatorCardRepositoryImpl.java, v 0.1 2024-07-29 19:04
*/
@Repository
public class UserRepositoryImpl implements UserRepository {
@Resource
private UserMapper userMapper;
/**
* 获取中支指标配置列表
* @param parames
* @return
*/
@Override
public PageInfo<UserExtend> getUserList(UserParams parames) {
PageHelper.startPage(parames.getPageIndex(), parames.getPageSize());
List<UserExtend> userExtends=userMapper.getUserList(parames);
return new PageInfo<>(userExtends);
}
/**
* 根据indicatorCardNo获取指标卡
* @param indicatorCardNo
* @return
*/
@Override
public User getUser(String userAccount) {
return userMapper.selectByPrimaryKey(userAccount);
}
}

View File

@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class UserFacadelImpl implements UserFacade {
public class UserFacadeImpl implements UserFacade {
@Resource
private UserService userService;

Binary file not shown.

View File

@ -22,7 +22,7 @@ import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-10-29T10:14:34+0800",
date = "2024-10-29T14:07:53+0800",
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_432 (Temurin)"
)
public class IndicatorCardMappersImpl implements IndicatorCardMappers {

View File

@ -0,0 +1,147 @@
package com.electromagnetic.industry.software.data.manage.service.mappers;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.User;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.UserExtend;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.UserPage;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
import com.electromagnetic.industry.software.data.manage.request.indicator.UserRequest;
import com.electromagnetic.industry.software.data.manage.response.indicator.UserPageResponse;
import com.electromagnetic.industry.software.data.manage.response.indicator.UserResponse;
import com.github.pagehelper.PageInfo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-10-29T14:07:53+0800",
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_432 (Temurin)"
)
public class UserMappersImpl implements UserMappers {
@Override
public UserPageResponse getUserToModel(UserPage userPage) {
if ( userPage == null ) {
return null;
}
UserPageResponse userPageResponse = new UserPageResponse();
userPageResponse.setUserExtends( userExtendPageInfoToUserResponsePageInfo( userPage.getUserExtends() ) );
userPageResponse.setUsers( userListToUserResponseList( userPage.getUsers() ) );
return userPageResponse;
}
@Override
public UserParams getUserParames(UserRequest request) {
if ( request == null ) {
return null;
}
UserParams userParams = new UserParams();
return userParams;
}
protected UserResponse userExtendToUserResponse(UserExtend userExtend) {
if ( userExtend == null ) {
return null;
}
UserResponse userResponse = new UserResponse();
userResponse.setId( userExtend.getId() );
userResponse.setUserAccount( userExtend.getUserAccount() );
userResponse.setUserName( userExtend.getUserName() );
userResponse.setTitleType( userExtend.getTitleType() );
userResponse.setJobNumber( userExtend.getJobNumber() );
userResponse.setDepartment( userExtend.getDepartment() );
userResponse.setGmtHire( userExtend.getGmtHire() );
userResponse.setWorkState( userExtend.getWorkState() );
userResponse.setGmtCreate( userExtend.getGmtCreate() );
return userResponse;
}
protected List<UserResponse> userExtendListToUserResponseList(List<UserExtend> list) {
if ( list == null ) {
return null;
}
List<UserResponse> list1 = new ArrayList<UserResponse>( list.size() );
for ( UserExtend userExtend : list ) {
list1.add( userExtendToUserResponse( userExtend ) );
}
return list1;
}
protected PageInfo<UserResponse> userExtendPageInfoToUserResponsePageInfo(PageInfo<UserExtend> pageInfo) {
if ( pageInfo == null ) {
return null;
}
PageInfo<UserResponse> pageInfo1 = new PageInfo<UserResponse>();
pageInfo1.setPageNum( pageInfo.getPageNum() );
pageInfo1.setPageSize( pageInfo.getPageSize() );
pageInfo1.setSize( pageInfo.getSize() );
pageInfo1.setStartRow( pageInfo.getStartRow() );
pageInfo1.setEndRow( pageInfo.getEndRow() );
pageInfo1.setTotal( pageInfo.getTotal() );
pageInfo1.setPages( pageInfo.getPages() );
pageInfo1.setList( userExtendListToUserResponseList( pageInfo.getList() ) );
pageInfo1.setFirstPage( pageInfo.getFirstPage() );
pageInfo1.setPrePage( pageInfo.getPrePage() );
pageInfo1.setNextPage( pageInfo.getNextPage() );
pageInfo1.setLastPage( pageInfo.getLastPage() );
pageInfo1.setIsFirstPage( pageInfo.isIsFirstPage() );
pageInfo1.setIsLastPage( pageInfo.isIsLastPage() );
pageInfo1.setHasPreviousPage( pageInfo.isHasPreviousPage() );
pageInfo1.setHasNextPage( pageInfo.isHasNextPage() );
pageInfo1.setNavigatePages( pageInfo.getNavigatePages() );
int[] navigatepageNums = pageInfo.getNavigatepageNums();
if ( navigatepageNums != null ) {
pageInfo1.setNavigatepageNums( Arrays.copyOf( navigatepageNums, navigatepageNums.length ) );
}
pageInfo1.setNavigateFirstPage( pageInfo.getNavigateFirstPage() );
pageInfo1.setNavigateLastPage( pageInfo.getNavigateLastPage() );
return pageInfo1;
}
protected UserResponse userToUserResponse(User user) {
if ( user == null ) {
return null;
}
UserResponse userResponse = new UserResponse();
userResponse.setId( user.getId() );
userResponse.setUserAccount( user.getUserAccount() );
userResponse.setUserName( user.getUserName() );
userResponse.setTitleType( user.getTitleType() );
userResponse.setJobNumber( user.getJobNumber() );
userResponse.setDepartment( user.getDepartment() );
userResponse.setGmtHire( user.getGmtHire() );
userResponse.setWorkState( user.getWorkState() );
userResponse.setGmtCreate( user.getGmtCreate() );
return userResponse;
}
protected List<UserResponse> userListToUserResponseList(List<User> list) {
if ( list == null ) {
return null;
}
List<UserResponse> list1 = new ArrayList<UserResponse>( list.size() );
for ( User user : list ) {
list1.add( userToUserResponse( user ) );
}
return list1;
}
}