From 305ae61464e89ac84ca2d0b814605510e30ad606 Mon Sep 17 00:00:00 2001
From: zhangyongzhangyong <2012005003@qq.coom>
Date: Fri, 14 Aug 2020 10:30:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E5=80=BC=E5=88=97=E8=A1=A8=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../form/FunctionCustomizedListFormDTO.java | 59 ++++++++++++++++++
.../dto/result/FunctionCustomizedListDTO.java | 61 +++++++++++++++++++
.../FunctionCustomizedListResultDTO.java | 29 +++++++++
.../FunctionCustomizedController.java | 17 ++++++
.../com/epmet/dao/FunctionCustomizedDao.java | 25 ++++++++
.../service/FunctionCustomizedService.java | 13 ++++
.../impl/FunctionCustomizedServiceImpl.java | 12 ++++
.../mapper/FunctionCustomizedDao.xml | 43 +++++++++++++
8 files changed, 259 insertions(+)
create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java
create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java
create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java
new file mode 100644
index 0000000000..2c6e3c037a
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ * 定制功能列表 入参
+ *
+ * @author zhangyong
+ * @since v1.0.0 2020-08-14
+ */
+@Data
+public class FunctionCustomizedListFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 功能名称
+ */
+ private String customizedName;
+
+
+ /**
+ * 所属端
+ */
+ private String fromApp;
+
+ /**
+ * 页码,从1开始
+ */
+ @Min(value = 1, message = "页码必须大于0")
+ private Integer pageNo;
+
+ /**
+ * 页容量,默认20页
+ */
+ @Min(value = 1, message = "每页条数必须大于必须大于0")
+ private Integer pageSize;
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java
new file mode 100644
index 0000000000..85faedd828
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java
@@ -0,0 +1,61 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 定制功能列表 返回值
+ *
+ * @author zhangyong
+ * @since v1.0.0 2020-08-14
+ */
+@Data
+public class FunctionCustomizedListDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 功能ID(function.ID)
+ */
+ private String functionId;
+
+ /**
+ * 上架状态:0:下架、1:上架
+ */
+ private String shoppingStatus;
+
+ /**
+ * 功能说明
+ */
+ private String functionExplain;
+
+ /**
+ * 默认名称
+ */
+ private String customizedName;
+
+ /**
+ * 默认大图标
+ */
+ private String iconLargeImg;
+
+ /**
+ * 默认小图标
+ */
+ private String iconSmallImg;
+
+ /**
+ * 外链地址
+ */
+ private String targetLink;
+
+ /**
+ * 业务域名
+ */
+ private String domainName;
+
+ /**
+ * 来源app(政府端:gov、居民端:resi)
+ */
+ private String fromApp;
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java
new file mode 100644
index 0000000000..fc44d76d1a
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 定制功能列表 返回值
+ *
+ * @author zhangyong
+ * @since v1.0.0 2020-08-14
+ */
+@Data
+public class FunctionCustomizedListResultDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 列表总条数
+ */
+ private Integer total;
+
+ /**
+ * 列表内容
+ */
+ private List listDTOS;
+
+
+}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
index 1739ec15ae..1df9d0e568 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
@@ -27,9 +27,11 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.FunctionCustomizedDTO;
import com.epmet.dto.form.CommonFunctionIdFormDTO;
+import com.epmet.dto.form.FunctionCustomizedListFormDTO;
import com.epmet.dto.form.SaveFunctionCustomizedFormDTO;
import com.epmet.dto.form.UpdateCustomizedFormDTO;
import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
+import com.epmet.dto.result.FunctionCustomizedListResultDTO;
import com.epmet.excel.FunctionCustomizedExcel;
import com.epmet.service.FunctionCustomizedService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -157,4 +159,19 @@ public class FunctionCustomizedController {
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.updateCustomized(formDTO);
}
+
+ /**
+ * 定制功能列表
+ * 按功能分组,先工作端在居民端,在按创建时间倒序
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 10:07 2020-08-14
+ **/
+ @PostMapping("functioncustomizedlist")
+ public Result functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO);
+ return functionCustomizedService.functionCustomizedList(formDTO);
+ }
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java
index 6c358516fd..d283a1a586 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java
@@ -20,11 +20,15 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomizedDTO;
import com.epmet.dto.form.CommonFunctionIdFormDTO;
+import com.epmet.dto.form.FunctionCustomizedListFormDTO;
import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
+import com.epmet.dto.result.FunctionCustomizedListDTO;
import com.epmet.entity.FunctionCustomizedEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
* 定制功能
*
@@ -63,4 +67,25 @@ public interface FunctionCustomizedDao extends BaseDao
* @Date 16:21 2020-08-13
**/
CustomizedDTO selectCustomized(@Param("functionId") String functionId);
+
+ /**
+ * 定制功能列表
+ * 按功能分组,先工作端在居民端,在按创建时间倒序
+ *
+ * @param formDTO
+ * @return java.lang.util
+ * @Author zhangyong
+ * @Date 10:07 2020-08-14
+ **/
+ List selectListFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO);
+
+ /**
+ * 定制功能列表 - 总数
+ *
+ * @param formDTO
+ * @return java.lang.Integer
+ * @Author zhangyong
+ * @Date 10:10 2020-08-14
+ **/
+ Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO);
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java
index b52125f21d..178c2d439b 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java
@@ -22,9 +22,11 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.FunctionCustomizedDTO;
import com.epmet.dto.form.CommonFunctionIdFormDTO;
+import com.epmet.dto.form.FunctionCustomizedListFormDTO;
import com.epmet.dto.form.SaveFunctionCustomizedFormDTO;
import com.epmet.dto.form.UpdateCustomizedFormDTO;
import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
+import com.epmet.dto.result.FunctionCustomizedListResultDTO;
import com.epmet.entity.FunctionCustomizedEntity;
import java.util.List;
@@ -140,4 +142,15 @@ public interface FunctionCustomizedService extends BaseService
+ * @Author zhangyong
+ * @Date 10:07 2020-08-14
+ **/
+ Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO);
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java
index 23448fbea6..ff45c737a0 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java
@@ -31,9 +31,11 @@ import com.epmet.dto.CustomerFunctionDetailDTO;
import com.epmet.dto.CustomizedDTO;
import com.epmet.dto.FunctionCustomizedDTO;
import com.epmet.dto.form.CommonFunctionIdFormDTO;
+import com.epmet.dto.form.FunctionCustomizedListFormDTO;
import com.epmet.dto.form.SaveFunctionCustomizedFormDTO;
import com.epmet.dto.form.UpdateCustomizedFormDTO;
import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
+import com.epmet.dto.result.FunctionCustomizedListResultDTO;
import com.epmet.entity.CustomerFunctionDetailEntity;
import com.epmet.entity.FunctionCustomizedEntity;
import com.epmet.entity.FunctionEntity;
@@ -233,6 +235,16 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl functionCustomizedList(FunctionCustomizedListFormDTO formDTO) {
+ int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
+ formDTO.setPageNo(pageIndex);
+ FunctionCustomizedListResultDTO resultDTO = new FunctionCustomizedListResultDTO();
+ resultDTO.setListDTOS(baseDao.selectListFunctionCustomizedList(formDTO));
+ resultDTO.setTotal(baseDao.countTotalFunctionCustomizedList(formDTO));
+ return new Result().ok(resultDTO);
+ }
+
/**
* 保存数据到 功能表
* @param formDTO
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml
index 3d9ac9e6cb..1aed963adc 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml
@@ -45,4 +45,47 @@
WHERE f.DEL_FLAG = '0'
AND f.ID = #{functionId}
+
+
+
+ SELECT
+ f.ID functionId,
+ f.SHOPPING_STATUS shoppingStatus,
+ f.FUNCTION_EXPLAIN functionExplain,
+ cu.CUSTOMIZED_NAME customizedName,
+ cu.ICON_LARGE_IMG iconLargeImg,
+ cu.ICON_SMALL_IMG iconSmallImg,
+ cu.TARGET_LINK targetLink,
+ cu.DOMAIN_NAME domainName,
+ cu.FROM_APP fromApp
+ FROM `function` f
+ LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
+ WHERE f.DEL_FLAG = '0'
+ AND cu.DEL_FLAG = '0'
+
+ AND cu.CUSTOMIZED_NAME = #{customizedName}
+
+
+ AND cu.FROM_APP = 'gov'
+
+ ORDER BY cu.FROM_APP, f.CREATED_TIME DESC
+
+
+
+
+ SELECT
+ count(1)
+ FROM `function` f
+ LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
+ WHERE f.DEL_FLAG = '0'
+ AND cu.DEL_FLAG = '0'
+
+ AND cu.CUSTOMIZED_NAME = #{customizedName}
+
+
+ AND cu.FROM_APP = 'gov'
+
+