Browse Source

定值列表接口开发

master
zhangyongzhangyong 5 years ago
parent
commit
305ae61464
  1. 59
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java
  2. 61
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java
  3. 29
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java
  4. 17
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
  5. 25
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java
  6. 13
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java
  7. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java
  8. 43
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml

59
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
* <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.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;
}

61
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;
}

29
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<FunctionCustomizedListDTO> listDTOS;
}

17
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<com.epmet.dto.result.FunctionCustomizedListResultDTO>
* @Author zhangyong
* @Date 10:07 2020-08-14
**/
@PostMapping("functioncustomizedlist")
public Result<FunctionCustomizedListResultDTO> functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.functionCustomizedList(formDTO);
}
}

25
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<FunctionCustomizedEntity>
* @Date 16:21 2020-08-13
**/
CustomizedDTO selectCustomized(@Param("functionId") String functionId);
/**
* 定制功能列表
* 按功能分组先工作端在居民端在按创建时间倒序
*
* @param formDTO
* @return java.lang.util<com.epmet.dto.result.FunctionCustomizedListDTO>
* @Author zhangyong
* @Date 10:07 2020-08-14
**/
List<FunctionCustomizedListDTO> selectListFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO);
/**
* 定制功能列表 - 总数
*
* @param formDTO
* @return java.lang.Integer
* @Author zhangyong
* @Date 10:10 2020-08-14
**/
Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO);
}

13
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<FunctionCustomize
* @Date 14:52 2020-08-13
**/
Result updateCustomized(UpdateCustomizedFormDTO formDTO);
/**
* 定制功能列表
* 按功能分组先工作端在居民端在按创建时间倒序
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.FunctionCustomizedListResultDTO>
* @Author zhangyong
* @Date 10:07 2020-08-14
**/
Result<FunctionCustomizedListResultDTO> functionCustomizedList(FunctionCustomizedListFormDTO formDTO);
}

12
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<FunctionCusto
return new Result();
}
@Override
public Result<FunctionCustomizedListResultDTO> 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<FunctionCustomizedListResultDTO>().ok(resultDTO);
}
/**
* 保存数据到 功能表
* @param formDTO

43
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>
<!-- 定制功能列表 -->
<select id="selectListFunctionCustomizedList" parameterType="com.epmet.dto.form.FunctionCustomizedListFormDTO"
resultType="com.epmet.dto.result.FunctionCustomizedListDTO">
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'
<if test="customizedName != null and customizedName.trim() != ''">
AND cu.CUSTOMIZED_NAME = #{customizedName}
</if>
<if test="fromApp != null and fromApp.trim() != ''">
AND cu.FROM_APP = 'gov'
</if>
ORDER BY cu.FROM_APP, f.CREATED_TIME DESC
</select>
<!-- 定制功能列表 总条数 -->
<select id="countTotalFunctionCustomizedList" parameterType="com.epmet.dto.form.FunctionCustomizedListFormDTO"
resultType="INT">
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'
<if test="customizedName != null and customizedName.trim() != ''">
AND cu.CUSTOMIZED_NAME = #{customizedName}
</if>
<if test="fromApp != null and fromApp.trim() != ''">
AND cu.FROM_APP = 'gov'
</if>
</select>
</mapper>

Loading…
Cancel
Save