用户模块冗余代码clean,新增用户功能
This commit is contained in:
parent
14033c265a
commit
240599cf2d
|
|
@ -1,11 +1,7 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.controller;
|
package com.electromagnetic.industry.software.data.manage.controller;
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.UserPage;
|
import com.electromagnetic.industry.software.data.manage.facade.user.UserFacade;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.facade.UserFacade;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.request.indicator.EDDataRequest;
|
import com.electromagnetic.industry.software.data.manage.request.indicator.EDDataRequest;
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.UserPageResponse;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.service.mappers.UserMappers;
|
|
||||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||||
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.controller.user;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.facade.user.UserFacade;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||||
|
import electromagnetic.data.framework.share.model.BaseResult;
|
||||||
|
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RequestMapping("/data/ed/user")
|
||||||
|
@RestController
|
||||||
|
public class UserController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserFacade userFacade;
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增用户信息", notes = "")
|
||||||
|
@PostMapping
|
||||||
|
public BaseResult<?> createUser(@RequestBody UserRequest userRequest) {
|
||||||
|
return userFacade.createUser(userRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编码
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
private String workNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
private String userDept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职称
|
||||||
|
*/
|
||||||
|
private String userTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录密码
|
||||||
|
*/
|
||||||
|
private String userPwd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职日期
|
||||||
|
*/
|
||||||
|
private DateTime joinTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作状态
|
||||||
|
*/
|
||||||
|
private String userStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实习截止日期
|
||||||
|
*/
|
||||||
|
private Date internshipEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已发布
|
||||||
|
*/
|
||||||
|
private Integer isPublished;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盐
|
||||||
|
*/
|
||||||
|
private String salt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人姓名
|
||||||
|
*/
|
||||||
|
private String creatorName;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date gmtCreate;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String modifier;
|
||||||
|
/**
|
||||||
|
* 更新人姓名
|
||||||
|
*/
|
||||||
|
private String modifierName;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date gmtModified;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有效:0-无效 1-有效
|
||||||
|
*/
|
||||||
|
private Integer effectFlag;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,13 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository;
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
|
||||||
public interface UserRepository {
|
public interface UserRepository {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户插入
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insert(User user);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
|
||||||
|
public interface UserService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean createUser(User user);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.impl;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository.UserRepository;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.UserService;
|
||||||
|
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserServiceImpl implements UserService {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(LoggerConstant.DOMAIN_SERVICE);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean createUser(User user) {
|
||||||
|
return userRepository.insert(user)>0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.util;
|
||||||
|
|
||||||
|
public class UserConstant {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认初始密码
|
||||||
|
*/
|
||||||
|
public static final String DEFAULT_PASSWORD = "123456";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认发布状态(未发布)
|
||||||
|
*/
|
||||||
|
public static final int DEFAULT_PUBLISH_STATUS = 0;
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package electromagnetic.data.framework.share.model;
|
||||||
|
|
||||||
|
import electromagnetic.data.framework.share.enums.ErrorEnum;
|
||||||
|
import electromagnetic.data.framework.share.result.CallbackResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回结果转换工具类
|
||||||
|
*
|
||||||
|
* @version $Id: DataCenterResultUtil.java, v 0.1 2021-01-11 16:57 Exp $$
|
||||||
|
*/
|
||||||
|
public class BaseResultUtil {
|
||||||
|
|
||||||
|
public static <T> BaseResult<T> convertToResult(CallbackResult<T> callbackResult) {
|
||||||
|
BaseResult<T> BaseResult = new BaseResult<>();
|
||||||
|
BaseResult.setSuccess(callbackResult.isSuccess());
|
||||||
|
BaseResult.setErrorCode(callbackResult.getResultCode());
|
||||||
|
BaseResult.setErrorMessage(callbackResult.getResultMessage());
|
||||||
|
return BaseResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> BaseResult<T> success(T data){
|
||||||
|
BaseResult<T> BaseResult = new BaseResult<>();
|
||||||
|
BaseResult.setSuccess(true);
|
||||||
|
return BaseResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> BaseResult<T> fail(String code , String msg){
|
||||||
|
BaseResult<T> BaseResult = new BaseResult<>();
|
||||||
|
BaseResult.setSuccess(false);
|
||||||
|
BaseResult.setErrorCode(code);
|
||||||
|
BaseResult.setErrorMessage(msg);
|
||||||
|
return BaseResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> BaseResult fail(ErrorEnum errorEnum){
|
||||||
|
BaseResult<T> BaseResult = new BaseResult<>();
|
||||||
|
BaseResult.setSuccess(false);
|
||||||
|
BaseResult.setErrorCode(errorEnum.getCode());
|
||||||
|
BaseResult.setErrorMessage(errorEnum.getErrorMessage());
|
||||||
|
return BaseResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.facade.user;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||||
|
import electromagnetic.data.framework.share.model.BaseResult;
|
||||||
|
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||||
|
|
||||||
|
public interface UserFacade {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户信息
|
||||||
|
* @param userRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BaseResult<?> createUser(UserRequest userRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserRequest extends BaseRequest implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号
|
||||||
|
*/
|
||||||
|
private String workNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
private String userDept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职称
|
||||||
|
*/
|
||||||
|
private String userTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职日期
|
||||||
|
*/
|
||||||
|
private DateTime joinTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作状态
|
||||||
|
*/
|
||||||
|
private String userStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实习截止日期
|
||||||
|
*/
|
||||||
|
private Date internshipEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者姓名
|
||||||
|
*/
|
||||||
|
private String creatorName;
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -1,31 +1,14 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.repository.dao;
|
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.user.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 org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserMapper {
|
public interface UserMapper {
|
||||||
/**
|
/**
|
||||||
* 插入
|
* 插入
|
||||||
* @param record
|
* @param user
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int insert(User record);
|
int insert(User user);
|
||||||
/**
|
|
||||||
* 根据indicatorCardNo获取指标卡
|
|
||||||
* @param indicatorCardNo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
User selectByPrimaryKey(String userNo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取中支指标配置列表
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<UserExtend> getUserList(UserParams parames);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -3,22 +3,14 @@
|
||||||
*/
|
*/
|
||||||
package com.electromagnetic.industry.software.data.manage.repository.impl;
|
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.user.model.User;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.UserParams;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository.UserRepository;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.repository.UserRepository;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.repository.dao.UserMapper;
|
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 org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author
|
|
||||||
* @version $Id: IndicatorCardRepositoryImpl.java, v 0.1 2024-07-29 19:04
|
|
||||||
*/
|
|
||||||
@Repository
|
@Repository
|
||||||
public class UserRepositoryImpl implements UserRepository {
|
public class UserRepositoryImpl implements UserRepository {
|
||||||
|
|
||||||
|
|
@ -26,25 +18,12 @@ public class UserRepositoryImpl implements UserRepository {
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取中支指标配置列表
|
* 新增用户
|
||||||
* @param parames
|
* @param user
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<UserExtend> getUserList(UserParams parames) {
|
public int insert(User user) {
|
||||||
PageHelper.startPage(parames.getPageIndex(), parames.getPageSize());
|
return userMapper.insert(user);
|
||||||
List<UserExtend> userExtends=userMapper.getUserList(parames);
|
|
||||||
return new PageInfo<>(userExtends);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据indicatorCardNo获取指标卡
|
|
||||||
* @param indicatorCardNo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public User getUser(String userAccount) {
|
|
||||||
return userMapper.selectByPrimaryKey(userAccount);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.electromagnetic.industry.software.data.manage.repository.dao.UserMapper">
|
||||||
|
<resultMap id="UserResultMap" type="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||||
|
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||||
|
<result column="work_number" jdbcType="VARCHAR" property="workNumber" />
|
||||||
|
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
||||||
|
<result column="user_dept" jdbcType="VARCHAR" property="userDept" />
|
||||||
|
<result column="user_title" jdbcType="VARCHAR" property="userTitle" />
|
||||||
|
<result column="user_pwd" jdbcType="VARCHAR" property="userPwd" />
|
||||||
|
<result column="join_time" jdbcType="TIMESTAMP" property="joinTime" />
|
||||||
|
<result column="is_published" jdbcType="TINYINT" property="isPublished" />
|
||||||
|
<result column="salt" jdbcType="VARCHAR" property="salt" />
|
||||||
|
<result column="user_status" jdbcType="VARCHAR" property="userStatus" />
|
||||||
|
<result column="internship_end_date" jdbcType="DATE" property="internshipEndDate"/>
|
||||||
|
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
||||||
|
<result column="creator_name" jdbcType="VARCHAR" property="creatorName" />
|
||||||
|
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
|
||||||
|
<result column="modifier" jdbcType="VARCHAR" property="modifier" />
|
||||||
|
<result column="modifier_name" jdbcType="VARCHAR" property="modifierName" />
|
||||||
|
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
|
||||||
|
<result column="effect_flag" jdbcType="TINYINT" property="effectFlag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User">
|
||||||
|
insert into ed_users(
|
||||||
|
<if test="userId != null and userId !='' ">user_id,</if>
|
||||||
|
<if test="userName != null and userName !='' ">user_name,</if>
|
||||||
|
<if test="workNumber != null and workNumber !='' ">work_number,</if>
|
||||||
|
<if test="mobile != null and mobile !='' ">mobile,</if>
|
||||||
|
<if test="userDept != null and userDept !='' ">user_dept,</if>
|
||||||
|
<if test="userTitle != null and userTitle !='' ">user_title,</if>
|
||||||
|
<if test="userPwd != null and userPwd !='' ">user_pwd,</if>
|
||||||
|
<if test="joinTime != null">join_time,</if>
|
||||||
|
<if test="isPublished != null">is_published,</if>
|
||||||
|
<if test="salt != null and salt !='' ">salt,</if>
|
||||||
|
<if test="userStatus != null and userStatus !='' ">user_status,</if>
|
||||||
|
<if test="internshipEndDate != null">internship_end_date,</if>
|
||||||
|
<if test="creator != null and creator !='' ">creator,</if>
|
||||||
|
<if test="creatorName != null and creatorName !='' ">creator_name,</if>
|
||||||
|
gmt_create,
|
||||||
|
effect_flag)
|
||||||
|
values (
|
||||||
|
<if test="userId != null and userId !='' ">#{userId},</if>
|
||||||
|
<if test="userName != null and userName !='' ">#{userName},</if>
|
||||||
|
<if test="workNumber != null and workNumber !='' ">#{workNumber},</if>
|
||||||
|
<if test="mobile != null and mobile !='' ">#{mobile},</if>
|
||||||
|
<if test="userDept != null and userDept !='' ">#{userDept},</if>
|
||||||
|
<if test="userTitle != null and userTitle !='' ">#{userTitle},</if>
|
||||||
|
<if test="userPwd != null and userPwd !='' ">#{userPwd},</if>
|
||||||
|
<if test="joinTime != null">#{joinTime},</if>
|
||||||
|
<if test="isPublished != null">#{isPublished},</if>
|
||||||
|
<if test="salt != null and salt !='' ">#{salt},</if>
|
||||||
|
<if test="userStatus != null and userStatus !='' ">#{userStatus},</if>
|
||||||
|
<if test="internshipEndDate != null">#{internshipEndDate},</if>
|
||||||
|
<if test="creator != null and creator !='' ">#{creator},</if>
|
||||||
|
<if test="creatorName != null and creatorName !='' ">#{creatorName},</if>
|
||||||
|
now(),
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.electromagnetic.industry.software.data.manage.repository.dao.UserMapper">
|
||||||
|
<resultMap id="UserResultMap" type="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||||
|
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||||
|
<result column="work_number" jdbcType="VARCHAR" property="workNumber" />
|
||||||
|
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
||||||
|
<result column="user_dept" jdbcType="VARCHAR" property="userDept" />
|
||||||
|
<result column="user_title" jdbcType="VARCHAR" property="userTitle" />
|
||||||
|
<result column="user_pwd" jdbcType="VARCHAR" property="userPwd" />
|
||||||
|
<result column="join_time" jdbcType="TIMESTAMP" property="joinTime" />
|
||||||
|
<result column="is_published" jdbcType="TINYINT" property="isPublished" />
|
||||||
|
<result column="salt" jdbcType="VARCHAR" property="salt" />
|
||||||
|
<result column="user_status" jdbcType="VARCHAR" property="userStatus" />
|
||||||
|
<result column="internship_end_date" jdbcType="DATE" property="internshipEndDate"/>
|
||||||
|
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
||||||
|
<result column="creator_name" jdbcType="VARCHAR" property="creatorName" />
|
||||||
|
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
|
||||||
|
<result column="modifier" jdbcType="VARCHAR" property="modifier" />
|
||||||
|
<result column="modifier_name" jdbcType="VARCHAR" property="modifierName" />
|
||||||
|
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
|
||||||
|
<result column="effect_flag" jdbcType="TINYINT" property="effectFlag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User">
|
||||||
|
insert into ed_users(
|
||||||
|
<if test="userId != null and userId !='' ">user_id,</if>
|
||||||
|
<if test="userName != null and userName !='' ">user_name,</if>
|
||||||
|
<if test="workNumber != null and workNumber !='' ">work_number,</if>
|
||||||
|
<if test="mobile != null and mobile !='' ">mobile,</if>
|
||||||
|
<if test="userDept != null and userDept !='' ">user_dept,</if>
|
||||||
|
<if test="userTitle != null and userTitle !='' ">user_title,</if>
|
||||||
|
<if test="userPwd != null and userPwd !='' ">user_pwd,</if>
|
||||||
|
<if test="joinTime != null">join_time,</if>
|
||||||
|
<if test="isPublished != null">is_published,</if>
|
||||||
|
<if test="salt != null and salt !='' ">salt,</if>
|
||||||
|
<if test="userStatus != null and userStatus !='' ">user_status,</if>
|
||||||
|
<if test="internshipEndDate != null">internship_end_date,</if>
|
||||||
|
<if test="creator != null and creator !='' ">creator,</if>
|
||||||
|
<if test="creatorName != null and creatorName !='' ">creator_name,</if>
|
||||||
|
gmt_create,
|
||||||
|
effect_flag)
|
||||||
|
values (
|
||||||
|
<if test="userId != null and userId !='' ">#{userId},</if>
|
||||||
|
<if test="userName != null and userName !='' ">#{userName},</if>
|
||||||
|
<if test="workNumber != null and workNumber !='' ">#{workNumber},</if>
|
||||||
|
<if test="mobile != null and mobile !='' ">#{mobile},</if>
|
||||||
|
<if test="userDept != null and userDept !='' ">#{userDept},</if>
|
||||||
|
<if test="userTitle != null and userTitle !='' ">#{userTitle},</if>
|
||||||
|
<if test="userPwd != null and userPwd !='' ">#{userPwd},</if>
|
||||||
|
<if test="joinTime != null">#{joinTime},</if>
|
||||||
|
<if test="isPublished != null">#{isPublished},</if>
|
||||||
|
<if test="salt != null and salt !='' ">#{salt},</if>
|
||||||
|
<if test="userStatus != null and userStatus !='' ">#{userStatus},</if>
|
||||||
|
<if test="internshipEndDate != null">#{internshipEndDate},</if>
|
||||||
|
<if test="creator != null and creator !='' ">#{creator},</if>
|
||||||
|
<if test="creatorName != null and creatorName !='' ">#{creatorName},</if>
|
||||||
|
now(),
|
||||||
|
1
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.electromagnetic.industry.software.data.manage.service.facade.user;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.UserService;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.util.UserConstant;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.facade.user.UserFacade;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.service.mappers.UserMappers;
|
||||||
|
import electromagnetic.data.framework.share.id.IdWorker;
|
||||||
|
import electromagnetic.data.framework.share.model.BaseResult;
|
||||||
|
import electromagnetic.data.framework.share.model.BaseResultUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserFacadeImpl implements UserFacade {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户信息
|
||||||
|
* @param userRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BaseResult<Boolean> createUser(UserRequest userRequest){
|
||||||
|
User user = UserMappers.INSTANCE.getUserRequestToModel(userRequest);
|
||||||
|
user.setUserId(IdWorker.getSnowFlakeIdString());
|
||||||
|
user.setUserPwd(UserConstant.DEFAULT_PASSWORD);
|
||||||
|
user.setIsPublished(UserConstant.DEFAULT_PUBLISH_STATUS);
|
||||||
|
return BaseResultUtil.success(userService.createUser(user));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2004-2024 All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.electromagnetic.industry.software.data.manage.service.mappers;
|
||||||
|
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户模型转换
|
||||||
|
* @author szt
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserMappers {
|
||||||
|
UserMappers INSTANCE= Mappers.getMapper(UserMappers.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户Request转用户模型
|
||||||
|
* @param userRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
User getUserRequestToModel(UserRequest userRequest);
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -1,320 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.service.mappers;
|
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.Indicator;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCard;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCardDetial;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCardExtend;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCardPage;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.IndicatorCardParams;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.IndicatorParams;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.request.indicator.IndicatorCardRequest;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.request.indicator.IndicatorDataRequest;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.request.indicator.IndicatorRequest;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.IndicatorCardDetailReponse;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.IndicatorCardPageResponse;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.IndicatorCardResponse;
|
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.IndicatorResponse;
|
|
||||||
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 IndicatorCardMappersImpl implements IndicatorCardMappers {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IndicatorCardPageResponse getIndicatorCardToModel(IndicatorCardPage indicatorCardPage) {
|
|
||||||
if ( indicatorCardPage == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCardPageResponse indicatorCardPageResponse = new IndicatorCardPageResponse();
|
|
||||||
|
|
||||||
indicatorCardPageResponse.setIndicatorCardExtends( indicatorCardExtendPageInfoToIndicatorCardResponsePageInfo( indicatorCardPage.getIndicatorCardExtends() ) );
|
|
||||||
indicatorCardPageResponse.setIndicators( indicatorListToIndicatorResponseList( indicatorCardPage.getIndicators() ) );
|
|
||||||
|
|
||||||
return indicatorCardPageResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IndicatorCardParams getIndicatorCardParames(IndicatorCardRequest request) {
|
|
||||||
if ( request == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCardParams indicatorCardParams = new IndicatorCardParams();
|
|
||||||
|
|
||||||
indicatorCardParams.setIndicatorCardType( request.getIndicatorCardType() );
|
|
||||||
indicatorCardParams.setIndicatorName( request.getIndicatorName() );
|
|
||||||
indicatorCardParams.setUserId( request.getUserId() );
|
|
||||||
indicatorCardParams.setPersonName( request.getPersonName() );
|
|
||||||
indicatorCardParams.setAccessControl( request.getAccessControl() );
|
|
||||||
indicatorCardParams.setPageIndex( request.getPageIndex() );
|
|
||||||
indicatorCardParams.setPageSize( request.getPageSize() );
|
|
||||||
indicatorCardParams.setCardStatus( request.getCardStatus() );
|
|
||||||
|
|
||||||
return indicatorCardParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IndicatorParams getIndicatorParames(IndicatorDataRequest request) {
|
|
||||||
if ( request == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorParams indicatorParams = new IndicatorParams();
|
|
||||||
|
|
||||||
indicatorParams.setIndicatorCardNo( request.getIndicatorCardNo() );
|
|
||||||
indicatorParams.setDataserviceNo( request.getDataserviceNo() );
|
|
||||||
indicatorParams.setDt( request.getDt() );
|
|
||||||
indicatorParams.setIndicatorList( getIndicatorRequestToModel( request.getIndicatorList() ) );
|
|
||||||
|
|
||||||
return indicatorParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Indicator> getIndicatorRequestToModel(List<IndicatorRequest> requests) {
|
|
||||||
if ( requests == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Indicator> list = new ArrayList<Indicator>( requests.size() );
|
|
||||||
for ( IndicatorRequest indicatorRequest : requests ) {
|
|
||||||
list.add( indicatorRequestToIndicator( indicatorRequest ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IndicatorCard getIndicatorCardRequestToModel(IndicatorCardRequest request) {
|
|
||||||
if ( request == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCard indicatorCard = new IndicatorCard();
|
|
||||||
|
|
||||||
indicatorCard.setIndicatorCardNo( request.getIndicatorCardNo() );
|
|
||||||
indicatorCard.setIndicatorCardName( request.getIndicatorCardName() );
|
|
||||||
indicatorCard.setIndicatorCardType( request.getIndicatorCardType() );
|
|
||||||
indicatorCard.setDataserviceNo( request.getDataserviceNo() );
|
|
||||||
indicatorCard.setDataserviceName( request.getDataserviceName() );
|
|
||||||
indicatorCard.setIndicatorCardOrder( request.getIndicatorCardOrder() );
|
|
||||||
indicatorCard.setAccessControl( request.getAccessControl() );
|
|
||||||
indicatorCard.setHomeDisplay( request.getHomeDisplay() );
|
|
||||||
indicatorCard.setWarningFlag( request.getWarningFlag() );
|
|
||||||
indicatorCard.setTemplateNos( request.getTemplateNos() );
|
|
||||||
indicatorCard.setCardStatus( request.getCardStatus() );
|
|
||||||
indicatorCard.setEffectFlag( request.getEffectFlag() );
|
|
||||||
|
|
||||||
return indicatorCard;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IndicatorCardDetailReponse getIndicatorCardDetailToReponse(IndicatorCardDetial model) {
|
|
||||||
if ( model == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCardDetailReponse indicatorCardDetailReponse = new IndicatorCardDetailReponse();
|
|
||||||
|
|
||||||
indicatorCardDetailReponse.setIndicatorCard( indicatorCardToIndicatorCardResponse( model.getIndicatorCard() ) );
|
|
||||||
indicatorCardDetailReponse.setIndicatorList( indicatorListToIndicatorResponseList( model.getIndicatorList() ) );
|
|
||||||
|
|
||||||
return indicatorCardDetailReponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<IndicatorCard> getIndicatorCardRequestsToModel(List<IndicatorCardRequest> requests) {
|
|
||||||
if ( requests == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<IndicatorCard> list = new ArrayList<IndicatorCard>( requests.size() );
|
|
||||||
for ( IndicatorCardRequest indicatorCardRequest : requests ) {
|
|
||||||
list.add( getIndicatorCardRequestToModel( indicatorCardRequest ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IndicatorCardResponse indicatorCardExtendToIndicatorCardResponse(IndicatorCardExtend indicatorCardExtend) {
|
|
||||||
if ( indicatorCardExtend == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCardResponse indicatorCardResponse = new IndicatorCardResponse();
|
|
||||||
|
|
||||||
indicatorCardResponse.setId( indicatorCardExtend.getId() );
|
|
||||||
indicatorCardResponse.setIndicatorCardNo( indicatorCardExtend.getIndicatorCardNo() );
|
|
||||||
indicatorCardResponse.setIndicatorCardName( indicatorCardExtend.getIndicatorCardName() );
|
|
||||||
indicatorCardResponse.setIndicatorCardType( indicatorCardExtend.getIndicatorCardType() );
|
|
||||||
indicatorCardResponse.setDataserviceNo( indicatorCardExtend.getDataserviceNo() );
|
|
||||||
indicatorCardResponse.setDataserviceName( indicatorCardExtend.getDataserviceName() );
|
|
||||||
indicatorCardResponse.setIndicatorCardOrder( indicatorCardExtend.getIndicatorCardOrder() );
|
|
||||||
indicatorCardResponse.setAccessControl( indicatorCardExtend.getAccessControl() );
|
|
||||||
indicatorCardResponse.setHomeDisplay( indicatorCardExtend.getHomeDisplay() );
|
|
||||||
indicatorCardResponse.setWarningFlag( indicatorCardExtend.getWarningFlag() );
|
|
||||||
indicatorCardResponse.setTemplateNos( indicatorCardExtend.getTemplateNos() );
|
|
||||||
indicatorCardResponse.setHome( indicatorCardExtend.getHome() );
|
|
||||||
indicatorCardResponse.setWarning( indicatorCardExtend.getWarning() );
|
|
||||||
indicatorCardResponse.setCardStatus( indicatorCardExtend.getCardStatus() );
|
|
||||||
indicatorCardResponse.setRenewType( indicatorCardExtend.getRenewType() );
|
|
||||||
indicatorCardResponse.setWarningIndicator( indicatorCardExtend.getWarningIndicator() );
|
|
||||||
indicatorCardResponse.setCreator( indicatorCardExtend.getCreator() );
|
|
||||||
indicatorCardResponse.setCreatorName( indicatorCardExtend.getCreatorName() );
|
|
||||||
indicatorCardResponse.setGmtCreate( indicatorCardExtend.getGmtCreate() );
|
|
||||||
indicatorCardResponse.setModifier( indicatorCardExtend.getModifier() );
|
|
||||||
indicatorCardResponse.setModifierName( indicatorCardExtend.getModifierName() );
|
|
||||||
indicatorCardResponse.setGmtModified( indicatorCardExtend.getGmtModified() );
|
|
||||||
indicatorCardResponse.setEffectFlag( indicatorCardExtend.getEffectFlag() );
|
|
||||||
|
|
||||||
return indicatorCardResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected List<IndicatorCardResponse> indicatorCardExtendListToIndicatorCardResponseList(List<IndicatorCardExtend> list) {
|
|
||||||
if ( list == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<IndicatorCardResponse> list1 = new ArrayList<IndicatorCardResponse>( list.size() );
|
|
||||||
for ( IndicatorCardExtend indicatorCardExtend : list ) {
|
|
||||||
list1.add( indicatorCardExtendToIndicatorCardResponse( indicatorCardExtend ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return list1;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected PageInfo<IndicatorCardResponse> indicatorCardExtendPageInfoToIndicatorCardResponsePageInfo(PageInfo<IndicatorCardExtend> pageInfo) {
|
|
||||||
if ( pageInfo == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
PageInfo<IndicatorCardResponse> pageInfo1 = new PageInfo<IndicatorCardResponse>();
|
|
||||||
|
|
||||||
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( indicatorCardExtendListToIndicatorCardResponseList( 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 IndicatorResponse indicatorToIndicatorResponse(Indicator indicator) {
|
|
||||||
if ( indicator == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorResponse indicatorResponse = new IndicatorResponse();
|
|
||||||
|
|
||||||
indicatorResponse.setId( indicator.getId() );
|
|
||||||
indicatorResponse.setIndicatorNo( indicator.getIndicatorNo() );
|
|
||||||
indicatorResponse.setIndicatorCardNo( indicator.getIndicatorCardNo() );
|
|
||||||
indicatorResponse.setIndicatorType( indicator.getIndicatorType() );
|
|
||||||
indicatorResponse.setIndicatorName( indicator.getIndicatorName() );
|
|
||||||
indicatorResponse.setStandardField( indicator.getStandardField() );
|
|
||||||
indicatorResponse.setStandardNo( indicator.getStandardNo() );
|
|
||||||
indicatorResponse.setIndicatorUnit( indicator.getIndicatorUnit() );
|
|
||||||
indicatorResponse.setIndicatorDefine( indicator.getIndicatorDefine() );
|
|
||||||
indicatorResponse.setRenewType( indicator.getRenewType() );
|
|
||||||
indicatorResponse.setWarningIndicator( indicator.getWarningIndicator() );
|
|
||||||
indicatorResponse.setCreator( indicator.getCreator() );
|
|
||||||
indicatorResponse.setCreatorName( indicator.getCreatorName() );
|
|
||||||
indicatorResponse.setGmtCreate( indicator.getGmtCreate() );
|
|
||||||
indicatorResponse.setModifier( indicator.getModifier() );
|
|
||||||
indicatorResponse.setModifierName( indicator.getModifierName() );
|
|
||||||
indicatorResponse.setGmtModified( indicator.getGmtModified() );
|
|
||||||
indicatorResponse.setEffectFlag( indicator.getEffectFlag() );
|
|
||||||
|
|
||||||
return indicatorResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected List<IndicatorResponse> indicatorListToIndicatorResponseList(List<Indicator> list) {
|
|
||||||
if ( list == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<IndicatorResponse> list1 = new ArrayList<IndicatorResponse>( list.size() );
|
|
||||||
for ( Indicator indicator : list ) {
|
|
||||||
list1.add( indicatorToIndicatorResponse( indicator ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return list1;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Indicator indicatorRequestToIndicator(IndicatorRequest indicatorRequest) {
|
|
||||||
if ( indicatorRequest == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Indicator indicator = new Indicator();
|
|
||||||
|
|
||||||
indicator.setId( indicatorRequest.getId() );
|
|
||||||
indicator.setIndicatorNo( indicatorRequest.getIndicatorNo() );
|
|
||||||
indicator.setIndicatorCardNo( indicatorRequest.getIndicatorCardNo() );
|
|
||||||
indicator.setIndicatorType( indicatorRequest.getIndicatorType() );
|
|
||||||
indicator.setIndicatorName( indicatorRequest.getIndicatorName() );
|
|
||||||
indicator.setStandardField( indicatorRequest.getStandardField() );
|
|
||||||
indicator.setStandardNo( indicatorRequest.getStandardNo() );
|
|
||||||
indicator.setIndicatorUnit( indicatorRequest.getIndicatorUnit() );
|
|
||||||
indicator.setIndicatorDefine( indicatorRequest.getIndicatorDefine() );
|
|
||||||
indicator.setRenewType( indicatorRequest.getRenewType() );
|
|
||||||
indicator.setWarningIndicator( indicatorRequest.getWarningIndicator() );
|
|
||||||
|
|
||||||
return indicator;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IndicatorCardResponse indicatorCardToIndicatorCardResponse(IndicatorCard indicatorCard) {
|
|
||||||
if ( indicatorCard == null ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorCardResponse indicatorCardResponse = new IndicatorCardResponse();
|
|
||||||
|
|
||||||
indicatorCardResponse.setId( indicatorCard.getId() );
|
|
||||||
indicatorCardResponse.setIndicatorCardNo( indicatorCard.getIndicatorCardNo() );
|
|
||||||
indicatorCardResponse.setIndicatorCardName( indicatorCard.getIndicatorCardName() );
|
|
||||||
indicatorCardResponse.setIndicatorCardType( indicatorCard.getIndicatorCardType() );
|
|
||||||
indicatorCardResponse.setDataserviceNo( indicatorCard.getDataserviceNo() );
|
|
||||||
indicatorCardResponse.setDataserviceName( indicatorCard.getDataserviceName() );
|
|
||||||
indicatorCardResponse.setIndicatorCardOrder( indicatorCard.getIndicatorCardOrder() );
|
|
||||||
indicatorCardResponse.setAccessControl( indicatorCard.getAccessControl() );
|
|
||||||
indicatorCardResponse.setHomeDisplay( indicatorCard.getHomeDisplay() );
|
|
||||||
indicatorCardResponse.setWarningFlag( indicatorCard.getWarningFlag() );
|
|
||||||
indicatorCardResponse.setTemplateNos( indicatorCard.getTemplateNos() );
|
|
||||||
indicatorCardResponse.setCardStatus( indicatorCard.getCardStatus() );
|
|
||||||
indicatorCardResponse.setCreator( indicatorCard.getCreator() );
|
|
||||||
indicatorCardResponse.setCreatorName( indicatorCard.getCreatorName() );
|
|
||||||
indicatorCardResponse.setGmtCreate( indicatorCard.getGmtCreate() );
|
|
||||||
indicatorCardResponse.setModifier( indicatorCard.getModifier() );
|
|
||||||
indicatorCardResponse.setModifierName( indicatorCard.getModifierName() );
|
|
||||||
indicatorCardResponse.setGmtModified( indicatorCard.getGmtModified() );
|
|
||||||
indicatorCardResponse.setEffectFlag( indicatorCard.getEffectFlag() );
|
|
||||||
|
|
||||||
return indicatorCardResponse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue