forked from rongchao/epmet-cloud-rizhao
				
			
				 15 changed files with 313 additions and 3 deletions
			
			
		| @ -0,0 +1,15 @@ | |||
| package com.epmet.dto.form; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.Min; | |||
| 
 | |||
| @Data | |||
| public class ExternalCustomerFormDTO { | |||
| 
 | |||
|     @Min(0) | |||
|     private Integer pageNo; | |||
| 
 | |||
|     @Min(0) | |||
|     private Integer pageSize; | |||
| } | |||
| @ -0,0 +1,46 @@ | |||
| /** | |||
|  * Copyright 2018 人人开源 https://www.renren.io
 | |||
|  * <p> | |||
|  * This program is free software: you can redistribute it and/or modify | |||
|  * it under the terms of the GNU General Public License as published by | |||
|  * the Free Software Foundation, either version 3 of the License, or | |||
|  * (at your option) any later version. | |||
|  * <p> | |||
|  * This program is distributed in the hope that it will be useful, | |||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | |||
|  * GNU General Public License for more details. | |||
|  * <p> | |||
|  * You should have received a copy of the GNU General Public License | |||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | |||
|  */ | |||
| 
 | |||
| package com.epmet.dto.result; | |||
| 
 | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import lombok.Data; | |||
| 
 | |||
| 
 | |||
| /** | |||
|  *  | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-08-19 | |||
|  */ | |||
| @Data | |||
| public class ExternalCustomerResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 1L; | |||
| 
 | |||
|     /** | |||
|      * 客户ID | |||
|      */ | |||
| 	private String id; | |||
| 
 | |||
|     /** | |||
|      * 客户名称 | |||
|      */ | |||
| 	private String customerName; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,47 @@ | |||
| package com.epmet.controller; | |||
| 
 | |||
| import com.epmet.commons.tools.exception.RenException; | |||
| import com.epmet.commons.tools.utils.Result; | |||
| import com.epmet.commons.tools.validator.ValidatorUtils; | |||
| import com.epmet.dto.form.ExternalAppAuthFormDTO; | |||
| import com.epmet.dto.form.ExternalCustomerFormDTO; | |||
| import com.epmet.dto.result.ExternalAppAuthResultDTO; | |||
| import com.epmet.service.ExternalAppAuthService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| 
 | |||
| import javax.validation.constraints.Min; | |||
| 
 | |||
| /** | |||
|  * 外部客户管理 | |||
|  */ | |||
| @RestController | |||
| @RequestMapping("/externalcustomer") | |||
| public class ExternalCustomerController { | |||
| 
 | |||
|     private static Logger logger = LoggerFactory.getLogger(ExternalCustomerController.class); | |||
| 
 | |||
|     @Autowired | |||
|     private ExternalAppAuthService externalAppAuthService; | |||
| 
 | |||
|     /** | |||
|      * 外部客户管理 | |||
|      * @return | |||
|      */ | |||
|     @PostMapping("/list") | |||
|     public Result<ExternalAppAuthResultDTO> list(@RequestBody ExternalCustomerFormDTO form) { | |||
|         ValidatorUtils.validateEntity(form); | |||
|         Integer pageNo = form.getPageNo(); | |||
|         Integer pageSize = form.getPageSize(); | |||
| 
 | |||
| 
 | |||
|         return null; | |||
|     } | |||
| 
 | |||
| } | |||
| @ -0,0 +1,41 @@ | |||
| /** | |||
|  * Copyright 2018 人人开源 https://www.renren.io
 | |||
|  * <p> | |||
|  * This program is free software: you can redistribute it and/or modify | |||
|  * it under the terms of the GNU General Public License as published by | |||
|  * the Free Software Foundation, either version 3 of the License, or | |||
|  * (at your option) any later version. | |||
|  * <p> | |||
|  * This program is distributed in the hope that it will be useful, | |||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | |||
|  * GNU General Public License for more details. | |||
|  * <p> | |||
|  * You should have received a copy of the GNU General Public License | |||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | |||
|  */ | |||
| 
 | |||
| package com.epmet.dao; | |||
| 
 | |||
| import com.epmet.commons.mybatis.dao.BaseDao; | |||
| import com.epmet.dto.result.ExternalCustomerResultDTO; | |||
| import com.epmet.entity.ExternalCustomerEntity; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  *  | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-08-19 | |||
|  */ | |||
| @Mapper | |||
| public interface ExternalCustomerDao extends BaseDao<ExternalCustomerEntity> { | |||
| 
 | |||
|     /** | |||
|      * 列出客户基本信息 | |||
|      * @return | |||
|      */ | |||
|     List<ExternalCustomerResultDTO> listBaseInfo(); | |||
| } | |||
| @ -0,0 +1,46 @@ | |||
| /** | |||
|  * Copyright 2018 人人开源 https://www.renren.io
 | |||
|  * <p> | |||
|  * This program is free software: you can redistribute it and/or modify | |||
|  * it under the terms of the GNU General Public License as published by | |||
|  * the Free Software Foundation, either version 3 of the License, or | |||
|  * (at your option) any later version. | |||
|  * <p> | |||
|  * This program is distributed in the hope that it will be useful, | |||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | |||
|  * GNU General Public License for more details. | |||
|  * <p> | |||
|  * You should have received a copy of the GNU General Public License | |||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | |||
|  */ | |||
| 
 | |||
| package com.epmet.entity; | |||
| 
 | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| 
 | |||
| import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| 
 | |||
| import java.util.Date; | |||
| 
 | |||
| /** | |||
|  *  | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-08-19 | |||
|  */ | |||
| @Data | |||
| @EqualsAndHashCode(callSuper=false) | |||
| @TableName("external_customer") | |||
| public class ExternalCustomerEntity extends BaseEpmetEntity { | |||
| 
 | |||
| 	private static final long serialVersionUID = 1L; | |||
| 
 | |||
|     /** | |||
|      * 客户名称 | |||
|      */ | |||
| 	private String customerName; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| package com.epmet.service; | |||
| 
 | |||
| import com.epmet.dto.result.ExternalCustomerResultDTO; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| public interface ExternalCustomerService { | |||
| 
 | |||
|     public List<ExternalCustomerResultDTO> list(Integer pageNo, Integer pageSize); | |||
| 
 | |||
| } | |||
| @ -0,0 +1,26 @@ | |||
| package com.epmet.service.impl; | |||
| 
 | |||
| import com.epmet.dao.ExternalCustomerDao; | |||
| import com.epmet.dto.result.ExternalCustomerResultDTO; | |||
| import com.epmet.service.ExternalCustomerService; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| @Service | |||
| public class ExternalCustomerServiceImpl implements ExternalCustomerService { | |||
| 
 | |||
|     @Autowired | |||
|     private ExternalCustomerDao externalCustomerDao; | |||
| 
 | |||
|     @Override | |||
|     public List<ExternalCustomerResultDTO> list(Integer pageNo, Integer pageSize) { | |||
|         PageHelper.startPage(pageNo, pageSize); | |||
|         List<ExternalCustomerResultDTO> customers = externalCustomerDao.listBaseInfo(); | |||
|         PageInfo<ExternalCustomerResultDTO> pageInfo = new PageInfo<>(customers); | |||
|         return null; | |||
|     } | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| <?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.epmet.dao.ExternalCustomerDao"> | |||
| 
 | |||
|     <resultMap type="com.epmet.entity.ExternalCustomerEntity" id="externalCustomerMap"> | |||
|         <result property="id" column="ID"/> | |||
|         <result property="customerName" column="CUSTOMER_NAME"/> | |||
|         <result property="delFlag" column="DEL_FLAG"/> | |||
|         <result property="revision" column="REVISION"/> | |||
|         <result property="createdBy" column="CREATED_BY"/> | |||
|         <result property="createdTime" column="CREATED_TIME"/> | |||
|         <result property="updatedBy" column="UPDATED_BY"/> | |||
|         <result property="updatedTime" column="UPDATED_TIME"/> | |||
|     </resultMap> | |||
| 
 | |||
| <!--    列出客户基本信息--> | |||
|     <select id="listBaseInfo" resultType="com.epmet.dto.result.ExternalCustomerResultDTO"> | |||
|         SELECT | |||
|             id, | |||
|             CUSTOMER_NAME | |||
|         FROM | |||
|             external_customer | |||
|         WHERE | |||
|             DEL_FLAG = 0 | |||
|     </select> | |||
| 
 | |||
| 
 | |||
| </mapper> | |||
					Loading…
					
					
				
		Reference in new issue